Class ContentModel

java.lang.Object
com.broadleafcommerce.catalogbrowse.domain.ContentModel
All Implemented Interfaces:
Serializable

public class ContentModel extends Object implements Serializable
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:
    • 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 map of field names and type that make up this content model
    • 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:
    • 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 map of field names and type that make up this content model
    • 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