[Registry-dev] svn commit r17878 -
branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils
deepal at wso2.com
deepal at wso2.com
Tue Jun 3 23:13:25 PDT 2008
Author: deepal
Date: Tue Jun 3 23:13:25 2008
New Revision: 17878
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=17878
Log:
getting all the three wsdl handlers working after doing a small hack :)
Modified:
branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLFileProcessor.java
Modified: branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLFileProcessor.java
URL: http://wso2.org/svn/browse/wso2/branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLFileProcessor.java?rev=17878&r1=17877&r2=17878&view=diff
==============================================================================
--- branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLFileProcessor.java (original)
+++ branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLFileProcessor.java Tue Jun 3 23:13:25 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) {
@@ -344,7 +372,7 @@
private void persistAssociations(Registry registry, List <Association> associations)
throws RegistryException {
Iterator <Association> associationIterator = associations.iterator();
-
+
while(associationIterator.hasNext()) {
Association association = associationIterator.next();
@@ -352,4 +380,4 @@
association.getAssociationType());
}
}
-}
+}
\ No newline at end of file
More information about the Registry-dev
mailing list