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.
-  Log in to the G-Reg Store if you are not already logged in. For instructions, see Searching for an Asset in Store.
- Search and locate the asset. For instructions, see Searching for an Asset in Store.
- Click on the asset.
You view the following information about it as shown below.
Details of the information you view are as follows.
Information | Description |
---|---|
Overview | The name and version that you specified, when creating this asset. |
Lifecycle | The 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. |
Associations | Associations that are added to the asset. For more information on associations, see Adding Associations for an Asset. |
Swagger | The 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:
- Navigate to theÂ
<G-REG_HOME>
/repository/deployment/server/jaggeryapps/store/config/store-tenant.json
file. 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:
- 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
- Click Main, and then click Browse in the Resources menu as shown below.
- Select theÂ
/_system/config/store/configs/store.json
file as shown below.
- Click the Edit as text option in the Content section.
- 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.
- Click the User Reviews tab.
Add the review, a rating for the asset, and then click Post Review as shown below.
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.
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.
- Click the ->OPTIONS button in the top right-hand corner of the screen to expand the notification settings:Â
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.
Click the following notifications button in the right hand corner of the screen:
- 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.
Navigate to theÂ
<G-REG_HOME>/repository/deployment/server/jaggeryapps/store/extensions/assets/restservice/asset.js
 file.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 } } };
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.Â
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.
You view the content of the service as shown below.
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.
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.
- 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:Â
- Log in to the G-Reg Store using the following URL and admin/admin credentials:Â https://<G-REG_HOST>:<G-REG_PORT>/store
- Locate the REST Service that you added, and click on it as shown below.
- Click the following Swagger UI button, to invoke the Service using the in-built Swagger UI:Â
- Click the pet link in the Swagger UI, and then click on the GET /pet/{petId} box to expand it as shown below.
- Enter a value for petId, and click the Try it out! button as shown below, to make an invocation.
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.
- Repeat steps 6 and 7 above. You view the response of the Service invocation as shown below.