Primitive Attributes
You define the data fields available for a particular asset type using primitive attributes. A primitive attribute added to an asset type will appear as an editable data field on all assets having that asset type.
Each primitive attribute has a value type defining the kind of data it can store and how you can search on that data. This can be a simple type, such as a text or a number, or an advanced type, such as a link to a model version stored in the database. All available value types are listed in Table 3-5.
A primitive attribute also has a widget type defining how the data is edited in the web interface. This can, for example, be an input field, a list of options in a combo box, or a picker for selecting a model version. All available widget types are listed in Table 3-4.
Given a particular widget type, only a subset of all value types are available to combine the widget type with. Some widget types also require a set of allowed values for the data, which becomes an additional constraint on the data that a primitive attribute can store.
When a Model Manager server database is created, two primitive attributes — Attachment and Model Version — are automatically created for you. They correspond, respectively, to an uploaded file attachment and a link to a model version.
The Primitive Attributes page, opened by clicking Primitive Attributes in the Database navigation sidebar, shows a table with all primitive attributes in the database. The table columns are:
The Label column — the label of the primitive attribute.
The Widget column — the type of widget used when editing the primitive attribute.
The Value column — the type of value that can be set for the primitive attribute.
The Description column — the optional description of the primitive attribute.
Click on the label of a primitive attribute in the table to show more details for that primitive attribute. Click the Add button to add a new primitive attribute.
Adding Primitive Attributes
To add a new primitive attribute:
1
Write an identifier for the primitive attribute in the Identifier field. This identifier must be unique among the set of all attributes — primitive and composite — and start with a Latin alphabet character followed by zero or more additional such characters or an underscore.
The identifier of a primitive attribute is, for example, used in the Model Manager search syntax when filtering on attribute values — see Searching on Asset Attributes.
2
Write a label for the primitive attribute in the Label field. The label is shown on an asset page next to the asset’s attribute value.
3
The description is shown as a tooltip to the attribute label on The Asset Page.
4
5
6
For applicable widget types, add allowed values for the primitive attribute in Allowed values. Click Add to add each value. At least one allowed value must be added.
7
Click Save to add the new primitive attribute.
Widget Types
The widget type of a primitive attribute determines how the corresponding attribute value is displayed and edited on an asset page. Each widget type supports a subset of all Value Types. The following widget types are available:
Table 3-4: All available widget types for primitive attributes.
The check box list and list box widget types are functionally equivalent, with the main difference that the latter always shows all available options when editing. Similarly for the combo box and radio button widget types.
The difference between the file upload and the file version picker widget types may not be obvious. The former is used to attach files to assets such that these attachments are version controlled together with the asset itself. The latter is used to link to existing data files that are version controlled as separate items in a Model Manager database.
Value Types
The value type of a primitive attribute determines how the corresponding attribute data is validated, as well as how that data is made available for searching and filtering. The following value types are available:
Table 3-5: All available value types for primitive attributes.
A true or false value.
The Primitive Attribute Page
The Primitive Attribute page contains details on a primitive attribute in the database. The fields are:
Identifier. The unique identifier of the primitive attribute.
Label. The label of the primitive attribute.
The label is used as the field text of the attribute on The Asset Page.
Description. The description of the primitive attribute.
The description is shown as a tooltip on the field text of the attribute on The Asset Page.
Widget. The type of widget used when editing the primitive attribute.
Value. The type of value that can be set for the primitive attribute.
Allowed values. The set of allowed values for the primitive attribute. This field is only shown for Widget Types that support a set of allowed values.
Click Edit to edit the primitive attribute, including possibly changing its widget type and value type or adding allowed values.
Changing a primitive attribute from one widget type to another, while leaving the value type and, when applicable, any allowed values unchanged, is always harmless — assets that use the primitive attribute will simply change how their data is displayed and edited. The data itself is left untouched even when saving a new version of the asset.
Changing the value type of a primitive attribute should be done with care. If you open and subsequently save a new version of an asset that uses a primitive attribute whose value type has been changed, Model Manager will try to automatically convert the data value to the new type using natural conversion rules. The save will be canceled if there is a conversion error, in which case the attribute value would first need to be manually adjusted. If a conversion is known to be impossible — for example, changing the value type from Date to Attachment — Model Manager will simply remove the value.
Click Delete Permanently if you want to permanently delete the primitive attribute in the database. The attribute will be automatically removed from any asset type using it. Any assets with data for the primitive attribute will, however, be left untouched until you save a new version of the asset (in which case the attribute data will simply be excluded from the new version).