Author: chathura
Date: Fri Jan 25 09:03:34 2008
New Revision: 12920

Log:


Fixed a bug in importing wsdl and its dependencies at root level.



Modified:
   
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/SchemaFileProcessor.java
   
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/WSDLFileProcessor.java

Modified: 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/SchemaFileProcessor.java
==============================================================================
--- 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/SchemaFileProcessor.java
  (original)
+++ 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/SchemaFileProcessor.java
  Fri Jan 25 09:03:34 2008
@@ -204,7 +204,15 @@
                 xsdResource.setDescription(metadata.getDescription());
             }
             xsdResource.setContent(xsdContent);
-            defaultMediaTypeHandler.put(registryBasePath + 
RegistryConstants.PATH_SEPARATOR + fileNameToSave, xsdResource);
+
+            String xsdPath;
+            if (RegistryConstants.ROOT_PATH.equals(registryBasePath)) {
+                xsdPath = RegistryConstants.ROOT_PATH + fileNameToSave;
+            } else {
+                xsdPath = registryBasePath + RegistryConstants.PATH_SEPARATOR 
+ fileNameToSave;
+            }
+
+            defaultMediaTypeHandler.put(xsdPath, xsdResource);
 
             //xmlSchema.write(new FileOutputStream("repository/" + 
fileNameToSave),
             //                getDefaultOptionMap());

Modified: 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/WSDLFileProcessor.java
==============================================================================
--- 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/WSDLFileProcessor.java
    (original)
+++ 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/utils/WSDLFileProcessor.java
    Fri Jan 25 09:03:34 2008
@@ -221,8 +221,13 @@
 
             // create a resource this wsdlResourceContent and put it to the 
registry with the name importedResourceName (in some path)
 
-            String wsdlPath =
-                    registryBasePath + RegistryConstants.PATH_SEPARATOR + 
importedResourceName;
+            String wsdlPath;
+            if (RegistryConstants.ROOT_PATH.equals(registryBasePath)) {
+                wsdlPath = RegistryConstants.ROOT_PATH + importedResourceName;
+            } else {
+                wsdlPath =
+                        registryBasePath + RegistryConstants.PATH_SEPARATOR + 
importedResourceName;
+            }
             Resource wsdlResource = new Resource();
 
             if (metadata != null) {

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

Reply via email to