org.broadleafcommerce.cms.structure.service
Interface StructuredContentService

All Superinterfaces:
SandBoxItemListener
All Known Implementing Classes:
StructuredContentServiceImpl

public interface StructuredContentService
extends SandBoxItemListener

Created by bpolster.


Method Summary
 StructuredContent addStructuredContent(StructuredContent content, SandBox destinationSandbox)
          This method is intended to be called from within the CMS admin only.
 java.lang.Long countContentItems(SandBox sandBox, org.hibernate.Criteria c)
           
 void deleteStructuredContent(StructuredContent content, SandBox destinationSandbox)
          If deleting and item where content.originalItemId != null then the item is deleted from the database.
 java.util.List<StructuredContent> findContentItems(SandBox sandbox, org.hibernate.Criteria c)
          Retuns content items for the passed in sandbox that match the passed in criteria.
 java.util.Map<java.lang.String,StructuredContentField> findFieldsByContentId(java.lang.Long contentId)
          Returns the fields associated with the passed in contentId.
 StructuredContent findStructuredContentById(java.lang.Long contentId)
          Returns the StructuredContent item associated with the passed in id.
 StructuredContentType findStructuredContentTypeById(java.lang.Long id)
           
 StructuredContentType findStructuredContentTypeByName(java.lang.String name)
           
 java.util.List<StructuredContent> lookupStructuredContentItemsByName(SandBox sandBox, StructuredContentType contentType, java.lang.String contentName, Locale locale, java.lang.Integer count, java.util.Map<java.lang.String,java.lang.Object> ruleDTOs)
           
 java.util.List<StructuredContent> lookupStructuredContentItemsByType(SandBox sandBox, StructuredContentType contentType, Locale locale, java.lang.Integer count, java.util.Map<java.lang.String,java.lang.Object> ruleDTOs)
           
 java.util.List<StructuredContentType> retrieveAllStructuredContentTypes()
          Returns the list of structured content types.
 StructuredContent updateStructuredContent(StructuredContent content, SandBox sandbox)
          This method is intended to be called from within the CMS admin only.
 
Methods inherited from interface org.broadleafcommerce.openadmin.server.domain.SandBoxItemListener
itemPromoted, itemRejected, itemReverted
 

Method Detail

findStructuredContentById

StructuredContent findStructuredContentById(java.lang.Long contentId)
Returns the StructuredContent item associated with the passed in id.

Parameters:
contentId - - The id of the content item.
Returns:
The associated structured content item.

findStructuredContentTypeById

StructuredContentType findStructuredContentTypeById(java.lang.Long id)

findStructuredContentTypeByName

StructuredContentType findStructuredContentTypeByName(java.lang.String name)

retrieveAllStructuredContentTypes

java.util.List<StructuredContentType> retrieveAllStructuredContentTypes()
Returns the list of structured content types.


findFieldsByContentId

java.util.Map<java.lang.String,StructuredContentField> findFieldsByContentId(java.lang.Long contentId)
Returns the fields associated with the passed in contentId. This is preferred over the direct access from the ContentItem so that the two items can be cached distinctly

Parameters:
contentId - - The id of the content.
Returns:
Map of fields for this content id

findContentItems

java.util.List<StructuredContent> findContentItems(SandBox sandbox,
                                                   org.hibernate.Criteria c)
Retuns content items for the passed in sandbox that match the passed in criteria. Merges the sandbox content with the production content.

Parameters:
sandbox - - the sandbox to find structured content items (null indicates items that are in production for sites that are single tenant.
Returns:

countContentItems

java.lang.Long countContentItems(SandBox sandBox,
                                 org.hibernate.Criteria c)
Returns:
the count of items in this sandbox that match the passed in Criteria

addStructuredContent

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


updateStructuredContent

StructuredContent updateStructuredContent(StructuredContent content,
                                          SandBox sandbox)
This method is intended to be called from within the CMS admin only. Updates the structuredContent 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 item and add it to the new sandbox and set the cloned item's originalItemId to the id of the item 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 item 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 item has an originalItemId, then update that item by setting it's archived flag to true. Then, update the siteId of the item being updated to be the siteId of the original item. 4. If the sandbox is the same then just update the item.


deleteStructuredContent

void deleteStructuredContent(StructuredContent content,
                             SandBox destinationSandbox)
If deleting and item where content.originalItemId != null then the item is deleted from the database. If the originalItemId is null, then this method marks the items as deleted within the passed in sandbox.

Parameters:
page -
destinationSandbox -

lookupStructuredContentItemsByType

java.util.List<StructuredContent> lookupStructuredContentItemsByType(SandBox sandBox,
                                                                     StructuredContentType contentType,
                                                                     Locale locale,
                                                                     java.lang.Integer count,
                                                                     java.util.Map<java.lang.String,java.lang.Object> ruleDTOs)

lookupStructuredContentItemsByName

java.util.List<StructuredContent> lookupStructuredContentItemsByName(SandBox sandBox,
                                                                     StructuredContentType contentType,
                                                                     java.lang.String contentName,
                                                                     Locale locale,
                                                                     java.lang.Integer count,
                                                                     java.util.Map<java.lang.String,java.lang.Object> ruleDTOs)


Copyright © 2011. All Rights Reserved.