Class ContentModel
java.lang.Object
com.broadleafcommerce.content.domain.ContentModel
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware
,Serializable
public class ContentModel
extends Object
implements Serializable, com.broadleafcommerce.data.tracking.core.ContextStateAware
Represents the definition for
ContentItems
. This does not hold the actual
values to be displayed on a commerce-facing frontend, rather it defines the fields and field
types that are common to all ContentItems
based on this model.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState
A subset ofTracking
information to expose the context state for this object.The list of fields that make up this content modelgetId()
The context ID of the content model.getName()
A unique name for the content model, used for retrieval.getUri()
SEO-friendly URI to identifyContentItems
of this model.int
hashCode()
boolean
Whether allContentItems
of this model can be retrieved by navigating touri
from a storefront app.boolean
Whether this model is only used as an embedded model.void
setAddressableByUri
(boolean addressableByUri) Whether allContentItems
of this model can be retrieved by navigating touri
from a storefront app.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
setEmbeddedOnly
(boolean embeddedOnly) Whether this model is only used as an embedded model.void
setFields
(List<ContentField> fields) The list of fields that make up this content modelvoid
The context ID of the content model.void
A unique name for the content model, used for retrieval.void
SEO-friendly URI to identifyContentItems
of this model.toString()
-
Constructor Details
-
ContentModel
public ContentModel()
-
-
Method Details
-
getId
The context ID of the content model.- Returns:
- the context ID of the content model
-
getName
A unique name for the content model, used for retrieval.- Returns:
- a unique name for the content model, used for retrieval
-
isAddressableByUri
public boolean isAddressableByUri()Whether allContentItems
of this model can be retrieved by navigating touri
from a storefront app. For example, navigating to/blogs
would result in all Content Items using the "Blog" model being fetching. Moreover, those content items would have their own URIs that would be appended to the model's, e.g.,/:ContentModel.uri/:ContentItem.uri
.- Returns:
- Whether all
ContentItems
of this model can be retrieved by navigating touri
from a storefront app. - See Also:
-
isEmbeddedOnly
public boolean isEmbeddedOnly()Whether this model is only used as an embedded model. Embedded models are not addressable by URL and are only used as part of another model.- Returns:
- Whether this model is only used as an embedded model.
- Since:
- Release Train 2.1.2
-
getUri
SEO-friendly URI to identifyContentItems
of this model.ContentItems
of this model will have theirURIs
appended to this.- Returns:
- SEO-friendly URI to identify
ContentItems
of this model.
-
getFields
The list of fields that make up this content model- Returns:
- a list of field names and type that make up this content model
-
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 context ID of the content model.- Parameters:
id
- the context ID of the content model
-
setName
A unique name for the content model, used for retrieval.- Parameters:
name
- a unique name for the content model, used for retrieval
-
setAddressableByUri
public void setAddressableByUri(boolean addressableByUri) Whether allContentItems
of this model can be retrieved by navigating touri
from a storefront app. For example, navigating to/blogs
would result in all Content Items using the "Blog" model being fetching. Moreover, those content items would have their own URIs that would be appended to the model's, e.g.,/:ContentModel.uri/:ContentItem.uri
.- Parameters:
addressableByUrl
- Whether allContentItems
of this model can be retrieved by navigating touri
from a storefront app.- See Also:
-
setEmbeddedOnly
public void setEmbeddedOnly(boolean embeddedOnly) Whether this model is only used as an embedded model. Embedded models are not addressable by URL and are only used as part of another model.- Parameters:
embeddedOnly
- Whether this model is only used as an embedded model.- Since:
- Release Train 2.1.2
-
setUri
SEO-friendly URI to identifyContentItems
of this model.ContentItems
of this model will have theirURIs
appended to this.- Parameters:
SEO
- -friendly URI to identifyContentItems
of this model.
-
setFields
The list of fields that make up this content model- Parameters:
fields
- a list of field names and type that make up this content model
-
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
-