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.
 Page findPageByURI(SandBox currentSandbox, Locale locale, String uri)
          Retrieve the page if one is available for the passed in uri.
 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.
 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.


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 -

findPageByURI

Page findPageByURI(SandBox currentSandbox,
                   Locale locale,
                   String uri)
Retrieve the page if one is available for the passed in uri.


findPages

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

countPages

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


Copyright © 2011. All Rights Reserved.