Interface StructuredContent

All Superinterfaces:
MultiTenantCloneable<StructuredContent>, Serializable
All Known Implementing Classes:
StructuredContentImpl

public interface StructuredContent extends Serializable, MultiTenantCloneable<StructuredContent>
StructuredContent implementations provide a representation of a generic content item with a set of predefined fields. The fields associated with an instance of StructuredContent are defined by its associated StructuredContentType.
StructuredContent items are typically maintained via the Broadleaf Commerce admin.
Display structured content items is typically done using the org.broadleafcommerce.cms.web.structure.DisplayContentTag taglib.
An typical usage for StructuredContent is to display targeted ads. Consider a StructuredContentType of "ad" with fields "ad-image" and "target-url". This "ad" might show on a websites home page. By adding StructuredContentMatchRules and setting the priority, different ads could be shown to different users.

It would not be typical in a Broadleaf implementation to extend this interface or to use any implementation other than StructuredContentImpl.

Author:
Brian Polster, Jeff Fischer
  • Method Details

    • getId

      @Nullable Long getId()
      Gets the primary key.
      Returns:
      the primary key
    • setId

      void setId(@Nullable Long id)
      Sets the primary key.
      Parameters:
      id - the new primary key
    • getContentName

      @Nonnull String getContentName()
      Gets the name.
      Returns:
      the name
    • setContentName

      void setContentName(@Nonnull String contentName)
      Sets the name.
      Parameters:
      contentName -
    • getLocale

      @Nonnull Locale getLocale()
      Gets the Locale associated with this content item.
      Returns:
    • setLocale

      void setLocale(@Nonnull Locale locale)
      Sets the locale associated with this content item.
      Parameters:
      locale -
    • getStructuredContentType

      @Nonnull StructuredContentType getStructuredContentType()
      Gets the StructuredContentType associated with this content item.
      Returns:
    • setStructuredContentType

      void setStructuredContentType(@Nonnull StructuredContentType structuredContentType)
      Sets the StructuredContentType associated with this content item.
    • getStructuredContentFieldXrefs

      @Nullable Map<String,StructuredContentFieldXref> getStructuredContentFieldXrefs()
      NOTE: This method is typically only used when wanting to persist new StructuredContentFields. Users trying to get a field to render should typically invoke getFieldValues().

      Gets a map with the custom fields associated with this content item.
      The map keys are based on the field types. For example, consider a content item with a StructuredContentType of ad which defined a field named targetUrl. The field could be accessed with structuredContentItem.getStructuredContentFields().get("targetUrl")

      Returns:
    • setStructuredContentFieldXrefs

      void setStructuredContentFieldXrefs(@Nullable Map<String,StructuredContentFieldXref> structuredContentFields)
      Sets the structured content fields for this item. Would not typically be called outside of the ContentManagementSystem.
      Parameters:
      structuredContentFields -
    • getOfflineFlag

      @Nullable Boolean getOfflineFlag()
      Returns the offlineFlag. Indicates that the item should no longer appear on the site. The item will still appear within the content administration program but no longer be returned as part of the client facing APIs.
      Returns:
      true if this item is offline
    • setOfflineFlag

      void setOfflineFlag(@Nullable Boolean offlineFlag)
      Sets the offline flag.
      Parameters:
      offlineFlag -
    • getPriority

      @Nullable Integer getPriority()
      Gets the integer priority of this content item. Items with a lower priority should be displayed before items with a higher priority.
      Returns:
      the priority as a numeric value
    • setPriority

      void setPriority(@Nullable Integer priority)
      Sets the display priority of this item. Lower priorities should be displayed first.
      Parameters:
      priority -
    • getStructuredContentMatchRules

      @Nullable @Deprecated Map<String,StructuredContentRule> getStructuredContentMatchRules()
      Deprecated.
      - Not supported - simplifying interface

      Functionality removed as of BLC 3.2

      Returns:
    • setStructuredContentMatchRules

      @Deprecated void setStructuredContentMatchRules(@Nullable Map<String,StructuredContentRule> structuredContentMatchRules)
      Deprecated.
      - Not supported - simplifying interface

      Functionality removed as of BLC 3.2

      Parameters:
      structuredContentMatchRules -
    • getQualifyingItemCriteria

      @Nullable @Deprecated Set<StructuredContentItemCriteria> getQualifyingItemCriteria()
      Deprecated.
      - no longer supported - simplifying interface

      Functionality removed as of BLC 3.2

      Returns:
    • setQualifyingItemCriteria

      @Deprecated void setQualifyingItemCriteria(@Nullable Set<StructuredContentItemCriteria> qualifyingItemCriteria)
      Deprecated.
      - no longer supported - simplifying interface

      Functionality removed as of BLC 3.2

      Parameters:
      qualifyingItemCriteria -
    • getFieldValue

      String getFieldValue(String fieldName)
      Returns the value of the associated StructuredContentField if the given fieldName exists in the map returned by getStructuredContentFieldXrefs(), and null otherwise.
      Parameters:
      fieldName -
      Returns:
      the value of the given field
    • getFieldValues

      Map<String,String> getFieldValues()
      Returns:
      a map of StructuredContentField field key names to their associated values
    • setFieldValues

      void setFieldValues(Map<String,String> fieldValuesMap)
      Sets the transient fieldValues map on this StructuredContent.
      Parameters:
      fieldValuesMap -