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 Details

    • ContentModel

      public ContentModel()
  • Method Details

    • getId

      public String getId()
      The context ID of the content model.
      Returns:
      the context ID of the content model
    • getName

      public String 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 all ContentItems of this model can be retrieved by navigating to uri 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 to uri 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

      public String getUri()
      SEO-friendly URI to identify ContentItems of this model. ContentItems of this model will have their URIs appended to this.
      Returns:
      SEO-friendly URI to identify ContentItems of this model.
    • getFields

      public List<ContentField> 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 of Tracking information to expose the context state for this object.
      Specified by:
      getContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Returns:
      a subset of Tracking information to expose the context state for this object
    • setId

      public void setId(String id)
      The context ID of the content model.
      Parameters:
      id - the context ID of the content model
    • setName

      public void setName(String name)
      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 all ContentItems of this model can be retrieved by navigating to uri 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 all ContentItems of this model can be retrieved by navigating to uri 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

      public void setUri(String uri)
      SEO-friendly URI to identify ContentItems of this model. ContentItems of this model will have their URIs appended to this.
      Parameters:
      SEO - -friendly URI to identify ContentItems of this model.
    • setFields

      public void setFields(List<ContentField> fields)
      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 of Tracking information to expose the context state for this object.
      Specified by:
      setContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Parameters:
      contextState - a subset of Tracking information to expose the context state for this object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object