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> 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.
 
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
Called by the DisplayContentTag to locate content based on the current SandBox, StructuredContentType, and Locale.

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

findActiveStructuredContentByNameAndType

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

Specified by:
findActiveStructuredContentByNameAndType 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 © 2011. All Rights Reserved.