Class AdvancedTag

java.lang.Object
com.broadleafcommerce.catalog.domain.tag.AdvancedTag
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware, Serializable

public class AdvancedTag extends Object implements Serializable, com.broadleafcommerce.data.tracking.core.ContextStateAware
A "tag" represents a unique purchasing attribute for a product such "new", "on sale", "fairtrade", etc. Tags may also be configured as tags with a rich text message and some controls for how or where they should be displayed on the storefront. By default, tags are facetable and can be configured to be searchable.
Author:
Nathan Moore (nathandmoore)
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
     
    boolean
     
    End when this tag is not longer active.
    Start of when this tag should be active.
    Miscellaneous attributes for this tag.
    An asset that should be displayed for this tag.
    Message to display on a storefront such "New" or "Fairtrade" as a badge.
    com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState
    A subset of Tracking information to expose the context state for this object.
    A unique system identifier.
    A friendly identifier for the tag.
    Defines the position over a display component this tag should be displayed such as the "top-left" of a Product's image on a list or details page.
    Priority of this tag relative to other tags that may share the same position or type.
    Defines the type of this tag such as "key feature" or "discount".
    int
     
    boolean
    Whether storefront users can find products (or other entities) with this tag by its name.
    void
    setActiveEndDate(Instant activeEndDate)
    End when this tag is not longer active.
    void
    setActiveStartDate(Instant activeStartDate)
    Start of when this tag should be active.
    void
    Miscellaneous attributes for this tag.
    void
    setBadgeAsset(TagAsset badgeAsset)
    An asset that should be displayed for this tag.
    void
    setBadgeMessage(String badgeMessage)
    Message to display on a storefront such "New" or "Fairtrade" as a badge.
    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.
    void
    A unique system identifier.
    void
    A friendly identifier for the tag.
    void
    setPosition(String position)
    Defines the position over a display component this tag should be displayed such as the "top-left" of a Product's image on a list or details page.
    void
    setPriority(Long priority)
    Priority of this tag relative to other tags that may share the same position or type.
    void
    setSearchableByName(boolean searchableByName)
    Whether storefront users can find products (or other entities) with this tag by its name.
    void
    Defines the type of this tag such as "key feature" or "discount".
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AdvancedTag

      public AdvancedTag()
  • Method Details

    • getId

      public String getId()
      A unique system identifier.
      Returns:
      A unique system identifier.
    • getName

      public String getName()
      A friendly identifier for the tag. Can be used as a search term on the storefront if searchableByName is true. This will also be displayed as the facet value.
      Returns:
      A friendly identifier for the tag.
    • getBadgeMessage

      public String getBadgeMessage()
      Message to display on a storefront such "New" or "Fairtrade" as a badge. This should support rich text (HTML) as well as plain text.
      Returns:
      Message to display on a storefront as a badge. Can be HTML.
    • getActiveStartDate

      public Instant getActiveStartDate()
      Start of when this tag should be active.
      Returns:
      the date when this tag should start being active
    • getActiveEndDate

      public Instant getActiveEndDate()
      End when this tag is not longer active. Unset indicates that it is always active.
      Returns:
      the date when this tag should no longer be active
    • isSearchableByName

      public boolean isSearchableByName()
      Whether storefront users can find products (or other entities) with this tag by its name.
      Returns:
      Whether storefront users can find products (or other entities) with this tag by its name.
    • getPosition

      public String getPosition()
      Defines the position over a display component this tag should be displayed such as the "top-left" of a Product's image on a list or details page. If multiple tags have the same position, then their relative order on a product or their priority will determine which is displayed.
      Returns:
      The position over a component this tag should be displayed.
      See Also:
    • getType

      public String getType()
      Defines the type of this tag such as "key feature" or "discount". This allows categorizing tags to enhance user's ability to prioritize related tags such as only showing one "discount" tag even if a product has several.
      Returns:
      The type of this tag such as "key feature" or "discount".
      See Also:
    • getPriority

      public Long getPriority()
      Priority of this tag relative to other tags that may share the same position or type. This provides a way to pick on tag over another when there is a conflict. This could be overridden in the context of a specific product depending on the ProductTag.getSorting().
      Returns:
      Priority of this tag relative to other tags that may share the same position or type.
    • getBadgeAsset

      public TagAsset getBadgeAsset()
      An asset that should be displayed for this tag.
      Returns:
      An asset that should be displayed for this tag.
    • 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
    • getAttributes

      public Map<String,Object> getAttributes()
      Miscellaneous attributes for this tag.
      Returns:
      Miscellaneous attributes for this tag.
    • setId

      public void setId(String id)
      A unique system identifier.
      Parameters:
      id - A unique system identifier.
    • setName

      public void setName(String name)
      A friendly identifier for the tag. Can be used as a search term on the storefront if searchableByName is true. This will also be displayed as the facet value.
      Parameters:
      name - A friendly identifier for the tag.
    • setBadgeMessage

      public void setBadgeMessage(String badgeMessage)
      Message to display on a storefront such "New" or "Fairtrade" as a badge. This should support rich text (HTML) as well as plain text.
      Parameters:
      badgeMessage - Message to display on a storefront as a badge. Can be HTML
    • setActiveStartDate

      public void setActiveStartDate(Instant activeStartDate)
      Start of when this tag should be active.
      Parameters:
      activeStartDate - the date when this tag should start being active
    • setActiveEndDate

      public void setActiveEndDate(Instant activeEndDate)
      End when this tag is not longer active. Unset indicates that it is always active.
      Parameters:
      activeEndDate - the date when this tag should no longer be active
    • setSearchableByName

      public void setSearchableByName(boolean searchableByName)
      Whether storefront users can find products (or other entities) with this tag by its name.
      Parameters:
      searchableByName - Whether storefront users can find products (or other entities) with this tag by its name.
    • setPosition

      public void setPosition(String position)
      Defines the position over a display component this tag should be displayed such as the "top-left" of a Product's image on a list or details page. If multiple tags have the same position, then their relative order on a product or their priority will determine which is displayed.
      Parameters:
      position - The position over a component this tag should be displayed.
      See Also:
    • setType

      public void setType(String type)
      Defines the type of this tag such as "key feature" or "discount". This allows categorizing tags to enhance user's ability to prioritize related tags such as only showing one "discount" tag even if a product has several.
      Parameters:
      type - The type of this tag such as "key feature" or "discount".
      See Also:
    • setPriority

      public void setPriority(Long priority)
      Priority of this tag relative to other tags that may share the same position or type. This provides a way to pick on tag over another when there is a conflict. This could be overridden in the context of a specific product depending on the ProductTag.getSorting().
      Parameters:
      priority - Priority of this tag relative to other tags that may share the same position or type.
    • setBadgeAsset

      public void setBadgeAsset(TagAsset badgeAsset)
      An asset that should be displayed for this tag.
      Parameters:
      asset - An asset that should be displayed for this tag.
    • 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
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Miscellaneous attributes for this tag.
      Parameters:
      attributes - Miscellaneous attributes for this tag.
    • 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