2.8 Required Attributes for Container Child Objects
Required
attributes
are a feature that allows users to automatically give children objects of a
given collection a specific set of attributes upon insertion. This works by
means of a special attribute that is given to the collection. The value of this
attribute determines the name and possible values of the attribute that are to
appear in the child object. Upon insertion of a new object, a dialog box is
displayed showing the defined attributes and their values (if any). The user
can alter, add or delete values in this dialog box. When a collection is
inserted into the collection, it gets the required attributes as well as the
attribute declarations. Thus the required attributes are given recursively to
the entire collection hierarchy.
This feature is useful in any case where an attribute should be propagated down
through an entire collection hierarchy. For example, you might have a
collection containing all information related to a certain project. Each
project in your company has a project number to identify it. You want to give
all documents and collections that are contained in a project collection the
same project number automatically. An example of how this could be done using
required attributes is shown in Figure 94. The collection with the title "XFone
Cordless" has the project number (PN) 1248. The HW_ReqChildAttr
attribute specifies that all children documents of the collection have the same
project number as the parent collection. As can be seen in the figure, the text
document that is contained in the collection has the same project number as the
collection. The syntax when using HW_ReqChildAttr is explained in the
course of this text.
Figure 94: Using required attributes to give a project number to a child
document
|
Benutzer: Gast
Besitzer: hwsystem Zuletzt geändert am:
|
|
|