Class ContentResolverRequest

java.lang.Object
com.broadleafcommerce.content.domain.commerce.ContentResolverRequest
All Implemented Interfaces:
Serializable

public class ContentResolverRequest extends Object implements Serializable
Represents a request to the ContentItemResolverEndpoint to retrieve ContentItems from a commerce-facing context.
Author:
Nathan Moore (nathandmoore)
See Also:
  • Constructor Details

    • ContentResolverRequest

      public ContentResolverRequest()
  • Method Details

    • setUris

      public void setUris(List<String> uris)
      Added for compatibility with CatalogBrowseServices requests to resolve a browse entity that may be a content item, product, or category when only a URI is known. The payload there could include multiple URIs, but this service can only handle a single URI. This will pick the first and set it as uri.
      Parameters:
      uris -
    • addAttribute

      public void addAttribute(String name, Object value)
      Takes in any additional attributes passed in the request not matching any defined properties.
      Parameters:
      name - Name of the additional attribute
      value - Value of the additional attribute
    • getAttribute

      public Map<String,Object> getAttribute()
      Return any additional attributes passed in the request not matching any defined properties.
      Returns:
      any additional attributes passed in the request not matching any defined properties.
    • getRequestId

      public String getRequestId()
      The id of this content resolver request.
      Since:
      2.0.3
    • getItemNames

      public Set<String> getItemNames()
      Names of ContentItems to retrieve.

      If uri, itemIds, modelId, or modelName are present, then this will be ignored.

      Returns:
      Names of ContentItems to retrieve.
    • getItemIds

      public Set<String> getItemIds()
      Ids of ContentItems to retrieve.

      If uri, modelId, or modelName are present, then this will be ignored. If this is present, then itemNames will be ignored.

      Returns:
      Ids of ContentItems to retrieve.
    • getModelName

      public String getModelName()
      Name of a ContentModel all of whose ContentItems to retrieve.

      If present, itemIds and itemNames will be ignored will be ignored. If uri or modelId are present, then this will be ignored.

    • getModelId

      public String getModelId()
      Id of a ContentModel all of whose ContentItems to retrieve.

      If present, modelId, itemIds, and itemNames will be ignored. If uri is present, then this will be ignored.

    • getUri

      public String getUri()
      URI of either a ContentModel all of whose ContentItems should be retrieved or else that of a single ContentItem. In the latter case, the parent ContentModel's URI should be appended in the request.

      If present, itemNames, itemIds, modelId, and modelName will be ignored.

      Returns:
      URI of either a ContentModel all of whose ContentItems should be retrieved or else that of a single ContentItem
    • getContentZoneName

      public String getContentZoneName()
      Name of a ContentZone to retrieve related ContentItems.

      If a zone with the provided name is found, the ContentZone's `defaultItems` will be returned as well as any `alternateItemSets` that meet their `displayRule`'s criteria.

      If present, all other request parameters will be ignored.

    • getContentContext

      public ContentContext getContentContext()
      Any contextual information needed to resolve targetted content.

      If present, this information is used during content zone resolution.

    • getAttributes

      public Map<String,Object> getAttributes()
      Map holding any additional attributes passed in the request not matching any defined properties.
    • setRequestId

      public void setRequestId(String requestId)
      The id of this content resolver request.
      Since:
      2.0.3
    • setItemNames

      public void setItemNames(Set<String> itemNames)
      Names of ContentItems to retrieve.

      If uri, itemIds, modelId, or modelName are present, then this will be ignored.

      Parameters:
      names - Names of ContentItems to retrieve.
    • setItemIds

      public void setItemIds(Set<String> itemIds)
      Ids of ContentItems to retrieve.

      If uri, modelId, or modelName are present, then this will be ignored. If this is present, then itemNames will be ignored.

      Parameters:
      ids - Ids of ContentItems to retrieve.
    • setModelName

      public void setModelName(String modelName)
      Name of a ContentModel all of whose ContentItems to retrieve.

      If present, itemIds and itemNames will be ignored will be ignored. If uri or modelId are present, then this will be ignored.

    • setModelId

      public void setModelId(String modelId)
      Id of a ContentModel all of whose ContentItems to retrieve.

      If present, modelId, itemIds, and itemNames will be ignored. If uri is present, then this will be ignored.

    • setUri

      public void setUri(String uri)
      URI of either a ContentModel all of whose ContentItems should be retrieved or else that of a single ContentItem. In the latter case, the parent ContentModel's URI should be appended in the request.

      If present, itemNames, itemIds, modelId, and modelName will be ignored.

      Parameters:
      uri - URI of either a ContentModel all of whose ContentItems should be retrieved or else that of a single ContentItem
    • setContentZoneName

      public void setContentZoneName(String contentZoneName)
      Name of a ContentZone to retrieve related ContentItems.

      If a zone with the provided name is found, the ContentZone's `defaultItems` will be returned as well as any `alternateItemSets` that meet their `displayRule`'s criteria.

      If present, all other request parameters will be ignored.

    • setContentContext

      public void setContentContext(ContentContext contentContext)
      Any contextual information needed to resolve targetted content.

      If present, this information is used during content zone resolution.

    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Map holding any additional attributes passed in the request not matching any defined properties.
    • 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