public class TemplateServiceImpl extends GenericDaoImpl<Template> implements TemplateService, CacheLookups
TemplateService
Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.ApplicationContext |
context |
em
ct, t
CONTENT_PUBLISH_CACHE_NAME, PRODUCT_LOOKUP_CACHE_NAME, PRODUCT_SEARCH_CACHE_NAME, TEMPLATEPAGE_MAPPING_CACHE_NAME
Constructor and Description |
---|
TemplateServiceImpl() |
Modifier and Type | Method and Description |
---|---|
Map<Template,List<PageIdentifier>> |
getPages(Collection<Template> templates,
Status status)
Get pages, categorized by the requested
Template s |
Template |
getTemplate(Query<Template> qry)
Get the Template based on a Query
|
Template |
getTemplateByName(String name)
Matches
Template.getName() to get the associated template |
Template |
getTemplateByRefId(String refId)
Use whatever reference identifier is used to refer to the template like name or bean-name (if templates defined in Spring configs) etc
Note, the Ref-id is not the same as Template.getId() or Template.getName() ; but can be different yet unique based
on the implementation scheme of creating templates and referring to them. |
String |
getTemplateNameIdForContent(String contentNameId,
Locale locale)
This method was created for pages to derive which Template they belong to.
|
Collection<Template> |
getTemplates(Class... templateTypes)
Get all templates available to context.
|
delete, delete, getEntityManager, getNativeEntityName, load, load, paginate, query, query, save, setEntityManager, update
public Collection<Template> getTemplates(Class... templateTypes)
TemplateService
Template
by further class definitions that extend Template
getTemplates
in interface TemplateService
Template
public Template getTemplate(Query<Template> qry)
TemplateService
getTemplate
in interface TemplateService
Template
@Cacheable(key="#contentNameId + \'_\' + #locale.language + \'_\' + #locale.country + \'_\' + #locale.variant", value="templatePageMapping") public String getTemplateNameIdForContent(String contentNameId, Locale locale)
getTemplate(Query)
where the query supplied has the class for the desired template.
getTemplateNameIdForContent
in interface TemplateService
contentNameId
- as String @nullable falselocale
- as Locale
@nullable truepublic Map<Template,List<PageIdentifier>> getPages(Collection<Template> templates, Status status)
TemplateService
Template
sgetPages
in interface TemplateService
templates
- as Collection of template
Template
as key and List of PageIdentifier
as value for the map.public Template getTemplateByName(String name)
TemplateService
Template.getName()
to get the associated templategetTemplateByName
in interface TemplateService
public Template getTemplateByRefId(String refId)
TemplateService
Template.getId()
or Template.getName()
; but can be different yet unique based
on the implementation scheme of creating templates and referring to them.
getTemplateByRefId
in interface TemplateService
Copyright © 2018. All rights reserved.