axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kei...@apache.org
Subject svn commit: r596268 - in /webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2: deployment/ServiceBuilder.java description/AxisDescription.java description/AxisService.java util/WSDLSerializationUtil.java
Date Mon, 19 Nov 2007 11:04:40 GMT
Author: keithc
Date: Mon Nov 19 03:04:34 2007
New Revision: 596268

URL: http://svn.apache.org/viewvc?rev=596268&view=rev
Log:
Adding getDocumentationNode to axisDescription to get documentation as a DOMNode


Modified:
    webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
    webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
    webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java

Modified: webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java?rev=596268&r1=596267&r2=596268&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
(original)
+++ webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
Mon Nov 19 03:04:34 2007
@@ -130,11 +130,7 @@
             if (descriptionElement != null) {
                 OMElement descriptionValue = descriptionElement.getFirstElement();
                 if (descriptionValue != null) {
-                    StringWriter writer = new StringWriter();
-                    descriptionValue.build();
-                    descriptionValue.serialize(writer);
-                    writer.flush();
-                    service.setDocumentation(writer.toString());
+                    service.setDocumentation(descriptionValue);
                 } else {
                     service.setDocumentation(descriptionElement.getText());
                 }
@@ -383,8 +379,6 @@
                 processDataLocatorConfig(dataLocatorElement, service);
             }
 
-        } catch (XMLStreamException e) {
-            throw new DeploymentException(e);
         } catch (AxisFault axisFault) {
             throw new DeploymentException(axisFault);
         }

Modified: webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisDescription.java?rev=596268&r1=596267&r2=596268&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
(original)
+++ webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
Mon Nov 19 03:04:34 2007
@@ -16,23 +16,26 @@
 
 package org.apache.axis2.description;
 
+import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNode;
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.util.Utils;
-import org.apache.axis2.util.JavaUtils;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.modules.Module;
+import org.apache.axis2.util.JavaUtils;
+import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Collection;
 import java.util.Map;
 
 public abstract class AxisDescription implements ParameterInclude,
@@ -48,8 +51,10 @@
 
     protected Map engagedModules;
 
+    private OMFactory omFactory = OMAbstractFactory.getOMFactory();
+
     // Holds the documentation details for each element
-    private String documentation;
+    private OMNode documentation;
 
     // creating a logger instance
     private Log log = LogFactory.getLog(this.getClass());
@@ -137,11 +142,22 @@
     }
 
     public String getDocumentation() {
+        if (documentation != null) {
+            return documentation.toString();
+        }
+        return null;
+    }
+
+    public OMNode getDocumentationNode() {
         return documentation;
     }
 
-    public void setDocumentation(String documentation) {
+    public void setDocumentation(OMNode documentation) {
         this.documentation = documentation;
+    }
+
+    public void setDocumentation(String documentation) {
+        this.documentation = omFactory.createOMText(documentation);
     }
 
     public void setParent(AxisDescription parent) {

Modified: webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisService.java?rev=596268&r1=596267&r2=596268&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisService.java
(original)
+++ webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/AxisService.java
Mon Nov 19 03:04:34 2007
@@ -21,6 +21,7 @@
 package org.apache.axis2.description;
 
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMNode;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.description.java2wsdl.*;
@@ -76,6 +77,7 @@
 import javax.wsdl.xml.WSDLWriter;
 import javax.xml.namespace.QName;
 import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLStreamException;
 import java.io.*;
 import java.net.SocketException;
 import java.net.URL;

Modified: webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java?rev=596268&r1=596267&r2=596268&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java
(original)
+++ webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/util/WSDLSerializationUtil.java
Mon Nov 19 03:04:34 2007
@@ -18,28 +18,27 @@
  */
 package org.apache.axis2.util;
 
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMNode;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.description.AxisDescription;
 import org.apache.axis2.description.AxisMessage;
-import org.apache.axis2.description.WSDL2Constants;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.AxisDescription;
+import org.apache.axis2.description.WSDL2Constants;
 import org.apache.axis2.description.java2wsdl.Java2WSDLConstants;
+import org.apache.axis2.namespace.Constants;
+import org.apache.axis2.wsdl.HTTPHeaderMessage;
 import org.apache.axis2.wsdl.SOAPHeaderMessage;
 import org.apache.axis2.wsdl.SOAPModuleMessage;
-import org.apache.axis2.wsdl.HTTPHeaderMessage;
-import org.apache.axis2.namespace.Constants;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.AddressingConstants;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.OMText;
 
 import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import java.util.Map;
-import java.util.Iterator;
 import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Map;
 import java.util.Set;
 
 /**
@@ -455,19 +454,11 @@
     }
 
     public static void addWSDLDocumentationElement(AxisDescription axisDescription, OMElement
omElement, OMFactory omFactory, OMNamespace wsdl) {
-        String documentationString = axisDescription.getDocumentation();
+        OMNode documentationNode = axisDescription.getDocumentationNode();
         OMElement documentation;
-        if (documentationString != null && !"".equals(documentationString)) {
+        if (documentationNode != null) {
             documentation = omFactory.createOMElement(WSDL2Constants.DOCUMENTATION, wsdl);
-            OMText omText;
-            if (documentationString.indexOf(CDATA_START) > -1) {
-                documentationString = documentationString.replaceFirst(CDATA_START_REGEX,
"");
-                documentationString = documentationString.replaceFirst(CDATA_END_REGEX, "");
-                omText = omFactory.createOMText(documentationString, XMLStreamConstants.CDATA);
-            } else {
-            omText =  omFactory.createOMText(documentationString);
-            }
-            documentation.addChild(omText);
+            documentation.addChild(documentationNode);
             omElement.addChild(documentation);
         }
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message