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

Commenting on a Resource

You can also comment on a resource using the registry. The following lines of code illustrate how to create a comment object and call the registry instance:

Comment c1 = new Comment();

c1.setText("This is my comment");

String commentPath = registry.addComment("/c1/c2/r2", c1);

The above lines of code will add a comment to the resource named: "c1/c2/r2 ."

Edit a Comment

You can also make changes to comments you have already made using the registry instance. Here, you need the path and new text for the comment which is being added. For example, to change from "This is my comment" to "This is cool," do the following:

registry.editComment(commentPath, "This is cool"); // Here commentPath have a value something like "/c1/c2/r2;comment:1"

Remove a Comment

A comment can be removed using the comment path. The following code shows how this is done:


Retrieving Comments Made About a Resource

Comments about a specific resource can be retrieved using the following code:



See also Comments and Ratings to learn how to manage commenting using the Management Console.

  • No labels