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
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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 ofTracking
information to expose the context state for this object.getId()
A unique system identifier.getName()
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 sameposition
ortype
.getType()
Defines the type of this tag such as "key feature" or "discount".int
hashCode()
boolean
Whether storefront users can find products (or other entities) with this tag by itsname
.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
setAttributes
(Map<String, Object> attributes) 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 ofTracking
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 sameposition
ortype
.void
setSearchableByName
(boolean searchableByName) Whether storefront users can find products (or other entities) with this tag by itsname
.void
Defines the type of this tag such as "key feature" or "discount".toString()
-
Constructor Details
-
AdvancedTag
public AdvancedTag()
-
-
Method Details
-
getId
A unique system identifier.- Returns:
- A unique system identifier.
-
getName
A friendly identifier for the tag. Can be used as a search term on the storefront ifsearchableByName
is true. This will also be displayed as the facet value.- Returns:
- A friendly identifier for the tag.
-
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
Start of when this tag should be active.- Returns:
- the date when this tag should start being active
-
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 itsname
.- Returns:
- Whether storefront users can find products (or other entities) with this tag by its
name
.
-
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 theirpriority
will determine which is displayed.- Returns:
- The position over a component this tag should be displayed.
- See Also:
-
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
Priority of this tag relative to other tags that may share the sameposition
ortype
. 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 theProductTag.getSorting()
.- Returns:
- Priority of this tag relative to other tags that may share the same
position
ortype
.
-
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 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
-
getAttributes
Miscellaneous attributes for this tag.- Returns:
- Miscellaneous attributes for this tag.
-
setId
A unique system identifier.- Parameters:
id
- A unique system identifier.
-
setName
A friendly identifier for the tag. Can be used as a search term on the storefront ifsearchableByName
is true. This will also be displayed as the facet value.- Parameters:
name
- A friendly identifier for the tag.
-
setBadgeMessage
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
Start of when this tag should be active.- Parameters:
activeStartDate
- the date when this tag should start being active
-
setActiveEndDate
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 itsname
.- Parameters:
searchableByName
- Whether storefront users can find products (or other entities) with this tag by itsname
.
-
setPosition
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 theirpriority
will determine which is displayed.- Parameters:
position
- The position over a component this tag should be displayed.- See Also:
-
setType
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
Priority of this tag relative to other tags that may share the sameposition
ortype
. 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 theProductTag.getSorting()
.- Parameters:
priority
- Priority of this tag relative to other tags that may share the sameposition
ortype
.
-
setBadgeAsset
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 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
-
setAttributes
Miscellaneous attributes for this tag.- Parameters:
attributes
- Miscellaneous attributes for this tag.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-