@Service(value="blPageService") public class PageServiceImpl extends Object implements PageService
Modifier and Type | Field and Description |
---|---|
protected static String |
AND |
protected PageServiceExtensionManager |
extensionManager |
protected static String |
FOREIGN_LOOKUP |
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 net.sf.ehcache.Cache |
pageMapCache |
protected List<RuleProcessor<PageDTO>> |
pageRuleProcessors |
protected PageServiceUtility |
pageServiceUtility |
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,
String uri,
Long sandBox,
Long site) |
protected void |
addPageMapCacheEntry(String keyToStore,
String uri,
Long sandBox,
Long site) |
protected String |
buildKey(Long currentSandBox,
Long site,
Locale locale,
String uri) |
protected String |
buildKey(SandBox sandBox,
Page page) |
List<PageDTO> |
buildPageDTOList(List<Page> pageList,
boolean secure)
Converts a list of pages to a list of pageDTOs.
Internally calls buildPageDTO(...). |
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.
|
Map<String,PageField> |
findPageFieldMapByPageId(Long pageId)
Returns the page with the passed in id.
|
PageTemplate |
findPageTemplateById(Long id)
Returns the page template with the passed in id.
|
net.sf.ehcache.Cache |
getPageCache() |
protected List<PageDTO> |
getPageListFromCache(String key) |
net.sf.ehcache.Cache |
getPageMapCache() |
String |
getPageMapCacheKey(String uri,
Long sandBox,
Long site) |
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(String key)
Call to evict all known PageDTOs that are associated with the given page from cache
|
PageTemplate |
savePageTemplate(PageTemplate template)
Saves the given
PageTemplate |
protected static final org.apache.commons.logging.Log LOG
protected static String AND
protected static final String FOREIGN_LOOKUP
protected PageDao pageDao
protected List<RuleProcessor<PageDTO>> pageRuleProcessors
protected LocaleService localeService
protected StaticAssetService staticAssetService
protected StatisticsService statisticsService
protected TemplateOverrideExtensionManager templateOverrideManager
protected PageServiceUtility pageServiceUtility
protected PageServiceExtensionManager extensionManager
protected net.sf.ehcache.Cache pageCache
protected net.sf.ehcache.Cache pageMapCache
protected final PageDTO NULL_PAGE
public Page findPageById(Long pageId)
findPageById
in interface PageService
pageId
- - The id of the page.public Map<String,PageField> findPageFieldMapByPageId(Long pageId)
findPageFieldMapByPageId
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(String key)
PageService
removePageFromCache
in interface PageService
public List<PageDTO> buildPageDTOList(List<Page> pageList, boolean secure)
buildPageDTOList
in interface PageService
pageList
- secure
- protected PageDTO evaluatePageRules(List<PageDTO> pageDTOList, Locale locale, Map<String,Object> ruleDTOs)
public net.sf.ehcache.Cache getPageCache()
getPageCache
in interface PageService
public net.sf.ehcache.Cache getPageMapCache()
getPageMapCache
in interface PageService
protected void addPageListToCache(List<PageDTO> pageList, String key, String uri, Long sandBox, Long site)
protected void addPageMapCacheEntry(String keyToStore, String uri, Long sandBox, Long site)
public String getPageMapCacheKey(String uri, Long sandBox, Long site)
getPageMapCacheKey
in interface PageService
Copyright © 2017. All rights reserved.