com.ibm.workplace.wcm.api
Interface ContentComponentContainer
- All Superinterfaces:
- Document, Editable, EditableItem, Item, Localized, WCMApiObject, WorkflowedDocument
- All Known Subinterfaces:
- Content, ContentPrototype, com.ibm.workplace.wcm.api.ContentSiteFrameworkContainer, DxContentPagePrototype, PortalPage, Site, SiteArea, SiteAreaPrototype, SiteFrameworkContainer
public interface ContentComponentContainer
- extends Editable, WorkflowedDocument
The root interface for the content component container hierarchy.
A ContentComponentContainer
represents a container for
ContentComponent
objects.
note: since v6.0.0
, a ContentComponent
is
referred to as an "Element" in the Authoring UI.
The ContentComponentContainer interface includes methods for
retrieving and setting ContentComponent
objects. Components
cannot be added or removed from a ContentComponentContainer
through the API. The API only allows an update of a ContentComponent
object that already exists in this ContentComponentContainer
.
Passing a null argument to a method of this class will result in a
NullPointerException
, unless stated otherwise.
Method Summary |
void |
addComponent(java.lang.String name,
ContentComponent component)
Adds the ContentComponent with the name specified by the
argument to this ContentComponentContainer . |
ContentComponentIterator |
componentIterator()
Returns an iterator of all ContentComponent objects
in this ContentComponentContainer . |
|
createComponent(java.lang.String name,
DocumentType<T> componentType)
Creates a new ContentComponent of the specified type with
the name specified by the argument and associates it with this
ContentComponentContainer . |
DocumentId<? extends Category>[] |
getCombinedCategoryIds()
Return array of IDs for the all categories associated with this content. |
ContentComponent |
getComponent(java.lang.String name)
Retrieves a ContentComponent with a name specified by the
argument from this ContentComponentContainer . |
ContentComponent |
getComponentByReference(java.lang.String name)
Retrieves a reference to a ContentComponent with a name specified by the
argument from this ContentComponentContainer ; ContentComponent s
returned by this method must be treated as read-only. |
java.lang.String[] |
getComponentNames()
Returns a list of component names for all ContentComponent s in
this ContentComponentContainer . |
boolean |
hasComponent(java.lang.String name)
Returns true if and only if the argument is not null and a
ContentComponent with a name specified by the argument exists in
this ContentComponentContainer . |
void |
removeComponent(java.lang.String name)
Removes the ContentComponent with the name specified by the
argument in this ContentComponentContainer . |
void |
setComponent(java.lang.String name,
ContentComponent component)
Sets the ContentComponent with the name specified by the
argument in this ContentComponentContainer . |
Methods inherited from interface com.ibm.workplace.wcm.api.Editable |
addAuthors, addCategoryIds, addContributorAccessMembers, addDeleteAccessMembers, addEditAccessMembers, addEditorAccessMembers, addHistoryLogEntry, addLiveAccessMembers, addManagerAccessMembers, addMembersForAccess, addOwners, addReadAccessMembers, addUserAccessMembers, isChanged, removeAuthors, removeCategoryIds, removeContributorAccessMembers, removeDeleteAccessMembers, removeEditAccessMembers, removeEditorAccessMembers, removeLiveAccessMembers, removeManagerAccessMembers, removeMembersForAccess, removeOwners, removeReadAccessMembers, removeUserAccessMembers, setContributorAccessInheritance, setDescriptionTextProviderKey, setDescriptionTextProviderName, setEditorAccessInheritance, setInheritance, setKeywords, setManagerAccessInheritance, setPropagation, setTitleTextProviderKey, setTitleTextProviderName, setUserAccessInheritance |
Methods inherited from interface com.ibm.workplace.wcm.api.Document |
getAuthors, getCategoryIds, getContributorAccessMembers, getCreator, getDeleteAccessMembers, getDescription, getDescriptionTextProviderKey, getDescriptionTextProviderName, getEditAccessMembers, getEditorAccessMembers, getHistoryLog, getId, getInheritedContributorAccessMembers, getInheritedEditorAccessMembers, getInheritedManagerAccessMembers, getInheritedUserAccessMembers, getKeywords, getLastModifier, getLiveAccessMembers, getManagerAccessMembers, getMembersForAccess, getMembersForInheritedAccess, getOwnerLibrary, getOwners, getProject, getReadAccessMembers, getSourceWorkspace, getTitle, getTitleTextProviderKey, getTitleTextProviderName, getUserAccessMembers, getVersionCatalog, getVersionStrategy, hasDeleteAccess, hasDeleteAccess, hasEditAccess, hasEditAccess, hasLiveAccess, hasLiveAccess, hasProfile, hasProject, hasReadAccess, hasReadAccess, isContributorAccessInherited, isEditorAccessInherited, isInherited, isManagerAccessInherited, isNew, isPropagated, isUserAccessInherited, isWorkflowed |
Methods inherited from interface com.ibm.workplace.wcm.api.WorkflowedDocument |
addAdditionalViewers, addApprovers, approve, cancelDraftDocument, clearApprovers, createDraftDocument, decline, decline, getAdditionalViewers, getCurrentApprovers, getDateEnteredStage, getEffectiveDate, getExpiryDate, getGeneralDateOne, getGeneralDateTwo, getPendingWorkflowStatus, getPublishedDate, getPublishedId, getWorkflowId, getWorkflowStageId, getWorkflowStatus, hasApproverAccess, hasApproverAccess, hasDraft, isDraft, isDraftOfPublishedDocument, isExpired, isPublished, isWorkflowMovingBackward, nextWorkflowStage, nextWorkflowStage, nextWorkflowStage, previousWorkflowStage, previousWorkflowStage, removeAdditionalViewers, removeApprovers, restartWorkflow, setEffectiveDate, setExpiryDate, setGeneralDateOne, setGeneralDateTwo, setWorkflowId, setWorkflowId |
componentIterator
ContentComponentIterator componentIterator()
- Returns an iterator of all
ContentComponent
objects
in this ContentComponentContainer
.
Note: This method will return null
entries for unsupported
content components
Note: The iterator this method returns contains a copy of each
ContentComponent
rather than a reference to each
ContentComponent
- Returns:
- a content component iterator
hasComponent
boolean hasComponent(java.lang.String name)
- Returns true if and only if the argument is not null and a
ContentComponent
with a name specified by the argument exists in
this ContentComponentContainer
.
Note: This method is case sensitive.
- Parameters:
name
- the name of the ContentComponent
- Returns:
- true if the argument is not null and a
ContentComponent
with a name matching the argument exists in
this ContentComponentContainer
; false otherwise.
getComponent
ContentComponent getComponent(java.lang.String name)
throws com.ibm.workplace.wcm.api.exceptions.ComponentNotFoundException
- Retrieves a
ContentComponent
with a name specified by the
argument from this ContentComponentContainer
.
The hasComponent()
method should be called first to ensure
that a ContentComponent
with the specified name exists,
otherwise an exception may be thrown.
Note: This method is case sensitive.
Note: If the requested ContentComponent
is to be used during rendering
only (or simply inspected) and will never be modified, then the getComponentByReference
method can be used instead to speed up performance
- Parameters:
name
- the name of the ContentComponent
to retrieve
- Returns:
- a copy of the specified
ContentComponent
- Throws:
com.ibm.workplace.wcm.api.exceptions.ComponentNotFoundException
- if a ContentComponent
with the
specified name cannot be found
getComponentByReference
ContentComponent getComponentByReference(java.lang.String name)
throws com.ibm.workplace.wcm.api.exceptions.ComponentNotFoundException
Retrieves a reference to a ContentComponent
with a name specified by the
argument from this ContentComponentContainer
; ContentComponent
s
returned by this method must be treated as read-only.
The hasComponent()
method should be called first to ensure
that a ContentComponent
with the specified name exists,
otherwise an exception may be thrown.
Note: This method is case sensitive.
Warning: Unlike the getComponent()
method, this method doesn't
clone the internal ContentComponent
and therefore should only be used during
rendering. If you need to change the ContentComponent
OR copy it to
another Document
then use the getComponent()
method instead
- Parameters:
name
- the name of the ContentComponent
to retrieve
- Returns:
- the actual
ContentComponent
as specified by the name
- Throws:
com.ibm.workplace.wcm.api.exceptions.ComponentNotFoundException
- if a ContentComponent
with the
specified name cannot be found
setComponent
void setComponent(java.lang.String name,
ContentComponent component)
throws com.ibm.workplace.wcm.api.exceptions.ComponentNotFoundException,
com.ibm.workplace.wcm.api.exceptions.IllegalTypeChangeException
- Sets the
ContentComponent
with the name specified by the
argument in this ContentComponentContainer
.
Note: The name and type of ContentComponent
passed in as
arguments to this method must exactly match the name and type of an existing
ContentComponent
in this ContentComponentContainer
.
This method only allows an update of an existing component.
- Parameters:
name
- name of component to be updatedcomponent
- updated copy of component
- Throws:
com.ibm.workplace.wcm.api.exceptions.ComponentNotFoundException
- if no ContentComponent
with
the given name exists in this ContentComponentContainer
com.ibm.workplace.wcm.api.exceptions.IllegalTypeChangeException
- if the ContentComponent
passed
in as an argument is a different type than the existing component with the
given name
addComponent
void addComponent(java.lang.String name,
ContentComponent component)
throws com.ibm.workplace.wcm.api.exceptions.DuplicateComponentException
- Adds the
ContentComponent
with the name specified by the
argument to this ContentComponentContainer
.
Note: The name of ContentComponent
passed in as an
argument to this method must not match the name of an existing
ContentComponent
in this ContentComponentContainer
.
This method does not allow the update of an existing component.
Note: The supplied ContentComponent
must be either a new
ContentComponent
or a clone of an existing ContentComponent
,
components returned from the getComponentByReference() method must not be used as
arguments to this method
Valid characters for the name are a-z, A-Z, 0-9 and the special characters " $-_.+!*(),".
- Parameters:
name
- name of component to be addedcomponent
- component to be added
- Throws:
com.ibm.workplace.wcm.api.exceptions.DuplicateComponentException
- if a ContentComponent
with
the given name exists in this ContentComponentContainer
createComponent
<T extends ContentComponent> T createComponent(java.lang.String name,
DocumentType<T> componentType)
throws com.ibm.workplace.wcm.api.exceptions.DuplicateComponentException,
com.ibm.workplace.wcm.api.exceptions.IllegalDocumentTypeException,
com.ibm.workplace.wcm.api.exceptions.DocumentCreationException
- Creates a new
ContentComponent
of the specified type with
the name specified by the argument and associates it with this
ContentComponentContainer
.
Note: The association of the new ContentComponent
and any changes
to the ContentComponent
will not be saved until this ContentComponentContainer
is saved
Note: The name of ContentComponent
passed in as an
argument to this method must not match the name of an existing
ContentComponent
in this ContentComponentContainer
.
This method does not allow the update of an existing component.
Note: The type of ContentComponent
passed in as an
argument to this method must be a valid content component type, such as:
- DocumentTypes.DateComponent
- DocumentTypes.FileComponent
- DocumentTypes.HTMLComponent
- DocumentTypes.ImageComponent
- DocumentTypes.JSPComponent
- DocumentTypes.LinkComponent
- DocumentTypes.NumericComponent
- DocumentTypes.OptionSelectionComponent
- DocumentTypes.ReferenceComponent
- DocumentTypes.RichTextComponent
- DocumentTypes.ShortTextComponent
- DocumentTypes.TextComponent
- DocumentTypes.UserSelectionComponent
Valid characters for the name are a-z, A-Z, 0-9 and the special characters " $-_.+!*(),".
- Parameters:
name
- name of component to be addedcomponentType
- type of component to be added
- Returns:
- the actual
ContentComponent
that was created
- Throws:
com.ibm.workplace.wcm.api.exceptions.DuplicateComponentException
- if a ContentComponent
with
the given name exists in this ContentComponentContainer
com.ibm.workplace.wcm.api.exceptions.IllegalDocumentTypeException
- if the specified component type is not a
valid content component type
com.ibm.workplace.wcm.api.exceptions.DocumentCreationException
- if the specified component type could not be created
removeComponent
void removeComponent(java.lang.String name)
throws com.ibm.workplace.wcm.api.exceptions.ComponentNotFoundException
- Removes the
ContentComponent
with the name specified by the
argument in this ContentComponentContainer
.
Note: The name of ContentComponent
passed in as an
argument to this method must exactly match the name of an existing
ContentComponent
in this ContentComponentContainer
.
Note: This method is case sensitive.
- Parameters:
name
- name of component to be updated
- Throws:
com.ibm.workplace.wcm.api.exceptions.ComponentNotFoundException
- if no ContentComponent
with
the given name exists in this ContentComponentContainer
getComponentNames
java.lang.String[] getComponentNames()
- Returns a list of component names for all
ContentComponent
s in
this ContentComponentContainer
.
Note: The component name list will also include the names of unsupported
content components
- Returns:
- a
String
array of all component names
getCombinedCategoryIds
DocumentId<? extends Category>[] getCombinedCategoryIds()
- Return array of IDs for the all categories associated with this content.
This method would return a combined set of all the categories set in the profile section
and the categories set in option selection elements.
Only the categories that can be seen by this user will be returned.
Returns an empty array if categories have not been set.
- Returns:
- array of category Ids