com.filenet.api.admin

Interface Choice

  • All Superinterfaces:
    DependentObject, EngineObject, RepositoryObject, java.io.Serializable


    public interface Choice
    extends RepositoryObject, EngineObject, DependentObject
    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.

    Locale support 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 provide locale support for 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 locale-specific 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, locale support 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

    • Method Detail

      • get_DisplayName

        java.lang.String get_DisplayName()
        Returns the value of the DisplayName property. For more information, see DisplayName Property.
      • set_DisplayName

        void set_DisplayName(java.lang.String value)
        Sets the value of the DisplayName property. For more information, see DisplayName Property.
      • get_Id

        Id get_Id()
        Returns the value of the Id property. For more information, see Id Property.
      • get_Name

        java.lang.String get_Name()
        Returns the value of the Name property. For more information, see Name Property.
      • set_ChoiceType

        void set_ChoiceType(ChoiceType value)
        Sets the value of the ChoiceType property. For more information, see ChoiceType Property.
      • get_ChoiceIntegerValue

        java.lang.Integer get_ChoiceIntegerValue()
        Returns the value of the ChoiceIntegerValue property. For more information, see ChoiceIntegerValue Property.
      • set_ChoiceIntegerValue

        void set_ChoiceIntegerValue(java.lang.Integer value)
        Sets the value of the ChoiceIntegerValue property. For more information, see ChoiceIntegerValue Property.
      • get_ChoiceStringValue

        java.lang.String get_ChoiceStringValue()
        Returns the value of the ChoiceStringValue property. For more information, see ChoiceStringValue Property.
      • set_ChoiceStringValue

        void set_ChoiceStringValue(java.lang.String value)
        Sets the value of the ChoiceStringValue property. For more information, see ChoiceStringValue Property.

© Copyright IBM Corporation 2006, 2013. All rights reserved.