|
Note: The attributes defined by HW_ReqChildAttr are only given to the children objects of the collection where they are defined when the children objects are newly uploaded. If an object is moved, copied or duplicated into the collection, it does not get the defined attributes.
PROPAGATION OF REQUIRED ATTRIBUTES
Note that when inserting a container into the container with the HW_ReqChildAttr attributes, all the HW_ReqChildAttr attribute definitions are copied to the new container object. This guarantees that the attributes are propagated to objects in deeper container levels.
EXAMPLE
For example, the set of attributes in the container object might be defined as follows:
HW_ReqChildAttr=<Definition of Description attribute>
HW_ReqChildAttr=<Definition of Title attribute in English>
HW_ReqChildAttr=<Definition of Title attribute in German>
As can be seen here, this declaration defines a Description attribute and two Title attributes in different languages for the children objects. Though not shown here, the attribute definition allows several different specifications for each attribute, such as its name and type, whether or not it is required, and what its value should be. The syntax for the value of HW_ReqChildAttr is explained below.
type-def name-def [necessity-def] [default-def] [caption-def] [enum-def] [range-def] [prompt-def]
Note: The declarations must be in the order shown above.
NOTES ON SYNTAX
Note the following about the syntax below:
The meaning of the declarations and their syntax is explained below:
TYPE DEFINITION
type-def = (Type: type )
Possible values: integer, float, string or boolean.
Purpose: Defines the type of value the attribute can have.
Example: (Type: boolean)
NAME DEFINITION
name-def = (Name: name )
Purpose: Defines the name of the attribute to be added to the new object. Note that this is different from the caption of the attribute, which appears in the interface.
NECESSITY DEFINITION
necessity-def = (Necessity: necessity )
Possible values: required, optional
Purpose: Specifies whether or not the attribute is required. If its value is "required", then the client is not allowed to accept an empty value as input. If the value is "optional", then an attribute value does not have to be entered, in which case the attribute is not added to the new object.
Example: (Necessity: optional)
DEFAULT DEFINITION
default-def = (Default: <literal of type> )
Possible values: any literal value that corresponds to the type declared for the attribute, or a reference to an attribute in the parent collection.
Purpose: This specification gives the default value for the attribute. This can either be an actual value or a construct that takes the value from an attribute in the parent collection.
Examples of literal values:
(Default: %%attr-name%%)
Example of referencing an attribute value:
(Default: %%DocAuthor%%)
gives the specified attribute in the child object the value of the attribute DocAuthor in the parent object.
Note: References to HW_ReqChildAttr are not allowed.
Note: If an attribute with multiple values is referenced then one value is randomly selected.
The reference can also be used as part of the value of the Default declaration, e.g.:
(Default: This document is %%status%%)
CAPTION DEFINITION
caption-def = (Caption: 1*caption )
Possible values: The caption definition consists of one or more texts, each with a language declaration.
Purpose: The Caption appears in the user interface and provides the user with information about the meaning of the attribute or the value to be entered. Captions can be in multiple languages.
Example: (Caption: (en:"Project Number")(ge:"Projektnummer"))
ENUMERATION DEFINITION
enum-def = (Values: 1*named-value )
named-value = Value [caption-def]
Value = anything Type can have
caption-def = (Caption: 1*caption)
Purpose: This enumeration specification defines all possible values for the attribute. Each value can be associated with a caption to improve the input user interface.
Example: (Values:(1(Caption:(en:"one")(ge:"eins"))))
Note: Values of type "string" must be enclosed in quotes.
RANGE DEFINITION
range-def = (Range: value - value )
Purpose: This defines the range of possible values for the attribute, corresponding to the Type definition.
Example: If Type is integer, then the Range definition might look like
(Range: 1 - 100)
PROMPT DEFINITION
prompt-def = (Prompt: bval )
Possible values: true, false
Purpose: The prompt definition tells whether or not there should be user interaction when giving a child object a required attribute. When the prompt definition is false, there is no user interaction when adding the attribute. In this case "required" attributes (see Necessity Definition) are added with their defined default value. If no default value is specified, then a warning appears and the attribute is not added. "Optional" attributes are added only if a default value is specified, otherwise they are not added and there is no warning. When the prompt definition is "true", the client presents a user interface to input the value of the attribute. This is also the default behavior if no prompt definition is supplied.
Example: (Prompt: true)
FULL REQUIRED ATTRIBUTE DEFINITION
Here is an example of a complete required attribute definition:
HW_ReqChildAttr=(Type: integer)(Name: ProjectNr)(Necessity: optional)(Default: 1)(Caption: (en:"Project Number")(ge:"Projektnummer"))(Range: 1 - 100) (Values:(1(Caption:(en:"one")(ge:"eins"))))
TO SET REQUIRED CHILD ATTRIBUTES
|