@Service(value="blPageService") public class PageServiceImpl extends Object implements PageService
Modifier and Type | Field and Description |
---|---|
protected static String |
AND |
protected LocaleService |
localeService |
protected static org.apache.commons.logging.Log |
LOG |
protected PageDTO |
NULL_PAGE |
protected net.sf.ehcache.Cache |
pageCache |
protected PageDao |
pageDao |
protected List<RuleProcessor<PageDTO>> |
pageRuleProcessors |
protected StaticAssetPathService |
staticAssetPathService |
protected StaticAssetService |
staticAssetService |
protected StatisticsService |
statisticsService |
protected TemplateOverrideExtensionManager |
templateOverrideManager |
Constructor and Description |
---|
PageServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
addPageListToCache(List<PageDTO> pageList,
String key) |
protected List<ItemCriteriaDTO> |
buildItemCriteriaDTOList(Page page) |
protected String |
buildKey(SandBox currentSandBox,
Locale locale,
String uri) |
protected String |
buildKey(SandBox sandBox,
Page page) |
protected PageDTO |
buildPageDTOInternal(Page page,
boolean secure) |
protected List<PageDTO> |
buildPageDTOList(List<Page> pageList,
boolean secure)
Converts a list of pages to a list of pageDTOs.
Internally calls buildPageDTO(...). |
protected String |
buildRuleExpression(Page page) |
protected PageDTO |
evaluatePageRules(List<PageDTO> pageDTOList,
Locale locale,
Map<String,Object> ruleDTOs) |
protected Locale |
findLanguageOnlyLocale(Locale locale) |
Page |
findPageById(Long pageId)
Returns the page with the passed in id.
|
PageDTO |
findPageByURI(Locale locale,
String uri,
Map<String,Object> ruleDTOs,
boolean secure)
Retrieve the page if one is available for the passed in uri.
|
PageTemplate |
findPageTemplateById(Long id)
Returns the page template with the passed in id.
|
net.sf.ehcache.Cache |
getPageCache() |
protected List<PageDTO> |
getPageListFromCache(String key) |
protected boolean |
passesPageRules(PageDTO page,
Map<String,Object> ruleDTOs) |
List<Page> |
readAllPages()
Returns all pages, regardless of any sandbox they are apart of
|
List<PageTemplate> |
readAllPageTemplates()
Returns all page templates, regardless of any sandbox they are apart of
|
void |
removePageFromCache(SandBox sandBox,
Page p)
Call to evict a page for a sandbox
|
void |
removePageFromCache(String baseKey)
Call to evict both secure and non-secure pages matching
the passed in key.
|
PageTemplate |
savePageTemplate(PageTemplate template)
Saves the given
PageTemplate |
protected static final org.apache.commons.logging.Log LOG
protected static String AND
protected PageDao pageDao
protected List<RuleProcessor<PageDTO>> pageRuleProcessors
protected LocaleService localeService
protected StaticAssetService staticAssetService
protected StaticAssetPathService staticAssetPathService
protected StatisticsService statisticsService
protected TemplateOverrideExtensionManager templateOverrideManager
protected net.sf.ehcache.Cache pageCache
protected final PageDTO NULL_PAGE
public Page findPageById(Long pageId)
findPageById
in interface PageService
pageId
- - The id of the page.public PageTemplate findPageTemplateById(Long id)
PageService
findPageTemplateById
in interface PageService
id
- - the id of the page template@Transactional(value="blTransactionManager") public PageTemplate savePageTemplate(PageTemplate template)
PageService
PageTemplate
savePageTemplate
in interface PageService
template
- the PageTemplate
to savePageTemplate
public PageDTO findPageByURI(Locale locale, String uri, Map<String,Object> ruleDTOs, boolean secure)
findPageByURI
in interface PageService
locale
- - current localeuri
- - the URI to return a page forruleDTOs
- - ruleDTOs that are used as the data to process page rulessecure
- - set to true if current request is over HTTPSpublic List<Page> readAllPages()
PageService
readAllPages
in interface PageService
Page
s configured in the systempublic List<PageTemplate> readAllPageTemplates()
PageService
readAllPageTemplates
in interface PageService
PageTemplate
s configured in the systempublic void removePageFromCache(SandBox sandBox, Page p)
PageService
removePageFromCache
in interface PageService
sandBox
- The sandbox in which the page residesp
- The page instance to evict from cachepublic void removePageFromCache(String baseKey)
PageService
removePageFromCache
in interface PageService
protected List<PageDTO> buildPageDTOList(List<Page> pageList, boolean secure)
pageList
- secure
- protected List<ItemCriteriaDTO> buildItemCriteriaDTOList(Page page)
protected PageDTO evaluatePageRules(List<PageDTO> pageDTOList, Locale locale, Map<String,Object> ruleDTOs)
public net.sf.ehcache.Cache getPageCache()
getPageCache
in interface PageService
Copyright © 2014. All rights reserved.