|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents a selection list; a user-defined list of text values that specifies
the list of valid values for an ISelectionListProperty
property that can be added to an IDataEntryTemplate
.
An ISelectionList
is similar to a drop-down menu
which contains multiple pre-defined text values for a property.
A user can select from the pre-defined list of values instead
of typing a value for a text field. A selection list simplifies content item creation
because it ensures that the value is spelled correctly and it is a valid value for that field.
IDataEntryTemplate
. A given selection list can be reused in multiple
ISelectionListProperty
s and in different IDataEntryTemplate
s.
In the following example, a selection
list is created that contains abbreviations for the U.S. states.
// Create a selection list representing states String[] stateOptionValues = {"CA", "MA"}; ISelectionList stateSelectionList = selectionListManager.createSelectionList(rootFolder, "State Selection List", stateOptionValues); stateSelectionList.store(); // Expand the list options String[] expandedStateOptionValues = {"OR", "NY"}; stateSelectionList.addValues(expandedStateOptionValues); stateSelectionList.store(); // The list now contains "CA", "MA", "OR", "NY" // Remove the expanded options stateSelectionList.removeValues(expandedStateOptionValues); stateSelectionList.store(); // The list now contains "CA", "MA"
Method Summary | |
void |
addValues(java.lang.String[] values)
Adds an array of text values to the end of the existing selection list values. |
IFolder |
getContainingFolder()
Returns the IFolder that this selection list is created in. |
java.lang.String |
getName()
Returns the name of the selection list. |
java.lang.String |
getUUID()
Returns the selection list UUID. |
java.lang.String[] |
getValues()
Retrieves all text values from the selection list. |
void |
removeValues(java.lang.String[] values)
Removes an array of text values from the selection list. |
void |
setName(java.lang.String name)
Sets the name for the selection list. |
void |
store()
Stores the selection list. |
Method Detail |
public void addValues(java.lang.String[] values)
store
is called.
values
- an array of text values to be added to the selection list.
A text value cannot be null
, an empty string, or a string longer than 255 characters.
Text values will preserve whitespace when stored and are case-sensitive during comparison.
Duplicate text values will only be added once. The order of the values will be preserved.
java.lang.IllegalStateException
- if the selection list has already been removed
java.lang.IllegalArgumentException
- if the values contain an empty string or a string longer than 255 characterspublic IFolder getContainingFolder() throws ContentSecurityException, ContentException, java.rmi.RemoteException
IFolder
that this selection list is created in.
IFolder
that this selection list is created in
ContentSecurityException
- if the user does not have
permission to access the containing folder
ContentException
- if the method call resulted in a Publisher exception
java.lang.IllegalStateException
- if the selection list has not
yet been persisted or has already been removed
java.rmi.RemoteException
- if there was a communication problem
during the execution of the remote method callpublic java.lang.String getName()
java.lang.IllegalStateException
- if the selection list
has been removedpublic java.lang.String getUUID()
ISelectionListManager.getSelectionList
to retrieve the selection list.
java.lang.IllegalStateException
- if the selection list has
not yet been persisted or has been removedpublic java.lang.String[] getValues()
java.lang.IllegalStateException
- if the selection list has already been removedpublic void removeValues(java.lang.String[] values)
store
is called.
values
- an array of text values to be removed from the
selection list.
The values
cannot be null
or contain an empty string or strings longer than 255 characters.
Text values will preserve whitespace when stored and are case-sensitive during comparison.
Only exact matches will be removed and duplicate string values will only be removed once.
java.lang.IllegalStateException
- if the selection list has already been removed
java.lang.IllegalArgumentException
- if the values contain an empty string, or a string longer than 255 characterspublic void setName(java.lang.String name)
name
- name of the selection list;
cannot be null
, empty, or longer than 255 characters.
The string used for the name will be trimmed of leading and trailing whitespace when it is stored
and is case-insensitive during name comparison.
java.lang.IllegalStateException
- if the selection list
has already been removed
java.lang.IllegalArgumentException
- if the
name is an empty string or longer than 255 characterspublic void store() throws ContentSecurityException, NameAlreadyInUseException, ContentException, java.rmi.RemoteException
ContentSecurityException
- if the user does not have
permission to store the selection list
NameAlreadyInUseException
- if there is already a selection list with the
given name in the same folder
ContentException
- if the method call resulted in a Publisher exception
java.lang.IllegalStateException
- if the selection list has already been removed,
or if its containing folder has been removed
java.lang.IllegalArgumentException
- if the values contain an empty string
java.rmi.RemoteException
- if there was a communication problem
during the execution of the remote method call
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©2010 Oracle® Corporation. All Rights Reserved.