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.EntityManager
protected EntityConfiguration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddOrUpdateContentItem
(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
Detaches 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 theDisplayContentTag
to 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 theDisplayContentTag
to 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 theDisplayContentTag
to locate content based on the current SandBox, StructuredContentType, fullLocale and/or languageOnlyLocale.Finds all content regardless of theSandBox
they are a member offindStructuredContentById
(Long contentId) Returns theStructuredContent
item that matches the passed in Id.findStructuredContentTypeById
(Long contentTypeId) Returns theStructuredContentType
that matches the passed in contentTypeId.Used to lookup the StructuredContentType by name.Returns the list of allStructuredContentType
s.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:StructuredContentDao
Returns theStructuredContent
item that matches the passed in Id.- Specified by:
findStructuredContentById
in interfaceStructuredContentDao
- Returns:
- the found item or null if it does not exist
-
findStructuredContentTypeById
Description copied from interface:StructuredContentDao
Returns theStructuredContentType
that matches the passed in contentTypeId.- Specified by:
findStructuredContentTypeById
in interfaceStructuredContentDao
- Returns:
- the found item or null if it does not exist
-
retrieveAllStructuredContentTypes
Description copied from interface:StructuredContentDao
Returns the list of allStructuredContentType
s.- Specified by:
retrieveAllStructuredContentTypes
in interfaceStructuredContentDao
- Returns:
- the list of found items
-
findAllContentItems
Description copied from interface:StructuredContentDao
Finds all content regardless of theSandBox
they are a member of- Specified by:
findAllContentItems
in interfaceStructuredContentDao
- Returns:
- the list of
StructuredContent
, an empty list of none are found
-
addOrUpdateContentItem
Description copied from interface:StructuredContentDao
Persists the changes or saves a new content item.- Specified by:
addOrUpdateContentItem
in interfaceStructuredContentDao
- Returns:
- the newly saved or persisted item
-
delete
Description copied from interface:StructuredContentDao
Removes the passed in item from the underlying storage.- Specified by:
delete
in interfaceStructuredContentDao
-
saveStructuredContentType
Description copied from interface:StructuredContentDao
Saves the given type and returns the merged instance- Specified by:
saveStructuredContentType
in interfaceStructuredContentDao
-
findActiveStructuredContentByType
public List<StructuredContent> findActiveStructuredContentByType(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 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:StructuredContentDao
Called by theDisplayContentTag
to locate content based on the current SandBox, StructuredContentType, fullLocale and/or languageOnlyLocale.- Specified by:
findActiveStructuredContentByType
in 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:StructuredContentDao
Pass through function for backwards compatibility to get a list of structured content.- Specified by:
findActiveStructuredContentByNameAndType
in interfaceStructuredContentDao
- Returns:
-
findActiveStructuredContentByNameAndType
public List<StructuredContent> findActiveStructuredContentByNameAndType(StructuredContentType type, String name, Locale fullLocale, Locale languageOnlyLocale) Description copied from interface:StructuredContentDao
Called by theDisplayContentTag
to locate content based on the current SandBox, StructuredContentType, Name, fullLocale and/or languageOnlyLocale.- Specified by:
findActiveStructuredContentByNameAndType
in interfaceStructuredContentDao
- Returns:
-
findActiveStructuredContentByName
Description copied from interface:StructuredContentDao
Pass through function for backwards compatibility to get a list of structured content.- Specified by:
findActiveStructuredContentByName
in interfaceStructuredContentDao
- Returns:
-
findActiveStructuredContentByName
public List<StructuredContent> findActiveStructuredContentByName(String name, Locale fullLocale, Locale languageOnlyLocale) Description copied from interface:StructuredContentDao
Called by theDisplayContentTag
to locate content based on the current SandBox, StructuredContentType, Name, fullLocale and/or languageOnlyLocale.- Specified by:
findActiveStructuredContentByName
in interfaceStructuredContentDao
- Returns:
-
findStructuredContentTypeByName
Description copied from interface:StructuredContentDao
Used to lookup the StructuredContentType by name.- Specified by:
findStructuredContentTypeByName
in interfaceStructuredContentDao
- Returns:
-
detach
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 interfaceStructuredContentDao
- Parameters:
sc
- - the item to detach
-