Author: chathura
Date: Fri Jan 25 08:31:58 2008
New Revision: 12918

Log:


Fixed resource updating issue for root resource.
Fixed the resource renaming issue.
Fixed the resource import issue for root collection.



Modified:
   
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
   
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/DefaultMediaTypeHandler.java
   
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/ResourceHandler.java
   trunk/registry/pom.xml

Modified: 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
==============================================================================
--- 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
  (original)
+++ 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
  Fri Jan 25 08:31:58 2008
@@ -335,11 +335,16 @@
             throw new RegistryException(msg);
         }
 
+        // if the current path and the new resource path are same, we don't 
want to do anything
+        if (currentPath.equals(newPath)) {
+            return currentPath;
+        }
+
         String userID = User.getCurrentUser();
 
         Connection conn = getConnection();
 
-        if (resourceExists(currentPath) && !currentPath.equals(newPath)) {
+        if (resourceExists(currentPath)) {
 
             if (!resourceExists(newPath)) {
 

Modified: 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/DefaultMediaTypeHandler.java
==============================================================================
--- 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/DefaultMediaTypeHandler.java
    (original)
+++ 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/builtin/DefaultMediaTypeHandler.java
    Fri Jan 25 08:31:58 2008
@@ -247,6 +247,11 @@
     private void activateParentCollections(String path,
                                            Connection conn) throws 
SQLException, RegistryException {
 
+        if (path.equals(RegistryConstants.ROOT_PATH)) {
+            // if we are at root, there are no parent collections.
+            return;
+        }
+
         String[] parts = path.split(RegistryConstants.PATH_SEPARATOR);
 
         String currentPath = RegistryConstants.ROOT_PATH + parts[1];

Modified: 
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/ResourceHandler.java
==============================================================================
--- 
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/ResourceHandler.java
     (original)
+++ 
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/ResourceHandler.java
     Fri Jan 25 08:31:58 2008
@@ -33,7 +33,13 @@
 
         String parentPath = request.getParameter("path");
         String resourceName = request.getParameter("filename");
-        String resourcePath = parentPath + RegistryConstants.PATH_SEPARATOR + 
resourceName;
+
+        String resourcePath;
+        if (RegistryConstants.ROOT_PATH.equals(parentPath)) {
+            resourcePath = RegistryConstants.ROOT_PATH + resourceName;
+        } else {
+            resourcePath = parentPath + RegistryConstants.PATH_SEPARATOR + 
resourceName;
+        }
 
         String fetchURL = request.getParameter("fetchURL");
         String mediaType = request.getParameter("mediaType");

Modified: trunk/registry/pom.xml
==============================================================================
--- trunk/registry/pom.xml      (original)
+++ trunk/registry/pom.xml      Fri Jan 25 08:31:58 2008
@@ -384,7 +384,7 @@
         <!--<opensymphony.version>2.6.11</opensymphony.version>-->
         <hsqldb.version>1.8.0</hsqldb.version>
          <!--For Abdera-->
-        <abdera.version>0.4.0-incubating-SNAPSHOT</abdera.version>
+        <abdera.version>0.395</abdera.version>
         <httpclient.version>3.0.1</httpclient.version>
         <axiom.version>1.2.5</axiom.version>
         <stax.version>1.0.1</stax.version>

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

Reply via email to