This documentation is for WSO2 Governance Registry 5.1.0. View documentation for the latest release.
||
Skip to end of metadata
Go to start of metadata


Rating a Resource

In order to rate a resource based on our judgment, you can use the registry instance. Rating a resource can be done using the following line of code:

registry.rateResource("c1/c2/r2 " , 4);

Retrieving the Average Rating of a Resource

An average of all ratings of a particular resource can be retrieved. This can be done using the following line of code:

registry.getAverageRating("c1/c2/r2");

Retrieving the Rating Given to the Resource by a Particular User

When a rating given by a particular user for a resource is needed, it can be done using the following line of code:

registry.getRating("c1/c2/r2", "wso2_admin"); // rating given for r2 by wso2 admin

See also Comments and Ratings to learn how to manage rating in the Management Console.

  • No labels