Author: deepal
Date: Tue Jan 29 04:09:10 2008
New Revision: 13140

Log:

fixing URL encoding issue and comment serialization problem 

Modified:
   
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Comment.java
   
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
   
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java

Modified: 
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Comment.java
==============================================================================
--- 
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Comment.java 
    (original)
+++ 
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Comment.java 
    Tue Jan 29 04:09:10 2008
@@ -24,14 +24,14 @@
 public class Comment {
 
     /** Path of the comment. Each comment has a path in the form 
/projects/esb/config.xml;comments:12 */
-    private String commentPath;
+    private transient String commentPath;
 
-    private String text;
-    private String user;
-    private Date time;
+    private transient String text;
+    private transient String user;
+    private transient Date time;
 
     /** Path of the resource on which this comment is made. */
-    private String resourcePath;
+    private transient String resourcePath;
 
     public Comment() {
     }

Modified: 
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
==============================================================================
--- 
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
    (original)
+++ 
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
    Tue Jan 29 04:09:10 2008
@@ -19,6 +19,7 @@
 package org.wso2.registry.app;
 
 import org.apache.abdera.Abdera;
+import org.apache.abdera.i18n.text.UrlEncoding;
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.*;
 import org.apache.abdera.parser.Parser;
@@ -580,6 +581,8 @@
                                               Feed feed) {
         for (String value : values) {
             String nodeLink = baseURI + "atom" + value;
+            nodeLink = RemoteRegistry.encodeURL(nodeLink);
+            value = RemoteRegistry.encodeURL(value);
             Entry entry = abdera.getFactory().newEntry();
             entry.addLink(nodeLink);
             entry.setTitle(value);
@@ -661,7 +664,7 @@
         String uri = request.getUri().toString();
         uri = uri.replaceAll(path + "atom", "");
         try {
-            uri = URLDecoder.decode(uri,"UTF-8");
+            uri =  URLDecoder.decode(uri,"utf-8");
         } catch (UnsupportedEncodingException e) {
 
         }

Modified: 
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
==============================================================================
--- 
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
  (original)
+++ 
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
  Tue Jan 29 04:09:10 2008
@@ -19,6 +19,8 @@
 package org.wso2.registry.app;
 
 import org.apache.abdera.Abdera;
+import org.apache.abdera.i18n.text.UrlEncoding;
+import org.apache.abdera.i18n.text.Filter;
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.*;
 import org.apache.abdera.protocol.Response;
@@ -701,11 +703,9 @@
     }
 
     public static String encodeURL(String path){
-        try {
-            return URLEncoder.encode(path,"UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            return path;
-        }
+        //I know I should use URLEncoder but when I used that it tries
+        //  to encode "/" as well which is not need here
+        return path.replaceAll(" " ,"+");
     }
 
 }

_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev

Reply via email to