Class ContentItem
java.lang.Object
com.broadleafcommerce.content.domain.ContentItem
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware,Serializable
public class ContentItem
extends Object
implements Serializable, com.broadleafcommerce.data.tracking.core.ContextStateAware
A domain representing some content that should be displayed on the associated application.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanDefines the ending time for which this content item is active.Defines the beginning time for which this content item is active.Information on the user who created this item.com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStateA subset ofTrackinginformation to expose the context state for this object.This item's display order relative to other items.Rule governing when this item can be displayed based on the context.Whether this item is considered embedded within another item and should not be retrieved separately.The individual field data for this contentThe folder ID that this content item belongs to.Return the full content item URI if the relatedContentModelis addressable by URIgetId()The system ID of the content item.The date and time that this content item was last modified.getModel()The content model for this content.The content model name for this content.getName()A unique name for the content item, used for retrieval.getTags()List of simple tags used for filtering and retrieval.getUri()SEO-friendly URI to identify this content item.inthashCode()booleanDetermine whether this content is active at the given instant.booleanWhether this item is starred by a user.voidsetActiveEndDate(Instant activeEndDate) Defines the ending time for which this content item is active.voidsetActiveStartDate(Instant activeStartDate) Defines the beginning time for which this content item is active.voidInformation on the user who created this item.voidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.voidsetDisplayOrder(Integer displayOrder) This item's display order relative to other items.voidsetDisplayRule(String displayRule) Rule governing when this item can be displayed based on the context.voidsetEmbedded(Boolean embedded) Whether this item is considered embedded within another item and should not be retrieved separately.voidThe individual field data for this contentvoidsetFolderId(String folderId) The folder ID that this content item belongs to.voidThe system ID of the content item.voidsetLastUpdated(Instant lastUpdated) The date and time that this content item was last modified.voidsetModel(ContentModel model) The content model for this content.voidsetModelName(String modelName) The content model name for this content.voidA unique name for the content item, used for retrieval.voidsetStarred(boolean starred) Whether this item is starred by a user.voidList of simple tags used for filtering and retrieval.voidSEO-friendly URI to identify this content item.toString()
-
Constructor Details
-
ContentItem
public ContentItem()
-
-
Method Details
-
isActive
Determine whether this content is active at the given instant.- Parameters:
now- the instant to check if the content is active- Returns:
- whether this content is active
-
getFullUri
Return the full content item URI if the relatedContentModelis addressable by URI- Returns:
- the full content URI
-
getId
The system ID of the content item.- Returns:
- the system ID of the content item
-
getName
A unique name for the content item, used for retrieval.- Returns:
- a unique name for the content item, used for retrieval
-
getUri
SEO-friendly URI to identify this content item. This will be appended to theContentModel's URIifContentModel.isAddressableByUri()is true.- Returns:
- SEO-friendly URI to identify this content item.
-
getModel
The content model for this content.- Returns:
- the content model for this content
-
getModelName
The content model name for this content.- Returns:
- the content model name for this content
-
getActiveStartDate
Defines the beginning time for which this content item is active. If both the active start date and theactive end dateare null, this content item is considered to always be active.- Returns:
- the beginning time for which this content item is active
- See Also:
-
getActiveEndDate
Defines the ending time for which this content item is active. If theactive start dateis not null, but the active end date is, the content item is considered to be active forever, starting on the start date.- Returns:
- the ending time for which this content item is active
- See Also:
-
getFields
The individual field data for this content- Returns:
- the individual field data for this content
-
getAuthor
Information on the user who created this item.- Returns:
- Information on the user who created this item.
-
getDisplayRule
Rule governing when this item can be displayed based on the context. This can be used to restrict this item to only logged in customers or similar restrictions.- Returns:
- Rule governing when this item can be displayed based on the context.
-
getDisplayOrder
This item's display order relative to other items. Usually set in post-processing before consumed by the frontend application. -
getTags
List of simple tags used for filtering and retrieval.- Returns:
- list of simple tags
-
getEmbedded
Whether this item is considered embedded within another item and should not be retrieved separately.- Returns:
- if the item is embedded
-
isStarred
public boolean isStarred()Whether this item is starred by a user. This field is typically calculated and not set by external clients.- Returns:
- if the item is starred
-
getLastUpdated
The date and time that this content item was last modified.- Returns:
- when this content item was last modified
- See Also:
-
getFolderId
The folder ID that this content item belongs to.- Returns:
- the folder ID that this content item belongs to
-
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTrackinginformation to expose the context state for this object.- Specified by:
getContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Returns:
- a subset of
Trackinginformation to expose the context state for this object
-
setId
The system ID of the content item.- Parameters:
id- the system ID of the content item
-
setName
A unique name for the content item, used for retrieval.- Parameters:
name- a unique name for the content item, used for retrieval
-
setUri
SEO-friendly URI to identify this content item. This will be appended to theContentModel's URIifContentModel.isAddressableByUri()is true.- Parameters:
uri- SEO-friendly URI to identify this content item.
-
setModel
The content model for this content.- Parameters:
model- the content model for this content
-
setModelName
The content model name for this content.- Parameters:
modelName- the content model name for this content
-
setActiveStartDate
Defines the beginning time for which this content item is active. If both the active start date and theactive end dateare null, this content item is considered to always be active.- Parameters:
activeStartDate- the beginning time for which this content item is active- See Also:
-
setActiveEndDate
Defines the ending time for which this content item is active. If theactive start dateis not null, but the active end date is, the content item is considered to be active forever, starting on the start date.- Parameters:
activeEndDate- the ending time for which this content item is active- See Also:
-
setFields
The individual field data for this content- Parameters:
fields- the individual field data for this content
-
setAuthor
Information on the user who created this item.- Parameters:
creator- Information on the user who created this item.
-
setDisplayRule
Rule governing when this item can be displayed based on the context. This can be used to restrict this item to only logged in customers or similar restrictions.- Parameters:
displayRule- Rule governing when this item can be displayed based on the context.
-
setDisplayOrder
This item's display order relative to other items. Usually set in post-processing before consumed by the frontend application. -
setTags
List of simple tags used for filtering and retrieval.- Parameters:
tags- list of simple tags
-
setEmbedded
Whether this item is considered embedded within another item and should not be retrieved separately.- Parameters:
isEmbedded- if this item is embedded in another
-
setStarred
public void setStarred(boolean starred) Whether this item is starred by a user. This field is typically calculated and not set by external clients.- Parameters:
isStarred- if this item is starred by a user
-
setLastUpdated
The date and time that this content item was last modified.- Parameters:
lastUpdated- when this content item was last modified- See Also:
-
setFolderId
The folder ID that this content item belongs to.- Parameters:
folderId- the folder ID that this content item belongs to
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.- Specified by:
setContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Parameters:
contextState- a subset ofTrackinginformation to expose the context state for this object
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-