Governance Artifacts

WSO2 Governance Registry stores governance metadata and information on governance related entities. Registry resources storing these information and/or metadata are known as Governance Artifacts. Examples for Governance Artifacts include Services, WSDLs, Schemas, Processes and People.

Configurable Governance Artifacts

GReg allows users to customize information captured by Configurable Governance Artifacts. Each Configurable Governance Artifact has a content template that can be customized by editing the corresponding XML configuration. XML language described under XML Language for Customizing Configurable Governance Artifacts below should be used for this purpose.

Currently, WSO2 GReg supports the following Configurable Governance Artifact types.

To customize each content template, user can simply edit the corresponding configuration XML by clicking Configure -> artifact name link in the right-hand side menu of WSO2 GReg. For example, to customize Services, click on Configure -> Services.

Configuring Services

To customize Service content template. Click Configure -> Services. XML editor will appear as shown in Figure 1. XML language described here should be used for this configuration.

Figure 1: Configuring Services

XML Language for Customizing Configurable Governance Artifacts

The following guide describes the XML language used in above content template configurations.

table Element

This element defines a group of input fields. All the input fields should be defined inside a table element. In the generated UI, each table element will generate a corresponding HTML table segment. Figure 2 below shows such generated HTML UI of the following table element.

Definition for UI shown in Figure 2:

<table name="Overview">
  <field type="text" required="true"> <name>Name</name> </field>
  <field type="text" required="true"> <name>Namespace</name> </field>
  <field type="text"> <name>Version</name> </field>
  <field type="text-area"> <name>Description</name> </field>
</table>

Figure 2: Resulting HTML table segment

This element has a mandatory attribute, name which will be displayed as the heading of the generated HTML table.

Example:

<table name="Overview"></table>

By default, a table has two columns. However, user can specify any number of columns using the columns attribute.

<table name="Doc Links" columns="3">

subheading Element

This elements specifies the headings for a table. Therefore, this always is a child element of a table element. Number of heading elements within a subheading element must equal the number of columns of the corresponding table. subheading element is not mandatory inside a table element.

Example:

<table name="Contacts">
  <subheading>
    <heading>Contact Type</heading> <heading>Contact Name/Organization Name</heading>
  </subheading>
</table>

Example II:

<table name="Doc Links" columns=3>
  <subheading>
    <heading>Document Type</heading> <heading>URL</heading> <heading>Comment</heading>
  </subheading>
</table>

In the above example it can be seen that column number is set to 3. This will create three columns and subheadings will be added as specified. If more than two columns are used, field name will not be printed in front of the input field.

<table name="Doc Links" columns="3">
  <subheading> <heading>Document Type</heading> <heading>URL</heading> <heading>Comment</heading> </subheading>
  <field type="text"> <name>Document Type</name> </field> <field type="text"> <name>URL</name> </field> <field type="text-area"> <name>Document Comment</name> </field>
  <field type="text"> <name>Document Type1</name> </field> <field type="text"> <name>URL1</name> </field> <field type="text"> <name>Document Comment 1</name> </field>
</table>

field Element

This element which defines in input field. It can be a text field, drop-down list, text area, checkbox or a option-text. Option-text field is contains drop-down with a text field.

Ex:

field element can have couple of attributes including a mandatory attribute type. type attribute specifies the field type which can be text, option, text-area, option-text, or checkbox.

Some types of fields can have optional attributes. A text-area field accepts height and width as optional attributes. The height and width should be numerical and the value should be in pixels. The text field or an option-text accepts url as an optional attribute. Setting url="true" will display the text as a URL instead of a plain text box. Setting path="true" will provide the user a prompt to select a resource path from the registry.

name Element as a child of field

In addition to having a mandatory type attribute, field element should have another child element named name to specify the name and to display as the caption of the input field. Inside a single table element, the same name cannot be used for more than one field of the same type.

Example: A field element to create a text field.

<field type="text"> <name>Name</name> </field>

When option or option-text types are used, the set of values to be included in the drop-down list must be specified. values element is used for this purpose. Example: Definition of an "options" input field

<field type="options"> <name>States</name> <values> <value>Created</value> <value>Tested</value> <value>Deployed</value> <value>Deprecated</value> </values> </field>

Example: Definition option-text field, this has a drop-down list to select the caption of the text input field.

<field type="option-text"> <name>Contact</name> <values> <value>Technical Owner</value><value>Business Owner</value> </values> </field>

Mandatory input fields can be declared by setting the mandatory attribute to true. Default value of this attribute will be false if it is not specified in the field element. For a mandatory field, the HTML form will show an error message during submission if the field is not filled.

Example: Declaring a mandatory field

<field type="text" required=true> <name>Name</name> </field>

maxoccurs attribute

maxoccurs can be used only with field type option-text. This feature is useful when there is a requirement to add a variable number of fields (option-text). Users will be able to add those fields dynamically by clicking add link. When a particular option-text field is declared with maxoccurs=unbounded, a link will be displayed to add new input fields as required.

Example: Declaring maxoccurs=unbounded option-text fields

<table name="EndPoints">
<subheading> <heading>Environments</heading> <heading>URL</heading> </subheading>
<field type="option-text" maxoccurs="unbounded"> <name>EndPoint</name> <values> <value>Unknown</value> <value>Dev</value> <value>QA</value> <value>Test</value> </values> </field>
</table>

With this configuration following link will be displayed in the UI initially.

Users can click on Add EndPoint link and add required number of endpoints. As seen in the figure, the sub-headers are printed after the Add EndPoint link. When more than two sub headers are specified, maxoccurs attribute cannot be set to unbounded. Ex:

Configuring Filters

When listing saved artifacts, a UI similar to the one that is used to add (or edit) artifacts is used to specify the filter criteria. All the fields defined through the content template configuration will be displayed in the filter UI unless filtering is explicitly disable for a particular item. To disable filtering for all items under a table, add filter="false" attribute at the table-level. To disable filtering for a single field, add filter="false" attribute at the field-level.

<table name="Contacts" filter="false"> <subheading> <heading>Contact Type</heading> <heading>Contact Name/Organization Name</heading> </subheading> </table>

<field type="text" required=true filter="false"> <name>Name</name> </field>

Deploying a Configurable Governance Artifact

Once a Registry extension file is created, it is needed to get uploaded. Follow the instructions below to deploy the extension file in the WSO2 Governance Registry.

Storing Governance Artifacts in GReg

WSO2 Governance Registry provides a complete set of Service Metadata Management features leading to better governance of your SOA system.

Governing SOA with GReg involves two initial steps

Users can add service details in different ways such as saving complete set of service details, importing WSDLs, Schemas and Policies of services in the SOA system. These operations can be carried out using the upper part of the metadata menu which contains the links Add->Service, Add->Policy, Add->WSDL, Add->Schema. Users can upload policies, WSDLs and schemas from their local file system or from a given URL as shown in the figures below.

Figure 3: Adding Policy using a URL

Figure 4: Adding Policy using Local File System

API and URI Artifacts

API and URI are two artifact types which are implemented as Configurable Governance Artifacts. API is an artifact which can be published to an Artifact Store which is defined to perform a particular task. URI artifact is used in order to maintain and govern resources which are physically residing at an external repository and stored in the registry by its URI.

Figure 5: Add API

Figure 6: List API

Figure 7: Add URI

Figure 8: List URI