org.broadleafcommerce.cms.structure.service
Interface StructuredContentService

All Known Implementing Classes:
StructuredContentServiceImpl

public interface StructuredContentService

Provides services to manage StructuredContent items.

Author:
bpolster

Method Summary
 void addStructuredContentListToCache(String key, List<StructuredContentDTO> scDTOList)
           
 List<StructuredContentDTO> buildStructuredContentDTOList(List<StructuredContent> structuredContentList, boolean secure)
           
 String buildTypeKey(SandBox currentSandbox, Locale locale, String contentType)
           
 Long countContentItems(org.hibernate.Criteria c)
          Follows the same rules as findContentItems.
 List<StructuredContentDTO> evaluateAndPriortizeContent(List<StructuredContentDTO> structuredContentList, int count, Map<String,Object> ruleDTOs)
           
 List<StructuredContent> findAllContentItems()
          Finds all content items regardless of the Sandbox they are a member of
 List<StructuredContent> findContentItems(org.hibernate.Criteria criteria)
          This method is intended to be called solely from the CMS admin.
 Locale findLanguageOnlyLocale(Locale locale)
           
 StructuredContent findStructuredContentById(Long contentId)
          Returns the StructuredContent item associated with the passed in id.
 StructuredContentType findStructuredContentTypeById(Long id)
          Returns the StructuredContentType associated with the passed in id.
 StructuredContentType findStructuredContentTypeByName(String name)
          Returns the StructuredContentType associated with the passed in String value.
 net.sf.ehcache.Cache getStructuredContentCache()
           
 List<StructuredContentDTO> getStructuredContentListFromCache(String key)
           
 List<StructuredContentDTO> lookupStructuredContentItemsByName(String contentName, Locale locale, Integer count, Map<String,Object> ruleDTOs, boolean secure)
          This method returns content by name only.
 List<StructuredContentDTO> lookupStructuredContentItemsByName(StructuredContentType contentType, String contentName, Locale locale, Integer count, Map<String,Object> ruleDTOs, boolean secure)
          This method returns content by name and type.
 List<StructuredContentDTO> lookupStructuredContentItemsByType(StructuredContentType contentType, Locale locale, Integer count, Map<String,Object> ruleDTOs, boolean secure)
          This method returns content
Returns active content items for the passed in sandbox that match the passed in type.
 void removeItemFromCache(String nameKey, String typeKey)
           
 void removeStructuredContentFromCache(SandBox sandBox, StructuredContent sc)
           
 List<StructuredContentType> retrieveAllStructuredContentTypes()
           
 StructuredContentType saveStructuredContentType(StructuredContentType type)
          Saves the given type and returns the merged instance
 

Method Detail

findStructuredContentById

