com.ibm.workplace.wcm.api
Interface ContentComponentContainer

All Superinterfaces:
Document, Editable
All Known Subinterfaces:
Content, Site, SiteArea, SiteFrameworkContainer

public interface ContentComponentContainer
extends Editable

The root inteface for the content component container hierarchy. A ContentComponentContainer represents a container for ContentComponent objects.

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.


Field Summary
static java.lang.String COPYRIGHT
          Copyright statement
 
Method Summary
 ContentComponentIterator componentIterator()
          Returns an iterator of all ContentComponent objects in this ContentComponentContainer.
 ContentComponent getComponent(java.lang.String p_name)
          Retrieves a ContentComponent with a name specified by the argument from this ContentComponentContainer.
 ContentComponent getComponentByReference(java.lang.String p_name)
          Retrieves a ContentComponent with a name specified by the argument from this ContentComponentContainer.
 boolean hasComponent(java.lang.String p_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 setComponent(java.lang.String p_name, ContentComponent p_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, addDeleteAccessMembers, addEditAccessMembers, addLiveAccessMembers, addOwners, addReadAccessMembers, isChanged, removeAuthors, removeDeleteAccessMembers, removeEditAccessMembers, removeLiveAccessMembers, removeOwners, removeReadAccessMembers, setDescription, setName
 
Methods inherited from interface com.ibm.workplace.wcm.api.Document
getAuthors, getDeleteAccessMembers, getDescription, getEditAccessMembers, getId, getLiveAccessMembers, getName, getOwners, getReadAccessMembers
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Copyright statement

See Also:
Constant Field Values
Method Detail

componentIterator

public ContentComponentIterator componentIterator()
Returns an iterator of all ContentComponent objects in this ContentComponentContainer.

Returns:
a content component iterator

hasComponent

public boolean hasComponent(java.lang.String p_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:
p_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

public ContentComponent getComponent(java.lang.String p_name)
                              throws 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:
p_name - the name of the ContentComponent to retrieve
Returns:
a copy of the specified ContentComponent
Throws:
ComponentNotFoundException - if a ContentComponent with the specified name cannot be found

getComponentByReference

public ContentComponent getComponentByReference(java.lang.String p_name)
                                         throws 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.

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:
p_name - the name of the ContentComponent to retrieve
Returns:
the actual ContentComponent as specified by the name
Throws:
ComponentNotFoundException - if a ContentComponent with the specified name cannot be found

setComponent

public void setComponent(java.lang.String p_name,
                         ContentComponent p_component)
                  throws ComponentNotFoundException,
                         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:
p_name - name of component to be updated
p_component - updated copy of component
Throws:
ComponentNotFoundException - if no ContentComponent with the given name exists in this ContentComponentContainer
IllegalTypeChangeException - if the ContentComponent passed in as an argument is a different type than the existing component with the given name