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-7.
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-6.
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 in a repository.
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 Identifier column — the unique identifier 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 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.
2
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, numbers, or underscores.
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.
An identifier will be automatically generated as soon as you starting typing in the Label field. Feel free to change the generated identifier as you see fit.
3
The description is shown as a tooltip to the attribute field label on The Asset Page and in the Filters menu on The Home Page.
4
5
6
For applicable widget types, add allowed values for the primitive attribute to the Allowed values table. The allowed values are shown as selectable options when editing the attribute on the Asset page, when filtering table rows for composite attributes on the Asset page, and when filtering assets on the Home page. At least one allowed value must be added to the table.
a
Write a display label for an allowed value in the Label field. The label is used for the corresponding selectable option.
b
c
Click Add Allowed Value to add to the table.
You can rearrange the allowed values using drag and drop — see also Rearranging Table Rows. Click Sort alphabetically to enable automatic sorting on label. Click again to disable. The sort order of the allowed values determines the order for the corresponding selectable options on the Asset page and the Home page.
Click Delete to remove an allowed value from the table.
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-6: All available widget types for primitive attributes.
The Checkbox list and List box widget types are functionally equivalent, with the main difference that the latter always shows all available options on screen when editing (and thus suitable when the number of options are relatively few). The analogous holds true 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 repository of the 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-7: All available value types for primitive attributes.
A true or false value.
The Date value type is used to store a whole day without any explicit reference to a specific timezone. You can use it, for example, to store an event-like date for which the location may be inferred elsewhere.
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 label 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.
Workflows. Links to workflows that are based on the primitive attribute — see Primitive Attribute Workflows.
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 the Asset page for 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. 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 from being displayed on the page. The value is lost altogether for the new version if the asset is subsequently saved, although it remains on the old version.
The same is true if you remove an allowed value from a primitive attribute that has previously been saved on older assets — the removed value becomes effectively hidden on the Asset page for those older assets and it will not be included in the new version if one of those assets is resaved. If you add the allowed value back, however, it reappears on the Asset page for the older assets.
Click Duplicate to open the Add Primitive Attribute page filled in advance with the current primitive attribute’s widget type, value type, and allowed values.
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, or from any composite attribute it is a member of. 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).