StructuredContent findStructuredContentById(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(Long id)
Returns the StructuredContentType associated with the passed in id.

Parameters:
id - - The id of the content type.
Returns:
The associated StructuredContentType.

findStructuredContentTypeByName

StructuredContentType findStructuredContentTypeByName(String name)
Returns the StructuredContentType associated with the passed in String value.

Parameters:
name - - The name of the content type.
Returns:
The associated StructuredContentType.

retrieveAllStructuredContentTypes

List<StructuredContentType> retrieveAllStructuredContentTypes()
Returns:
a list of all StructuredContentTypes

findContentItems

List<StructuredContent> findContentItems(org.hibernate.Criteria criteria)
This method is intended to be called solely from the CMS admin. Similar methods exist that are intended for other clients (e.g. lookupStructuredContentItemsBy....
Returns content items for the passed in sandbox that match the passed in criteria. The criteria acts as a where clause to be used in the search for content items. Implementations should automatically add criteria such that no archived items are returned from this method.
The SandBox parameter impacts the results as follows. If a SandBoxType of production is passed in, only those items in that SandBox are returned.
If a non-production SandBox is passed in, then the method will return the items associatd with the related production SandBox and then merge in the results of the passed in SandBox.

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

findAllContentItems

List<StructuredContent> findAllContentItems()
Finds all content items regardless of the Sandbox they are a member of

Returns:

countContentItems

Long countContentItems(org.hibernate.Criteria c)
Follows the same rules as findContentItems.

Returns:
the count of items in this sandbox that match the passed in Criteria

saveStructuredContentType

StructuredContentType saveStructuredContentType(StructuredContentType type)
Saves the given type and returns the merged instance


lookupStructuredContentItemsByType

List<StructuredContentDTO> lookupStructuredContentItemsByType(StructuredContentType contentType,
                                                              Locale locale,
                                                              Integer count,
                                                              Map<String,Object> ruleDTOs,
                                                              boolean secure)
This method returns content
Returns active content items for the passed in sandbox that match the passed in type.
The SandBox parameter impacts the results as follows. If a SandBoxType of production is passed in, only those items in that SandBox are returned.
If a non-production SandBox is passed in, then the method will return the items associatd with the related production SandBox and then merge in the results of the passed in SandBox.
The secure item is used in cases where the structured content item contains an image path that needs to be rewritten to use https.

Parameters:
sandBox - - the sandbox to find structured content items (null indicates items that are in production for sites that are single tenant.
contentType - - the type of content to return
count - - the max number of content items to return
ruleDTOs - - a Map of objects that will be used in MVEL processing.
secure - - set to true if the request is being served over https
Returns:
- The matching items
See Also:
DisplayContentTag

lookupStructuredContentItemsByName

List<StructuredContentDTO> lookupStructuredContentItemsByName(String contentName,
                                                              Locale locale,
                                                              Integer count,
                                                              Map<String,Object> ruleDTOs,
                                                              boolean secure)
This method returns content by name only.
Returns active content items for the passed in sandbox that match the passed in type.
The SandBox parameter impacts the results as follows. If a SandBoxType of production is passed in, only those items in that SandBox are returned.
If a non-production SandBox is passed in, then the method will return the items associatd with the related production SandBox and then merge in the results of the passed in SandBox.

Parameters:
sandBox - - the sandbox to find structured content items (null indicates items that are in production for sites that are single tenant.
contentName - - the name of content to return
count - - the max number of content items to return
ruleDTOs - - a Map of objects that will be used in MVEL processing.
secure - - set to true if the request is being served over https
Returns:
- The matching items
See Also:
DisplayContentTag

lookupStructuredContentItemsByName

List<StructuredContentDTO> lookupStructuredContentItemsByName(StructuredContentType contentType,
                                                              String contentName,
                                                              Locale locale,
                                                              Integer count,
                                                              Map<String,Object> ruleDTOs,
                                                              boolean secure)
This method returns content by name and type.
Returns active content items for the passed in sandbox that match the passed in type.
The SandBox parameter impacts the results as follows. If a SandBoxType of production is passed in, only those items in that SandBox are returned.
If a non-production SandBox is passed in, then the method will return the items associatd with the related production SandBox and then merge in the results of the passed in SandBox.

Parameters:
sandBox - - the sandbox to find structured content items (null indicates items that are in production for sites that are single tenant.
contentType - - the type of content to return
contentName - - the name of content to return
count - - the max number of content items to return
ruleDTOs - - a Map of objects that will be used in MVEL processing.
secure - - set to true if the request is being served over https
Returns:
- The matching items
See Also:
DisplayContentTag

findLanguageOnlyLocale

Locale findLanguageOnlyLocale(Locale locale)

buildStructuredContentDTOList

List<StructuredContentDTO> buildStructuredContentDTOList(List<StructuredContent> structuredContentList,
                                                         boolean secure)

evaluateAndPriortizeContent

List<StructuredContentDTO> evaluateAndPriortizeContent(List<StructuredContentDTO> structuredContentList,
                                                       int count,
                                                       Map<String,Object> ruleDTOs)

removeStructuredContentFromCache

void removeStructuredContentFromCache(SandBox sandBox,
                                      StructuredContent sc)

getStructuredContentCache

net.sf.ehcache.Cache getStructuredContentCache()

addStructuredContentListToCache

void addStructuredContentListToCache(String key,
                                     List<StructuredContentDTO> scDTOList)

buildTypeKey

String buildTypeKey(SandBox currentSandbox,
                    Locale locale,
                    String contentType)

getStructuredContentListFromCache

List<StructuredContentDTO> getStructuredContentListFromCache(String key)

removeItemFromCache

void removeItemFromCache(String nameKey,
                         String typeKey)


Copyright © 2013. All Rights Reserved.