|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Choice
Represents a single choice item in a choice list that can be assigned to a property, or represents a group node for a nested collection of choice items within a choice list. A choice item is a single possible value, or choice, in a choice list. A choice item can be of two possible types: integer or string. An integer-type choice item holds a single integer value and can be assigned only to an integer-valued property. A string-type choice item holds a single string value and can be assigned only to a string-valued property.
A Choice
object is a dependently persistable object; it has no save
method and therefore cannot be
independently saved. Because any given Choice
object is dependent on the independently persistable
com.filenet.api.admin.ChoiceList
object to which it belongs, its state is not saved until you call the save
method of the ChoiceList
object that owns it. For a given Choice
object to belong to a
com.filenet.api.admin.ChoiceList
object, it must be added to the com.filenet.api.collection.ChoiceList
collection that is returned by the com.filenet.api.admin.ChoiceList
object's ChoiceValues property.
The type of data that a Choice
object can represent is determined by the ChoiceType
constant value
that you specify with its ChoiceType property. This property determines whether a Choice
object represents an
integer-type choice item, a string-type choice item, a group node for a nested collection of integer-type choice items, or
a group node for a nested collection of string-type choice items.
Localization is provided by the DisplayNames property, using the same mechanism that ClassDefinition
and
PropertyTemplate
objects use. However, unlike those objects, the Choice
object does not have a
DescriptiveTexts property. To localize a Choice
object, set its DisplayNames property to a LocalizedStringList
object containing a collection of LocalizedString
objects. Each object in this collection represents a locale-specific,
user-readable display name that can be used for a Choice
object; set its LocaleName
property to a locale ID and its LocalizedText property to the localized text for the display name. Once you have set the
DisplayNames property, the server will automatically set the value of the DisplayName property to the
LocalizedText property value of the LocalizedString
object in the LocalizedStringList
collection that corresponds
to the object store's default locale.
A Choice
object's display name, or label, identifies it and is stored by its DisplayName property. You can either
set the DisplayName property directly or you can set it indirectly by setting the DisplayNames property.
Setting the DisplayNames property is the preferred method. You must set either a Choice
object's
DisplayName property or its DisplayNames property; you cannot set both.
If you set the DisplayName property directly, the server will automatically create a LocalizedString
object with its
LocaleName property set to the object store's default locale and add it as a single item in the DisplayNames property's
LocalizedStringList
collection. If you set the DisplayName property directly, localization will be bypassed and the
language of its text may not match the specified locale. For example, if you store English text (en-us) in the DisplayName
property and the default locale is French (fr-fr), the DisplayNames property will return a collection containing a single
LocalizedString
object that specifies a French locale with English text. Note that this behavior is unique to
Choice
objects.
A Choice
object's display name, which is always a string value, should not be confused
with its value, which can be a string, an integer, or a collection of Choice
objects
(when a Choice
object acts as a group node).
A Choice
object's display name is assigned with the DisplayName property, while its value is
assigned using the appropriate property, depending on its type: ChoiceIntegerValue for integer-type choice
items, ChoiceStringValue for string-type choice items, or ChoiceValues for group nodes.
Although the server does not check the display names and values of the choice items within a given choice list for uniqueness,
it is recommended that they be unique to avoid ambiguity.
To create a Choice
object, call the Factory.Choice.createInstance
method. In order to save the state of a new
Choice
object (when you save the com.filenet.api.admin.ChoiceList
object to which it belongs), you must, at a minimum, set
its ChoiceType and DisplayNames properties. The DisplayNames property can be either set directly, by setting it to a
LocalizedStringList
object; or set indirectly, by setting the DisplayName property. To create a list collection of
Choice
objects (com.filenet.api.collection.ChoiceList
object), call the
Factory.Choice.createList
method.
Metadata
Auditable: false
Method Summary | |
---|---|
java.lang.Integer |
get_ChoiceIntegerValue()
Returns the value of the ChoiceIntegerValue property. |
java.lang.String |
get_ChoiceStringValue()
Returns the value of the ChoiceStringValue property. |
ChoiceType |
get_ChoiceType()
Returns the value of the ChoiceType property. |
ChoiceList |
get_ChoiceValues()
Returns the value of the ChoiceValues property. |
java.lang.String |
get_DisplayName()
Returns the value of the DisplayName property. |
LocalizedStringList |
get_DisplayNames()
Returns the value of the DisplayNames property. |
Id |
get_Id()
Returns the value of the Id property. |
java.lang.String |
get_Name()
Returns the value of the Name property. |
void |
set_ChoiceIntegerValue(java.lang.Integer value)
Sets the value of the ChoiceIntegerValue property. |
void |
set_ChoiceStringValue(java.lang.String value)
Sets the value of the ChoiceStringValue property. |
void |
set_ChoiceType(ChoiceType value)
Sets the value of the ChoiceType property. |
void |
set_ChoiceValues(ChoiceList value)
Sets the value of the ChoiceValues property. |
void |
set_DisplayName(java.lang.String value)
Sets the value of the DisplayName property. |
void |
set_DisplayNames(LocalizedStringList value)
Sets the value of the DisplayNames property. |
Methods inherited from interface com.filenet.api.core.RepositoryObject |
---|
getObjectStore |
Methods inherited from interface com.filenet.api.core.EngineObject |
---|
get_ClassDescription, getClassName, getConnection, getProperties, getSuperClasses |
Method Detail |
---|
java.lang.String get_DisplayName()
void set_DisplayName(java.lang.String value)
LocalizedStringList get_DisplayNames()
void set_DisplayNames(LocalizedStringList value)
Id get_Id()
java.lang.String get_Name()
ChoiceType get_ChoiceType()
void set_ChoiceType(ChoiceType value)
java.lang.Integer get_ChoiceIntegerValue()
void set_ChoiceIntegerValue(java.lang.Integer value)
java.lang.String get_ChoiceStringValue()
void set_ChoiceStringValue(java.lang.String value)
ChoiceList get_ChoiceValues()
void set_ChoiceValues(ChoiceList value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |