com.ibm.workplace.wcm.api
Interface OptionSelectionComponent

All Superinterfaces:
ContentComponent, WCMApiObject

public interface OptionSelectionComponent
extends ContentComponent

Represents a OptionSelection component.

A OptionSelectionComponent is a ContentComponent and cannot be stored as a separate entity in the repository.

A OptionSelectionComponent can contain array of String values. This interface provides methods to retrieve and set the array of Strings or categories contained within this component. The user must determine or set the option type and use the appropriate methods for the option type. Those that contain 'category' are used when the type is OptionType.USE_TAXONOMY and the methods that do not contain 'category' in the name should be used when option type is OptionType.USER_DEFINED

note: since v6.0.0, a OptionSelectionComponent is referred to as an "Option Selection Element" in the Authoring UI.

See Also:
ContentComponent

Method Summary
 DocumentId[] getAvailableCategorySelectionValues()
          Returns the array of available category options defined in the authoring template for this OptionSelectionComponent
 java.lang.String[] getAvailableSelectionValues()
          Returns the array of available options defined in the authoring template for this OptionSelectionComponent
 DocumentId[] getCategorySelections()
          Returns the list of categories selected in this component as a DocumentId[].
 DocumentType<? extends OptionSelectionComponent> getDocumentType()
          Returns the DocumentType of the ContentComponent.
 com.ibm.workplace.wcm.api.OptionType getOptionType()
          Returns the OptionType of this option selection element.
 java.lang.String[] getSelections()
          Returns the current selections contained in this component as a String[].
 boolean isSingleSelect()
          Returns true if this OptionSelectionComponent has been configured within the authoring template to be single select, false if not.
 void setCategorySelections(DocumentId[] selections)
          Sets the selected categories on this OptionSelectionComponent.
 void setOptionType(com.ibm.workplace.wcm.api.OptionType type)
          Set the OptionType for this OptionSelectionComponent
 void setSelections(java.lang.String[] selections)
          Sets the String[] contained in this OptionSelectionComponent.
 
Methods inherited from interface com.ibm.workplace.wcm.api.ContentComponent
getContainer, getName, getTitleTextProviderKey, getTitleTextProviderName, setTitleTextProviderKey, setTitleTextProviderName
 

Method Detail

getDocumentType

DocumentType<? extends OptionSelectionComponent> getDocumentType()
Description copied from interface: ContentComponent
Returns the DocumentType of the ContentComponent.

Specified by:
getDocumentType in interface ContentComponent
Returns:
the type
See Also:
ContentComponent.getDocumentType()

getSelections

java.lang.String[] getSelections()
Returns the current selections contained in this component as a String[].

Returns:
the current selections or null if no values are selected.

setSelections

void setSelections(java.lang.String[] selections)
                   throws com.ibm.workplace.wcm.api.exceptions.OperationFailedException
Sets the String[] contained in this OptionSelectionComponent.

Note. This method replaces any existing String[] in this component.

Parameters:
selections - the selected options on this OptionSelectionComponent.
Throws:
com.ibm.workplace.wcm.api.exceptions.OperationFailedException - if the String[] argument is null or the selections could not be set

getAvailableSelectionValues

java.lang.String[] getAvailableSelectionValues()
Returns the array of available options defined in the authoring template for this OptionSelectionComponent

Returns:
the available selections from the authoring template or null if no values is are set.
Since:
7.0

isSingleSelect

boolean isSingleSelect()
Returns true if this OptionSelectionComponent has been configured within the authoring template to be single select, false if not.

Returns:
true if this OptionSelectionComponent is is configured to be single select, false if not.
Since:
7.0

getAvailableCategorySelectionValues

DocumentId[] getAvailableCategorySelectionValues()
                                                 throws com.ibm.workplace.wcm.api.exceptions.OperationFailedException
Returns the array of available category options defined in the authoring template for this OptionSelectionComponent

Returns:
the DocumentIds of the available categories defined in the authoring template for this OptionSelectionComponent or null if the no values are set.
Throws:
com.ibm.workplace.wcm.api.exceptions.OperationFailedException - if the option type is OptionType.USER_DEFINED
Since:
7.0

getCategorySelections

DocumentId[] getCategorySelections()
                                   throws com.ibm.workplace.wcm.api.exceptions.OperationFailedException
Returns the list of categories selected in this component as a DocumentId[].

Returns null if the values is not set.

Returns:
the DocumentId[]
Throws:
com.ibm.workplace.wcm.api.exceptions.OperationFailedException - if the option type is OptionType.USER_DEFINED
Since:
7.0

setCategorySelections

void setCategorySelections(DocumentId[] selections)
                           throws com.ibm.workplace.wcm.api.exceptions.OperationFailedException

Sets the selected categories on this OptionSelectionComponent.

Note. This method replaces any existing Categories in this component.

Parameters:
selections - the DocumentIds of the selected Categories on this OptionSelectionComponent.
Throws:
com.ibm.workplace.wcm.api.exceptions.OperationFailedException - if the option type is OptionType.USER_DEFINED or the selections could not be set.
java.lang.IllegalArgumentException - if the selections argument is null or the provided DocumentIds are not Categories.
Since:
7.0

getOptionType

com.ibm.workplace.wcm.api.OptionType getOptionType()
Returns the OptionType of this option selection element. Either OptionType.USE_TAXONOMY or OptionType.USER_DEFINED

Returns:
the OptionType.
Since:
7.0

setOptionType

void setOptionType(com.ibm.workplace.wcm.api.OptionType type)
                   throws java.lang.IllegalArgumentException
Set the OptionType for this OptionSelectionComponent

Parameters:
type - the OptionType to set. The parameter type should be either OptionType.USE_TAXONOMY or OptionType.USER_DEFINED.
Throws:
IllegalArgumentException - if the OptionType provided was null.
java.lang.IllegalArgumentException