||
Skip to end of metadata
Go to start of metadata

In WSO2 G-Reg, the categorization or facetted-search feature allows you to further filter (narrow down) the results of a particular search to refine it, by selecting a specific value or a set of values for a given attribute. Also, you can provide the filtering criteria for multiple attributes.

Configuring the RXT definition based on the refinements

Follow the steps below to configure the RXT of the asset type to enable categorization on it.

  1. Log in to the 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.
    artifact types menu
  3. Click View/Edit option of restservice to configure REST services to enable categorization on them.
    select rest service as artifact type
  4. Enter the following example configuration to add a new option field to the Categorization table of the REST service RXT using the provided Editor.  

    You can enable categorization by adding the categorization="true" property to a field of the type option in any of the existing tables in the RXT (e.g. Overview). Also, you can configure the order in which the categories are displayed by adding the priority parameter (e.g. priority="1"). 

    <table name="Categorization">
        <field type="options" categorization="true">
            <name label="Security">Security</name>
            <values>
                <value>Encrypted</value>
                <value>Policy-based</value>
                <value>Token-based</value>
                <value>Signature-based</value>
            </values>
        </field>
    </table>
     

    source of artifact type

  5.  Click Save, and then click Ok in the message which pops-up as shown below.
     

 Other configuration options

You can use the following configuration options when creating categories for asset types in WSO2 G-Reg.

To get the values to display under each categorization option from Apache Solr 

Change the value of the solarFacetsEnabled element under the asset.configure function to truein the < G-REG_HOME>/repository/deployment/server/jaggeryapps/store/extensions/assets/default/ asset.js file as follows, to retrieve the values from Solr facets.

categorization: {
solarFacetsEnabled: true,
}

To configure the number of categorization fields, to be expanded by default in the Store.

Change the value of the collapseInMenuCount element under the asset.configure function to truein the <G-REG_HOME>/repository/deployment/server/jaggeryapps/store/extensions/assets/default/ asset.js file as follows, to configure the number of categorization fields, to be expanded by default in the Store

categorization: {
collapseInMenuCount: 3
}

Applying the refinements to an asset 

Follow the instructions below to apply the defined categories and select the categorization values for the  BuyMoreBillCalculateRESTAPI Version 1.0.0 asset.

  1. Log in to the WSO2 G-Reg Publisher using the following URL and admin/admin credentials: https://<G-REG_HOST>:<G-REG_PORT>/publisher/
  2. Type "name:BuyMoreBillCalculateRESTAPI version:1.0.0" in the search field and click the search icon.
    searching for the asset
  3. Click the BuyMoreBillCalculateRESTAPI asset, which appears in the search results to open it.
    search results
  4. Click the EDIT button in the top menu.
    edit button in the top menu
  5. Select the categorization value.
    select categorization value
  6. Click Update to finalize the asset updating process.

Refining the search

Once you add the filters to an asset, follow the steps below to use those filters to search for that asset in the G-Reg Store.

  1. Log in to the WSO2 G-Reg Store using the following URL and admin/admin credentials: https://<G-REG_HOST>:<G-REG_PORT>/store/
  2. Click Rest Services in the left menu.
    select REST services
  3. Expand  Security  category under the  Refine by  menu, and select the Token-based option.

 You view the BuyMoreBillCalculateRESTAPI Version 1.0.0 asset, to which you added the refinements in the search results.

search results

  • No labels