WSAttributeMetadata

WSAttributeMetadata defines information about the data of a particular typed attribute, such as value data type, localized text (display name, description, prompts), its default value, permissible value range, select type, options (if single or multiple select). As with attributes, attribute metadata is typed. For example, a WSDecimalAttribute myNumber must have a WS DecimalAttributeMetadata bound to it, and all values, including the attribute values, metadata default value, and possible option values, are all be typed Double.

Descriptions, labels, and other attribute metadata text are localized; however, user-specified text may only be available as it was typed in by the user. Each API call includes a requested locale that client code can use to define the locale in which a particular user would like localized messages to be displayed. The usual Java locale fallback policies are used to fulfill the request.

WSAttributeMetadata includes the following fields:

  • name: The attribute's name, standard or custom; also the name that is used by the attribute that binds to this metadata. Standard attributes are defined by the system and have standard names in a reserved name space (that is, they use a "uac" prefix), custom names may use any other naming convention.
    Note: The attribute name must be unique, is never localized, and has length restrictions (which depend on the character content and database). The name is not case-sensitive and can be composed of any combination of Unicode letter or digit characters, plus the underscore character '_', but cannot start with a digit.
  • description: optional description of the attribute. Suitable for a tooltip or other user-interface presentation.
  • Predicates: assorted predicates that describe the attribute:
    • isRequired: true if the attribute is mandatory.
    • isInternal: true if the attribute is defined by the system, and is for internal use only (should not be presented to a user).
    • isGenerated: true if the attribute's value or values are auto-generated by Unica Campaign when the component is created, such as a target cell code. Typically the accessTypeEnum will be READ_ONLY for generated values.
    • hasOptions: true if the attribute has options. Implies that options are defined for this metadata and that the selectTypeEnum is either SINGLE_SELECT or MULTIPLE_SELECT.
  • typeEnum: a WSAttributeTypeEnum that defines the type of attribute, such as STANDARD or CUSTOM.
  • statusEnum: a WSAttributeStatusEnum that defines the status of the attribute, such as ACTIVE.
  • accessTypeEnum: a WSAccessTypeEnum that defines the type of access to the attribute value, such as READ_ONLY.
  • selectTypeEnum: a WSAccessTypeEnum that defines the type of selection that is used for the attribute, such as SINGLE. Must be NONE for Unica Campaign and cell attributes, or if no options are provided.
  • componentTypeEnum: a WSComponentTypeEnum of all possible Unica Campaign components that are exposed by the API, such as CAMPAIGN, FOLDER.
  • defaultValue (flowcharts only): optional type default value for the attribute. This value is provided by the concrete attribute metadata class, such as a WSTextAttributeMetadata's default value is of type String. (Refer to the description of the Attribute values). For components other than flowcharts, the default value is undefined.
  • options: optional list of options for this attribute. Taken together, an attribute's options define the exact set of permissible values for that attribute; each option is typed, so for example a WSTextAttributeMetadata can only have a WSTextAttributeOption bound to it.
Note: There is a restriction on options; only text attributes are supported.

Each option defines the following:

  • prompt: prompt for the option suitable for pull-down menus, such as "Male" as a gender attribute option. Unlike the metadata prompt, option display names usually do not include punctuation.
  • description: localized description of the option, such as "A person of the male persuasion." Suitable for tooltip text.
  • isDefault: true if this particular option is the default. For MULTIPLE_SELECT select types, more than one option can be marked as a default.
  • value: the typed option value. As with the attribute metadata defaultValue, this value is provided by the concrete option subclass, such as a WSDecimalAttributeOption's value is of type Decimal. (Refer to the description of the Attribute values). Continuing the gender example, above, the value either could be declared as a string "m" (WSTextAttributeOption) or as a numeric code, 123 (WSDecimalAttributeOption).