Author: jkaputin
Date: Fri Oct 6 18:29:05 2006
New Revision: 453830
URL: http://svn.apache.org/viewvc?view=rev&rev=453830
Log:
Due to conflicts, manually merged in changes to
OMWSDLReader from trunk/java to WODEN-44 for
rev 429642 to 453800.
Modified:
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/OMWSDLReader.java
Modified:
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/OMWSDLReader.java
URL:
http://svn.apache.org/viewvc/incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/OMWSDLReader.java?view=diff&rev=453830&r1=453829&r2=453830
==============================================================================
---
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/OMWSDLReader.java
(original)
+++
incubator/woden/branches/WODEN-44/src/org/apache/woden/internal/OMWSDLReader.java
Fri Oct 6 18:29:05 2006
@@ -31,6 +31,7 @@
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMNamespace;
+import org.apache.woden.ElementSource;
import org.apache.woden.ErrorHandler;
import org.apache.woden.ErrorReporter;
import org.apache.woden.WSDLException;
@@ -706,10 +707,10 @@
private InterfaceOperationElement parseInterfaceOperation(
OMElement operEl,
DescriptionElement desc,
- WSDLElement parent)
+ InterfaceElement parent)
throws WSDLException{
- InterfaceOperationElement oper =
desc.createInterfaceOperationElement();
+ InterfaceOperationElement oper = parent.addInterfaceOperationElement();
oper.setParentElement(parent);
String name = OMUtils.getAttribute(operEl, Constants.ATTR_NAME);
@@ -720,7 +721,7 @@
String style = OMUtils.getAttribute(operEl, Constants.ATTR_STYLE);
if(style != null){
List stringList = StringUtils.parseNMTokens(style);
- String uriString;
+ String uriString = null;
Iterator it = stringList.iterator();
while(it.hasNext()){
uriString = (String)it.next();
@@ -740,25 +741,25 @@
while (operElChildren.hasNext()){
OMElement operElChild = (OMElement)operElChildren.next();
if (OMQNameUtils.matches(Constants.Q_ELEM_DOCUMENTATION,
operElChild)){
- oper.addDocumentationElement(parseDocumentation(operElChild,
desc));
+ parseDocumentation(operElChild, desc, oper);
}
else if (OMQNameUtils.matches(Constants.Q_ELEM_FEATURE,
operElChild)){
- oper.addFeatureElement(parseFeature(operElChild, desc, oper));
+ parseFeature(operElChild, desc, oper);
}
else if (OMQNameUtils.matches(Constants.Q_ELEM_PROPERTY,
operElChild)){
- oper.addPropertyElement(parseProperty(operElChild, desc,
oper));
+ parseProperty(operElChild, desc, oper);
}
else if (OMQNameUtils.matches(Constants.Q_ELEM_INPUT,
operElChild)){
-
oper.addInterfaceMessageReferenceElement(parseInterfaceMessageReference(operElChild,
desc, oper));
+ parseInterfaceMessageReference(operElChild, desc, oper);
}
else if (OMQNameUtils.matches(Constants.Q_ELEM_OUTPUT,
operElChild)){
-
oper.addInterfaceMessageReferenceElement(parseInterfaceMessageReference(operElChild,
desc, oper));
+ parseInterfaceMessageReference(operElChild, desc, oper);
}
else if (OMQNameUtils.matches(Constants.Q_ELEM_INFAULT,
operElChild)){
-
oper.addInterfaceFaultReferenceElement(parseInterfaceFaultReference(operElChild,
desc, oper));
+ parseInterfaceFaultReference(operElChild, desc, oper);
}
else if (OMQNameUtils.matches(Constants.Q_ELEM_OUTFAULT,
operElChild)){
-
oper.addInterfaceFaultReferenceElement(parseInterfaceFaultReference(operElChild,
desc, oper));
+ parseInterfaceFaultReference(operElChild, desc, oper);
}
else{
oper.addExtensionElement(
@@ -772,10 +773,10 @@
private InterfaceFaultReferenceElement parseInterfaceFaultReference(
OMElement faultRefEl,
DescriptionElement desc,
- WSDLElement parent)
+ InterfaceOperationElement
parent)
throws WSDLException{
- InterfaceFaultReferenceElement faultRef =
desc.createInterfaceFaultReferenceElement();
+ InterfaceFaultReferenceElement faultRef =
parent.addInterfaceFaultReferenceElement();
faultRef.setParentElement(parent);
if(Constants.ELEM_INFAULT.equals(faultRefEl.getLocalName())) {
@@ -802,16 +803,7 @@
String msgLabel = OMUtils.getAttribute(faultRefEl,
Constants.ATTR_MESSAGE_LABEL);
if(msgLabel != null){
- if(msgLabel.equals(MessageLabel.IN.toString())) {
- faultRef.setMessageLabel(MessageLabel.IN);
- }
- else if(msgLabel.equals(MessageLabel.OUT.toString())) {
- faultRef.setMessageLabel(MessageLabel.OUT);
- }
- else {
- //invalid value, but capture it anyway.
- faultRef.setMessageLabel(MessageLabel.invalidValue(msgLabel));
- }
+ faultRef.setMessageLabel(new NCName(msgLabel));
}
parseExtensionAttributes(faultRefEl,
InterfaceFaultReferenceElement.class, faultRef, desc);
@@ -821,13 +813,13 @@
while (faultRefElChildren.hasNext()){
OMElement faultRefElChild = (OMElement)faultRefElChildren.next();
if (OMQNameUtils.matches(Constants.Q_ELEM_DOCUMENTATION,
faultRefElChild)){
-
faultRef.addDocumentationElement(parseDocumentation(faultRefElChild, desc));
+ parseDocumentation(faultRefElChild, desc, faultRef);
}
else if (OMQNameUtils.matches(Constants.Q_ELEM_FEATURE,
faultRefElChild)){
- faultRef.addFeatureElement(parseFeature(faultRefElChild, desc,
faultRef));
+ parseFeature(faultRefElChild, desc, faultRef);
}
else if (OMQNameUtils.matches(Constants.Q_ELEM_PROPERTY,
faultRefElChild)){
- faultRef.addPropertyElement(parseProperty(faultRefElChild,
desc, faultRef));
+ parseProperty(faultRefElChild, desc, faultRef);
}
else{
faultRef.addExtensionElement(
@@ -841,10 +833,10 @@
private InterfaceMessageReferenceElement parseInterfaceMessageReference(
OMElement msgRefEl,
DescriptionElement desc,
- WSDLElement parent)
+ InterfaceOperationElement
parent)
throws WSDLException{
- InterfaceMessageReferenceElement message =
desc.createInterfaceMessageReferenceElement();
+ InterfaceMessageReferenceElement message =
parent.addInterfaceMessageReferenceElement();
message.setParentElement(parent);
if(Constants.ELEM_INPUT.equals(msgRefEl.getLocalName())) {
@@ -856,16 +848,7 @@
String msgLabel = OMUtils.getAttribute(msgRefEl,
Constants.ATTR_MESSAGE_LABEL);
if(msgLabel != null){
- if(msgLabel.equals(MessageLabel.IN.toString())) {
- message.setMessageLabel(MessageLabel.IN);
- }
- else if(msgLabel.equals(MessageLabel.OUT.toString())) {
- message.setMessageLabel(MessageLabel.OUT);
- }
- else {
- //invalid value, but capture it anyway.
- message.setMessageLabel(MessageLabel.invalidValue(msgLabel));
- }
+ message.setMessageLabel(new NCName(msgLabel));
}
else{
//TODO this is a temp fix, correct action to use MEP to determine
default
@@ -904,13 +887,13 @@
while(msgRefElChildren.hasNext()){
OMElement msgRefChild = (OMElement)msgRefElChildren.next();
if (OMQNameUtils.matches(Constants.Q_ELEM_DOCUMENTATION,
msgRefChild)){
-
message.addDocumentationElement(parseDocumentation(msgRefChild, desc));
+ parseDocumentation(msgRefChild, desc, message);
}
else if (OMQNameUtils.matches(Constants.Q_ELEM_FEATURE,
msgRefChild)){
- message.addFeatureElement(parseFeature(msgRefChild, desc,
message));
+ parseFeature(msgRefChild, desc, message);
}
else if (OMQNameUtils.matches(Constants.Q_ELEM_PROPERTY,
msgRefChild)){
- message.addPropertyElement(parseProperty(msgRefChild, desc,
message));
+ parseProperty(msgRefChild, desc, message);
}
else{
message.addExtensionElement(
@@ -924,10 +907,10 @@
private InterfaceFaultElement parseInterfaceFault(
OMElement faultEl,
DescriptionElement desc,
- WSDLElement parent)
+ InterfaceElement parent)
throws WSDLException{
- InterfaceFaultElement fault = desc.createInterfaceFaultElement();
+ InterfaceFaultElement fault = parent.addInterfaceFaultElement();
fault.setParentElement(parent);
String name = OMUtils.getAttribute(faultEl, Constants.ATTR_NAME);
@@ -958,13 +941,13 @@
while(faultElChildren.hasNext()){
OMElement faultElChild = (OMElement)faultElChildren.next();
if (OMQNameUtils.matches(Constants.Q_ELEM_DOCUMENTATION,
faultElChild)){
- fault.addDocumentationElement(parseDocumentation(faultElChild,
desc));
+ parseDocumentation(faultElChild, desc, fault);
}
else if (OMQNameUtils.matches(Constants.Q_ELEM_FEATURE,
faultElChild)){
- fault.addFeatureElement(parseFeature(faultElChild, desc,
fault));
+ parseFeature(faultElChild, desc, fault);
}
else if (OMQNameUtils.matches(Constants.Q_ELEM_PROPERTY,
faultElChild)){
- fault.addPropertyElement(parseProperty(faultElChild, desc,
fault));
+ parseProperty(faultElChild, desc, fault);
}
else{
fault.addExtensionElement(
@@ -977,10 +960,10 @@
private PropertyElement parseProperty(OMElement propEl,
DescriptionElement desc,
- WSDLElement parent)
+ ConfigurableElement parent)
throws WSDLException{
- PropertyElement property = desc.createPropertyElement();
+ PropertyElement property = parent.addPropertyElement();
property.setParentElement(parent);
String ref = OMUtils.getAttribute(propEl, Constants.ATTR_REF);
@@ -996,7 +979,7 @@
OMElement propElChild = (OMElement)propElChildren.next();
if (OMQNameUtils.matches(Constants.Q_ELEM_DOCUMENTATION,
propElChild)){
-
property.addDocumentationElement(parseDocumentation(propElChild, desc));
+ parseDocumentation(propElChild, desc, property);
}
else if(OMQNameUtils.matches(Constants.Q_ELEM_VALUE, propElChild)){
//the property value consists of the child info items of
<value>
@@ -1064,11 +1047,11 @@
//Now try to retrieve the schema import using schemaLocation
- OMElement importedSchemaDoc;
- OMElement schemaEl;
+ OMElement importedSchemaDoc = null;
+ OMElement schemaEl = null;
URI contextURI = null;
String schemaLoc = null;
- URL url;
+ URL url = null;
try{
contextURI = desc.getDocumentBaseURI();
@@ -1164,13 +1147,8 @@
//Set the baseURI and the namespaces from the DescriptionElement
in the XMLSchemaCollection
xsc.setBaseUri(baseURI);
- Iterator prefixKeySet = desc.getNamespaces().keySet().iterator();
- Object prefix;
- while (prefixKeySet.hasNext()){
- prefix = prefixKeySet.next();
- String namespace = desc.getNamespaces().get(prefix).toString();
- xsc.mapNamespace(prefix.toString(),namespace);
- }
+ NamespaceMap namespaces = new NamespaceMap(desc.getNamespaces());
+ xsc.setNamespaceContext(namespaces);
schemaDef = xsc.read(schemaSource, null);
}
catch (XmlSchemaException e){
@@ -1195,10 +1173,10 @@
private FeatureElement parseFeature(OMElement featEl,
DescriptionElement desc,
- WSDLElement parent)
+ ConfigurableElement parent)
throws WSDLException {
- FeatureElement feature = desc.createFeatureElement();
+ FeatureElement feature = parent.addFeatureElement();
feature.setParentElement(parent);
String ref = OMUtils.getAttribute(featEl, Constants.ATTR_REF);
@@ -1218,7 +1196,7 @@
while (featElChildren.hasNext()){
OMElement featElChild = (OMElement)featElChildren.next();
if (OMQNameUtils.matches(Constants.Q_ELEM_DOCUMENTATION,
featElChild)){
-
feature.addDocumentationElement(parseDocumentation(featElChild, desc));
+ parseDocumentation(featElChild, desc, feature);
}
else{
feature.addExtensionElement(parseExtensionElement(
@@ -1232,7 +1210,7 @@
DescriptionElement desc,
Map wsdlModules)
throws WSDLException{
- ImportElement imp = desc.createImportElement();
+ ImportElement imp = desc.addImportElement();
String namespaceURI = OMUtils.getAttribute(importEl,
Constants.ATTR_NAMESPACE);
String locationURI = OMUtils.getAttribute(importEl,
Constants.ATTR_LOCATION);
@@ -1259,7 +1237,7 @@
DescriptionElement desc,
Map wsdlModules)
throws WSDLException{
- IncludeElement include = desc.createIncludeElement();
+ IncludeElement include = desc.addIncludeElement();
String locationURI = OMUtils.getAttribute(includeEl,
Constants.ATTR_LOCATION);
@@ -1415,9 +1393,9 @@
DescriptionElement desc,
Map wsdlModules)
throws WSDLException{
- DescriptionElement referencedDesc;
+ DescriptionElement referencedDesc = null;
OMElement docEl;
- URL locationURL;
+ URL locationURL = null;
URI contextURI = null;
try{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]