RequestContext context = new RequestContext(this, repository, versionRepository);
try {
// start the transaction
beginTransaction();
ResourcePath processedPath = new ResourcePath(resourcePath);
context.setResourcePath(processedPath);
context.setComment(comment);
context.setOldComments(getComments(processedPath.getPath()));
String output = registryContext.getHandlerManager().addComment(context);
if (!context.isSimulation()) {
if (!context.isProcessingComplete()) {
if (!processedPath.isCurrentVersion()) {
String msg = "Failed to add comment to the resource " + processedPath +
". Given path refers to an archived version of the resource.";
log.error(msg);
throw new RegistryException(msg);
}
resourcePath = processedPath.getPath();
String userName = CurrentSession.getUser();
if (!AuthorizationUtils.authorize(resourcePath, ActionConstants.GET)) {
String msg =