[Registry-dev] svn commit r19231 - in trunk/registry/modules: core/src/main/java/org/wso2/registry core/src/main/java/org/wso2/registry/app core/src/main/java/org/wso2/registry/jdbc core/src/main/java/org/wso2/registry/jdbc/dao core/src/main/java/org/wso2/registry/jdbc/handlers core/src/main/java/org/wso2/registry/jdbc/handlers/builtin core/src/main/java/org/wso2/registry/jdbc/handlers/filters core/src/main/java/org/wso2/registry/utils extensions/src/org/wso2/registry/aspects extensions/src/org/wso2/registry/handlers samples/collection-handler-sample/src/org/wso2/registry/samples/handlers/servers webapps/src/main/java/org/wso2/registry/web/actions webapps/src/main/java/org/wso2/registry/web/actions/utils webapps/src/main/java/org/wso2/registry/web/utils webapps/src/main/webapp/admin

chathura at wso2.com chathura at wso2.com
Mon Jul 14 03:20:30 PDT 2008


Author: chathura
Date: Mon Jul 14 03:20:30 2008
New Revision: 19231
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=19231

Log:

Implemented uniform URL handling method for embedded registry.
Now paths are processed in the BasicRegistry and pure resource path and parameters are separated. These path and parameters are stored in ResourcePath onjects.
So the components activated after that can simply use ResourcePath objects without processing the complete path.

Changed the URL pattern for representing versions as discussed in registry-dev at . New pattern is <resource path>;version:<version number>



Added:
   trunk/registry/modules/core/src/main/java/org/wso2/registry/ResourcePath.java
   trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/utils/WebResourcePath.java
      - copied, changed from r19117, /trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/utils/ResourcePath.java
Removed:
   trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/utils/ResourcePath.java
Modified:
   trunk/registry/modules/core/src/main/java/org/wso2/registry/RegistryConstants.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/ResourceImpl.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RegistryResolver.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/BasicRegistry.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/VersionRepository.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/ResourceVersionDAO.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/RequestContext.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/UIEnabledHandler.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/XSLTBasedUIEnabledHandler.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/CommentCollectionURLHandler.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/CommentURLHandler.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/RatingCollectionURLHandler.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/RatingURLHandler.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/SQLQueryHandler.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/TagCollectionURLHandler.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/TagURLHandler.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/filters/MediaTypeMatcher.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/filters/URLMatcher.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/utils/RegistryUtils.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/utils/VersionedPath.java
   trunk/registry/modules/extensions/src/org/wso2/registry/aspects/ReviewLifecycle.java
   trunk/registry/modules/extensions/src/org/wso2/registry/handlers/Axis2RepositoryHandler.java
   trunk/registry/modules/extensions/src/org/wso2/registry/handlers/SynapseRepositoryHandler.java
   trunk/registry/modules/extensions/src/org/wso2/registry/handlers/WSDLMediaTypeHandler.java
   trunk/registry/modules/extensions/src/org/wso2/registry/handlers/XSDMediaTypeHandler.java
   trunk/registry/modules/samples/collection-handler-sample/src/org/wso2/registry/samples/handlers/servers/ServerCollectionHandler.java
   trunk/registry/modules/samples/collection-handler-sample/src/org/wso2/registry/samples/handlers/servers/ServerDetailsHandler.java
   trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/CollectionPagesViewAction.java
   trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/CollectionViewAction.java
   trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/ResourceDetailsAction.java
   trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/utils/ResourcesUtil.java
   trunk/registry/modules/webapps/src/main/webapp/admin/header.jsp
   trunk/registry/modules/webapps/src/main/webapp/admin/registry-resources.jsp

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/RegistryConstants.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/RegistryConstants.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/RegistryConstants.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/RegistryConstants.java	Mon Jul 14 03:20:30 2008
@@ -125,6 +125,7 @@
 
     // Separator used to access Registry metadata - i.e. "/resource$tags"
     public static final String URL_SEPARATOR = ";";
+    public static final String URL_PARAMETER_SEPERATOR = ":";
 
     public static final String VIEW_ACTION = ";view";
     public static final String VIEW_PROPERTY = "view";

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/ResourceImpl.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/ResourceImpl.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/ResourceImpl.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/ResourceImpl.java	Mon Jul 14 03:20:30 2008
@@ -282,7 +282,7 @@
             permanentPath = null;
         } else {
             permanentPath =
-                    path + RegistryConstants.URL_SEPARATOR + "version=" + matchingSnapshotID;
+                    path + RegistryConstants.URL_SEPARATOR + "version:" + matchingSnapshotID;
         }
     }
 

