You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yoko-commits@incubator.apache.org by en...@apache.org on 2006/12/07 18:06:33 UTC
svn commit: r483577 - in /incubator/yoko/trunk/tools: ./
src/main/java/org/apache/yoko/tools/
src/main/java/org/apache/yoko/tools/common/
src/main/java/org/apache/yoko/tools/common/idltypes/
src/main/java/org/apache/yoko/tools/processors/idl/ src/main/...
Author: enolan
Date: Thu Dec 7 10:06:29 2006
New Revision: 483577
URL: http://svn.apache.org/viewvc?view=rev&rev=483577
Log:
yoko-225 - porting yoko from celtix to use cxf.
Added:
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ProcessorEnvironment.java (with props)
Modified:
incubator/yoko/trunk/tools/pom.xml
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/WSDLToIDL.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLUtils.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlArray.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlField.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlParam.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlSequence.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlStruct.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaProcessor.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToIDLAction.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToProcessor.java
incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLTypes.java
incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java
incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/utils/TestUtils.java
Modified: incubator/yoko/trunk/tools/pom.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/pom.xml?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/pom.xml (original)
+++ incubator/yoko/trunk/tools/pom.xml Thu Dec 7 10:06:29 2006
@@ -42,8 +42,12 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.objectweb.celtix</groupId>
- <artifactId>celtix-api</artifactId>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-tools-common</artifactId>
</dependency>
<dependency>
<groupId>org.apache.yoko</groupId>
@@ -56,6 +60,16 @@
<dependency>
<groupId>org.apache.ws.commons</groupId>
<artifactId>XmlSchema</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>2.9.3</version>
+ </dependency>
+ <dependency>
+ <groupId>wsdl4j</groupId>
+ <artifactId>wsdl4j</artifactId>
+ <version>1.5.2</version>
</dependency>
</dependencies>
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/IDLToWSDL.java Thu Dec 7 10:06:29 2006
@@ -23,25 +23,25 @@
import java.util.HashSet;
import java.util.Set;
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.tools.common.AbstractCXFToolContainer;
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.toolspec.ToolRunner;
+import org.apache.cxf.tools.common.toolspec.ToolSpec;
+import org.apache.cxf.tools.common.toolspec.parser.BadUsageException;
+import org.apache.cxf.tools.common.toolspec.parser.CommandDocument;
+import org.apache.cxf.tools.common.toolspec.parser.ErrorVisitor;
+
+import org.apache.yoko.tools.common.ProcessorEnvironment;
import org.apache.yoko.tools.common.ToolCorbaConstants;
import org.apache.yoko.tools.processors.idl.IDLToWSDLProcessor;
-import org.objectweb.celtix.common.i18n.Message;
-import org.objectweb.celtix.tools.AbstractCeltixToolContainer;
-import org.objectweb.celtix.tools.common.ProcessorEnvironment;
-import org.objectweb.celtix.tools.common.ToolConstants;
-import org.objectweb.celtix.tools.common.ToolException;
-import org.objectweb.celtix.tools.common.toolspec.ToolRunner;
-import org.objectweb.celtix.tools.common.toolspec.ToolSpec;
-import org.objectweb.celtix.tools.common.toolspec.parser.BadUsageException;
-import org.objectweb.celtix.tools.common.toolspec.parser.CommandDocument;
-import org.objectweb.celtix.tools.common.toolspec.parser.ErrorVisitor;
-
/**
* This class can converts an IDL to a WSDL with CORBA binding information
*/
-public class IDLToWSDL extends AbstractCeltixToolContainer {
+public class IDLToWSDL extends AbstractCXFToolContainer {
static final String TOOL_NAME = "idltowsdl";
private static String[] args;
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/WSDLToIDL.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/WSDLToIDL.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/WSDLToIDL.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/WSDLToIDL.java Thu Dec 7 10:06:29 2006
@@ -23,25 +23,25 @@
import java.util.HashSet;
import java.util.Set;
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.tools.common.AbstractCXFToolContainer;
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.toolspec.ToolRunner;
+import org.apache.cxf.tools.common.toolspec.ToolSpec;
+import org.apache.cxf.tools.common.toolspec.parser.BadUsageException;
+import org.apache.cxf.tools.common.toolspec.parser.CommandDocument;
+import org.apache.cxf.tools.common.toolspec.parser.ErrorVisitor;
+import org.apache.yoko.tools.common.ProcessorEnvironment;
import org.apache.yoko.tools.common.ToolCorbaConstants;
import org.apache.yoko.tools.processors.wsdl.WSDLToCorbaProcessor;
-import org.objectweb.celtix.common.i18n.Message;
-import org.objectweb.celtix.tools.AbstractCeltixToolContainer;
-import org.objectweb.celtix.tools.common.ProcessorEnvironment;
-import org.objectweb.celtix.tools.common.ToolConstants;
-import org.objectweb.celtix.tools.common.ToolException;
-import org.objectweb.celtix.tools.common.toolspec.ToolRunner;
-import org.objectweb.celtix.tools.common.toolspec.ToolSpec;
-import org.objectweb.celtix.tools.common.toolspec.parser.BadUsageException;
-import org.objectweb.celtix.tools.common.toolspec.parser.CommandDocument;
-import org.objectweb.celtix.tools.common.toolspec.parser.ErrorVisitor;
/**
* This class can augment a plain WSDL definition with CORBA binding
* information, and can take WSDL CORBA binding information and convert it into
* the equivalent CORBA IDL.
*/
-public class WSDLToIDL extends AbstractCeltixToolContainer {
+public class WSDLToIDL extends AbstractCXFToolContainer {
static final String TOOL_NAME = "wsdltoidl";
private static String[] args;
Added: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ProcessorEnvironment.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ProcessorEnvironment.java?view=auto&rev=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ProcessorEnvironment.java (added)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ProcessorEnvironment.java Thu Dec 7 10:06:29 2006
@@ -0,0 +1,150 @@
+package org.apache.yoko.tools.common;
+
+import java.io.*;
+import java.util.*;
+import org.xml.sax.InputSource;
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.util.PropertyUtil;
+import org.apache.cxf.tools.util.URIParserUtil;
+
+public class ProcessorEnvironment {
+
+ private Map<String, Object> paramMap;
+ private String packageName;
+ private Map<String, String> namespacePackageMap = new HashMap<String, String>();
+ private Map<String, String> excludeNamespacePackageMap = new HashMap<String, String>();
+ private final Map<String, InputSource> jaxbBindingFiles = new HashMap<String, InputSource>();
+
+ public ProcessorEnvironment() {
+ }
+
+ public void loadDefaultNS2Pck() {
+ try {
+ PropertyUtil properties = new PropertyUtil();
+ properties.load(getResourceAsStream("toolspec/toolspecs/namespace2package.cfg"));
+ namespacePackageMap.putAll(properties.getMaps());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void loadDefaultExcludes() {
+ try {
+ PropertyUtil properties = new PropertyUtil();
+ properties.load(getResourceAsStream("toolspec/toolspecs/wsdltojavaexclude.cfg"));
+ excludeNamespacePackageMap.putAll(properties.getMaps());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private InputStream getResourceAsStream(String file) throws IOException {
+ return ProcessorEnvironment.class.getResourceAsStream(file);
+ }
+
+ public void setParameters(Map<String, Object> map) {
+ this.paramMap = map;
+ }
+
+ public boolean containsKey(String key) {
+ return (paramMap == null) ? false : paramMap.containsKey(key);
+ }
+
+ public Object get(String key) {
+ return (paramMap == null) ? null : paramMap.get(key);
+ }
+
+ public Object get(String key, Object defaultValue) {
+ if (!optionSet(key)) {
+ return defaultValue;
+ } else {
+ return get(key);
+ }
+ }
+
+ public boolean getBooleanValue(String key, String defaultValue) {
+ return Boolean.valueOf((String) get(key, defaultValue)).booleanValue();
+ }
+
+ public void put(String key, Object value) {
+ if (paramMap == null) {
+ paramMap = new HashMap<String, Object>();
+ }
+ paramMap.put(key, value);
+ }
+
+ public void remove(String key) {
+ if (paramMap == null) {
+ return;
+ }
+ paramMap.remove(key);
+ }
+
+ public boolean optionSet(String key) {
+ return (get(key) == null) ? false : true;
+ }
+
+ public boolean isVerbose() {
+ if (get(ToolConstants.CFG_VERBOSE) == null) {
+ return false;
+ } else {
+ return get(ToolConstants.CFG_VERBOSE) == ToolConstants.CFG_VERBOSE;
+ }
+ }
+
+ public void addNamespacePackageMap(String namespace, String pn) {
+ this.namespacePackageMap.put(namespace, pn);
+ }
+
+ private String mapNamespaceToPackageName(String ns) {
+ return this.namespacePackageMap.get(ns);
+ }
+
+ public boolean hasNamespace(String ns) {
+ return this.namespacePackageMap.containsKey(ns);
+ }
+
+ public void addExcludeNamespacePackageMap(String namespace, String pn) {
+ this.excludeNamespacePackageMap.put(namespace, pn);
+ }
+
+ public boolean hasExcludeNamespace(String ns) {
+ return this.excludeNamespacePackageMap.containsKey(ns);
+ }
+
+ public String getExcludePackageName(String ns) {
+ return this.excludeNamespacePackageMap.get(ns);
+ }
+
+ public void setPackageName(String pkgName) {
+ this.packageName = pkgName;
+ }
+
+ public String getPackageName() {
+ return this.packageName;
+ }
+
+ public String mapPackageName(String ns) {
+ if (hasNamespace(ns)) {
+ return mapNamespaceToPackageName(ns);
+ } else {
+ return getPackageName();
+ }
+ }
+
+ public String getCustomizedNS(String ns) {
+ return URIParserUtil.getNamespace(mapPackageName(ns));
+ }
+
+ public void addJaxbBindingFile(String location, InputSource is) {
+ this.jaxbBindingFiles.put(location, is);
+ }
+
+ public Map<String, InputSource> getJaxbBindingFile() {
+ return this.jaxbBindingFiles;
+ }
+
+ public boolean isExcludeNamespaceEnabled() {
+ return excludeNamespacePackageMap.size() > 0;
+ }
+}
Propchange: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ProcessorEnvironment.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/ProcessorEnvironment.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLUtils.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLUtils.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLUtils.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/WSDLUtils.java Thu Dec 7 10:06:29 2006
@@ -26,7 +26,7 @@
import javax.wsdl.WSDLException;
import javax.wsdl.xml.WSDLWriter;
-import org.objectweb.celtix.tools.utils.FileWriterUtil;
+import org.apache.cxf.tools.util.FileWriterUtil;
public final class WSDLUtils {
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlArray.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlArray.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlArray.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlArray.java Thu Dec 7 10:06:29 2006
@@ -23,7 +23,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.objectweb.celtix.common.logging.LogUtils;
+import org.apache.cxf.common.logging.LogUtils;
public final class IdlArray extends IdlArrayBase {
@@ -50,4 +50,4 @@
}
}
-}
\ No newline at end of file
+}
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlField.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlField.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlField.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlField.java Thu Dec 7 10:06:29 2006
@@ -24,7 +24,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.objectweb.celtix.common.logging.LogUtils;
+import org.apache.cxf.common.logging.LogUtils;
public class IdlField extends IdlDefnImplBase {
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlParam.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlParam.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlParam.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlParam.java Thu Dec 7 10:06:29 2006
@@ -24,7 +24,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.objectweb.celtix.common.logging.LogUtils;
+import org.apache.cxf.common.logging.LogUtils;
public final class IdlParam extends IdlDefnImplBase {
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlSequence.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlSequence.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlSequence.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlSequence.java Thu Dec 7 10:06:29 2006
@@ -23,7 +23,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.objectweb.celtix.common.logging.LogUtils;
+import org.apache.cxf.common.logging.LogUtils;
public final class IdlSequence extends IdlSequenceBase {
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlStruct.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlStruct.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlStruct.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/common/idltypes/IdlStruct.java Thu Dec 7 10:06:29 2006
@@ -23,7 +23,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.objectweb.celtix.common.logging.LogUtils;
+import org.apache.cxf.common.logging.LogUtils;
public final class IdlStruct extends IdlStructBase {
private static final Logger LOG = LogUtils.getL7dLogger(IdlStruct.class);
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java Thu Dec 7 10:06:29 2006
@@ -32,18 +32,20 @@
import antlr.collections.AST;
+import org.apache.cxf.tools.common.Processor;
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.util.FileWriterUtil;
+
import org.apache.schemas.yoko.bindings.corba.AddressType;
+import org.apache.yoko.tools.common.ProcessorEnvironment;
import org.apache.yoko.tools.common.ToolCorbaConstants;
import org.apache.yoko.wsdl.CorbaConstants;
-import org.objectweb.celtix.tools.common.Processor;
-import org.objectweb.celtix.tools.common.ProcessorEnvironment;
-import org.objectweb.celtix.tools.common.ToolConstants;
-import org.objectweb.celtix.tools.common.ToolException;
-import org.objectweb.celtix.tools.utils.FileWriterUtil;
-
public class IDLToWSDLProcessor implements Processor {
+ protected ToolContext toolContext;
private String idl;
private ProcessorEnvironment env;
private Writer outputWriter;
@@ -55,6 +57,11 @@
} catch (Exception e) {
throw new ToolException(e);
}
+ }
+
+
+ public void setEnvironment(ToolContext toolCtx) {
+ toolContext = toolCtx;
}
public void setOutputWriter(Writer writer) {
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java Thu Dec 7 10:06:29 2006
@@ -42,6 +42,9 @@
import antlr.ASTVisitor;
import antlr.collections.AST;
+import org.apache.cxf.tools.common.WSDLConstants;
+import org.apache.cxf.wsdl.JAXBExtensionHelper;
+
import org.apache.schemas.yoko.bindings.corba.AddressType;
import org.apache.schemas.yoko.bindings.corba.BindingType;
import org.apache.schemas.yoko.bindings.corba.OperationType;
@@ -56,9 +59,6 @@
import org.apache.yoko.tools.common.WSDLUtils;
import org.apache.yoko.wsdl.CorbaConstants;
-
-import org.objectweb.celtix.tools.common.WSDLConstants;
-import org.objectweb.celtix.wsdl.JAXBExtensionHelper;
public class WSDLASTVisitor implements ASTVisitor {
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java Thu Dec 7 10:06:29 2006
@@ -47,6 +47,8 @@
import javax.xml.bind.JAXBException;
import javax.xml.namespace.QName;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.wsdl.JAXBExtensionHelper;
import org.apache.schemas.yoko.bindings.corba.ArgType;
import org.apache.schemas.yoko.bindings.corba.BindingType;
import org.apache.schemas.yoko.bindings.corba.CaseType;
@@ -88,8 +90,6 @@
import org.apache.yoko.tools.common.W3CConstants;
import org.apache.yoko.wsdl.CorbaConstants;
import org.apache.yoko.wsdl.CorbaTypeImpl;
-import org.objectweb.celtix.common.logging.LogUtils;
-import org.objectweb.celtix.wsdl.JAXBExtensionHelper;
public class WSDLToCorbaBinding {
@@ -204,7 +204,7 @@
Map portTypes = def.getPortTypes();
if (portTypes == null) {
- org.objectweb.celtix.common.i18n.Message msg = new org.objectweb.celtix.common.i18n.Message(
+ org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message(
"No PortTypes defined in wsdl", LOG);
throw new Exception(msg.toString());
} else {
@@ -229,8 +229,8 @@
private void throwMultiplePortTypeException(Map portTypes) throws Exception {
StringBuffer sb = new StringBuffer();
- org.objectweb.celtix.common.i18n.Message msgDef =
- new org.objectweb.celtix.common.i18n.Message("Multiple PortTypes defined in wsdl", LOG);
+ org.apache.cxf.common.i18n.Message msgDef =
+ new org.apache.cxf.common.i18n.Message("Multiple PortTypes defined in wsdl", LOG);
sb.append(msgDef.toString());
Iterator it2 = portTypes.keySet().iterator();
int cnt = 0;
@@ -275,8 +275,8 @@
if (queryBinding(definition, bqname)) {
String msgStr = "Binding " + bqname.getLocalPart()
+ " already exists in WSDL.";
- org.objectweb.celtix.common.i18n.Message msg =
- new org.objectweb.celtix.common.i18n.Message(msgStr, LOG);
+ org.apache.cxf.common.i18n.Message msg =
+ new org.apache.cxf.common.i18n.Message(msgStr, LOG);
throw new Exception(msg.toString());
}
}
@@ -325,7 +325,7 @@
private void addBindingOperations(Definition definition, PortType portType, Binding binding)
throws Exception {
- List<Operation> ops = portType.getOperations();
+ List<Operation> ops = (List<javax.wsdl.Operation>)portType.getOperations();
for (Operation op : ops) {
BindingOperation bindingOperation = definition.createBindingOperation();
addCorbaOperationExtElement(bindingOperation, op);
@@ -594,16 +594,16 @@
} else {
String msgStr = "Fault " + fault.getMessage().getQName().getLocalPart()
+ " INCORRECT_FAULT_MSG.";
- org.objectweb.celtix.common.i18n.Message msg =
- new org.objectweb.celtix.common.i18n.Message(msgStr, LOG);
+ org.apache.cxf.common.i18n.Message msg =
+ new org.apache.cxf.common.i18n.Message(msgStr, LOG);
throw new Exception(msg.toString());
}
if (corbaex == null) {
String msgStr = "Fault " + fault.getMessage().getQName().getLocalPart()
+ " UNSUPPORTED_FAULT.";
- org.objectweb.celtix.common.i18n.Message msg =
- new org.objectweb.celtix.common.i18n.Message(msgStr, LOG);
+ org.apache.cxf.common.i18n.Message msg =
+ new org.apache.cxf.common.i18n.Message(msgStr, LOG);
throw new Exception(msg.toString());
} else {
// Set the repository ID for Exception
@@ -909,7 +909,7 @@
if ((type instanceof Struct) && (struct.getMember().size() == 0)) {
String msgStr = "Cannot create CORBA Struct" + struct.getName()
+ "from container with no members";
- org.objectweb.celtix.common.i18n.Message msg = new org.objectweb.celtix.common.i18n.Message(
+ org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message(
msgStr, LOG);
throw new Exception(msg.toString());
}
@@ -1510,7 +1510,7 @@
}
} else {
- org.objectweb.celtix.common.i18n.Message msg = new org.objectweb.celtix.common.i18n.Message(
+ org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message(
"Restriction inside ComplexContent is not yet Supported.", LOG);
//throw new Exception(msg.toString());
return null;
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaProcessor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaProcessor.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaProcessor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaProcessor.java Thu Dec 7 10:06:29 2006
@@ -27,15 +27,15 @@
import javax.wsdl.Definition;
import javax.xml.bind.JAXBException;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.tools.common.ToolConstants;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.yoko.tools.common.ProcessorEnvironment;
import org.apache.yoko.tools.common.ToolCorbaConstants;
import org.apache.yoko.tools.common.WSDLUtils;
-import org.objectweb.celtix.common.i18n.Message;
-import org.objectweb.celtix.common.logging.LogUtils;
-import org.objectweb.celtix.tools.common.ProcessorEnvironment;
-import org.objectweb.celtix.tools.common.ToolConstants;
-import org.objectweb.celtix.tools.common.ToolException;
-
public class WSDLToCorbaProcessor extends WSDLToProcessor {
protected static final Logger LOG = LogUtils.getL7dLogger(WSDLToCorbaProcessor.class);
@@ -119,7 +119,8 @@
if (env.optionSet(ToolConstants.CFG_PORTTYPE)) {
wsdlToCorbaBinding.addInterfaceName(env.get("porttype").toString());
}
- if ((env.optionSet(ToolConstants.CFG_PORTTYPE)) && env.optionSet(ToolConstants.CFG_BINDING)) {
+ if ((env.optionSet(ToolConstants.CFG_PORTTYPE))
+ && env.optionSet(ToolConstants.CFG_BINDING)) {
wsdlToCorbaBinding.mapBindingToInterface(env.get("porttype").toString(), env.get("binding")
.toString());
}
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToIDLAction.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToIDLAction.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToIDLAction.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToIDLAction.java Thu Dec 7 10:06:29 2006
@@ -37,6 +37,9 @@
import javax.xml.bind.JAXBException;
import javax.xml.namespace.QName;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.wsdl.JAXBExtensionHelper;
+
import org.apache.schemas.yoko.bindings.corba.Alias;
import org.apache.schemas.yoko.bindings.corba.Anonarray;
import org.apache.schemas.yoko.bindings.corba.Anonfixed;
@@ -88,8 +91,6 @@
import org.apache.yoko.tools.utils.OutputStreamFactory;
import org.apache.yoko.wsdl.CorbaConstants;
import org.apache.yoko.wsdl.CorbaTypeImpl;
-import org.objectweb.celtix.common.logging.LogUtils;
-import org.objectweb.celtix.wsdl.JAXBExtensionHelper;
public class WSDLToIDLAction {
@@ -127,8 +128,8 @@
Binding binding = findBinding(def);
if (binding == null) {
String msgStr = "Binding " + bindingName + " doesn't exists in WSDL.";
- org.objectweb.celtix.common.i18n.Message msg =
- new org.objectweb.celtix.common.i18n.Message(msgStr, LOG);
+ org.apache.cxf.common.i18n.Message msg =
+ new org.apache.cxf.common.i18n.Message(msgStr, LOG);
throw new Exception(msg.toString());
}
generateIDL(def, binding);
@@ -298,8 +299,8 @@
idlOp.addException((IdlException)type);
} else {
String msgStr = type.fullName() + " is not a type.";
- org.objectweb.celtix.common.i18n.Message msg =
- new org.objectweb.celtix.common.i18n.Message(msgStr, LOG);
+ org.apache.cxf.common.i18n.Message msg =
+ new org.apache.cxf.common.i18n.Message(msgStr, LOG);
throw new Exception(msg.toString());
}
}
@@ -389,8 +390,8 @@
return (IdlType)defn;
} else {
String msgStr = name + " is an incorrect idltype.";
- org.objectweb.celtix.common.i18n.Message msg =
- new org.objectweb.celtix.common.i18n.Message(msgStr, LOG);
+ org.apache.cxf.common.i18n.Message msg =
+ new org.apache.cxf.common.i18n.Message(msgStr, LOG);
throw new Exception(msg.toString());
}
} else {
@@ -410,8 +411,8 @@
if (result != null
&& (!(result instanceof IdlType))) {
String msgStr = idlType.getLocalPart() + " is an incorrect idltype.";
- org.objectweb.celtix.common.i18n.Message msg =
- new org.objectweb.celtix.common.i18n.Message(msgStr, LOG);
+ org.apache.cxf.common.i18n.Message msg =
+ new org.apache.cxf.common.i18n.Message(msgStr, LOG);
throw new Exception(msg.toString());
}
@@ -437,8 +438,8 @@
if (corbaTypeImpl == null) {
String msgStr = "Type " + idlType.getLocalPart() + " not found.";
- org.objectweb.celtix.common.i18n.Message msg =
- new org.objectweb.celtix.common.i18n.Message(msgStr, LOG);
+ org.apache.cxf.common.i18n.Message msg =
+ new org.apache.cxf.common.i18n.Message(msgStr, LOG);
throw new Exception(msg.toString());
}
@@ -557,8 +558,8 @@
intf = storedIntf;
} catch (Exception ex) {
String msgStr = "Interface type " + intf.fullName() + " not found.";
- org.objectweb.celtix.common.i18n.Message msg =
- new org.objectweb.celtix.common.i18n.Message(msgStr, LOG);
+ org.apache.cxf.common.i18n.Message msg =
+ new org.apache.cxf.common.i18n.Message(msgStr, LOG);
throw new Exception(msg.toString());
}
}
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToProcessor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToProcessor.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToProcessor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToProcessor.java Thu Dec 7 10:06:29 2006
@@ -41,19 +41,22 @@
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLReader;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.tools.common.Processor;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+
import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
+import org.apache.ws.commons.schema.XmlSchemaCollection;
-import org.objectweb.celtix.common.logging.LogUtils;
-import org.objectweb.celtix.tools.common.Processor;
-import org.objectweb.celtix.tools.common.ProcessorEnvironment;
-import org.objectweb.celtix.tools.common.ToolException;
+import org.apache.yoko.tools.common.ProcessorEnvironment;
public class WSDLToProcessor implements Processor {
protected static final Logger LOG =
LogUtils.getL7dLogger(WSDLToProcessor.class);
protected Definition wsdlDefinition;
+ protected ToolContext toolContext;
protected WSDLFactory wsdlFactory;
protected WSDLReader wsdlReader;
@@ -72,6 +75,11 @@
schemaList = new ArrayList<Schema>();
}
+ public void setEnvironment(ToolContext toolCtx) {
+ toolContext = toolCtx;
+ }
+
+
public void parseWSDL(String wsdlUrl) {
try {
WSDLFactory factory = WSDLFactory.newInstance();
@@ -87,8 +95,8 @@
parseImports(wsdlDefinition);
buildWSDLDefinition();
} catch (WSDLException we) {
- org.objectweb.celtix.common.i18n.Message msg =
- new org.objectweb.celtix.common.i18n.Message(
+ org.apache.cxf.common.i18n.Message msg =
+ new org.apache.cxf.common.i18n.Message(
"FAIL_TO_CREATE_WSDL_DEFINITION", LOG);
throw new ToolException(msg, we);
}
Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLTypes.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLTypes.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLTypes.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLTypes.java Thu Dec 7 10:06:29 2006
@@ -33,6 +33,7 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+import org.apache.cxf.common.logging.LogUtils;
import org.apache.schemas.yoko.bindings.corba.Anonarray;
import org.apache.schemas.yoko.bindings.corba.Anonfixed;
import org.apache.schemas.yoko.bindings.corba.Anonsequence;
@@ -59,7 +60,6 @@
import org.apache.yoko.tools.common.W3CConstants;
import org.apache.yoko.wsdl.CorbaConstants;
import org.apache.yoko.wsdl.CorbaTypeImpl;
-import org.objectweb.celtix.common.logging.LogUtils;
public class WSDLTypes extends WSDLToCorbaBinding {
Modified: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java (original)
+++ incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java Thu Dec 7 10:06:29 2006
@@ -28,9 +28,9 @@
import junit.framework.TestCase;
+import org.apache.yoko.tools.common.ProcessorEnvironment;
import org.apache.yoko.tools.common.ToolCorbaConstants;
import org.apache.yoko.tools.processors.idl.IDLToWSDLProcessor;
-import org.objectweb.celtix.tools.common.ProcessorEnvironment;
public class IDLToWSDLGenerationTest extends TestCase {
Modified: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/utils/TestUtils.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/utils/TestUtils.java?view=diff&rev=483577&r1=483576&r2=483577
==============================================================================
--- incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/utils/TestUtils.java (original)
+++ incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/utils/TestUtils.java Thu Dec 7 10:06:29 2006
@@ -21,8 +21,8 @@
import java.io.InputStream;
-import org.objectweb.celtix.tools.common.toolspec.ToolSpec;
-import org.objectweb.celtix.tools.common.toolspec.parser.CommandLineParser;
+import org.apache.cxf.tools.common.toolspec.parser.CommandLineParser;
+import org.apache.cxf.tools.common.toolspec.ToolSpec;
public class TestUtils {
private String mUsage;