Class PageDaoImpl

java.lang.Object
org.broadleafcommerce.cms.page.dao.PageDaoImpl
All Implemented Interfaces:
PageDao

@Repository("blPageDao") public class PageDaoImpl extends Object implements PageDao
Created by bpolster.
  • Field Details

    • em

      protected jakarta.persistence.EntityManager em
    • entityConfiguration

      protected EntityConfiguration entityConfiguration
    • currentDateResolution

      protected Long currentDateResolution
    • cachedDate

      protected Date cachedDate
  • Constructor Details

    • PageDaoImpl

      public PageDaoImpl()
  • Method Details

    • readPageById

      public Page readPageById(Long id)
      Specified by:
      readPageById in interface PageDao
    • readPageFieldsByPageId

      public List<PageField> readPageFieldsByPageId(Long pageId)
      Specified by:
      readPageFieldsByPageId in interface PageDao
    • readPageTemplateById

      public PageTemplate readPageTemplateById(Long id)
      Specified by:
      readPageTemplateById in interface PageDao
    • savePageTemplate

      public PageTemplate savePageTemplate(PageTemplate template)
      Description copied from interface: PageDao
      Saves the given PageTemplate
      Specified by:
      savePageTemplate in interface PageDao
      Parameters:
      template - the PageTemplate to save
      Returns:
      the database-saved PageTemplate
    • updatePage

      public Page updatePage(Page page)
      Specified by:
      updatePage in interface PageDao
    • delete

      public void delete(Page page)
      Specified by:
      delete in interface PageDao
    • addPage

      public Page addPage(Page clonedPage)
      Specified by:
      addPage in interface PageDao
    • findPageByURI

      public List<Page> findPageByURI(String uri)
      Specified by:
      findPageByURI in interface PageDao
    • addActiveDateRestrictions

      protected void addActiveDateRestrictions(jakarta.persistence.criteria.CriteriaBuilder builder, jakarta.persistence.criteria.Root pageRoot, List<jakarta.persistence.criteria.Predicate> restrictions, Date afterStartDate, Date beforeEndDate)
    • addOfflineRestriction

      protected void addOfflineRestriction(jakarta.persistence.criteria.CriteriaBuilder builder, jakarta.persistence.criteria.Root pageRoot, List<jakarta.persistence.criteria.Predicate> restrictions)
    • getResultForQueryAndCache

      protected List<Page> getResultForQueryAndCache(jakarta.persistence.criteria.CriteriaQuery<Page> criteriaQuery)
    • findPageByURIAndActiveDate

      public List<Page> findPageByURIAndActiveDate(String uri, Date activeDate)
      Description copied from interface: PageDao
      Returns pages that match the given URI and are within 1 day of the active date (potentially cached). This will only cache for 1 day.
      Specified by:
      findPageByURIAndActiveDate in interface PageDao
      Returns:
    • filterInactive

      protected List<Page> filterInactive(List<Page> pages)
    • isActiveNow

      protected boolean isActiveNow(Page page)
    • findPageByURI

      public List<Page> findPageByURI(Locale fullLocale, Locale languageOnlyLocale, String uri)
      Specified by:
      findPageByURI in interface PageDao
    • readAllPages

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

      public List<Page> readOnlineAndIncludedPages(int limit, int offset, String sortBy)
      Description copied from interface: PageDao
      Retrieve a subset of all online and site map included Pages
      Specified by:
      readOnlineAndIncludedPages in interface PageDao
      Parameters:
      limit - the maximum number of results
      offset - the starting point in the record set
      sortBy - the column to sort by
      Returns:
    • readAllPageTemplates

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

      public List<Page> findPageByURI(Locale locale, String uri)
      Specified by:
      findPageByURI in interface PageDao
    • detachPage

      public void detachPage(Page page)
      Specified by:
      detachPage in interface PageDao
    • getCurrentDateResolution

      public Long getCurrentDateResolution()
      Specified by:
      getCurrentDateResolution in interface PageDao
    • setCurrentDateResolution

      public void setCurrentDateResolution(Long currentDateResolution)
      Specified by:
      setCurrentDateResolution in interface PageDao