Class PageServiceImpl

java.lang.Object
org.broadleafcommerce.cms.page.service.PageServiceImpl
All Implemented Interfaces:
PageService

@Service("blPageService") public class PageServiceImpl extends Object implements PageService
Author:
Brian Polster (bpolster), Nathan Moore (nathandmoore)
  • Field Details

    • LOG

      protected static final org.apache.commons.logging.Log LOG
    • AND

      protected static String AND
    • NULL_PAGE

      protected final org.broadleafcommerce.common.page.dto.PageDTO NULL_PAGE
    • pageDao

      protected PageDao pageDao
    • pageRuleProcessors

      protected List<org.broadleafcommerce.common.rule.RuleProcessor<org.broadleafcommerce.common.page.dto.PageDTO>> pageRuleProcessors
    • localeService

      protected org.broadleafcommerce.common.locale.service.LocaleService localeService
    • staticAssetService

      protected StaticAssetService staticAssetService
    • statisticsService

      protected org.broadleafcommerce.common.cache.StatisticsService statisticsService
    • templateOverrideManager

      protected org.broadleafcommerce.common.template.TemplateOverrideExtensionManager templateOverrideManager
    • pageServiceUtility

      protected PageServiceUtility pageServiceUtility
    • extensionManager

      protected PageServiceExtensionManager extensionManager
    • queryExtensionManager

      protected PageQueryExtensionManager 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

      public Page findPageById(Long pageId)
      Description copied from interface: PageService
      Returns the page with the passed in id.
      Specified by:
      findPageById in interface PageService
      Parameters:
      pageId - - The id of the page.
      Returns:
      The associated page.
    • findPageFieldMapByPageId

      public Map<String,PageField> findPageFieldMapByPageId(Long pageId)
      Description copied from interface: PageService
      Returns the page-fields associated with a page.
      Specified by:
      findPageFieldMapByPageId in interface PageService
      Returns:
    • findPageTemplateById

      public PageTemplate findPageTemplateById(Long id)
      Description copied from interface: PageService
      Returns the page template with the passed in id.
      Specified by:
      findPageTemplateById in interface PageService
      Parameters:
      id - - the id of the page template
      Returns:
      The associated page template.
    • savePageTemplate

      @Transactional("blTransactionManager") public PageTemplate savePageTemplate(PageTemplate template)
      Description copied from interface: PageService
      Saves the given PageTemplate
      Specified by:
      savePageTemplate in interface PageService
      Parameters:
      template - the PageTemplate to save
      Returns:
      the database-saved PageTemplate
    • findPageByURI

      public org.broadleafcommerce.common.page.dto.PageDTO findPageByURI(org.broadleafcommerce.common.locale.domain.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 interface PageService
      Parameters:
      locale - - current locale
      uri - - the URI to return a page for
      ruleDTOs - - ruleDTOs that are used as the data to process page rules
      secure - - set to true if current request is over HTTPS
      Returns:
    • isNullPageCached

      protected boolean isNullPageCached(org.broadleafcommerce.common.locale.domain.Locale locale, String uri, boolean secure)
    • getPageDTOListForURI

      protected List<org.broadleafcommerce.common.page.dto.PageDTO> getPageDTOListForURI(org.broadleafcommerce.common.locale.domain.Locale locale, String uri, boolean secure)
    • addCachedDate

      protected void addCachedDate(String key)
    • getCachedDate

      protected Date getCachedDate(String key)
    • buildPageDTOList

      public List<org.broadleafcommerce.common.page.dto.PageDTO> buildPageDTOList(List<Page> pageList, boolean secure, String identifier, org.broadleafcommerce.common.locale.domain.Locale locale)
      Description copied from interface: PageService
      Builds a list of PageDTO objects from the given list of Page objects and caches the list
      Specified by:
      buildPageDTOList in interface PageService
      Returns:
      copy of DTOList
    • buildPageDTOListUsingCache

      protected List<org.broadleafcommerce.common.page.dto.PageDTO> buildPageDTOListUsingCache(List<Page> pageList, String identifier, org.broadleafcommerce.common.locale.domain.Locale locale, boolean secure)
    • getCachedPageDTOList

      protected List<org.broadleafcommerce.common.page.dto.PageDTO> getCachedPageDTOList(List<Page> pageList, String identifier, org.broadleafcommerce.common.locale.domain.Locale locale, boolean secure)
    • addPageListToPageDTOList

      protected void addPageListToPageDTOList(List<Page> pageList, boolean secure, List<org.broadleafcommerce.common.page.dto.PageDTO> dtoList)
    • getPageListFromCache

      protected List<org.broadleafcommerce.common.page.dto.PageDTO> getPageListFromCache(String key)
    • addPageListToCache

      protected void addPageListToCache(List<org.broadleafcommerce.common.page.dto.PageDTO> pageList, String identifier, org.broadleafcommerce.common.locale.domain.Locale locale, boolean secure)
    • addPageMapCacheEntry

      protected void addPageMapCacheEntry(String identifier, String key)
    • getPageMapCacheKey

      public String getPageMapCacheKey(String uri, Long site)
      Specified by:
      getPageMapCacheKey in interface PageService
    • buildKey

      protected String buildKey(String identifier, org.broadleafcommerce.common.locale.domain.Locale locale, Boolean secure)
    • buildKey

      protected String buildKey(String identifier, String localeCode, Boolean secure, org.broadleafcommerce.common.extension.ResultType resultType)
    • buildBaseKey

      protected String buildBaseKey(String identifier, String localeCode, Boolean secure)
    • findLanguageOnlyLocale

      protected org.broadleafcommerce.common.locale.domain.Locale findLanguageOnlyLocale(org.broadleafcommerce.common.locale.domain.Locale locale)
    • getPageCache

      public javax.cache.Cache getPageCache()
      Specified by:
      getPageCache in interface PageService
    • getPageMapCache

      public javax.cache.Cache getPageMapCache()
      Specified by:
      getPageMapCache in interface PageService
    • getUriCachedDateCache

      public javax.cache.Cache getUriCachedDateCache()
      Specified by:
      getUriCachedDateCache in interface PageService
    • copyDTOList

      protected List<org.broadleafcommerce.common.page.dto.PageDTO> copyDTOList(List<org.broadleafcommerce.common.page.dto.PageDTO> dtoList)
    • evaluatePageRules

      protected org.broadleafcommerce.common.page.dto.PageDTO evaluatePageRules(List<org.broadleafcommerce.common.page.dto.PageDTO> pageDTOList, org.broadleafcommerce.common.locale.domain.Locale locale, Map<String,Object> ruleDTOs)
    • passesPageRules

      protected boolean passesPageRules(org.broadleafcommerce.common.page.dto.PageDTO page, Map<String,Object> ruleDTOs)
    • readAllPages

      public List<Page> readAllPages()
      Description copied from interface: PageService
      Returns all pages, regardless of any sandbox they are apart of
      Specified by:
      readAllPages in interface PageService
      Returns:
      all Pages configured in the system
    • readAllPageTemplates

      public List<PageTemplate> readAllPageTemplates()
      Description copied from interface: PageService
      Returns all page templates, regardless of any sandbox they are apart of
      Specified by:
      readAllPageTemplates in interface PageService
      Returns:
      all PageTemplates configured in the system
    • removePageFromCache

      public Boolean removePageFromCache(String mapKey)
      Description copied from interface: PageService
      Call to evict all known PageDTOs that are associated with the given page from cache
      Specified by:
      removePageFromCache in interface PageService
      Returns:
      whether successful
    • removeTranslationPageFromCache

      public Boolean removeTranslationPageFromCache(String uri, String localeCode, boolean isSecure)
      Description copied from interface: PageService
      Call to evict translated page from cache
      Specified by:
      removeTranslationPageFromCache in interface PageService
      Returns:
      whether successful