org.broadleafcommerce.cms.structure.domain
Interface StructuredContent

All Superinterfaces:
Serializable
All Known Implementing Classes:
StructuredContentImpl

public interface StructuredContent
extends Serializable

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 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
See Also:
StructuredContentType}, StructuredContentImpl}, org.broadleafcommerce.cms.web.structure.DisplayContentTag}

Method Summary
 StructuredContent cloneEntity()
          Builds a copy of this content item.
 Boolean getArchivedFlag()
          Gets the archived indicator.
 AdminAuditable getAuditable()
          Returns audit information for this content item.
 String getContentName()
          Gets the name.
 Boolean getDeletedFlag()
          Gets the "deleted" indicator.
 Long getId()
          Gets the primary key.
 Locale getLocale()
          Gets the Locale associated with this content item.
 Boolean getLockedFlag()
          Returns the locked flag.
 Boolean getOfflineFlag()
          Returns the offlineFlag.
 Long getOriginalItemId()
          Gets the id of a related content item on which this item is based.
 SandBox getOriginalSandBox()
          Gets the SandBox which originally edited this item.
 Integer getPriority()
          Gets the integer priority of this content item.
 Set<StructuredContentItemCriteria> getQualifyingItemCriteria()
          Returns the item (or cart) based rules associated with this content item.
 SandBox getSandbox()
          Gets the Sandbox associated with the content item.
 Map<String,StructuredContentField> getStructuredContentFields()
          Gets a map with the custom fields associated with this content item.
