Interface StructuredContent
- All Superinterfaces:
MultiTenantCloneable<StructuredContent>
,Serializable
- All Known Implementing Classes:
StructuredContentImpl
StructuredContent implementations provide a representation of a generic content
item with a set of predefined fields. The fields associated with an instance
of StructuredContent are defined by its associated
StructuredContent items are typically maintained via the Broadleaf Commerce admin.
Display structured content items is typically done using the
An typical usage for
StructuredContentType
.
StructuredContent items are typically maintained via the Broadleaf Commerce admin.
Display structured content items is typically done using the
org.broadleafcommerce.cms.web.structure.DisplayContentTag
taglib.
An typical usage for
StructuredContent
is to display targeted ads.
Consider a StructuredContentType
of "ad" with fields "ad-image" and
"target-url". This "ad" might show on a websites home page. By adding
StructuredContentMatchRules
and setting the priority
,
different ads could be shown to different users.
It would not be typical in a Broadleaf implementation to extend this interface
or to use any implementation other than StructuredContentImpl
.
- Author:
- Brian Polster, Jeff Fischer
-
Method Summary
Modifier and TypeMethodDescriptionGets the name.getFieldValue
(String fieldName) Returns the value of the associatedStructuredContentField
if the given fieldName exists in the map returned bygetStructuredContentFieldXrefs()
, and null otherwise.getId()
Gets the primary key.Gets theLocale
associated with this content item.Returns the offlineFlag.Gets the integer priority of this content item.Deprecated.- no longer supported - simplifying interfaceNOTE: This method is typically only used when wanting to persist newStructuredContentField
s.Deprecated.- Not supported - simplifying interfaceGets theStructuredContentType
associated with this content item.void
setContentName
(String contentName) Sets the name.void
setFieldValues
(Map<String, String> fieldValuesMap) Sets the transient fieldValues map on this StructuredContent.void
Sets the primary key.void
Sets the locale associated with this content item.void
setOfflineFlag
(Boolean offlineFlag) Sets the offline flag.void
setPriority
(Integer priority) Sets the display priority of this item.void
setQualifyingItemCriteria
(Set<StructuredContentItemCriteria> qualifyingItemCriteria) Deprecated.- no longer supported - simplifying interfacevoid
setStructuredContentFieldXrefs
(Map<String, StructuredContentFieldXref> structuredContentFields) Sets the structured content fields for this item.void
setStructuredContentMatchRules
(Map<String, StructuredContentRule> structuredContentMatchRules) Deprecated.- Not supported - simplifying interfacevoid
setStructuredContentType
(StructuredContentType structuredContentType) Sets theStructuredContentType
associated with this content item.Methods inherited from interface org.broadleafcommerce.common.copy.MultiTenantCloneable
createOrRetrieveCopyInstance
-
Method Details
-
getId
Gets the primary key.- Returns:
- the primary key
-
setId
Sets the primary key.- Parameters:
id
- the new primary key
-
getContentName
Gets the name.- Returns:
- the name
-
setContentName
Sets the name.- Parameters:
contentName
-
-
getLocale
Gets theLocale
associated with this content item.- Returns:
-
setLocale
Sets the locale associated with this content item.- Parameters:
locale
-
-
getStructuredContentType
Gets theStructuredContentType
associated with this content item.- Returns:
-
setStructuredContentType
Sets theStructuredContentType
associated with this content item. -
getStructuredContentFieldXrefs
NOTE: This method is typically only used when wanting to persist newStructuredContentField
s. Users trying to get a field to render should typically invokegetFieldValues()
.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 aStructuredContentType
of ad which defined a field named targetUrl. The field could be accessed withstructuredContentItem.getStructuredContentFields().get("targetUrl")
- Returns:
-
setStructuredContentFieldXrefs
void setStructuredContentFieldXrefs(@Nullable Map<String, StructuredContentFieldXref> structuredContentFields) Sets the structured content fields for this item. Would not typically be called outside of the ContentManagementSystem.- Parameters:
structuredContentFields
-
-
getOfflineFlag
Returns 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.- Returns:
- true if this item is offline
-
setOfflineFlag
Sets the offline flag.- Parameters:
offlineFlag
-
-
getPriority
Gets the integer priority of this content item. Items with a lower priority should be displayed before items with a higher priority.- Returns:
- the priority as a numeric value
-
setPriority
Sets the display priority of this item. Lower priorities should be displayed first.- Parameters:
priority
-
-
getStructuredContentMatchRules
Deprecated.- Not supported - simplifying interfaceFunctionality removed as of BLC 3.2
- Returns:
-
setStructuredContentMatchRules
@Deprecated void setStructuredContentMatchRules(@Nullable Map<String, StructuredContentRule> structuredContentMatchRules) Deprecated.- Not supported - simplifying interfaceFunctionality removed as of BLC 3.2
- Parameters:
structuredContentMatchRules
-
-
getQualifyingItemCriteria
Deprecated.- no longer supported - simplifying interfaceFunctionality removed as of BLC 3.2
- Returns:
-
setQualifyingItemCriteria
@Deprecated void setQualifyingItemCriteria(@Nullable Set<StructuredContentItemCriteria> qualifyingItemCriteria) Deprecated.- no longer supported - simplifying interfaceFunctionality removed as of BLC 3.2
- Parameters:
qualifyingItemCriteria
-
-
getFieldValue
Returns the value of the associatedStructuredContentField
if the given fieldName exists in the map returned bygetStructuredContentFieldXrefs()
, and null otherwise.- Parameters:
fieldName
-- Returns:
- the value of the given field
-
getFieldValues
- Returns:
- a map of
StructuredContentField
field key names to their associated values
-
setFieldValues
Sets the transient fieldValues map on this StructuredContent.- Parameters:
fieldValuesMap
-
-