Class StructuredContentDaoImpl
java.lang.Object
org.broadleafcommerce.cms.structure.dao.StructuredContentDaoImpl
- All Implemented Interfaces:
StructuredContentDao
@Repository("blStructuredContentDao")
public class StructuredContentDaoImpl
extends Object
implements StructuredContentDao
Created by bpolster.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected jakarta.persistence.EntityManagerprotected EntityConfiguration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddOrUpdateContentItem(StructuredContent content) Persists the changes or saves a new content item.voiddelete(StructuredContent content) Removes the passed in item from the underlying storage.voidDetaches the item from the JPA session.findActiveStructuredContentByName(String name, Locale locale) Pass through function for backwards compatibility to get a list of structured content.findActiveStructuredContentByName(String name, Locale fullLocale, Locale languageOnlyLocale) Called by theDisplayContentTagto locate content based on the current SandBox, StructuredContentType, Name, fullLocale and/or languageOnlyLocale.findActiveStructuredContentByNameAndType(StructuredContentType type, String name, Locale locale) Pass through function for backwards compatibility to get a list of structured content.findActiveStructuredContentByNameAndType(StructuredContentType type, String name, Locale fullLocale, Locale languageOnlyLocale) Called by theDisplayContentTagto locate content based on the current SandBox, StructuredContentType, Name, fullLocale and/or languageOnlyLocale.findActiveStructuredContentByType(StructuredContentType type, Locale locale) Pass through function for backwards compatibility to get a list of structured content.findActiveStructuredContentByType(StructuredContentType type, Locale fullLocale, Locale languageOnlyLocale) Called by theDisplayContentTagto locate content based on the current SandBox, StructuredContentType, fullLocale and/or languageOnlyLocale.Finds all content regardless of theSandBoxthey are a member offindStructuredContentById(Long contentId) Returns theStructuredContentitem that matches the passed in Id.findStructuredContentTypeById(Long contentTypeId) Returns theStructuredContentTypethat matches the passed in contentTypeId.Used to lookup the StructuredContentType by name.Returns the list of allStructuredContentTypes.Saves the given type and returns the merged instance
-
Field Details
-
em
protected jakarta.persistence.EntityManager em -
entityConfiguration
-
-
Constructor Details
-
StructuredContentDaoImpl
public StructuredContentDaoImpl()
-
-
Method Details
-
findStructuredContentById
Description copied from interface:StructuredContentDaoReturns theStructuredContentitem that matches the passed in Id.- Specified by:
findStructuredContentByIdin interfaceStructuredContentDao- Returns:
- the found item or null if it does not exist
-
findStructuredContentTypeById
Description copied from interface:StructuredContentDaoReturns theStructuredContentTypethat matches the passed in contentTypeId.- Specified by:
findStructuredContentTypeByIdin interfaceStructuredContentDao- Returns:
- the found item or null if it does not exist
-
retrieveAllStructuredContentTypes
Description copied from interface:StructuredContentDaoReturns the list of allStructuredContentTypes.- Specified by:
retrieveAllStructuredContentTypesin interfaceStructuredContentDao- Returns:
- the list of found items
-
findAllContentItems
Description copied from interface:StructuredContentDaoFinds all content regardless of theSandBoxthey are a member of- Specified by:
findAllContentItemsin interfaceStructuredContentDao- Returns:
- the list of
StructuredContent, an empty list of none are found
-
addOrUpdateContentItem
Description copied from interface:StructuredContentDaoPersists the changes or saves a new content item.- Specified by:
addOrUpdateContentItemin interfaceStructuredContentDao- Returns:
- the newly saved or persisted item
-
delete
Description copied from interface:StructuredContentDaoRemoves the passed in item from the underlying storage.- Specified by:
deletein interfaceStructuredContentDao
-
saveStructuredContentType
Description copied from interface:StructuredContentDaoSaves the given type and returns the merged instance- Specified by:
saveStructuredContentTypein interfaceStructuredContentDao
-
findActiveStructuredContentByType
public List<StructuredContent> findActiveStructuredContentByType(StructuredContentType type, Locale locale) Description copied from interface:StructuredContentDaoPass through function for backwards compatibility to get a list of structured content.- Specified by:
findActiveStructuredContentByTypein interfaceStructuredContentDao- Parameters:
type- of content to search forlocale- to restrict the search to- Returns:
- a list of all matching content
- See Also:
-
org.broadleafcommerce.cms.web.structure.DisplayContentTag
-
findActiveStructuredContentByType
public List<StructuredContent> findActiveStructuredContentByType(StructuredContentType type, Locale fullLocale, Locale languageOnlyLocale) Description copied from interface:StructuredContentDaoCalled by theDisplayContentTagto locate content based on the current SandBox, StructuredContentType, fullLocale and/or languageOnlyLocale.- Specified by:
findActiveStructuredContentByTypein interfaceStructuredContentDao- Parameters:
type- of content to search forfullLocale- to restrict the search tolanguageOnlyLocale- locale based only on a language specified- Returns:
- a list of all matching content
- See Also:
-
org.broadleafcommerce.cms.web.structure.DisplayContentTag
-
findActiveStructuredContentByNameAndType
public List<StructuredContent> findActiveStructuredContentByNameAndType(StructuredContentType type, String name, Locale locale) Description copied from interface:StructuredContentDaoPass through function for backwards compatibility to get a list of structured content.- Specified by:
findActiveStructuredContentByNameAndTypein interfaceStructuredContentDao- Returns:
-
findActiveStructuredContentByNameAndType
public List<StructuredContent> findActiveStructuredContentByNameAndType(StructuredContentType type, String name, Locale fullLocale, Locale languageOnlyLocale) Description copied from interface:StructuredContentDaoCalled by theDisplayContentTagto locate content based on the current SandBox, StructuredContentType, Name, fullLocale and/or languageOnlyLocale.- Specified by:
findActiveStructuredContentByNameAndTypein interfaceStructuredContentDao- Returns:
-
findActiveStructuredContentByName
Description copied from interface:StructuredContentDaoPass through function for backwards compatibility to get a list of structured content.- Specified by:
findActiveStructuredContentByNamein interfaceStructuredContentDao- Returns:
-
findActiveStructuredContentByName
public List<StructuredContent> findActiveStructuredContentByName(String name, Locale fullLocale, Locale languageOnlyLocale) Description copied from interface:StructuredContentDaoCalled by theDisplayContentTagto locate content based on the current SandBox, StructuredContentType, Name, fullLocale and/or languageOnlyLocale.- Specified by:
findActiveStructuredContentByNamein interfaceStructuredContentDao- Returns:
-
findStructuredContentTypeByName
Description copied from interface:StructuredContentDaoUsed to lookup the StructuredContentType by name.- Specified by:
findStructuredContentTypeByNamein interfaceStructuredContentDao- Returns:
-
detach
Description copied from interface:StructuredContentDaoDetaches 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:
detachin interfaceStructuredContentDao- Parameters:
sc- - the item to detach
-