Author: deepal
Date: Tue Jan 29 01:35:54 2008
New Revision: 13125
Log:
fixing REGISTRY-118
Modified:
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/CommentTest.java
Modified:
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
==============================================================================
---
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
(original)
+++
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
Tue Jan 29 01:35:54 2008
@@ -270,6 +270,11 @@
String entry_id = getRealPath(request);
String values[] = splitPath(entry_id);
String operation = values[1];
+ if (operation !=null ) {
+ if (operation.indexOf(":") >0) {
+ operation =
operation.substring(0,operation.indexOf(":"));
+ }
+ }
if (RegistryConstants.PARAMETER_RESTORE.equals(operation)) {
String version = values[0];
getSecureRegistry(request).restoreVersion(version);
@@ -286,9 +291,8 @@
String rate = entry.getContent();
getSecureRegistry(request).rateResource(path,
Integer.parseInt(rate));
} else if
(RegistryConstants.PARAMETER_COMMENTS.equals(operation)) {
- String path = values[0];
String commentString = entry.getContent();
- getSecureRegistry(request).editComment(path,
commentString);
+ getSecureRegistry(request).editComment(values[0] + ";" +
values[1], commentString);
}
}
return new EmptyResponseContext(200);
Modified:
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/CommentTest.java
==============================================================================
---
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/CommentTest.java
(original)
+++
trunk/registry/modules/core/src/test/java/org/wso2/registry/app/CommentTest.java
Tue Jan 29 01:35:54 2008
@@ -384,19 +384,23 @@
assertTrue(c1.getText() + " is not associated for resource
/c10/c11/r1.",
commentTexts.contains(c1.getText()));
registry.editComment(comments[0].getCommentPath(), "This is the
edited comment");
+ comments = registry.getComments("/c10/c11/r1");
+ System.out.println(comments);
+ Resource resource = registry.get(comments[0].getCommentPath());
+ assertEquals("This is the edited comment",resource.getContent());
} catch (RegistryException e) {
e.printStackTrace();
fail("Failed to get comments form URL:/c10/c11/r1;comments");
}
/*Edit comment goes here*/
- /*
+
try{
registry.editComment("/c10/c11/r1","This is the edited comment");
}catch(RegistryException e){
fail("Failed to Edit comment on /c10/c11/r1");
}
- */
+
}
public void testCommentDelete() {
_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev