Unknown macro: {next_previous_links}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »



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. For this you need the path and new text for the comment that 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:

registry.removeComment(commentpath);

Retrieving comments made about a resource

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

registry.getComments("/c1/c2/r2");
  • No labels