Here is a sample content.
Artifact datamodel can be sub-catagorized under different topics. This separation can be acheive by introducing table element. You can see there are five table elements in the above sample registry extension file. table element consists of different fields. There are several types of fields.<table name="Details"> Name Date </table> <table name="Rules"> Venue Gender male female Description </table> <table name="Participants"> Auther House Name </table> <table name="Service Lifecycle"> Contact Titans Legions Cloud Bots Wild Boars </table> <table name="SLA" columns="3"> Lifecycle Name Document Type URL Comment SLA SLA1 </table> SLA2
- text
- text-area
- options
- option-text
Now lets look at how each type and some of their attributes associated with it.
text
Defines a text field.
Name
path and url attributes
path attribute is set then input expected to be a path. Also enabling this gives the option of browsing within the repository. But you can type the path as well.SLA
If url attribute is set then the input expected to be a url.
If the input is a url or a path to a source in the repository then you can use both as in the example appear.
text-area
Defines a text area field.
Description
options
Defines a field with a combo-box with the given values.
Gender male female
option-text
Defines a composite field with a options field and a text field. Values of the options field need to define as a child element of field.
Contact Titans Legions Cloud Bots Wild Boars
maxoccurs attribute
This attribute enables store multiple entries under same field.Contact Titans Legions Cloud Bots Wild Boars
Here is how it looks like after saving multiple values.
Since maximum occurrance is unbounded this can keep unlimited entries. If you want limit the number you can define maxoccurs to bounded value.
Associating a lifecycle using options field
options field can be use to select a lifecycle to the artifact instance using above code. This will list down the existing lifecycles to choose one which will associated with the instance. Not associating a lifecycle is also possible. This can be done by adding the following field.
Lifecycle Name
Multi-type attributes
reqired attribute
required attribute makes a field required in order to create a artifact instance. In here I used the reqired attribute for text type, it can be used with other types also. Required fields are indicated using a red star as shown in the figure below.
Name
Table attributes
columns attribute
columns attribute is use to set the number of fields in each row. Following fields are put in to the table in the order of they appear. Also number of heading child elements in the subheading element needs to be same as the number of columns.
<table name="External Links" columns="3">Document Type URL Comment URL URL1 </table> URL2
Now we have an idea about elements of registry extension file. In the next part we will see how we can add this extension to the WSO2 Governance Registry.
can you do multiple columns with option-text? in the three column example, if i added maxoccurs="unbound", after saving the data, the property table doesn't seem to retain the affiliation of the record (i.e. say i added two rows, by just lookig at the reg_property table, i would not know the which url1 belongs to which row. any way around this? in option text, only field is related to each option). please advise.
ReplyDelete