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 boolean
boolean
Defines 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.ContextState
A subset ofTracking
information 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 relatedContentModel
is 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.int
hashCode()
boolean
Determine whether this content is active at the given instant.boolean
Whether this item is starred by a user.void
setActiveEndDate
(Instant activeEndDate) Defines the ending time for which this content item is active.void
setActiveStartDate
(Instant activeStartDate) Defines the beginning time for which this content item is active.void
Information on the user who created this item.void
setContextState
(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTracking
information to expose the context state for this object.void
setDisplayOrder
(Integer displayOrder) This item's display order relative to other items.void
setDisplayRule
(String displayRule) Rule governing when this item can be displayed based on the context.void
setEmbedded
(Boolean embedded) Whether this item is considered embedded within another item and should not be retrieved separately.void
The individual field data for this contentvoid
setFolderId
(String folderId) The folder ID that this content item belongs to.void
The system ID of the content item.void
setLastUpdated
(Instant lastUpdated) The date and time that this content item was last modified.void
setModel
(ContentModel model) The content model for this content.void
setModelName
(String modelName) The content model name for this content.void
A unique name for the content item, used for retrieval.void
setStarred
(boolean starred) Whether this item is starred by a user.void
List of simple tags used for filtering and retrieval.void
SEO-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 relatedContentModel
is 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 URI
ifContentModel.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 date
are 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 date
is 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 ofTracking
information to expose the context state for this object.- Specified by:
getContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Returns:
- a subset of
Tracking
information 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 URI
ifContentModel.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 date
are 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 date
is 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 ofTracking
information to expose the context state for this object.- Specified by:
setContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Parameters:
contextState
- a subset ofTracking
information to expose the context state for this object
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-