Defining the Project Asset Type
The projects saved in our customized asset management system will be based off a new asset type that has fields for storing the following data:
Status. One of Planned, Ongoing, or Completed for the status of a project.
Work group. A label for the group within the organization working with a project.
Documentation. An uploaded file that serves as documentation for a project.
Presentation. An uploaded file used during a presentation related to a project.
Presented. The date when a presentation was held.
Model version. A simulation model being used in a project.
Except for the last field, these fields are not available in the default asset management system included with a new Model Manager server database. Part of our task when creating the new project asset type will therefore be to extend the asset management system with new attributes that can hold the corresponding data.
You need to either be an administrator or have been granted the Manage asset types database permission to customize the asset management system — see Database Permissions.
The new asset type is added from the Database administration area in the Model Manager server web interface:
1
Click the cog wheel in the top navigation bar and select Database in the opened Administration menu.
2
Click Asset Types in the Database navigation sidebar.
3
Click Add to open the Add Asset Type page for adding a new asset type to the asset management system.
4
Write Project in the Name field.
5
Write PROJ in the Alias field.
The alias PROJ, combined with a unique integer, is used in web links for project assets — the first project you create will get the identifier PROJ-1. Once the new asset type has been saved to the database, this alias cannot be changed.
Attributes are organized into collapsible sections on an asset page. You will add three sections for the project asset type: Information, Files, and Simulation Models.
1
On the Sections card, write Information in the Title field.
2
Click the Add Section button to add a second section. Write Files in its Title field.
3
Click the Add Section button again to add a third and final section. Write Simulation models in its Title field.
While defining a new asset type, you may find it useful to see a preview of how the corresponding Asset page will look like. Click the Preview menu option located above the Sections card. The page switches into a preview mode for a hypothetical project asset. It shows the three sections — all currently void of any attributes. Click the Sections menu option to return to the list mode used to edit the sections.
There will already be a default asset type on the Asset Types page. This asset type is automatically created for a new Model Manager server database. It uses the two predefined composite attributes — Attachments and Model versions.
Adding Your First Primitive Attribute
We will add the Status field as a new primitive attribute placed first in the Information section.
1
In the Add attribute list in the Information section, select New primitive attribute.
2
Write Status in the Label field.
The Identifier field is automatically populated with a lowercase status for the unique identifier of the new attribute. This identifier is used, for example, when Searching on Asset Attributes. Once the attribute has been created, this identifier cannot be modified.
3
Write The current status of a project in the Description field.
4
Select Combo box in the Widget list.
The Value list is automatically set to the default value type for the widget, which in the case of a Combo box is Keyword.
5
In the Allowed Values table, write Planned in both the Label input field and the Value input field. Click Add Allowed Value. Repeat this with Ongoing and Completed.
6
Finish by clicking the Add Primitive Attribute button.
You have created your first primitive attribute. As its label and description indicates, it can be used to track the current status of a project.
There will already be two primitive attributes in the Add Attribute list — Attachment and Model version. These are automatically created for a new Model Manager server database.
Adding More Attributes
You will use a simple Input field for storing the work group within the organization that is involved with the project. Another reasonable widget for such a field would be a Combo box with a predefined list of available work groups.
1
In the Add attribute list in the Information section, select New primitive attribute.
2
Write Work group in the Label field.
3
Write Organizational unit in the Description field.
4
Select Input field in the Widget field.
5
Click Add Primitive Attribute.
Open the preview mode again. As expected, the Information section now displays a Status field and a Work group field with some placeholder data in both fields. Return to the sections list mode.
Users of the asset management system would likely want to upload multiple documentation and presentation files on a single project. You can accomplish this by adding the new Documentation and Presentation fields as columns in two separate tables. For the former:
1
In the Add attribute list in the Files section, select New composite attribute.
2
Write Documentation files in the Label field.
The Description field can be empty. Keep the default Table value in the Mode list.
3
In the Add primitive attribute list under Member attributes, select New primitive attribute.
4
Write Documentation in the Label field.
5
Write Documentation file in the Description field.
6
Select File Upload in the Widget list.
The Value field automatically defaults to Attachment.
7
Click Add Primitive Attribute to add the new primitive attribute as a member of the composite attribute.
8
Click Add Composite Attribute to add the composite attribute itself to the Files section.
A composite attribute is an aggregation of one or more primitive attributes. As such, it may be used to store a composite value. Moreover, a composite attribute can be defined in one of two modes — Simple or Table. The former is used when there is a single composite value. As such, it is displayed as a simple grouping of fields on the Asset page. The latter is used when there are multiple such composite values — the composite attribute is displayed as a table with the individual composite values as table rows and the primitive attributes as columns.
The Documentation files composite attribute is a special case where the composite value is just a single value — the uploaded file. It is displayed as a table having a single column, with each table row containing a single documentation file.
There will already be two composite attributes in the Add Attribute list — Attachments and Model versions. These are automatically created for a new Model Manager server database.
Any presentation held for a project has a corresponding presentation file and a date when the presentation was held. To store this data, add a table with two columns to the Files section:
1
In the Add attribute list in the Files section, select New composite attribute.
2
Write Presentations in the Label field.
3
Write Presentations held in the Description field.
4
In the Add primitive attribute list under Member attributes, select New primitive attribute.
5
Write Presentation in the Label field.
6
Write Presentation file in the Description field.
7
Select File Upload in the Widget list.
8
Click Add Primitive Attribute.
9
Select New primitive attribute again for an additional Presented column in the table. Use Presented, Date of presentation, and Date picker for the Label, Description, and Widget fields, respectively. Finish with Add Primitive Attribute.
10
Click Add Composite Attribute to add the composite attribute as a second attribute to the Files section.
Now could be a good point to preview the Asset page once more. Click Preview. You will see the two Documentation files and Presentation tables in the Files section. Click Sections to return to the sections list mode.
Finishing the Asset Type Definition
The last field, Model version, already exists as a primitive attribute. It is used by the default asset type that is automatically created for a new Model Manager server database. The primitive attribute itself is a member of an automatically created composite attribute, Model versions. You will reuse this latter attribute to link multiple model versions on a project: in the Add attribute list in the Simulation Models section, select Model versions.
With all attributes added to their respective sections, click Save at the bottom of the Add Asset Type page to save the new project asset type.
You should see three sections on the Asset Type page containing five attributes in total — two primitive attributes and three composite attributes. Click on the Presentations (presentation) link to open its details page. You should see the primitive attributes Presentation and Presented, the two members of the Presentations composite attribute.
Updating an Attribute Definition
As currently defined, the Status primitive attribute is edited on an Asset page by selecting a value in a Combo box widget — a list of options that you can show or hide by clicking on the widget. This is useful when there are many allowed values to select among. In our case, though, the Radio button widget may be more suitable:
1
Click Primitive Attributes in the Database navigation sidebar.
2
On the Primitive Attributes page, click Status to open its details page.
3
Click Edit.
4
In the Widget list, select Radio button.
5
Click Save.
The Radio button widget always shows all options when editing — useful in this case, as there are only three options to choose from.