Adding Categories for an Asset
G-Reg Publisher supports enabling first level of categorization for asset types that are stored in it. Once you define the categories within any <table>
element in the RXT of an asset type, you can select the category of the asset, when creating it. For an example, you can enable categorization by adding a new field to a new Information
table of SOAP Services as explained below.
- Log in to the WSO2 G-Reg Management Console using the following URL and admin/admin credentials: https://<G-REG_HOST>:<G-REG_PORT>/carbon/
- Click Extensions, and then click Artifact Types in the Configure menu.
- Click the corresponding View/Edit link of the artifact type, in which you want to enable categorization a shown below.
Add the following configuration to add an option field with the name
Category
to a newInformation
table of the rest service RXT using the provided Editor as shown below.<table name="Information"> <field type="options"> <name label="Category">Cat</name> <values> <value>None</value> <value>Engineering</value> <value>Finance</value> <value>HR</value> <value>Sales</value> <value>Marketing</value> </values> </field> </table>
You can enable categorization by adding an option field to any of the existing tables in the RXT of a particular type (e.g.
Overview
).- Click Save, and then click Ok in the message which pops-up as shown below.
Add a new
categoryField
within thecategories
element under theasset.configure
function, in the<
G-REG_HOME>/repository/deployment/server/jaggeryapps/store/extensions/assets/default/
asset.js
file as follows.Add the value of the
categoryField
property in the following format:<TABLE_NAME>_<FIELD-NAME>
. You can pick the<TABLE_NAME>
from the RXT of the particular asset type, and the<FIELD-NAME>
from the configuration you added to the RXT.categories: { categoryField: 'overview_category', categoryField: 'information_cat' },
- Restart the WSO2 G-Reg server.
You view the new field you added to enable categorization when creating a SOAP Service using the G-Reg Publisher as shown below.
You can use categorization to search for a SOAP Service in the G-Reg Publisher by its category as shown below.
Also, you can use categorization to search for a SOAP Service in the G-Reg Store by its category as shown below.