org.broadleafcommerce.cms.structure.dao
Class StructuredContentDaoImpl

java.lang.Object
  extended by org.broadleafcommerce.cms.structure.dao.StructuredContentDaoImpl
All Implemented Interfaces:
StructuredContentDao

@Repository(value="blStructuredContentDao")
public class StructuredContentDaoImpl
extends Object
implements StructuredContentDao

Created by bpolster.


Field Summary
protected  javax.persistence.EntityManager em
           
protected  EntityConfiguration entityConfiguration
           
 
Constructor Summary
StructuredContentDaoImpl()
           
 
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)
          Pass through function for backwards compatibility to get a list of structured content.
 List<StructuredContent> findActiveStructuredContentByName(SandBox sandBox, 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(SandBox sandBox, StructuredContentType type, String name, Locale locale)
          Pass through function for backwards compatibility to get a list of structured content.
 List<StructuredContent> findActiveStructuredContentByNameAndType(SandBox sandBox, 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(SandBox sandBox, StructuredContentType type, Locale locale)
          Pass through function for backwards compatibility to get a list of structured content.
 List<StructuredContent> findActiveStructuredContentByType(SandBox sandBox, StructuredContentType type, Locale fullLocale, Locale languageOnlyLocale)
          Called by the DisplayContentTag to locate content based on the current SandBox, StructuredContentType, fullLocale and/or languageOnlyLocale.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

em

protected javax.persistence.EntityManager em

entityConfiguration

protected EntityConfiguration entityConfiguration
Constructor Detail

StructuredContentDaoImpl

public StructuredContentDaoImpl()
Method Detail

findStructuredContentById

public StructuredContent findStructuredContentById(Long contentId)
Description copied from interface: StructuredContentDao
Returns the StructuredContent item that matches the passed in Id.

Specified by:
findStructuredContentById in interface StructuredContentDao
Returns:
the found item or null if it does not exist

findStructuredContentTypeById

public StructuredContentType findStructuredContentTypeById(Long contentTypeId)
Description copied from interface: StructuredContentDao
Returns the StructuredContentType that matches the passed in contentTypeId.

Specified by:
findStructuredContentTypeById in interface StructuredContentDao
Returns:
the found item or null if it does not exist

retrieveAllStructuredContentTypes

public List<StructuredContentType> retrieveAllStructuredContentTypes()
Description copied from interface: StructuredContentDao
Returns the list of all StructuredContentTypes.

Specified by:
retrieveAllStructuredContentTypes in interface StructuredContentDao
Returns:
the list of found items

readFieldsForStructuredContentItem

public Map<String,StructuredContentField> readFieldsForStructuredContentItem(StructuredContent sc)
Specified by:
readFieldsForStructuredContentItem in interface StructuredContentDao

addOrUpdateContentItem

public StructuredContent addOrUpdateContentItem(StructuredContent content)
Description copied from interface: StructuredContentDao
Persists the changes or saves a new content item.

Specified by:
addOrUpdateContentItem in interface StructuredContentDao
Returns:
the newly saved or persisted item

delete

public void delete(StructuredContent content)
Description copied from interface: StructuredContentDao
Removes the passed in item from the underlying storage.

Specified by:
delete in interface StructuredContentDao

findActiveStructuredContentByType

public List<StructuredContent> findActiveStructuredContentByType(SandBox sandBox,
                                                                 StructuredContentType type,
                                                                 Locale locale)
Description copied from interface: StructuredContentDao
Pass through function for backwards compatibility to get a list of structured content.

Specified by:
findActiveStructuredContentByType in interface StructuredContentDao
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

public List<StructuredContent> findActiveStructuredContentByType(SandBox sandBox,
                                                                 StructuredContentType type,
                                                                 Locale fullLocale,
                                                                 Locale languageOnlyLocale)
Description copied from interface: StructuredContentDao
Called by the DisplayContentTag to locate content based on the current SandBox, StructuredContentType, fullLocale and/or languageOnlyLocale.

Specified by:
findActiveStructuredContentByType in interface StructuredContentDao
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

public List<StructuredContent> findActiveStructuredContentByNameAndType(SandBox sandBox,
                                                                        StructuredContentType type,
                                                                        String name,
                                                                        Locale locale)
Description copied from interface: StructuredContentDao
Pass through function for backwards compatibility to get a list of structured content.

Specified by:
findActiveStructuredContentByNameAndType in interface StructuredContentDao
Returns:

findActiveStructuredContentByNameAndType

public List<StructuredContent> findActiveStructuredContentByNameAndType(SandBox sandBox,
                                                                        StructuredContentType type,
                                                                        String name,
                                                                        Locale fullLocale,
                                                                        Locale languageOnlyLocale)
Description copied from interface: StructuredContentDao
Called by the DisplayContentTag to locate content based on the current SandBox, StructuredContentType, Name, fullLocale and/or languageOnlyLocale.

Specified by:
findActiveStructuredContentByNameAndType in interface StructuredContentDao
Returns:

findActiveStructuredContentByName

public List<StructuredContent> findActiveStructuredContentByName(SandBox sandBox,
                                                                 String name,
                                                                 Locale locale)
Description copied from interface: StructuredContentDao
Pass through function for backwards compatibility to get a list of structured content.

Specified by:
findActiveStructuredContentByName in interface StructuredContentDao
Returns:

findActiveStructuredContentByName

public List<StructuredContent> findActiveStructuredContentByName(SandBox sandBox,
                                                                 String name,
                                                                 Locale fullLocale,
                                                                 Locale languageOnlyLocale)
Description copied from interface: StructuredContentDao
Called by the DisplayContentTag to locate content based on the current SandBox, StructuredContentType, Name, fullLocale and/or languageOnlyLocale.

Specified by:
findActiveStructuredContentByName in interface StructuredContentDao
Returns:

findStructuredContentTypeByName

public StructuredContentType findStructuredContentTypeByName(String name)
Description copied from interface: StructuredContentDao
Used to lookup the StructuredContentType by name.

Specified by:
findStructuredContentTypeByName in interface StructuredContentDao
Returns:

detach

public void detach(StructuredContent sc)
Description copied from interface: StructuredContentDao
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.

Specified by:
detach in interface StructuredContentDao
Parameters:
sc - - the item to detach


Copyright © 2013. All Rights Reserved.