Class StructuredContentImpl
java.lang.Object
org.broadleafcommerce.cms.structure.domain.StructuredContentImpl
- All Implemented Interfaces:
Serializable,StructuredContent,AdminMainEntity,MultiTenantCloneable<StructuredContent>,ProfileEntity
@Entity
public class StructuredContentImpl
extends Object
implements StructuredContent, AdminMainEntity, ProfileEntity
Created by bpolster.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Longprotected Localeprotected Booleanprotected Integerprotected Set<StructuredContentItemCriteria>static final Stringprotected Map<String,StructuredContentFieldXref> protected StructuredContentTypeFields inherited from interface org.broadleafcommerce.common.admin.domain.AdminMainEntity
MAIN_ENTITY_NAME_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<G extends StructuredContent>
CreateResponse<G>Clone this entity for the purpose of multiple tenancy.Gets the name.getFieldValue(String fieldName) Returns the value of the associatedStructuredContentFieldif the given fieldName exists in the map returned byStructuredContent.getStructuredContentFieldXrefs(), and null otherwise.getId()Gets the primary key.Gets theLocaleassociated with this content item.Returns the offlineFlag.Gets the integer priority of this content item.NOTE: This method is typically only used when wanting to persist newStructuredContentFields.Gets theStructuredContentTypeassociated with this content item.voidsetContentName(String contentName) Sets the name.voidsetFieldValues(Map<String, String> fieldValuesMap) Sets the transient fieldValues map on this StructuredContent.voidSets the primary key.voidSets the locale associated with this content item.voidsetOfflineFlag(Boolean offlineFlag) Sets the offline flag.voidsetPriority(Integer priority) Sets the display priority of this item.voidsetQualifyingItemCriteria(Set<StructuredContentItemCriteria> qualifyingItemCriteria) voidsetStructuredContentFieldXrefs(Map<String, StructuredContentFieldXref> structuredContentFields) Sets the structured content fields for this item.voidsetStructuredContentMatchRules(Map<String, StructuredContentRule> structuredContentMatchRules) voidsetStructuredContentType(StructuredContentType structuredContentType) Sets theStructuredContentTypeassociated with this content item.
-
Field Details
-
SC_DONT_DUPLICATE_SC_TYPE_HINT
- See Also:
-
id
-
contentName
-
locale
-
priority
-
qualifyingItemCriteria
-
structuredContentType
-
structuredContentFields
-
offlineFlag
-
fieldValuesMap
-
-
Constructor Details
-
StructuredContentImpl
public StructuredContentImpl()
-
-
Method Details
-
getId
Description copied from interface:StructuredContentGets the primary key.- Specified by:
getIdin interfaceStructuredContent- Returns:
- the primary key
-
setId
Description copied from interface:StructuredContentSets the primary key.- Specified by:
setIdin interfaceStructuredContent- Parameters:
id- the new primary key
-
getContentName
Description copied from interface:StructuredContentGets the name.- Specified by:
getContentNamein interfaceStructuredContent- Returns:
- the name
-
setContentName
Description copied from interface:StructuredContentSets the name.- Specified by:
setContentNamein interfaceStructuredContent
-
getLocale
Description copied from interface:StructuredContentGets theLocaleassociated with this content item.- Specified by:
getLocalein interfaceStructuredContent- Returns:
-
setLocale
Description copied from interface:StructuredContentSets the locale associated with this content item.- Specified by:
setLocalein interfaceStructuredContent
-
getStructuredContentType
Description copied from interface:StructuredContentGets theStructuredContentTypeassociated with this content item.- Specified by:
getStructuredContentTypein interfaceStructuredContent- Returns:
-
setStructuredContentType
Description copied from interface:StructuredContentSets theStructuredContentTypeassociated with this content item.- Specified by:
setStructuredContentTypein interfaceStructuredContent
-
getStructuredContentFieldXrefs
Description copied from interface:StructuredContentNOTE: This method is typically only used when wanting to persist newStructuredContentFields. Users trying to get a field to render should typically invokeStructuredContent.getFieldValues().Gets a map with the custom fields associated with this content item.
The map keys are based on the field types. For example, consider a content item with aStructuredContentTypeof ad which defined a field named targetUrl. The field could be accessed withstructuredContentItem.getStructuredContentFields().get("targetUrl")- Specified by:
getStructuredContentFieldXrefsin interfaceStructuredContent- Returns:
-
setStructuredContentFieldXrefs
public void setStructuredContentFieldXrefs(@Nullable Map<String, StructuredContentFieldXref> structuredContentFields) Description copied from interface:StructuredContentSets the structured content fields for this item. Would not typically be called outside of the ContentManagementSystem.- Specified by:
setStructuredContentFieldXrefsin interfaceStructuredContent
-
getFieldValue
Description copied from interface:StructuredContentReturns the value of the associatedStructuredContentFieldif the given fieldName exists in the map returned byStructuredContent.getStructuredContentFieldXrefs(), and null otherwise.- Specified by:
getFieldValuein interfaceStructuredContent- Returns:
- the value of the given field
-
getFieldValues
- Specified by:
getFieldValuesin interfaceStructuredContent- Returns:
- a map of
StructuredContentFieldfield key names to their associated values
-
setFieldValues
Description copied from interface:StructuredContentSets the transient fieldValues map on this StructuredContent.- Specified by:
setFieldValuesin interfaceStructuredContent
-
getOfflineFlag
Description copied from interface:StructuredContentReturns the offlineFlag. Indicates that the item should no longer appear on the site. The item will still appear within the content administration program but no longer be returned as part of the client facing APIs.- Specified by:
getOfflineFlagin interfaceStructuredContent- Returns:
- true if this item is offline
-
setOfflineFlag
Description copied from interface:StructuredContentSets the offline flag.- Specified by:
setOfflineFlagin interfaceStructuredContent
-
getPriority
Description copied from interface:StructuredContentGets the integer priority of this content item. Items with a lower priority should be displayed before items with a higher priority.- Specified by:
getPriorityin interfaceStructuredContent- Returns:
- the priority as a numeric value
-
setPriority
Description copied from interface:StructuredContentSets the display priority of this item. Lower priorities should be displayed first.- Specified by:
setPriorityin interfaceStructuredContent
-
getStructuredContentMatchRules
- Specified by:
getStructuredContentMatchRulesin interfaceStructuredContent- Returns:
-
setStructuredContentMatchRules
public void setStructuredContentMatchRules(Map<String, StructuredContentRule> structuredContentMatchRules) - Specified by:
setStructuredContentMatchRulesin interfaceStructuredContent
-
getQualifyingItemCriteria
- Specified by:
getQualifyingItemCriteriain interfaceStructuredContent- Returns:
-
setQualifyingItemCriteria
- Specified by:
setQualifyingItemCriteriain interfaceStructuredContent
-
getMainEntityName
- Specified by:
getMainEntityNamein interfaceAdminMainEntity- Returns:
- the display name of this entity for the admin screen
-
createOrRetrieveCopyInstance
public <G extends StructuredContent> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException Description copied from interface:MultiTenantCloneableClone this entity for the purpose of multiple tenancy. Note, extending classes should follow this pattern:public CreateResponse<MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponse<MyClass> createResponse = super.createOrRetrieveCopyInstance(context); if (createResponse.isAlreadyPopulated()) { return createResponse; } MyClass myClone = createResponse.getClone();Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity://copy extended field values on myClone here
return createResponse; }
public CreateResponse<G extends MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponsecreateResponse = context.createOrRetrieveCopyInstance(this); MyClass myClone = createResponse.getClone(); //copy extended field values on myClone here
return createResponse; }
- Specified by:
createOrRetrieveCopyInstancein interfaceMultiTenantCloneable<StructuredContent>- Parameters:
context- a context object providing persistence and library functionality for copying entities- Returns:
- the resulting copy container, possibly already persisted
- Throws:
CloneNotSupportedException- if there's a problem detected with the cloning configuration
-