Class PageServiceImpl
java.lang.Object
org.broadleafcommerce.cms.page.service.PageServiceImpl
- All Implemented Interfaces:
PageService
- Author:
- Brian Polster (bpolster), Nathan Moore (nathandmoore)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static Stringprotected javax.cache.CacheManagerprotected PageServiceExtensionManagerprotected LocaleServiceprotected static final org.apache.commons.logging.Logprotected final PageDTOprotected javax.cache.Cacheprotected PageDaoprotected javax.cache.Cacheprotected List<RuleProcessor<PageDTO>>protected PageServiceUtilityprotected PageQueryExtensionManagerprotected StaticAssetServiceprotected StatisticsServiceprotected TemplateOverrideExtensionManagerprotected javax.cache.Cache -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCachedDate(String key) protected voidaddPageListToCache(List<PageDTO> pageList, String identifier, Locale locale, boolean secure) protected voidaddPageListToPageDTOList(List<Page> pageList, boolean secure, List<PageDTO> dtoList) protected voidaddPageMapCacheEntry(String identifier, String key) protected StringbuildBaseKey(String identifier, String localeCode, Boolean secure) protected StringbuildKey(String identifier, String localeCode, Boolean secure, ResultType resultType) protected StringbuildPageDTOList(List<Page> pageList, boolean secure, String identifier, Locale locale) buildPageDTOListUsingCache(List<Page> pageList, String identifier, Locale locale, boolean secure) copyDTOList(List<PageDTO> dtoList) protected PageDTOprotected LocalefindLanguageOnlyLocale(Locale locale) findPageById(Long pageId) Returns the page with the passed in id.Looks up the page from the backend datastore.findPageFieldMapByPageId(Long pageId) Returns the page-fields associated with a page.Returns the page template with the passed in id.protected DategetCachedDate(String key) getCachedPageDTOList(List<Page> pageList, String identifier, Locale locale, boolean secure) javax.cache.CachegetPageDTOListForURI(Locale locale, String uri, boolean secure) javax.cache.CachegetPageMapCacheKey(String uri, Long site) javax.cache.Cacheprotected booleanisNullPageCached(Locale locale, String uri, boolean secure) protected booleanpassesPageRules(PageDTO page, Map<String, Object> ruleDTOs) Returns all pages, regardless of any sandbox they are apart ofReturns all page templates, regardless of any sandbox they are apart ofremovePageFromCache(String mapKey) Call to evict all known PageDTOs that are associated with the given page from cacheremoveTranslationPageFromCache(String uri, String localeCode, boolean isSecure) Call to evict translated page from cachesavePageTemplate(PageTemplate template) Saves the givenPageTemplate
-
Field Details
-
LOG
protected static final org.apache.commons.logging.Log LOG -
AND
-
NULL_PAGE
-
pageDao
-
pageRuleProcessors
-
localeService
-
staticAssetService
-
statisticsService
-
templateOverrideManager
-
pageServiceUtility
-
extensionManager
-
queryExtensionManager
-
cacheManager
protected javax.cache.CacheManager cacheManager -
pageCache
protected javax.cache.Cache pageCache -
pageMapCache
protected javax.cache.Cache pageMapCache -
uriCachedDateCache
protected javax.cache.Cache uriCachedDateCache
-
-
Constructor Details
-
PageServiceImpl
public PageServiceImpl()
-
-
Method Details
-
findPageById
Description copied from interface:PageServiceReturns the page with the passed in id.- Specified by:
findPageByIdin interfacePageService- Parameters:
pageId- - The id of the page.- Returns:
- The associated page.
-
findPageFieldMapByPageId
Description copied from interface:PageServiceReturns the page-fields associated with a page.- Specified by:
findPageFieldMapByPageIdin interfacePageService- Returns:
-
findPageTemplateById
Description copied from interface:PageServiceReturns the page template with the passed in id.- Specified by:
findPageTemplateByIdin interfacePageService- Parameters:
id- - the id of the page template- Returns:
- The associated page template.
-
savePageTemplate
Description copied from interface:PageServiceSaves the givenPageTemplate- Specified by:
savePageTemplatein interfacePageService- Parameters:
template- thePageTemplateto save- Returns:
- the database-saved
PageTemplate
-
findPageByURI
public PageDTO findPageByURI(Locale locale, String uri, Map<String, Object> ruleDTOs, boolean secure) Description copied from interface:PageServiceLooks up the page from the backend datastore. Processes the page's fields to fix the URL if the site has overridden the URL for images. If secure is true and images are being overridden, the system will use https.- Specified by:
findPageByURIin interfacePageService- Parameters:
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 HTTPS- Returns:
-
isNullPageCached
-
getPageDTOListForURI
-
addCachedDate
-
getCachedDate
-
buildPageDTOList
public List<PageDTO> buildPageDTOList(List<Page> pageList, boolean secure, String identifier, Locale locale) Description copied from interface:PageService- Specified by:
buildPageDTOListin interfacePageService- Returns:
- copy of DTOList
-
buildPageDTOListUsingCache
-
getCachedPageDTOList
-
addPageListToPageDTOList
-
getPageListFromCache
-
addPageListToCache
-
addPageMapCacheEntry
-
getPageMapCacheKey
- Specified by:
getPageMapCacheKeyin interfacePageService
-
buildKey
-
buildKey
protected String buildKey(String identifier, String localeCode, Boolean secure, ResultType resultType) -
buildBaseKey
-
findLanguageOnlyLocale
-
getPageCache
public javax.cache.Cache getPageCache()- Specified by:
getPageCachein interfacePageService
-
getPageMapCache
public javax.cache.Cache getPageMapCache()- Specified by:
getPageMapCachein interfacePageService
-
getUriCachedDateCache
public javax.cache.Cache getUriCachedDateCache()- Specified by:
getUriCachedDateCachein interfacePageService
-
copyDTOList
-
evaluatePageRules
-
passesPageRules
-
readAllPages
Description copied from interface:PageServiceReturns all pages, regardless of any sandbox they are apart of- Specified by:
readAllPagesin interfacePageService- Returns:
- all
Pages configured in the system
-
readAllPageTemplates
Description copied from interface:PageServiceReturns all page templates, regardless of any sandbox they are apart of- Specified by:
readAllPageTemplatesin interfacePageService- Returns:
- all
PageTemplates configured in the system
-
removePageFromCache
Description copied from interface:PageServiceCall to evict all known PageDTOs that are associated with the given page from cache- Specified by:
removePageFromCachein interfacePageService- Returns:
- whether successful
-
removeTranslationPageFromCache
Description copied from interface:PageServiceCall to evict translated page from cache- Specified by:
removeTranslationPageFromCachein interfacePageService- Returns:
- whether successful
-