org.broadleafcommerce.cms.page.service
Interface PageService

All Known Implementing Classes:
PageServiceImpl

public interface PageService

Created by bpolster.


Method Summary
 Page addPage(Page page, SandBox destinationSandbox)
          This method is intended to be called from within the CMS admin only.
 Long countPages(SandBox sandBox, org.hibernate.Criteria criteria)
           
 void deletePage(Page page, SandBox destinationSandbox)
          If deleting and item where page.originalPageId != null then the item is deleted from the database.
 Page findPageById(Long pageId)
          Returns the page with the passed in id.
 PageDTO findPageByURI(SandBox currentSandbox, Locale locale, String uri, Map<String,Object> ruleDTOs, boolean secure)
          Looks up the page from the backend datastore.
 Map<String,PageField> findPageFieldsByPageId(Long pageId)
          Returns the page-fields associated with the passed in page-id.
 List<Page> findPages(SandBox sandBox, org.hibernate.Criteria criteria)
           
 PageTemplate findPageTemplateById(Long id)
          Returns the page template with the passed in id.
 List<ArchivedPagePublisher> getArchivedPageListeners()
           
 boolean isAutomaticallyApproveAndPromotePages()
           
 void removePageFromCache(String baseKey)
          Call to evict both secure and non-secure pages matching the passed in key.
 void setArchivedPageListeners(List<ArchivedPagePublisher> archivedPageListeners)
           
 void setAutomaticallyApproveAndPromotePages(boolean automaticallyApproveAndPromotePages)
           
 Page updatePage(Page page, SandBox sandbox)
          This method is intended to be called from within the CMS admin only.
 

Method Detail

findPageById

Page findPageById(Long pageId)
Returns the page with the passed in id.

Parameters:
pageId - - The id of the page.
Returns:
The associated page.

findPageTemplateById

PageTemplate findPageTemplateById(Long id)
Returns the page template with the passed in id.

Parameters:
id - - the id of the page template
Returns:
The associated page template.

findPageFieldsByPageId

Map<String,PageField> findPageFieldsByPageId(Long pageId)
Returns the page-fields associated with the passed in page-id. This is preferred over the direct access from Page so that the two items can be cached distinctly

Parameters:
pageId - - The id of the page.
Returns:
The associated page.

addPage

Page addPage(Page page,
             SandBox destinationSandbox)
This method is intended to be called from within the CMS admin only. Adds the passed in page to the DB. Creates a sandbox/site if one doesn't already exist.


updatePage

Page updatePage(Page page,
                SandBox sandbox)
This method is intended to be called from within the CMS admin only. Updates the page according to the following rules: 1. If sandbox has changed from null to a value This means that the user is editing an item in production and the edit is taking place in a sandbox. Clone the page and add it to the new sandbox and set the cloned page's originalPageId to the id of the page being updated. 2. If the sandbox has changed from one value to another This means that the user is moving the item from one sandbox to another. Update the siteId for the page to the one associated with the new sandbox 3. If the sandbox has changed from a value to null This means that the item is moving from the sandbox to production. If the page has an originalPageId, then update that page by setting it's archived flag to true. Then, update the siteId of the page being updated to be the siteId of the original page. 4. If the sandbox is the same then just update the page.


findPageByURI

PageDTO findPageByURI(SandBox currentSandbox,
                      Locale locale,
                      String uri,
                      Map<String,Object> ruleDTOs,
                      boolean secure)
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.

Parameters:
currentSandbox - - current sandbox
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:

deletePage

void deletePage(Page page,
                SandBox destinationSandbox)
If deleting and item where page.originalPageId != null then the item is deleted from the database. If the originalPageId is null, then this method marks the items as deleted within the passed in sandbox.

Parameters:
page -
destinationSandbox -

findPages

List<Page> findPages(SandBox sandBox,
                     org.hibernate.Criteria criteria)

countPages

Long countPages(SandBox sandBox,
                org.hibernate.Criteria criteria)

removePageFromCache

void removePageFromCache(String baseKey)
Call to evict both secure and non-secure pages matching the passed in key.

Parameters:
baseKey -

getArchivedPageListeners

List<ArchivedPagePublisher> getArchivedPageListeners()

setArchivedPageListeners

void setArchivedPageListeners(List<ArchivedPagePublisher> archivedPageListeners)

isAutomaticallyApproveAndPromotePages

boolean isAutomaticallyApproveAndPromotePages()

setAutomaticallyApproveAndPromotePages

void setAutomaticallyApproveAndPromotePages(boolean automaticallyApproveAndPromotePages)


Copyright © 2013. All Rights Reserved.