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 String
protected javax.cache.CacheManager
protected PageServiceExtensionManager
protected LocaleService
protected static final org.apache.commons.logging.Log
protected final PageDTO
protected javax.cache.Cache
protected PageDao
protected javax.cache.Cache
protected List<RuleProcessor<PageDTO>>
protected PageServiceUtility
protected PageQueryExtensionManager
protected StaticAssetService
protected StatisticsService
protected TemplateOverrideExtensionManager
protected javax.cache.Cache
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addCachedDate
(String key) protected void
addPageListToCache
(List<PageDTO> pageList, String identifier, Locale locale, boolean secure) protected void
addPageListToPageDTOList
(List<Page> pageList, boolean secure, List<PageDTO> dtoList) protected void
addPageMapCacheEntry
(String identifier, String key) protected String
buildBaseKey
(String identifier, String localeCode, Boolean secure) protected String
buildKey
(String identifier, String localeCode, Boolean secure, ResultType resultType) protected String
buildPageDTOList
(List<Page> pageList, boolean secure, String identifier, Locale locale) buildPageDTOListUsingCache
(List<Page> pageList, String identifier, Locale locale, boolean secure) copyDTOList
(List<PageDTO> dtoList) protected PageDTO
protected Locale
findLanguageOnlyLocale
(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 Date
getCachedDate
(String key) getCachedPageDTOList
(List<Page> pageList, String identifier, Locale locale, boolean secure) javax.cache.Cache
getPageDTOListForURI
(Locale locale, String uri, boolean secure) javax.cache.Cache
getPageMapCacheKey
(String uri, Long site) javax.cache.Cache
protected boolean
isNullPageCached
(Locale locale, String uri, boolean secure) protected boolean
passesPageRules
(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:PageService
Returns the page with the passed in id.- Specified by:
findPageById
in interfacePageService
- Parameters:
pageId
- - The id of the page.- Returns:
- The associated page.
-
findPageFieldMapByPageId
Description copied from interface:PageService
Returns the page-fields associated with a page.- Specified by:
findPageFieldMapByPageId
in interfacePageService
- Returns:
-
findPageTemplateById
Description copied from interface:PageService
Returns the page template with the passed in id.- Specified by:
findPageTemplateById
in interfacePageService
- Parameters:
id
- - the id of the page template- Returns:
- The associated page template.
-
savePageTemplate
Description copied from interface:PageService
Saves the givenPageTemplate
- Specified by:
savePageTemplate
in interfacePageService
- Parameters:
template
- thePageTemplate
to save- Returns:
- the database-saved
PageTemplate
-
findPageByURI
public PageDTO findPageByURI(Locale locale, String uri, Map<String, Object> ruleDTOs, boolean secure) Description copied from interface:PageService
Looks 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:
findPageByURI
in 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:
buildPageDTOList
in interfacePageService
- Returns:
- copy of DTOList
-
buildPageDTOListUsingCache
-
getCachedPageDTOList
-
addPageListToPageDTOList
-
getPageListFromCache
-
addPageListToCache
-
addPageMapCacheEntry
-
getPageMapCacheKey
- Specified by:
getPageMapCacheKey
in interfacePageService
-
buildKey
-
buildKey
protected String buildKey(String identifier, String localeCode, Boolean secure, ResultType resultType) -
buildBaseKey
-
findLanguageOnlyLocale
-
getPageCache
public javax.cache.Cache getPageCache()- Specified by:
getPageCache
in interfacePageService
-
getPageMapCache
public javax.cache.Cache getPageMapCache()- Specified by:
getPageMapCache
in interfacePageService
-
getUriCachedDateCache
public javax.cache.Cache getUriCachedDateCache()- Specified by:
getUriCachedDateCache
in interfacePageService
-
copyDTOList
-
evaluatePageRules
-
passesPageRules
-
readAllPages
Description copied from interface:PageService
Returns all pages, regardless of any sandbox they are apart of- Specified by:
readAllPages
in interfacePageService
- Returns:
- all
Page
s configured in the system
-
readAllPageTemplates
Description copied from interface:PageService
Returns all page templates, regardless of any sandbox they are apart of- Specified by:
readAllPageTemplates
in interfacePageService
- Returns:
- all
PageTemplate
s configured in the system
-
removePageFromCache
Description copied from interface:PageService
Call to evict all known PageDTOs that are associated with the given page from cache- Specified by:
removePageFromCache
in interfacePageService
- Returns:
- whether successful
-
removeTranslationPageFromCache
Description copied from interface:PageService
Call to evict translated page from cache- Specified by:
removeTranslationPageFromCache
in interfacePageService
- Returns:
- whether successful
-