The map keys are based on the field types.
 Map<String,StructuredContentRule> getStructuredContentMatchRules()
          Returns a map of the targeting rules associated with this content item.
 StructuredContentType getStructuredContentType()
          Gets the StructuredContentType associated with this content item.
 void setArchivedFlag(Boolean archivedFlag)
          Sets the archived flag for this item.
 void setAuditable(AdminAuditable auditable)
          Sets audit information for this content item.
 void setContentName(String contentName)
          Sets the name.
 void setDeletedFlag(Boolean deletedFlag)
          Sets the deleted flag for this item.
 void setId(Long id)
          Sets the primary key.
 void setLocale(Locale locale)
          Sets the locale associated with this content item.
 void setLockedFlag(Boolean lockedFlag)
          Sets the lockedFlag for this item.
 void setOfflineFlag(Boolean offlineFlag)
          Sets the offline flag.
 void setOriginalItemId(Long originalItemId)
          The id of the item on which this content item is based.
 void setOriginalSandBox(SandBox originalSandBox)
          Sets the originalSandBox for this item.
 void setPriority(Integer priority)
          Sets the display priority of this item.
 void setQualifyingItemCriteria(Set<StructuredContentItemCriteria> qualifyingItemCriteria)
          Sets the item (e.g.
 void setSandbox(SandBox sandbox)
          Sets the SandBox for this content item.
 void setStructuredContentFields(Map<String,StructuredContentField> structuredContentFields)
          Sets the structured content fields for this item.
 void setStructuredContentMatchRules(Map<String,StructuredContentRule> structuredContentMatchRules)
          Sets the targeting rules for this content item.
 void setStructuredContentType(StructuredContentType structuredContentType)
          Sets the StructuredContentType associated with this content item.
 

Method Detail

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 -

getSandbox

@Nullable
SandBox getSandbox()
Gets the Sandbox associated with the content item. SandBoxes allow for segmentation of data. A result of null indicates that this item is in "Production" in a single-site architecture.
The processing may differ depending on which type of SandBox is returned.

Returns:

setSandbox

void setSandbox(@Nullable
                SandBox sandbox)
Sets the SandBox for this content item. This method is typically only called by the BLC Content Management System during content-item lifecycle operations like New, Promote, Approve, Deploy.

Parameters:
sandbox -

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.


getStructuredContentFields

@Nullable
Map<String,StructuredContentField> getStructuredContentFields()
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:

setStructuredContentFields

void setStructuredContentFields(@Nullable
                                Map<String,StructuredContentField> structuredContentFields)
Sets the structured content fields for this item. Would not typically called outside of the ContentManagementSystem.

Parameters:
structuredContentFields -

getDeletedFlag

@Nonnull
Boolean getDeletedFlag()
Gets the "deleted" indicator. Deleted means that the item has been marked for deletion. If this method returns true, the item will not be returned as part org.broadleafcommerce.cms.structure.service.StructuredContentService#lookupStructuredContentItemsByType(org.broadleafcommerce.common.sandbox.domain.SandBox, StructuredContentType, org.broadleafcommerce.common.locale.domain.Locale, Integer, java.util.Map)'s}. In a "production sandbox", an item that returns true for getDeletedFlag should also return true for getArchivedFlag

Returns:
the deleted indicator or false if none found

setDeletedFlag

void setDeletedFlag(@Nonnull
                    Boolean deletedFlag)
Sets the deleted flag for this item. Would not typically be called outside of the Content Administration system.

Parameters:
deletedFlag -

getArchivedFlag

@Nonnull
Boolean getArchivedFlag()
Gets the archived indicator. The archivedFlag indicates that the item is no longer of importance to the system. Items that have been archived may be removed by a data cleanup process.

Returns:
true if this item has been archived. Returns false if not set.

setArchivedFlag

void setArchivedFlag(@Nonnull
                     Boolean archivedFlag)
Sets the archived flag for this item. Would not typically be called outside the Content Administration system. Content items with an archived flag of true will not be returned from most APIs and can be deleted from the system.

Parameters:
archivedFlag -

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 -

getOriginalItemId

@Nullable
Long getOriginalItemId()
Gets the id of a related content item on which this item is based. This value is used internally by the content management system. Generally, when an item is promoted through a content workflow to production, the system will set mark the item associated with the originalItemId as archived.

Returns:
the id of the originalItemId

setOriginalItemId

void setOriginalItemId(@Nullable
                       Long originalItemId)
The id of the item on which this content item is based. This property gets set by the content management system when an item is edited.

Parameters:
originalItemId -

cloneEntity

@Nonnull
StructuredContent cloneEntity()
Builds a copy of this content item. Used by the content management system when an item is edited.

Returns:
a copy of this item

getAuditable

@Nullable
AdminAuditable getAuditable()
Returns audit information for this content item.

Returns:

setAuditable

void setAuditable(@Nullable
                  AdminAuditable auditable)
Sets audit information for this content item. Default implementations automatically populate this data during persistence.

Parameters:
auditable -

getLockedFlag

@Nonnull
Boolean getLockedFlag()
Returns the locked flag. If an item is locked, it is being edited by another user.

Returns:
true if this item is locked for editing.

setLockedFlag

void setLockedFlag(@Nullable
                   Boolean lockedFlag)
Sets the lockedFlag for this item.

Parameters:
lockedFlag -

getOriginalSandBox

@Nullable
SandBox getOriginalSandBox()
Gets the SandBox which originally edited this item. Used by the Content Management System to determine where to return an item that is being rejected.

Returns:

setOriginalSandBox

void setOriginalSandBox(@Nullable
                        SandBox originalSandBox)
Sets the originalSandBox for this item. The Content Management System will set this value when an item is promoted from a user sandbox.

Parameters:
originalSandBox -

getStructuredContentMatchRules

@Nullable
Map<String,StructuredContentRule> getStructuredContentMatchRules()
Returns a map of the targeting rules associated with this content item. Targeting rules are defined in the content mangagement system and used to enforce which items are returned to the client.

Returns:

setStructuredContentMatchRules

void setStructuredContentMatchRules(@Nullable
                                    Map<String,StructuredContentRule> structuredContentMatchRules)
Sets the targeting rules for this content item.

Parameters:
structuredContentMatchRules -

getQualifyingItemCriteria

@Nullable
Set<StructuredContentItemCriteria> getQualifyingItemCriteria()
Returns the item (or cart) based rules associated with this content item.

Returns:

setQualifyingItemCriteria

void setQualifyingItemCriteria(@Nullable
                               Set<StructuredContentItemCriteria> qualifyingItemCriteria)
Sets the item (e.g. cart) based rules associated with this content item.

Parameters:
qualifyingItemCriteria -


Copyright © 2013. All Rights Reserved.