com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

Performing Store Operations on an Asset

You can perform the following operations on an asset in WSO2 G-Reg Store.

This guide uses version 1.0.0 of the BuyMoreBillCalculateRESTAPI asset, which you searched and retrieved in Searching for an Asset in Store

Viewing information 

Follow the steps below to view information about an asset.

  1.  Log in to the G-Reg Store if you are not already logged in. For instructions, see Searching for an Asset in Store.
  2. Search and locate the asset. For instructions, see Searching for an Asset in Store.
  3. Click on the asset.

You view the following information about it as shown below.

Details of the information you view are as follows.

InformationDescription
OverviewThe name and version that you specified, when creating this asset.
LifecycleThe life cycle that is applied to this asset either by-default or as preferred. For more information on asset life cycles, see Managing Life Cycles of Assets.
AssociationsAssociations that are added to the asset. For more information on associations, see Adding Associations for an Asset.
SwaggerThe raw content of the source file of the asset.

Adding user reviews and ratings

You can add user reviews to the assets that are stored in WSO2 Governance Registry.

Enabling user reviews and ratings

Follow the steps below to enable adding user reviews, if you have set a port offset in your G-Reg server, or if you have hosted WSO2 G-Reg in another server other than localhost.

If you did not start the G-Reg server before:
  1. Navigate to the <G-REG_HOME> /repository/deployment/server/jaggeryapps/store/config/store-tenant.json file.
  2. Change the host and/or port accordingly in the value of the  socialAppUrl property as shown in the example below (i.e. when you have set a port offset of 1).

     "features": {
            "social": {
                "enabled": true,
                "keys": {
                    "socialScriptSource": "%https.host%/social/export-js/social.js",
                    "socialScriptType": "text/javascript",
                    "socialAppUrl": "%https.local%/social"
                }
            },
If you started the G-Reg server at least once:
  1. Log in to the Management Console of WSO2 G-Reg using the following uRl and admin/admin credentials: http://<G-REG_HOST>:<G-REG_PORT>/carbon
  2. Click Main, and then click Browse in the Resources menu as shown below.
    select registry browse option
  3. Select the /_system/config/store/configs/store.json file as shown below.
    select the file
  4. Click the Edit as text option in the Content section.
  5. Change the host and/or port accordingly in the value of the  socialAppUrl property as shown in the following example (i.e. when you have set a port offset of 1): "socialAppUrl":"https://localhost:9444/social"

Adding the review and rating 

Follow the steps below to add a user review in the G-Reg Store.

  1. Click the User Reviews tab.
  2. Add the review, a rating for the asset, and then click Post Review as shown below.
    add a user review
    You view the review you added posted as shown below.

    You can delete the reviews that you added using the Delete button. Furthermore, you can like or dislike any posted review using the following like and dislike buttons, and also, sort them based on the NEWEST, OLDEST and POPULAR options.

    view the review you added


Subscribing for notifications

Follow the steps below to subscribe to the asset to receive notifications on operations performed on it.

For instructions on configuring  subscriptions and notifications in a clustered WSO2 G-Reg setup, see Adding a Subscription.

  1. Click the ->OPTIONS button in the top right-hand corner of the screen to expand the notification settings: 
  2. Click on one of the STORE/EMAIL notification types of the LifeCycle State Change/Information Update notification options in the Notification Settings menu as shown below. 

    Enable the STORE option to view received notifications in the screens of the G-Reg Store, or enable the EMAIL option to receive emails on either a change in the life cycle of an asset or on an update of asset information. However, you need to configure WSO2 G-Reg to send email notifications.

Viewing the received notifications

Follow the steps below to view the received notifications, once you subscribe for notifications. using the STORE option.

  1. Click the following notifications button in the right hand corner of the screen:

  2. Click the received notification, which you view as shown below.

Viewing dependencies

You can view dependencies (i.e. endpoints, source files and other assets that are associated with it) of an asset using the WSO2 G-Reg Store.

Enabling the show dependency operation

Follow the steps below to enable it in the G-Reg Store for a REST service asset.

  1. Navigate to the <G-REG_HOME>/repository/deployment/server/jaggeryapps/store/extensions/assets/restservice/asset.js file.

  2. Add a comma after the scope of the ui element, and then add the following line in the  asset.configure = function() function as shown below: isDependencyShown: true

    asset.configure = function() {
        return {
            meta: {
                ui: {
                    icon: 'fw fw-soap',
                    iconColor: 'orange'
                },
                isDependencyShown: true
            }
        }
    };
  3. Save the file, and restart WSO2 Governance Registry to apply the changes.

Viewing the dependencies and the policy

Click Show Dependency to view the dependency graph of the asset as shown below. 

dependency-graph

Click on the icon representing the dependency to view more information about it.


Comparing two versions

If you have several versions of an asset, click the Compare with button, and select the version against which, you want to view a comparison. 

You do not need to select the version to compare with if you have only two versions available of the selected asset. For instructions on creating versions of an asset, see Adding a New Version of an Asset.

You view the differences between the two selected versions as shown below.


Downloading the content 

Click the following Download button, to download the content of the underlying source file of the asset for any future reference:

 

You view the content of the underlying Swagger file of the REST service in a new tab of your Web browser as shown below.


Copying the URL of the content

Click the following Copy URL button, to copy the URL that is associated with the underlying Swagger file of the REST service. You can use this copied URL to import a project to Swagger UI or generate a client using that.

You view the following Copied to clipboard button: 

Paste the copied URL in a new tab of your Web browser and press Enter

Enter the authentication details that you used to log in to WSO2 G-Reg Publisher as shown below.

enter credentials to log in to Publisher

You view the content of the service as shown below.

copied content

Once you add a WSDL asset, which is associated with a lively available SOAP service to WSO2 Governance Registry, you can invoke the SOAP service using SOAP UI by copying its URL to Clipboard as explained in the example below.

 Invoking a SOAP Service Using SOAP UI

Adding the SOAP Service

This example uses a publicly available live SOAP service sample. For instructions on adding this SOAP Service to WSO2 G-Reg using the underlying WSDL file, see Adding a SOAP Service. 

Copying the URL of the WSDL

You need the URL of the SOAP Service you added to invoke it using the SOAP UI. For instructions on copying the URL of the WSDL to Clipboard, see Copying the URL of the content.

Invoking the Service using a SOAP UI Project

Follow the steps below to create a new SOAP UI Project using the URL of the WSDL, which you copied to Clipboard.

  1. Download and install SOAP UI.
  2. Open the SOAP UI application.
  3. Click the following SOAP button in the top menu: 
  4. Enter a name for a new Project for Project Name, and paste the copied URL for Initial WSDL, as shown below.
    adding a new SOAP project
  5. Click OK.
  6. Enter the credentials that you use to log in to WSO2 G-Reg as authentication details for the WSDL as shown below, and then click OK.
  7. Expand the GetWeatherfunction menu, and double-click the Request1 option in the Navigator as shown below.
    Projects menu
  8. Replace the values of the <web:CityName> and <web:CountryName> properties with preferred values as shown below, to invoke the Service.
    send the request to invoke the Service
  9. Click the following button in the Request1 window, to submit the specified request: 
    submit request buttonYou view the response of the invocation as shown below.
    response of the invocation

Using the in-built Swagger UI

Once you add a Swagger asset, which is associated with a lively available REST service to WSO2 Governance Registry, you can invoke it using the in-built Swagger UI in WSO2 G-Reg Store as explained below.

Adding the REST Service

This example uses a publicly available live REST Service sample. For instructions on adding this REST Service to WSO2 G-Reg using the underlying Swagger file, see Adding a REST Service.

Invoking the REST Service using the in-built Swagger UI

Follow the steps below to invoke the added service using the in-built Swagger UI.

  1. Click the following Go to Store button in the top right hand corner of the G-Reg Publisher Home Page, to access the G-Rg Store: 
    Go To Store button
  2. Log in to the G-Reg Store using the following URL and admin/admin credentials: https://<G-REG_HOST>:<G-REG_PORT>/store
  3. Locate the REST Service that you added, and click on it as shown below.
  4. Click the following Swagger UI button, to invoke the Service using the in-built Swagger UI: 
    Swagger UI button
  5. Click the pet link in the Swagger UI, and then click on the GET /pet/{petId} box to expand it as shown below.
  6. Enter a value for petId, and click the Try it out! button as shown below, to make an invocation.
  7. Click the icon next to the address bar of your browser, and then click Load unsafe scripts (if you are using Google Chrome) as shown below.

    This step is required to enable scripts from unauthenticated sources since by default they are blocked in Web browsers as a standard. Hence, if your page supports http, it will not allow to load content which uses the https protocol and vice versa. You will view different message pop-ups depending on the Web browser you use. For more information on this, see Chrome and Firefox: Blocked Mixed (HTTPS and HTTP) Content.

    load unsafe scripts by Web browser

  8. Repeat steps 6 and 7 above. You view the response of the Service invocation as shown below.
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.