[Registry-dev] svn commit r17879 - trunk/registry/modules/extensions/src/org/wso2/registry/handlers/utils

deepal at wso2.com deepal at wso2.com
Tue Jun 3 23:13:34 PDT 2008


Author: deepal
Date: Tue Jun  3 23:13:34 2008
New Revision: 17879
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=17879

Log:
getting all the three wsdl handlers working after doing a small hack :)

Modified:
   trunk/registry/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLFileProcessor.java

Modified: trunk/registry/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLFileProcessor.java
URL: http://wso2.org/svn/browse/wso2/trunk/registry/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLFileProcessor.java?rev=17879&r1=17878&r2=17879&view=diff
==============================================================================
--- trunk/registry/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLFileProcessor.java	(original)
+++ trunk/registry/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLFileProcessor.java	Tue Jun  3 23:13:34 2008
@@ -98,7 +98,7 @@
                                          new HashMap(), new HashSet(), registryBasePath,
                                          processImports);
         saveWSDLFileToRegistry(repository, wsdlDefinition, processedWSDLMap, new HashSet(),
-                               registryBasePath, processImports, metadata);
+                               registryBasePath, processImports, metadata , true);
 
         persistAssociations(registry, associationsBuffer);
 
@@ -209,13 +209,26 @@
 
     }
 
+    /**
+     *
+     * @param repository
+     * @param wsdlDefinition
+     * @param processedWSDLMap
+     * @param visitedWSDLs
+     * @param registryBasePath
+     * @param processImports
+     * @param metadata
+     * @param original  : To indicate whether the resource is the top most resource of imported one
+     * @throws RegistryException
+     */
     public void saveWSDLFileToRegistry(Repository repository,
                                        Definition wsdlDefinition,
                                        Map processedWSDLMap,
                                        Set visitedWSDLs,
                                        String registryBasePath,
                                        boolean processImports,
-                                       Resource metadata) throws RegistryException {
+                                       Resource metadata ,
+                                       boolean original) throws RegistryException {
         List associations = new ArrayList();
         if (processImports) {
             // first we have to process the imports and change the
@@ -235,7 +248,7 @@
                         // we have not process this wsdl file earlier
                         saveWSDLFileToRegistry(repository, innerDefinition, processedWSDLMap,
                                                visitedWSDLs, registryBasePath, processImports,
-                                               null);
+                                               null ,false);
                     }
                     // set the import location according to the new location
                     wsdlImport.setLocationURI((String)processedWSDLMap.get(
@@ -292,6 +305,21 @@
 
             repository.put(wsdlPath, wsdlResource);
 
+            if (metadata !=null && original) {
+                metadata.addProperty("TargetNamespace", targetNamespace);
+                if (wsdlDefinition.getQName() != null) {
+                    String name = wsdlDefinition.getQName().getLocalPart();
+                    if (name != null) {
+                        metadata.addProperty("Name", name);
+                    }
+                }
+                if (wsdlDefinition.getDocumentationElement() != null) {
+                    String document = wsdlDefinition.getDocumentationElement().getTextContent();
+                    if (document != null) {
+                        metadata.addProperty("documentation", document);
+                    }
+                }
+            }
             // add the associations
             String associatedWSDL;
             for (Object association : associations) {



More information about the Registry-dev mailing list