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(String name, Locale locale)
          Pass through function for backwards compatibility to get a list of structured content.
 List<StructuredContent> findActiveStructuredContentByName(String name, Locale fullLocale, Locale languageOnlyLocale)
          Called by the DisplayContentTag to locate content based on the current SandBox, StructuredContentType, Name, fullLocale and/or languageOnlyLocale.
 List<StructuredContent> findActiveStructuredContentByNameAndType(StructuredContentType type, String name, Locale locale)
          Pass through function for backwards compatibility to get a list of structured content.
 List<StructuredContent> findActiveStructuredContentByNameAndType(StructuredContentType type, String name, Locale fullLocale, Locale languageOnlyLocale)
          Called by the DisplayContentTag to locate content based on the current SandBox, StructuredContentType, Name, fullLocale and/or languageOnlyLocale.
 List<StructuredContent> findActiveStructuredContentByType(StructuredContentType type, Locale locale)
          Pass through function for backwards compatibility to get a list of structured content.
 List<StructuredContent> findActiveStructuredContentByType(StructuredContentType type, Locale fullLocale, Locale languageOnlyLocale)
          Called by the DisplayContentTag to locate content based on the current SandBox, StructuredContentType, fullLocale and/or languageOnlyLocale.
 List<StructuredContent> findAllContentItems()
          Finds all content regardless of the Sandbox they are a member of
 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.
 List<StructuredContentType> retrieveAllStructuredContentTypes()
          Returns the list of all StructuredContentTypes.
 StructuredContentType saveStructuredContentType(StructuredContentType type)
          Saves the given type and returns the merged instance
 

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

findAllContentItems

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

Returns:
the list of StructuredContent, an empty list of none are found

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 -

saveStructuredContentType

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


findActiveStructuredContentByType

List<StructuredContent> findActiveStructuredContentByType(StructuredContentType type,
                                                          Locale locale)
Pass through function for backwards compatibility to get a list of structured content.

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

findActiveStructuredContentByType

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

Parameters:
sandBox - to search for the content
type - of content to search for
fullLocale - to restrict the search to
languageOnlyLocale - locale based only on a language specified
Returns:
a list of all matching content
See Also:
DisplayContentTag

findActiveStructuredContentByNameAndType

List<StructuredContent> findActiveStructuredContentByNameAndType(StructuredContentType type,
                                                                 String name,
                                                                 Locale locale)
Pass through function for backwards compatibility to get a list of structured content.

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

findActiveStructuredContentByNameAndType

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

Parameters:
sandBox -
type -
name -
fullLocale -
languageOnlyLocale -
Returns:

findActiveStructuredContentByName

List<StructuredContent> findActiveStructuredContentByName(String name,
                                                          Locale locale)
Pass through function for backwards compatibility to get a list of structured content.

Parameters:
sandBox -
name -
locale -
Returns:

findActiveStructuredContentByName

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

Parameters:
sandBox -
name -
fullLocale -
languageOnlyLocale -
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 © 2013. All Rights Reserved.