Added: trunk/registry/modules/core/src/main/java/org/wso2/registry/ResourcePath.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/ResourcePath.java?pathrev=19231
==============================================================================
--- (empty file)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/ResourcePath.java	Mon Jul 14 03:20:30 2008
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.wso2.registry;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * This class represents resource paths used inside the embedded registry. i.e. paths in the form
+ * /c1/c2/r1;version:2;view:1
+ */
+public class ResourcePath {
+
+    private String completePath;
+
+    private String path;
+
+    private Map <String, String> parameters = new HashMap <String, String> ();
+
+    public ResourcePath(String rawPath) {
+
+        completePath = rawPath;
+
+        String[] parts = rawPath.split(RegistryConstants.URL_SEPARATOR);
+
+        path = parts[0];
+
+        for (int i = 1; i < parts.length; i++) {
+            String[] paramParts = parts[i].split(RegistryConstants.URL_PARAMETER_SEPERATOR);
+            String key = paramParts[0];
+            String value = null;
+            if (paramParts.length > 1) {
+                value = paramParts[1];
+            }
+
+            // if a parameter has more than one value, they are just appended to the value.
+            // e.g. raw path: /c1/r1;p1:v1:v2
+            // parameter name: p1
+            // parameter value: v1:v2
+            for (int j = 2; j < paramParts.length; j++) {
+                value = value + RegistryConstants.URL_PARAMETER_SEPERATOR + paramParts[j];
+            }
+
+            parameters.put(key, value);
+        }
+    }
+
+
+    public String getCompletePath() {
+        return completePath;
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public boolean parameterExists(String key) {
+        return parameters.containsKey(key);
+    }
+
+    public String getParameterValue(String key) {
+        return parameters.get(key);
+    }
+}

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RegistryResolver.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RegistryResolver.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RegistryResolver.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RegistryResolver.java	Mon Jul 14 03:20:30 2008
@@ -161,7 +161,7 @@
             String discriminator = parts[1];
 
             // If this is a version request, don't do anything special.  Otherwise process.
-            if (discriminator.startsWith("version=")) {
+            if (discriminator.startsWith("version:")) {
                 if (parts.length > 2) {
                     // Make sure this is a restore...
                     if (parts[2].equals("restore")) {

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/BasicRegistry.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/BasicRegistry.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/BasicRegistry.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/BasicRegistry.java	Mon Jul 14 03:20:30 2008
@@ -102,23 +102,24 @@
     public Resource get(String path) throws RegistryException {
 
         path = RegistryUtils.prepareGeneralPath(path);
+        ResourcePath resourcePath = new ResourcePath(path);
 
         // check if this path refers to a resource referred by a URL query (e.g. comment)
 
         RequestContext requestContext = new RequestContext(this, repository);
 
-        if (path.endsWith(RegistryConstants.VIEW_ACTION)) {
-            path =  path.substring(0, path.length() - RegistryConstants.VIEW_ACTION.length());
-            requestContext.setProperty(
-                    RegistryConstants.UI_CONTENT_PROPERTY, RegistryConstants.VIEW_PROPERTY);
-
-        } else if (path.endsWith(RegistryConstants.EDIT_ACTION)) {
-            path = path.substring(0, path.length() - RegistryConstants.EDIT_ACTION.length());
-            requestContext.setProperty(
-                    RegistryConstants.UI_CONTENT_PROPERTY, RegistryConstants.EDIT_PROPERTY);
-        }
+        //if (path.endsWith(RegistryConstants.VIEW_ACTION)) {
+        //    path =  path.substring(0, path.length() - RegistryConstants.VIEW_ACTION.length());
+        //    requestContext.setProperty(
+        //            RegistryConstants.UI_CONTENT_PROPERTY, RegistryConstants.VIEW_PROPERTY);
+        //
+        //} else if (path.endsWith(RegistryConstants.EDIT_ACTION)) {
+        //    path = path.substring(0, path.length() - RegistryConstants.EDIT_ACTION.length());
+        //    requestContext.setProperty(
+        //            RegistryConstants.UI_CONTENT_PROPERTY, RegistryConstants.EDIT_PROPERTY);
+        //}
 
-        requestContext.setResourcePath(path);
+        requestContext.setResourcePath(resourcePath);
 
         Resource resource = registryContext.getHandlerManager().get(requestContext);
 
@@ -130,9 +131,9 @@
         }
 
         if (resource == null) {
-            VersionedPath versionedPath = RegistryUtils.getVersionedPath(path);
+            VersionedPath versionedPath = RegistryUtils.getVersionedPath(resourcePath);
             if (versionedPath.getVersion() == -1) {
-                resource = repository.get(path);
+                resource = repository.get(resourcePath.getPath());
             } else {
                 resource = versionRepository.get(versionedPath);
             }
@@ -155,9 +156,10 @@
 
         Collection collection;
 
-        VersionedPath versionedPath = RegistryUtils.getVersionedPath(path);
+        ResourcePath resourcePath = new ResourcePath(path);
+        VersionedPath versionedPath = RegistryUtils.getVersionedPath(resourcePath);
         if (versionedPath.getVersion() == -1) {
-            collection = repository.get(path, start, pageSize);
+            collection = repository.get(resourcePath.getPath(), start, pageSize);
         } else {
             collection = versionRepository.get(versionedPath, start, pageSize);
         }
@@ -167,9 +169,11 @@
 
     public boolean resourceExists(String path) throws RegistryException {
 
-        VersionedPath versionedPath = RegistryUtils.getVersionedPath(path);
+        ResourcePath resourcePath = new ResourcePath(path);
+        VersionedPath versionedPath = RegistryUtils.getVersionedPath(resourcePath);
 
-        return versionedPath.getVersion() == -1 && repository.resourceExists(path);
+        return versionedPath.getVersion() == -1 &&
+                repository.resourceExists(resourcePath.getPath());
     }
 
     /**
@@ -188,12 +192,13 @@
             throws RegistryException {
 
         suggestedPath = RegistryUtils.prepareGeneralPath(suggestedPath);
+        ResourcePath resourcePath = new ResourcePath(suggestedPath);
 
         RequestContext requestContext = new RequestContext(this, repository);
-        requestContext.setResourcePath(suggestedPath);
+        requestContext.setResourcePath(resourcePath);
         requestContext.setResource(resource);
 
-        if (!suggestedPath.equals(RegistryConstants.ROOT_PATH)) {
+        if (!RegistryConstants.ROOT_PATH.equals(resourcePath.getPath())) {
             registryContext.getHandlerManager().putChild(requestContext);
         }
 
@@ -203,7 +208,7 @@
 
         if (!requestContext.isProcessingComplete()) {
             actualPath = suggestedPath;
-            repository.put(suggestedPath, resource);
+            repository.put(resourcePath.getPath(), resource);
 
             // we are always creating versions for resources (files), if the resource has changed.
             if (!(resource instanceof Collection) &&
@@ -223,13 +228,16 @@
             throws RegistryException {
 
         suggestedPath = RegistryUtils.prepareGeneralPath(suggestedPath);
+        ResourcePath resourcePath = new ResourcePath(suggestedPath);
 
         RequestContext importChildContext = new RequestContext(this, repository);
-        importChildContext.setResourcePath(RegistryUtils.getParentPath(suggestedPath));
+        ResourcePath parentPath =
+                new ResourcePath(RegistryUtils.getParentPath(resourcePath.getPath()));
+        importChildContext.setResourcePath(parentPath);
         registryContext.getHandlerManager().importChild(importChildContext);
 
         RequestContext requestContext = new RequestContext(this, repository);
-        requestContext.setResourcePath(suggestedPath);
+        requestContext.setResourcePath(resourcePath);
         requestContext.setSourceURL(sourceURL);
         requestContext.setResource(metadata);
 
@@ -245,8 +253,8 @@
                 metadata = requestContext.getResource();
             }
 
-            repository.importResource(suggestedPath, sourceURL, metadata);
-            createVersion(suggestedPath);
+            repository.importResource(resourcePath.getPath(), sourceURL, metadata);
+            createVersion(resourcePath.getPath());
         }
 
         logsDAO.addLog(savedPath, CurrentSession.getUser(), LogEntry.UPDATE, null);
@@ -264,16 +272,18 @@
      */
     public synchronized void delete(String path) throws RegistryException {
 
+        ResourcePath resourcePath = new ResourcePath(path);
         RequestContext requestContext = new RequestContext(this, repository);
-        requestContext.setResourcePath(path);
+        requestContext.setResourcePath(resourcePath);
 
         registryContext.getHandlerManager().delete(requestContext);
 
         if (!requestContext.isProcessingComplete()) {
-            repository.delete(path);
+            repository.delete(resourcePath.getPath());
         }
 
-        logsDAO.addLog(path, CurrentSession.getUser(), LogEntry.DELETE_RESOURCE, null);
+        logsDAO.addLog(
+                resourcePath.getPath(), CurrentSession.getUser(), LogEntry.DELETE_RESOURCE, null);
     }
 
     public String rename(String currentPath, String newName) throws RegistryException {

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/VersionRepository.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/VersionRepository.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/VersionRepository.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/VersionRepository.java	Mon Jul 14 03:20:30 2008
@@ -119,7 +119,7 @@
         List <String> versionPaths = new ArrayList();
         for (Long snapshotNumber : snapshotNumbers) {
             String versionPath = resourcePath + RegistryConstants.URL_SEPARATOR +
-                    "version=" + snapshotNumber;
+                    "version:" + snapshotNumber;
             versionPaths.add(versionPath);
         }
 
@@ -174,7 +174,8 @@
 
     public void restoreVersion(String versionPath) throws RegistryException {
 
-        VersionedPath versionedPath = RegistryUtils.getVersionedPath(versionPath);
+        ResourcePath resourcePath = new ResourcePath(versionPath);
+        VersionedPath versionedPath = RegistryUtils.getVersionedPath(resourcePath);
         if (versionedPath.getVersion() == -1) {
             String msg = "Failed to restore resource. " +
                     versionedPath + " is not a valid version path.";

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/ResourceVersionDAO.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/ResourceVersionDAO.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/ResourceVersionDAO.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/ResourceVersionDAO.java	Mon Jul 14 03:20:30 2008
@@ -481,7 +481,7 @@
                 ps2.close();
 
                 if (AuthorizationUtils.authorize(childID, ActionConstants.GET)) {
-                    String childPath = path + ";version=" + snapshotID;
+                    String childPath = path + ";version:" + snapshotID;
                     childPathList.add(childPath);
                 }
             }
@@ -539,7 +539,7 @@
                     }
                     ps2.close();
 
-                    String childPath = path + ";version=" + snapshotID;
+                    String childPath = path + ";version:" + snapshotID;
                     childPathList.add(childPath);
                 }
             }
@@ -602,7 +602,7 @@
                         }
                         ps2.close();
 
-                        String childPath = path + ";version=" + snapshotID;
+                        String childPath = path + ";version:" + snapshotID;
                         childPathList.add(childPath);
                     }
 
@@ -676,7 +676,7 @@
                         }
                         ps2.close();
 
-                        String childPath = path + ";version=" + snapshotID;
+                        String childPath = path + ";version:" + snapshotID;
                         childPathList.add(childPath);
                     }
 

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/RequestContext.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/RequestContext.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/RequestContext.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/RequestContext.java	Mon Jul 14 03:20:30 2008
@@ -19,6 +19,7 @@
 import org.wso2.registry.Collection;
 import org.wso2.registry.Registry;
 import org.wso2.registry.Resource;
+import org.wso2.registry.ResourcePath;
 import org.wso2.registry.jdbc.Repository;
 
 import java.util.Map;
@@ -41,7 +42,7 @@
     /**
      * Path of the currently processing resource as given by the client of the Registry API
      */
-    private String resourcePath;
+    private ResourcePath resourcePath;
 
     /**
      * Path of the currently processing resource, which may have been modified by Registry impls to
@@ -95,14 +96,14 @@
         this.processingComplete = processingComplete;
     }
 
-    public String getResourcePath() {
+    public ResourcePath getResourcePath() {
         if (resourcePath == null && resource != null) {
-            resourcePath = resource.getPath();
+            resourcePath = new ResourcePath(resource.getPath());
         }
         return resourcePath;
     }
 
-    public void setResourcePath(String resourcePath) {
+    public void setResourcePath(ResourcePath resourcePath) {
         this.resourcePath = resourcePath;
     }
 

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/UIEnabledHandler.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/UIEnabledHandler.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/UIEnabledHandler.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/UIEnabledHandler.java	Mon Jul 14 03:20:30 2008
@@ -18,40 +18,37 @@
 
 import org.wso2.registry.Resource;
 import org.wso2.registry.RegistryConstants;
+import org.wso2.registry.ResourcePath;
 import org.wso2.registry.exceptions.RegistryException;
 
 public abstract class UIEnabledHandler extends Handler {
 
     public Resource get(RequestContext requestContext) throws RegistryException {
 
-        // UI enabling actions should always position at the end of the resource path.
+        ResourcePath resourcePath = requestContext.getResourcePath();
+        if (resourcePath.parameterExists(RegistryConstants.VIEW_PROPERTY)) {
+            Resource resource = getView(resourcePath.getParameterValue(RegistryConstants.VIEW_PROPERTY), requestContext);
+            resource.setProperty(
+                    RegistryConstants.UI_CONTENT_PROPERTY, RegistryConstants.UI_HTML);
+            return resource;
+
+        } else if (resourcePath.parameterExists(RegistryConstants.EDIT_PROPERTY)) {
+            Resource resource = getEdit(resourcePath.getParameterValue(RegistryConstants.EDIT_PROPERTY), requestContext);
+            resource.setProperty(
+                    RegistryConstants.UI_CONTENT_PROPERTY, RegistryConstants.UI_HTML);
+            return resource;
 
-        String UIAction =
-                (String) requestContext.getProperty(RegistryConstants.UI_CONTENT_PROPERTY);
-        if (UIAction != null) {
-            if (RegistryConstants.VIEW_PROPERTY.equals(UIAction)) {
-                Resource resource = getView(requestContext);
-                resource.setProperty(
-                        RegistryConstants.UI_CONTENT_PROPERTY, RegistryConstants.UI_HTML);
-                return resource;
-
-            } else if (RegistryConstants.EDIT_PROPERTY.equals(UIAction)) {
-                Resource resource = getEdit(requestContext);
-                resource.setProperty(
-                        RegistryConstants.UI_CONTENT_PROPERTY, RegistryConstants.UI_HTML);
-                return resource;
-            }
+        } else {
+            return getRawResource(requestContext);
         }
-
-        return getRawResource(requestContext);
     }
 
     public abstract Resource getRawResource(RequestContext requestContext)
             throws RegistryException;
 
-    public abstract Resource getView(RequestContext requestContext)
+    public abstract Resource getView(String viewName, RequestContext requestContext)
             throws RegistryException;
 
-    public abstract Resource getEdit(RequestContext requestContext)
+    public abstract Resource getEdit(String editName, RequestContext requestContext)
             throws RegistryException;
 }

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/XSLTBasedUIEnabledHandler.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/XSLTBasedUIEnabledHandler.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/XSLTBasedUIEnabledHandler.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/XSLTBasedUIEnabledHandler.java	Mon Jul 14 03:20:30 2008
@@ -77,14 +77,16 @@
         }
     }
 
-    public Resource getView(RequestContext requestContext) throws RegistryException {
+    public Resource getView(String viewName, RequestContext requestContext)
+            throws RegistryException {
 
         if (viewTransformer == null) {
             return getRawResource(requestContext);
         }
 
         ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
-        Resource resource = requestContext.getRegistry().get(requestContext.getResourcePath());
+        Resource resource =
+                requestContext.getRegistry().get(requestContext.getResourcePath().getPath());
 
         try {
             viewTransformer.setParameter("resourcePath", requestContext.getResourcePath());
@@ -105,14 +107,16 @@
         return resource;
     }
 
-    public Resource getEdit(RequestContext requestContext) throws RegistryException {
+    public Resource getEdit(String editName, RequestContext requestContext)
+            throws RegistryException {
 
         if (editTransformer == null) {
             return getRawResource(requestContext);
         }
 
         ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
-        Resource resource = requestContext.getRegistry().get(requestContext.getResourcePath());
+        Resource resource =
+                requestContext.getRegistry().get(requestContext.getResourcePath().getPath());
 
         try {
             editTransformer.setParameter("resourcePath", requestContext.getResourcePath());

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/CommentCollectionURLHandler.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/CommentCollectionURLHandler.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/CommentCollectionURLHandler.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/CommentCollectionURLHandler.java	Mon Jul 14 03:20:30 2008
@@ -21,34 +21,25 @@
 import org.wso2.registry.jdbc.handlers.Handler;
 import org.wso2.registry.jdbc.handlers.RequestContext;
 
+/**
+ * Handles paths of the form <pure resource path>;comments
+ * e.g. /projects/mashup/config.xml;comments
+ */
 public class CommentCollectionURLHandler extends Handler {
 
     public Resource get(RequestContext requestContext) throws RegistryException {
 
-        String url = requestContext.getResourcePath();
+        ResourcePath resourcePath = requestContext.getResourcePath();
 
-        String[] parts = url.split(RegistryConstants.URL_SEPARATOR);
-
-        if (parts.length != 2) {
-            return null;
-        }
-
-        if (parts[0].length() == 0) {
-            return null;
-        }
-
-        if (!parts[1].equals("comments")) {
-            return null;
-        }
-
-        Comment[] comments = requestContext.getRegistry().getComments(parts[0]);
+        Comment[] comments = requestContext.getRegistry().getComments(resourcePath.getPath());
         CollectionImpl resource = new CollectionImpl();
-        resource.setDescription("Comments for '" + parts[0] + "'");
-        resource.setPath(parts[0]);
+        resource.setDescription("Comments for '" + resourcePath.getPath() + "'");
+        resource.setPath(resourcePath.getPath());
         resource.setContent(comments);
 
         requestContext.setProcessingComplete(true);
         return resource;
+
     }
 
     public void put(RequestContext requestContext) throws RegistryException {
@@ -68,6 +59,6 @@
     }
 
     public void importChild(RequestContext requestContext) throws RegistryException {
-        
+
     }
 }

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/CommentURLHandler.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/CommentURLHandler.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/CommentURLHandler.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/CommentURLHandler.java	Mon Jul 14 03:20:30 2008
@@ -18,10 +18,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.wso2.registry.ActionConstants;
-import org.wso2.registry.Comment;
-import org.wso2.registry.RegistryConstants;
-import org.wso2.registry.Resource;
+import org.wso2.registry.*;
 import org.wso2.registry.exceptions.RegistryException;
 import org.wso2.registry.jdbc.dao.CommentsDAO;
 import org.wso2.registry.jdbc.dao.ResourceDAO;
@@ -33,6 +30,10 @@
 import org.wso2.registry.users.UserStoreException;
 import org.wso2.registry.utils.AuthorizationUtils;
 
+/**
+ * Handles paths of the form <pure resource path>;comments:<comment ID>
+ * e.g. /projects/ids/config.xml;comments:2
+ */
 public class CommentURLHandler extends Handler {
 
     private static final Log log = LogFactory.getLog(CommentURLHandler.class);
@@ -41,47 +42,36 @@
 
     public Resource get(RequestContext requestContext) throws RegistryException {
 
-        String url = requestContext.getResourcePath();
-        String[] parts = url.split(RegistryConstants.URL_SEPARATOR);
+        ResourcePath resourcePath = requestContext.getResourcePath();
 
-        if (parts.length != 2) {
-            return null;
-        }
-
-        if (parts[0].length() == 0) {
-            return null;
-        }
+        String commentID = resourcePath.getParameterValue("comments");
+        if (commentID != null) {
 
-        if (!parts[1].startsWith("comments:")) {
-            return null;
-        }
+            long cID;
+            try {
+                cID = Long.parseLong(commentID);
+
+            } catch (NumberFormatException e) {
+                // note that this might NOT be an exceptional scenario. there could be a different URL
+                // form, which contains strings after "comment".
+                // it is just that it is not the URL we expect here
+                return null;
+            }
 
-        String commentID = parts[1].substring("comments:".length());
-        if (!(commentID.length() > 0)) {
-            return null;
-        }
+            Comment comment = CommentsDAO.getComment(cID);
 
-        long cID;
-        try {
-            cID = Long.parseLong(commentID);
-
-        } catch (NumberFormatException e) {
-            // note that this might not be an exceptional scenario. there could be a different URL
-            // form, which contains strings after "comment".
-            // it is just that it is not the URL we expect here
-            return null;
-        }
+            if (comment == null) {
+                String msg = "Requested comment with ID: " + cID + " is not available.";
+                log.info(msg);
+                throw new RegistryException(msg);
+            }
 
-        Comment comment = CommentsDAO.getComment(cID);
+            requestContext.setProcessingComplete(true);
+            return comment;
 
-        if (comment == null) {
-            String msg = "Requested comment with ID: " + cID + " is not available.";
-            log.info(msg);
-            throw new RegistryException(msg);
         }
 
-        requestContext.setProcessingComplete(true);
-        return comment;
+        return null;
     }
 
     public void put(RequestContext requestContext) throws RegistryException {
@@ -93,71 +83,57 @@
     public void delete(RequestContext requestContext) throws RegistryException {
 
         requestContext.setProcessingComplete(false);
-        String path = requestContext.getResourcePath();
-        String[] parts = path.split(RegistryConstants.URL_SEPARATOR);
-
-        if (parts.length != 2) {
-            return;
-        }
+        ResourcePath resourcePath = requestContext.getResourcePath();
 
-        if (parts[0].length() == 0) {
-            return;
-        }
-
-        if (!parts[1].startsWith("comments:")) {
-            return;
-        }
+        String commentID = resourcePath.getParameterValue("comments");
+        if (commentID != null) {
 
-        String commentID = parts[1].substring("comments:".length());
-        if (!(commentID.length() > 0)) {
-            return;
-        }
-
-        long cID;
-        try {
-            cID = Long.parseLong(commentID);
-
-        } catch (NumberFormatException e) {
-            // note that this might not be an exceptional scenario. there could be a different URL
-            // form, which contains strings after "comment".
-            // it is just that it is not the URL we expect here
-            return;
-        }
-
-        String userID = CurrentSession.getUser();
-        String authPath = AuthorizationUtils.getAuthorizationPath(path);
-        String commentAuthor;
-
-        Comment comment = CommentsDAO.getComment(cID);
-        commentAuthor = comment.getUser();
-
-        String resourceID = ResourceDAO.getResourceID(authPath);
-
-        // check if the current user has permission to delete this comment.
-        // users who have PUT permission on the commented resource can delete any comment on
-        // that resource. Any user can delete his own comment.
-
-        try {
-            UserRealm realm = CurrentSession.getRealm();
+            long cID;
+            try {
+                cID = Long.parseLong(commentID);
+
+            } catch (NumberFormatException e) {
+                // note that this might not be an exceptional scenario. there could be a different URL
+                // form, which contains strings after "comment".
+                // it is just that it is not the URL we expect here
+                return;
+            }
 
-            if (!userID.equals(commentAuthor) &&
-                    !realm.getAuthorizer().isUserAuthorized(userID, resourceID,
-                            ActionConstants.PUT)) {
+            String userID = CurrentSession.getUser();
+            String authPath = AuthorizationUtils.getAuthorizationPath(resourcePath.getPath());
+            String commentAuthor;
+
+            Comment comment = CommentsDAO.getComment(cID);
+            commentAuthor = comment.getUser();
+
+            String resourceID = ResourceDAO.getResourceID(authPath);
+
+            // check if the current user has permission to delete this comment.
+            // users who have PUT permission on the commented resource can delete any comment on
+            // that resource. Any user can delete his own comment.
+
+            try {
+                UserRealm realm = CurrentSession.getRealm();
+
+                if (!userID.equals(commentAuthor) &&
+                        !realm.getAuthorizer().isUserAuthorized(userID, resourceID,
+                                ActionConstants.PUT)) {
+
+                    String msg = "User: " + userID +
+                            " is not authorized to delete the comment on the resource: " +
+                            authPath;
+                    log.info(msg);
+                    throw new AuthorizationFailedException(msg);
+                }
 
-                String msg = "User: " + userID +
-                        " is not authorized to delete the comment on the resource: " +
-                        authPath;
-                log.info(msg);
-                throw new AuthorizationFailedException(msg);
+            } catch (UserStoreException e) {
+                //
             }
 
-        } catch (UserStoreException e) {
-            //
-        }
-
-        CommentsDAO.deleteComment(cID);
+            CommentsDAO.deleteComment(cID);
 
-        requestContext.setProcessingComplete(true);
+            requestContext.setProcessingComplete(true);
+        }
     }
 
     public void putChild(RequestContext requestContext) throws RegistryException {

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/RatingCollectionURLHandler.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/RatingCollectionURLHandler.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/RatingCollectionURLHandler.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/RatingCollectionURLHandler.java	Mon Jul 14 03:20:30 2008
@@ -22,6 +22,7 @@
 import org.wso2.registry.RegistryConstants;
 import org.wso2.registry.exceptions.RegistryException;
 import org.wso2.registry.Resource;
+import org.wso2.registry.ResourcePath;
 import org.wso2.registry.jdbc.dao.RatingsDAO;
 import org.wso2.registry.jdbc.handlers.Handler;
 import org.wso2.registry.jdbc.handlers.RequestContext;
@@ -29,51 +30,41 @@
 import java.util.ArrayList;
 import java.util.List;
 
+/**
+ * Handles paths of the form <pure resource path>;ratings
+ * e.g. /projects/ids/config.xml;ratings
+ */
 public class RatingCollectionURLHandler extends Handler {
 
     private static final Log log = LogFactory.getLog(RatingCollectionURLHandler.class);
 
     public Resource get(RequestContext requestContext) throws RegistryException {
 
-        String url = requestContext.getResourcePath();
+        ResourcePath resourcePath = requestContext.getResourcePath();
 
-        String[] parts = url.split(RegistryConstants.URL_SEPARATOR);
+        if (resourcePath.parameterExists("ratings") &&
+                resourcePath.getParameterValue("ratings") == null) {
 
-        if (parts.length != 2) {
-            return null;
-        }
-
-        if (parts[0].length() == 0) {
-            return null;
-        }
-
-        if (!parts[1].equals("ratings")) {
-            return null;
-        }
-
-        if (parts[1].length() != "ratings".length()) {
-            return null;
-        }
+            RatingsDAO ratingsDAO = new RatingsDAO();
 
-        String resourcePath = parts[0];
+            CollectionImpl resource = new CollectionImpl();
+            resource.setPath(resourcePath.getCompletePath());
 
-        RatingsDAO ratingsDAO = new RatingsDAO();
+            String[] ratedUserNames = ratingsDAO.getRatedUserNames(resourcePath.getPath());
+            List ratingPaths = new ArrayList();
+            for (String ratedUserName : ratedUserNames) {
+                String ratingPath = resourcePath.getPath() + RegistryConstants.URL_SEPARATOR +
+                        "ratings:" + ratedUserName;
+                ratingPaths.add(ratingPath);
+            }
 
-        CollectionImpl resource = new CollectionImpl();
-        resource.setPath(url);
+            String[] ratingsContent = (String[])ratingPaths.toArray(new String[ratingPaths.size()]);
+            resource.setContent(ratingsContent);
 
-        String[] ratedUserNames = ratingsDAO.getRatedUserNames(resourcePath);
-        List ratingPaths = new ArrayList();
-        for (String ratedUserName : ratedUserNames) {
-            String ratingPath = resourcePath + RegistryConstants.URL_SEPARATOR + "ratings:" +
-                                ratedUserName;
-            ratingPaths.add(ratingPath);
+            return resource;
         }
 
-        String[] ratingsContent = (String[])ratingPaths.toArray(new String[ratingPaths.size()]);
-        resource.setContent(ratingsContent);
-
-        return resource;
+        return null;
     }
 
     public void put(RequestContext requestContext) throws RegistryException {

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/RatingURLHandler.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/RatingURLHandler.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/RatingURLHandler.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/RatingURLHandler.java	Mon Jul 14 03:20:30 2008
@@ -22,52 +22,44 @@
 import org.wso2.registry.exceptions.RegistryException;
 import org.wso2.registry.Resource;
 import org.wso2.registry.ResourceImpl;
+import org.wso2.registry.ResourcePath;
 import org.wso2.registry.jdbc.dao.RatingsDAO;
 import org.wso2.registry.jdbc.handlers.Handler;
 import org.wso2.registry.jdbc.handlers.RequestContext;
 
 import java.util.Date;
 
+/**
+ * Handles paths of the form <pure resource path>;ratings:<username>
+ * e.g. /projects/ids/config.xml;ratings:chathura
+ */
 public class RatingURLHandler extends Handler {
 
     private static final Log log = LogFactory.getLog(RatingURLHandler.class);
 
     public Resource get(RequestContext requestContext) throws RegistryException {
 
-        String url = requestContext.getResourcePath();
+        ResourcePath resourcePath = requestContext.getResourcePath();
 
-        String[] parts = url.split(RegistryConstants.URL_SEPARATOR);
+        String ratedUserName = resourcePath.getParameterValue("ratings");
+        if (ratedUserName != null) {
 
-        if (parts.length != 2) {
-            return null;
-        }
+            int rating = RatingsDAO.getRating(resourcePath.getPath(), ratedUserName);
+            Date ratedTime = RatingsDAO.getRatedTime(resourcePath.getPath(), ratedUserName);
 
-        if (parts[0].length() == 0) {
-            return null;
-        }
+            ResourceImpl resource = new ResourceImpl();
+            resource.setMediaType(RegistryConstants.RATING_MEDIA_TYPE);
+            resource.setContent(rating);
+            resource.setAuthorUserName(ratedUserName);
+            resource.setPath(resourcePath.getCompletePath());
+            resource.setCreatedTime(ratedTime);
+            resource.setLastModified(ratedTime);
+            resource.addProperty("resourcePath", resourcePath.getPath());
 
-        String[] details = parts[1].split(":");
-        if (details.length != 2 || !details[0].equals("ratings") || details[1].length() == 0) {
-            return null;
+            return resource;
         }
 
-        String resourcePath = parts[0];
-        String ratedUserName = details[1];
-
-        RatingsDAO ratingsDAO = new RatingsDAO();
-        int rating = ratingsDAO.getRating(resourcePath, ratedUserName);
-        Date ratedTime = ratingsDAO.getRatedTime(resourcePath, ratedUserName);
-
-        ResourceImpl resource = new ResourceImpl();
-        resource.setMediaType(RegistryConstants.RATING_MEDIA_TYPE);
-        resource.setContent(rating);
-        resource.setAuthorUserName(ratedUserName);
-        resource.setPath(url);
-        resource.setCreatedTime(ratedTime);
-        resource.setLastModified(ratedTime);
-        resource.addProperty("resourcePath", resourcePath);
-
-        return resource;
+        return null;
     }
 
     public void put(RequestContext requestContext) throws RegistryException {

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/SQLQueryHandler.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/SQLQueryHandler.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/SQLQueryHandler.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/SQLQueryHandler.java	Mon Jul 14 03:20:30 2008
@@ -27,7 +27,8 @@
 
         Resource resource = requestContext.getResource();
         if (resource == null) {
-            resource = requestContext.getRepository().get(requestContext.getResourcePath());
+            String queryPath = requestContext.getResourcePath().getPath();
+            resource = requestContext.getRepository().get(queryPath);
             requestContext.setResource(resource);
         }
 
@@ -50,7 +51,8 @@
             resource.setContent(textContent.getBytes());
         }
 
-        requestContext.getRepository().put(requestContext.getResourcePath(), resource);
+        String queryPath = requestContext.getResourcePath().getPath();
+        requestContext.getRepository().put(queryPath, resource);
         requestContext.setProcessingComplete(true);
     }
 

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/TagCollectionURLHandler.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/TagCollectionURLHandler.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/TagCollectionURLHandler.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/TagCollectionURLHandler.java	Mon Jul 14 03:20:30 2008
@@ -22,44 +22,44 @@
 import org.wso2.registry.exceptions.RegistryException;
 import org.wso2.registry.Resource;
 import org.wso2.registry.ResourceImpl;
+import org.wso2.registry.ResourcePath;
 import org.wso2.registry.jdbc.dao.TagsDAO;
 import org.wso2.registry.jdbc.handlers.Handler;
 import org.wso2.registry.jdbc.handlers.RequestContext;
 
+/**
+ * Handles paths of the form <pure resource path>;tags
+ * e.g. /projects/wsf-php/config.xml;tags
+ */
 public class TagCollectionURLHandler extends Handler {
 
     private static final Log log = LogFactory.getLog(TagCollectionURLHandler.class);
 
     public Resource get(RequestContext requestContext) throws RegistryException {
 
-        String url = requestContext.getResourcePath();
+        ResourcePath resourcePath = requestContext.getResourcePath();
 
-        String[] parts = url.split(RegistryConstants.URL_SEPARATOR);
+        if (resourcePath.parameterExists("tags") &&
+                resourcePath.getParameterValue("tags") == null) {
 
-        if (parts.length != 2) {
-            return null;
-        }
-
-        if (parts[0].length() == 0) {
-            return null;
-        }
+            String path = resourcePath.getPath();
 
-        String resourcePath = parts[0];
+            String [] tags = TagsDAO.getTags(path);
+            String tagStr = "";
+            for (String tag : tags) {
+                tagStr += tag;
+            }
+
+            ResourceImpl resource = new ResourceImpl();
+            resource.setMediaType(RegistryConstants.TAG_MEDIA_TYPE);
+            resource.setContent(tagStr);
+            resource.setPath(resourcePath.getCompletePath());
+            resource.addProperty("resourcePath", path);
 
-        TagsDAO tagsDAO = new TagsDAO();
-        String [] tags = tagsDAO.getTags(resourcePath);
-        String tagStr = "";
-        for (String tag : tags) {
-            tagStr += tag;
+            return resource;
         }
 
-        ResourceImpl resource = new ResourceImpl();
-        resource.setMediaType(RegistryConstants.TAG_MEDIA_TYPE);
-        resource.setContent(tagStr);
-        resource.setPath(resourcePath);
-        resource.addProperty("resourcePath", resourcePath);
-
-        return resource;
+        return null;
     }
 
     public void put(RequestContext requestContext) throws RegistryException {

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/TagURLHandler.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/TagURLHandler.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/TagURLHandler.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/builtin/TagURLHandler.java	Mon Jul 14 03:20:30 2008
@@ -22,6 +22,7 @@
 import org.wso2.registry.exceptions.RegistryException;
 import org.wso2.registry.Resource;
 import org.wso2.registry.ResourceImpl;
+import org.wso2.registry.ResourcePath;
 import org.wso2.registry.jdbc.dao.TagsDAO;
 import org.wso2.registry.jdbc.dataobjects.TaggingDO;
 import org.wso2.registry.jdbc.handlers.Handler;
@@ -29,50 +30,50 @@
 
 import java.util.Date;
 
+/**
+ * Handles paths of the form <pure resource path>;tags:<tag name>:<username>
+ * e.g. /projects/ids/config.xml;ratings:chathura
+ */
 public class TagURLHandler extends Handler {
 
     private static final Log log = LogFactory.getLog(TagURLHandler.class);
 
     public Resource get(RequestContext requestContext) throws RegistryException {
 
-        String url = requestContext.getResourcePath();
+        ResourcePath resourcePath = requestContext.getResourcePath();
 
-        String[] parts = url.split(RegistryConstants.URL_SEPARATOR);
+        String tagDetails = resourcePath.getParameterValue("tags");
+        if (tagDetails != null) {
 
-        if (parts.length != 2) {
-            return null;
-        }
+            String[] queries = tagDetails.split(":");
 
-        if (parts[0].length() == 0) {
-            return null;
-        }
+            if (queries.length != 2) {
+                return null;
+            }
 
-        String[] queries = parts[1].split(":");
+            String path = resourcePath.getPath();
+            String tagName = queries[0];
+            String userName = queries[1];
 
-        if (queries.length != 3) {
-            return null;
-        }
+            TagsDAO tagsDAO = new TagsDAO();
+            TaggingDO taggingDO = tagsDAO.getTagging(path, tagName, userName);
 
-        String resourcePath = parts[0];
-        String tagName = queries[1];
-        String userName = queries[2];
-
-        TagsDAO tagsDAO = new TagsDAO();
-        TaggingDO taggingDO = tagsDAO.getTagging(resourcePath, tagName, userName);
-
-        ResourceImpl resource = new ResourceImpl();
-        resource.setMediaType(RegistryConstants.TAG_MEDIA_TYPE);
-        resource.setPath(url);
-        resource.setContent(taggingDO.getTagName());
-        resource.setAuthorUserName(taggingDO.getTaggedUserName());
-        final Date taggedTime = taggingDO.getTaggedTime();
-        resource.setCreatedTime(taggedTime);
-        resource.setLastModified(taggedTime);
-        resource.addProperty("resourcePath", taggingDO.getResourcePath());
+            ResourceImpl resource = new ResourceImpl();
+            resource.setMediaType(RegistryConstants.TAG_MEDIA_TYPE);
+            resource.setPath(resourcePath.getCompletePath());
+            resource.setContent(taggingDO.getTagName());
+            resource.setAuthorUserName(taggingDO.getTaggedUserName());
+            final Date taggedTime = taggingDO.getTaggedTime();
+            resource.setCreatedTime(taggedTime);
+            resource.setLastModified(taggedTime);
+            resource.addProperty("resourcePath", taggingDO.getResourcePath());
 
-        requestContext.setProcessingComplete(true);
+            requestContext.setProcessingComplete(true);
+
+            return resource;
+        }
 
-        return resource;
+        return null;
     }
 
     public void put(RequestContext requestContext) throws RegistryException {

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/filters/MediaTypeMatcher.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/filters/MediaTypeMatcher.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/filters/MediaTypeMatcher.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/filters/MediaTypeMatcher.java	Mon Jul 14 03:20:30 2008
@@ -21,6 +21,7 @@
 import org.wso2.registry.Resource;
 import org.wso2.registry.jdbc.handlers.RequestContext;
 import org.wso2.registry.utils.RegistryUtils;
+import org.wso2.registry.utils.VersionedPath;
 
 public class MediaTypeMatcher extends Filter {
 
@@ -43,8 +44,14 @@
 
         Resource resource = requestContext.getResource();
         if (resource == null) {
-            resource = requestContext.getRepository().get(requestContext.getResourcePath());
-            requestContext.setResource(resource);
+            VersionedPath versionedPath =
+                    RegistryUtils.getVersionedPath(requestContext.getResourcePath());
+
+            if (versionedPath.getVersion() == -1) {
+                resource = requestContext.getRepository().
+                        get(requestContext.getResourcePath().getPath());
+                requestContext.setResource(resource);
+            }
         }
 
         if (resource != null) {
@@ -85,7 +92,8 @@
 
         Resource resource = requestContext.getResource();
         if (resource == null) {
-            resource = requestContext.getRepository().get(requestContext.getResourcePath());
+            resource =
+                    requestContext.getRepository().get(requestContext.getResourcePath().getPath());
             requestContext.setResource(resource);
         }
 
@@ -106,7 +114,7 @@
      * @param requestContext RequestContext for the current request
      * @return true if the media type of the parent collection of the current resource is equal
      * to the handler's media type.
-     * 
+     *
      * @throws RegistryException
      */
     public boolean handlePutChild(RequestContext requestContext) throws RegistryException {
@@ -115,12 +123,18 @@
         if (parentCollection == null) {
             String parentPath = requestContext.getParentPath();
             if (parentPath == null) {
-                parentPath = RegistryUtils.getParentPath(requestContext.getResourcePath());
+                parentPath = RegistryUtils.
+                        getParentPath(requestContext.getResourcePath().getPath());
                 requestContext.setParentPath(parentPath);
             }
 
-            parentCollection = (Collection) requestContext.getRepository().get(parentPath);
-            requestContext.setParentCollection(parentCollection);
+            VersionedPath versionedPath =
+                    RegistryUtils.getVersionedPath(requestContext.getResourcePath());
+
+            if (versionedPath.getVersion() == -1) {
+                parentCollection = (Collection) requestContext.getRepository().get(parentPath);
+                requestContext.setParentCollection(parentCollection);
+            }
         }
 
         if (parentCollection != null) {
@@ -139,12 +153,18 @@
         if (parentCollection == null) {
             String parentPath = requestContext.getParentPath();
             if (parentPath == null) {
-                parentPath = RegistryUtils.getParentPath(requestContext.getResourcePath());
+                parentPath = RegistryUtils.
+                        getParentPath(requestContext.getResourcePath().getPath());
                 requestContext.setParentPath(parentPath);
             }
 
-            parentCollection = (Collection) requestContext.getRepository().get(parentPath);
-            requestContext.setParentCollection(parentCollection);
+            VersionedPath versionedPath =
+                    RegistryUtils.getVersionedPath(requestContext.getResourcePath());
+
+            if (versionedPath.getVersion() == -1) {
+                parentCollection = (Collection) requestContext.getRepository().get(parentPath);
+                requestContext.setParentCollection(parentCollection);
+            }
         }
 
         if (parentCollection != null) {

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/filters/URLMatcher.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/filters/URLMatcher.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/filters/URLMatcher.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/handlers/filters/URLMatcher.java	Mon Jul 14 03:20:30 2008
@@ -28,28 +28,33 @@
     private String importChildPattern;
 
     public boolean handleGet(RequestContext requestContext) throws RegistryException {
-        return getPattern != null && requestContext.getResourcePath().matches(getPattern);
+        return getPattern != null &&
+                requestContext.getResourcePath().getCompletePath().matches(getPattern);
     }
 
     public boolean handlePut(RequestContext requestContext) throws RegistryException {
-        return putPattern != null && requestContext.getResourcePath().matches(putPattern);
+        return putPattern != null &&
+                requestContext.getResourcePath().getCompletePath().matches(putPattern);
     }
 
     public boolean handleImportResource(RequestContext requestContext) throws RegistryException {
-        return importPattern != null && requestContext.getResourcePath().matches(importPattern);
+        return importPattern != null &&
+                requestContext.getResourcePath().getCompletePath().matches(importPattern);
     }
 
     public boolean handleDelete(RequestContext requestContext) throws RegistryException {
-        return deletePattern != null && requestContext.getResourcePath().matches(deletePattern);
+        return deletePattern != null &&
+                requestContext.getResourcePath().getCompletePath().matches(deletePattern);
     }
 
     public boolean handlePutChild(RequestContext requestContext) throws RegistryException {
-        return putChildPattern != null && requestContext.getResourcePath().matches(putChildPattern);
+        return putChildPattern != null &&
+                requestContext.getResourcePath().getCompletePath().matches(putChildPattern);
     }
 
     public boolean handleImportChild(RequestContext requestContext) throws RegistryException {
         return importChildPattern != null &&
-               requestContext.getResourcePath().matches(importChildPattern);
+               requestContext.getResourcePath().getCompletePath().matches(importChildPattern);
     }
 
     public String getGetPattern() {

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/utils/RegistryUtils.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/utils/RegistryUtils.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/utils/RegistryUtils.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/utils/RegistryUtils.java	Mon Jul 14 03:20:30 2008
@@ -19,6 +19,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.wso2.registry.RegistryConstants;
+import org.wso2.registry.ResourcePath;
 
 public class RegistryUtils {
 
@@ -33,17 +34,15 @@
      *
      * @return VersionPath object containing the valid resource path and the version number.
      */
-    public static VersionedPath getVersionedPath(String resourcePath) {
+    public static VersionedPath getVersionedPath(ResourcePath resourcePath) {
 
-        String plainPath = resourcePath;
+        String versionString = resourcePath.getParameterValue("version");
         long versionNumber = -1;
-        if (resourcePath.indexOf(";version=") != -1) {
-            String[] parts = resourcePath.split(";version=");
-            plainPath = parts[0];
-            versionNumber = Long.parseLong(parts[1]);
+        if (versionString != null) {
+            versionNumber = Long.parseLong(versionString);
         }
 
-        plainPath = getPureResourcePath(plainPath);
+        String plainPath = getPureResourcePath(resourcePath.getPath());
 
         VersionedPath versionedPath = new VersionedPath();
         versionedPath.setPath(plainPath);

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/utils/VersionedPath.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/core/src/main/java/org/wso2/registry/utils/VersionedPath.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/utils/VersionedPath.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/utils/VersionedPath.java	Mon Jul 14 03:20:30 2008
@@ -41,6 +41,6 @@
     }
 
     public String toString() {
-        return path + RegistryConstants.URL_SEPARATOR + "version=" + version;
+        return path + RegistryConstants.URL_SEPARATOR + "version:" + version;
     }
 }

Modified: trunk/registry/modules/extensions/src/org/wso2/registry/aspects/ReviewLifecycle.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/extensions/src/org/wso2/registry/aspects/ReviewLifecycle.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/extensions/src/org/wso2/registry/aspects/ReviewLifecycle.java	(original)
+++ trunk/registry/modules/extensions/src/org/wso2/registry/aspects/ReviewLifecycle.java	Mon Jul 14 03:20:30 2008
@@ -92,7 +92,8 @@
             throw new RegistryException("Not a valid action");
         }
         Registry registry = context.getRegistry();
-        Association[] associations = registry.getAssociations(context.getResourcePath(), "original");
+        Association[] associations =
+                registry.getAssociations(context.getResourcePath().getPath(), "original");
         if (associations == null) {
             throw new RegistryException("No original resource to approve");
         }

Modified: trunk/registry/modules/extensions/src/org/wso2/registry/handlers/Axis2RepositoryHandler.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/extensions/src/org/wso2/registry/handlers/Axis2RepositoryHandler.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/extensions/src/org/wso2/registry/handlers/Axis2RepositoryHandler.java	(original)
+++ trunk/registry/modules/extensions/src/org/wso2/registry/handlers/Axis2RepositoryHandler.java	Mon Jul 14 03:20:30 2008
@@ -31,7 +31,7 @@
 
     public void put(RequestContext requestContext) throws RegistryException {
 
-        String path = requestContext.getResourcePath();
+        String path = requestContext.getResourcePath().getPath();
         requestContext.getRepository().put(path, requestContext.getResource());
 
         String confPath = path +
@@ -71,7 +71,8 @@
 
         Resource childResource = requestContext.getResource();
         if (childResource == null) {
-            childResource = requestContext.getRepository().get(requestContext.getResourcePath());
+            childResource = requestContext.getRepository().
+                    get(requestContext.getResourcePath().getPath());
             requestContext.setResource(childResource);
         }
         String childMediaType = requestContext.getResource().getMediaType();

Modified: trunk/registry/modules/extensions/src/org/wso2/registry/handlers/SynapseRepositoryHandler.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/extensions/src/org/wso2/registry/handlers/SynapseRepositoryHandler.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/extensions/src/org/wso2/registry/handlers/SynapseRepositoryHandler.java	(original)
+++ trunk/registry/modules/extensions/src/org/wso2/registry/handlers/SynapseRepositoryHandler.java	Mon Jul 14 03:20:30 2008
@@ -31,7 +31,7 @@
 
     public void put(RequestContext requestContext) throws RegistryException {
 
-        String path = requestContext.getResourcePath();
+        String path = requestContext.getResourcePath().getPath();
         Resource resource = requestContext.getResource();
 
         requestContext.getRepository().put(path, resource);

Modified: trunk/registry/modules/extensions/src/org/wso2/registry/handlers/WSDLMediaTypeHandler.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/extensions/src/org/wso2/registry/handlers/WSDLMediaTypeHandler.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/extensions/src/org/wso2/registry/handlers/WSDLMediaTypeHandler.java	(original)
+++ trunk/registry/modules/extensions/src/org/wso2/registry/handlers/WSDLMediaTypeHandler.java	Mon Jul 14 03:20:30 2008
@@ -35,7 +35,7 @@
     public void importResource(RequestContext requestContext) throws RegistryException {
 
         Resource metadata = requestContext.getResource();
-        String parentPath = RegistryUtils.getParentPath(requestContext.getResourcePath());
+        String parentPath = RegistryUtils.getParentPath(requestContext.getResourcePath().getPath());
         String sourceURL = requestContext.getSourceURL();
 
         String savedName = new WSDLFileProcessor()

Modified: trunk/registry/modules/extensions/src/org/wso2/registry/handlers/XSDMediaTypeHandler.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/extensions/src/org/wso2/registry/handlers/XSDMediaTypeHandler.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/extensions/src/org/wso2/registry/handlers/XSDMediaTypeHandler.java	(original)
+++ trunk/registry/modules/extensions/src/org/wso2/registry/handlers/XSDMediaTypeHandler.java	Mon Jul 14 03:20:30 2008
@@ -36,7 +36,7 @@
     public void importResource(RequestContext requestContext) throws RegistryException {
 
         Resource metadata = requestContext.getResource();
-        String parentPath = RegistryUtils.getParentPath(requestContext.getResourcePath());
+        String parentPath = RegistryUtils.getParentPath(requestContext.getResourcePath().getPath());
         String sourceURL = requestContext.getSourceURL();
 
         SchemaFileProcessor schemaFileProcessor =

Modified: trunk/registry/modules/samples/collection-handler-sample/src/org/wso2/registry/samples/handlers/servers/ServerCollectionHandler.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/samples/collection-handler-sample/src/org/wso2/registry/samples/handlers/servers/ServerCollectionHandler.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/samples/collection-handler-sample/src/org/wso2/registry/samples/handlers/servers/ServerCollectionHandler.java	(original)
+++ trunk/registry/modules/samples/collection-handler-sample/src/org/wso2/registry/samples/handlers/servers/ServerCollectionHandler.java	Mon Jul 14 03:20:30 2008
@@ -39,9 +39,10 @@
         return null;
     }
 
-    public Resource getView(RequestContext requestContext) throws RegistryException {
+    public Resource getView(String viewName, RequestContext requestContext)
+            throws RegistryException {
 
-        String path = requestContext.getResourcePath();
+        String path = requestContext.getResourcePath().getPath();
         Resource resource = requestContext.getRepository().get(path);
         requestContext.setResource(resource);
 
@@ -92,7 +93,8 @@
         return tableRow;
     }
 
-    public Resource getEdit(RequestContext requestContext) throws RegistryException {
+    public Resource getEdit(String editName, RequestContext requestContext)
+            throws RegistryException {
         return null;
     }
 

Modified: trunk/registry/modules/samples/collection-handler-sample/src/org/wso2/registry/samples/handlers/servers/ServerDetailsHandler.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/samples/collection-handler-sample/src/org/wso2/registry/samples/handlers/servers/ServerDetailsHandler.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/samples/collection-handler-sample/src/org/wso2/registry/samples/handlers/servers/ServerDetailsHandler.java	(original)
+++ trunk/registry/modules/samples/collection-handler-sample/src/org/wso2/registry/samples/handlers/servers/ServerDetailsHandler.java	Mon Jul 14 03:20:30 2008
@@ -41,9 +41,10 @@
         return null;
     }
 
-    public Resource getView(RequestContext requestContext) throws RegistryException {
+    public Resource getView(String viewName, RequestContext requestContext)
+            throws RegistryException {
 
-        String path = requestContext.getResourcePath();
+        String path = requestContext.getResourcePath().getPath();
         Resource resource = requestContext.getRepository().get(path);
         byte[] contentBytes = (byte[]) resource.getContent();
 
@@ -73,9 +74,10 @@
         return resource;
     }
 
-    public Resource getEdit(RequestContext requestContext) throws RegistryException {
+    public Resource getEdit(String editName, RequestContext requestContext)
+            throws RegistryException {
 
-        String path = requestContext.getResourcePath();
+        String path = requestContext.getResourcePath().getPath();
         Resource resource = requestContext.getRepository().get(path);
         requestContext.setResource(resource);
         byte[] contentBytes = (byte[]) resource.getContent();

Modified: trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/CollectionPagesViewAction.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/CollectionPagesViewAction.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/CollectionPagesViewAction.java	(original)
+++ trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/CollectionPagesViewAction.java	Mon Jul 14 03:20:30 2008
@@ -20,9 +20,7 @@
 import org.wso2.registry.exceptions.RegistryException;
 import org.wso2.registry.servlet.utils.UserUtil;
 import org.wso2.registry.secure.AuthorizationFailedException;
-import org.wso2.registry.web.MediaTypesReader;
 import org.wso2.registry.web.actions.utils.ResourceData;
-import org.wso2.registry.web.actions.utils.ResourcePath;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;

Modified: trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/CollectionViewAction.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/CollectionViewAction.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/CollectionViewAction.java	(original)
+++ trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/CollectionViewAction.java	Mon Jul 14 03:20:30 2008
@@ -18,11 +18,9 @@
 
 import org.wso2.registry.*;
 import org.wso2.registry.exceptions.RegistryException;
-import org.wso2.registry.servlet.utils.UserUtil;
-import org.wso2.registry.secure.AuthorizationFailedException;
 import org.wso2.registry.web.MediaTypesReader;
 import org.wso2.registry.web.actions.utils.ResourceData;
-import org.wso2.registry.web.actions.utils.ResourcePath;
+import org.wso2.registry.web.actions.utils.WebResourcePath;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
@@ -58,7 +56,7 @@
 
         if (path.equals(RegistryConstants.ROOT_PATH)) {
 
-            ResourcePath resourcePath = new ResourcePath();
+            WebResourcePath resourcePath = new WebResourcePath();
             resourcePath.setNavigateName("root");
             resourcePath.setNavigatePath("#");
 
@@ -67,7 +65,7 @@
         } else {
 
             // first add the root path
-            ResourcePath rootPath = new ResourcePath();
+            WebResourcePath rootPath = new WebResourcePath();
             rootPath.setNavigateName("root");
             rootPath.setNavigatePath(RegistryConstants.ROOT_PATH);
             navigatablePaths.add(rootPath);
@@ -84,7 +82,7 @@
 
             String[] parts = preparedPath.split(RegistryConstants.PATH_SEPARATOR);
             for (int i = 0; i < parts.length; i++) {
-                ResourcePath resourcePath = new ResourcePath();
+                WebResourcePath resourcePath = new WebResourcePath();
                 resourcePath.setNavigateName(parts[i]);
 
                 String tempPath = "";

Modified: trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/ResourceDetailsAction.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/ResourceDetailsAction.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/ResourceDetailsAction.java	(original)
+++ trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/ResourceDetailsAction.java	Mon Jul 14 03:20:30 2008
@@ -25,7 +25,7 @@
 import org.wso2.registry.users.UserStoreException;
 import org.wso2.registry.users.accesscontrol.AccessControlConstants;
 import org.wso2.registry.web.actions.utils.Permission;
-import org.wso2.registry.web.actions.utils.ResourcePath;
+import org.wso2.registry.web.actions.utils.WebResourcePath;
 import org.wso2.registry.web.utils.CommonUtil;
 
 import javax.servlet.http.HttpServletRequest;
@@ -104,7 +104,7 @@
 
         if (path.equals(RegistryConstants.ROOT_PATH)) {
 
-            ResourcePath resourcePath = new ResourcePath();
+            WebResourcePath resourcePath = new WebResourcePath();
             resourcePath.setNavigateName("/");
             resourcePath.setNavigatePath("#");
 
@@ -113,7 +113,7 @@
         } else {
 
             // first add the root path
-            ResourcePath rootPath = new ResourcePath();
+            WebResourcePath rootPath = new WebResourcePath();
             rootPath.setNavigateName("/");
             rootPath.setNavigatePath(RegistryConstants.ROOT_PATH);
             navigatablePaths.add(rootPath);
@@ -130,13 +130,13 @@
 
             String[] parts = preparedPath.split(RegistryConstants.PATH_SEPARATOR);
             for (int i = 0; i < parts.length; i++) {
-                ResourcePath resourcePath = new ResourcePath();
+                WebResourcePath resourcePath = new WebResourcePath();
 
                 if (i == parts.length - 1) {
                     String[] q = parts[i].split(RegistryConstants.URL_SEPARATOR);
                     if (q.length == 2) {
-                        if (q[1].startsWith("version=")) {
-                            String versionNumber = q[1].substring("version=".length());
+                        if (q[1].startsWith("version:")) {
+                            String versionNumber = q[1].substring("version:".length());
                             String navName = q[0] + " (version " + versionNumber + ")";
                             resourcePath.setNavigateName(navName);
                             this.versionView = true;
@@ -216,7 +216,7 @@
 
         if (versionView) {
 
-            String[] parts = path.split(";version=");
+            String[] parts = path.split(";version:");
             if (parts.length == 2) {
                 activeResourcePath = parts[0];
             } else {

Deleted: trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/utils/ResourcePath.java
URL: http://wso2.org/svn/browse/wso2/None?pathrev=19230

Copied: trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/utils/WebResourcePath.java (from r19117, /trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/utils/ResourcePath.java)
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/utils/WebResourcePath.java?rev=19231&r1=19117&r2=19231&view=diff
==============================================================================
--- /trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/utils/ResourcePath.java	(original)
+++ trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/utils/WebResourcePath.java	Mon Jul 14 03:20:30 2008
@@ -16,7 +16,7 @@
 
 package org.wso2.registry.web.actions.utils;
 
-public class ResourcePath {
+public class WebResourcePath {
 
     private String navigateName;
     private String navigatePath;

Modified: trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/utils/ResourcesUtil.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/utils/ResourcesUtil.java?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/utils/ResourcesUtil.java	(original)
+++ trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/utils/ResourcesUtil.java	Mon Jul 14 03:20:30 2008
@@ -92,7 +92,8 @@
         String versionPath = request.getParameter("versionPath");
         userRegistry.restoreVersion(versionPath);
 
-        VersionedPath versionedPath = RegistryUtils.getVersionedPath(versionPath);
+        ResourcePath resourcePath = new ResourcePath(versionPath);
+        VersionedPath versionedPath = RegistryUtils.getVersionedPath(resourcePath);
         return versionedPath.getPath();
     }
     public static void givePage(HttpServletRequest request, HttpServletResponse response)

Modified: trunk/registry/modules/webapps/src/main/webapp/admin/header.jsp
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/webapps/src/main/webapp/admin/header.jsp?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/header.jsp	(original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/header.jsp	Mon Jul 14 03:20:30 2008
@@ -6,7 +6,7 @@
 <%@ page import="org.wso2.registry.web.UIConstants" %>
 <%@ page import="org.wso2.registry.web.actions.*" %>
 <%@ page import="org.wso2.registry.web.actions.utils.ResourceData" %>
-<%@ page import="org.wso2.registry.web.actions.utils.ResourcePath" %>
+<%@ page import="org.wso2.registry.web.actions.utils.WebResourcePath" %>
 <%@ page import="org.wso2.registry.web.actions.utils.VersionPath" %>
 <%@ page import="org.wso2.registry.web.beans.AdminBean" %>
 <%@ page import="org.wso2.registry.web.beans.VersionsBean" %>
@@ -91,7 +91,7 @@
             <td valign="top" ><img src="/wso2registry/admin/images/logo.jpg" style="cursor:pointer;margin:0px; padding:0px;"
                     <%
                         if (iNavPaths.size() > 0) {
-                            ResourcePath rootPath = (ResourcePath) iNavPaths.get(0);
+                            WebResourcePath rootPath = (WebResourcePath) iNavPaths.get(0);
                     %>
                                    onclick="javascript:window.location.href='/wso2registry/web<%=rootPath.getNavigatePath()%>'"
                     <% } %>

Modified: trunk/registry/modules/webapps/src/main/webapp/admin/registry-resources.jsp
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/webapps/src/main/webapp/admin/registry-resources.jsp?rev=19231&r1=19230&r2=19231&view=diff
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/registry-resources.jsp	(original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/registry-resources.jsp	Mon Jul 14 03:20:30 2008
@@ -3,7 +3,7 @@
 <%@ page import="org.wso2.registry.web.actions.CollectionViewAction" %>
 <%@ page import="org.wso2.registry.web.actions.ResourceDetailsAction" %>
 <%@ page import="org.wso2.registry.web.actions.utils.ResourceData" %>
-<%@ page import="org.wso2.registry.web.actions.utils.ResourcePath" %>
+<%@ page import="org.wso2.registry.web.actions.utils.WebResourcePath" %>
 <%@ page import="org.wso2.registry.web.utils.CommonUtil" %>
 <%@ page import="java.util.*" %>
 <%@ page import="org.wso2.registry.*" %>
@@ -117,7 +117,7 @@
             }
                 List iNavPaths = details.getNavigatablePaths();
                 if (iNavPaths.size() > 0) {
-                    ResourcePath rootPath = (ResourcePath) iNavPaths.get(0);
+                    WebResourcePath rootPath = (WebResourcePath) iNavPaths.get(0);
 
 
 
@@ -143,7 +143,7 @@
 
 
         if (iNavPaths.size() > 1) {
-            ResourcePath childPath = (ResourcePath) iNavPaths.get(1);
+            WebResourcePath childPath = (WebResourcePath) iNavPaths.get(1);
 
 
 
@@ -168,7 +168,7 @@
 
         if (iNavPaths.size() > 2) {
             for (int i = 2; i < iNavPaths.size(); i++) {
-                ResourcePath resourcePath = (ResourcePath) iNavPaths.get(i);
+                WebResourcePath resourcePath = (WebResourcePath) iNavPaths.get(i);
 
 
 



More information about the Registry-dev mailing list