org.broadleafcommerce.cms.structure.dao
Interface StructuredContentDao

All Known Implementing Classes:
StructuredContentDaoImpl

public interface StructuredContentDao

Responsible for querying and updating StructuredContent items

Author:
bpolster

Method Summary
 StructuredContent addOrUpdateContentItem(StructuredContent content)
          Persists the changes or saves a new content item.
 void delete(StructuredContent content)
          Removes the passed in item from the underlying storage.
 void detach(StructuredContent sc)
          Detaches the item from the JPA session.
 List<StructuredContent> findActiveStructuredContentByName(SandBox sandBox, String name, Locale locale)
          Called by the DisplayContentTag to locate content based on the current SandBox, StructuredContentType, Name, and Locale.
 List<StructuredContent> findActiveStructuredContentByNameAndType(SandBox sandBox, StructuredContentType type, String name, Locale locale)
          Called by the DisplayContentTag to locate content based on the current SandBox, StructuredContentType, Name, and Locale.
 List<StructuredContent> findActiveStructuredContentByType(SandBox sandBox, StructuredContentType type, Locale locale)
          Called by the DisplayContentTag to locate content based on the current SandBox, StructuredContentType, and Locale.
 StructuredContent findStructuredContentById(Long contentId)
          Returns the StructuredContent item that matches the passed in Id.
 StructuredContentType findStructuredContentTypeById(Long contentTypeId)
          Returns the StructuredContentType that matches the passed in contentTypeId.
 StructuredContentType findStructuredContentTypeByName(String name)
          Used to lookup the StructuredContentType by name.
 Map<String,StructuredContentField> readFieldsForStructuredContentItem(StructuredContent sc)
           
 List<StructuredContentType> retrieveAllStructuredContentTypes()
          Returns the list of all StructuredContentTypes.
 

Method Detail

findStructuredContentById

StructuredContent findStructuredContentById(Long contentId)
Returns the StructuredContent item that matches the passed in Id.

Parameters:
contentId -
Returns:
the found item or null if it does not exist

findStructuredContentTypeById

StructuredContentType findStructuredContentTypeById(Long contentTypeId)
Returns the StructuredContentType that matches the passed in contentTypeId.

Parameters:
contentTypeId -
Returns:
the found item or null if it does not exist

retrieveAllStructuredContentTypes

List<StructuredContentType> retrieveAllStructuredContentTypes()
Returns the list of all StructuredContentTypes.

Returns:
the list of found items

readFieldsForStructuredContentItem

Map<String,StructuredContentField> readFieldsForStructuredContentItem(StructuredContent sc)

addOrUpdateContentItem

StructuredContent addOrUpdateContentItem(StructuredContent content)
Persists the changes or saves a new content item.

Parameters:
content -
Returns:
the newly saved or persisted item

delete

void delete(StructuredContent content)
Removes the passed in item from the underlying storage.

Parameters:
content -

findActiveStructuredContentByType

List<StructuredContent> findActiveStructuredContentByType(SandBox sandBox,
                                                          StructuredContentType type,
                                                          Locale locale)
Called by the DisplayContentTag to locate content based on the current SandBox, StructuredContentType, and Locale.

Parameters:
sandBox - to search for the content
type - of content to search for
locale - to restrict the search to
Returns:
a list of all matching content
See Also:
DisplayContentTag

findActiveStructuredContentByNameAndType

List<StructuredContent> findActiveStructuredContentByNameAndType(SandBox sandBox,
                                                                 StructuredContentType type,
                                                                 String name,
                                                                 Locale locale)
Called by the DisplayContentTag to locate content based on the current SandBox, StructuredContentType, Name, and Locale.

Parameters:
sandBox -
type -
name -
locale -
Returns:

findActiveStructuredContentByName

List<StructuredContent> findActiveStructuredContentByName(SandBox sandBox,
                                                          String name,
                                                          Locale locale)
Called by the DisplayContentTag to locate content based on the current SandBox, StructuredContentType, Name, and Locale.

Parameters:
sandBox -
name -
locale -
Returns:

findStructuredContentTypeByName

StructuredContentType findStructuredContentTypeByName(String name)
Used to lookup the StructuredContentType by name.

Parameters:
name -
Returns:

detach

void detach(StructuredContent sc)
Detaches the item from the JPA session. This is intended for internal use by the CMS system. It supports the need to clone an item as part of the editing process.

Parameters:
sc - - the item to detach


Copyright © 2012. All Rights Reserved.