Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 itFor an example, you can enable categorization by adding a new field to a new Information table of SOAP Services as explained below. 

  1. 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/
  2. Click Extensions, and then click Artifact Types in the Configure menu.
  3. Click the corresponding View/Edit link of the artifact type, in which you want to enable categorization a shown below.
    select artifact typeImage Removed
  4. Add the following configuration to add an option field with the name Category to a new Information table of the rest service RXT using the provided Editor as shown below. 

    Code Block
    languagexml
    <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>
    Info

    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).

  5. Click Save, and then click Ok in the message which pops-up as shown below.
    Image Removed
  6. Add a new categoryField within the categories element under the asset.configure function, in the <G-REG_HOME>/repository/deployment/server/jaggeryapps/store/extensions/assets/default/asset.js file as follows.

    Info

    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.

    Code Block
    languageactionscript3
    categories: {
    categoryField: 'overview_category',
        categoryField: 'information_cat'
    },
  7. 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.

new category field in PublisherImage Removed

You can use categorization to search for a SOAP Service in the G-Reg Publisher by its category as shown below.

search using Categories in PublisherImage Removed

Also, you can use categorization to search for a SOAP Service in the G-Reg Store by its category as shown below.

...

Once you configure the RXT to enable categorization and define categories as search refinements, you can select the categorization values for a particular asset in the WSO2 G-Reg Publisher when creating an asset using the G-Reg Publisher or updating an asset as shown below.

adding categories for an asset typeImage Added

Panel

After adding categories to an asset, to search for an asset using the added categories, see Searching for an asset using categories.