Author: Grid.Qian
Date: 2008-05-08 22:49:57 -0400 (Thu, 08 May 2008)
New Revision: 8017
Added:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java
Removed:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommnad.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommnad.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommnad.java
Log:
modify for spell error and add support for ws project classpath --jira2047
Copied:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java
(from rev 7988,
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommnad.java)
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java
(rev 0)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommand.java 2008-05-09
02:49:57 UTC (rev 8017)
@@ -0,0 +1,62 @@
+package org.jboss.tools.ws.creation.core.commands;
+
+import javax.wsdl.WSDLException;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jst.ws.axis2.consumption.core.utils.DefaultCodegenUtil;
+import org.eclipse.wst.command.internal.env.core.common.StatusUtils;
+import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+import org.eclipse.wst.ws.internal.wsrt.IWebService;
+import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario;
+import org.eclipse.wst.wsdl.WSDLFactory;
+import org.eclipse.wst.wsdl.internal.impl.wsdl4j.WSDLFactoryImpl;
+import org.eclipse.wst.wsdl.internal.util.WSDLDefinitionFactory;
+import org.eclipse.wst.wsdl.internal.util.WSDLUtil;
+import org.eclipse.wst.wsdl.util.WSDLParser;
+import org.jboss.tools.ws.creation.core.data.ServiceModel;
+import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
+import org.jboss.tools.ws.creation.core.utils.WSDLPropertyReader;
+
+public class InitialCommand extends AbstractDataModelOperation {
+
+ private ServiceModel model;
+ private IWebService ws;
+ private int scenario;
+
+ public InitialCommand(ServiceModel model, IWebService ws, int scenario) {
+ this.model = model;
+ this.ws = ws;
+ this.scenario = scenario;
+ }
+
+ @Override
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+
+ model.setTarget(JBossWSCreationCoreMessages.getString("VALUE_TARGET_1"));
+ if (scenario == WebServiceScenario.TOPDOWN) {
+ try{
+ model.setWsdlURI(ws.getWebServiceInfo().getWsdlURL());
+ WSDLPropertyReader reader = new WSDLPropertyReader();
+ reader.readWSDL(ws.getWebServiceInfo().getWsdlURL());
+ model.setCustomPackage(reader.packageFromTargetNamespace());
+ }catch (WSDLException e) {
+ return StatusUtils.errorStatus(e.getLocalizedMessage(), e);
+ }
+ }else {
+ model.setServiceClass(ws.getWebServiceInfo().getImplURL());
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ public ServiceModel getWebServiceDataModel() {
+
+ return model;
+ }
+
+}
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommnad.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommnad.java 2008-05-09
02:49:47 UTC (rev 8016)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/InitialCommnad.java 2008-05-09
02:49:57 UTC (rev 8017)
@@ -1,62 +0,0 @@
-package org.jboss.tools.ws.creation.core.commands;
-
-import javax.wsdl.WSDLException;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.ws.axis2.consumption.core.utils.DefaultCodegenUtil;
-import org.eclipse.wst.command.internal.env.core.common.StatusUtils;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.eclipse.wst.ws.internal.wsrt.IWebService;
-import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario;
-import org.eclipse.wst.wsdl.WSDLFactory;
-import org.eclipse.wst.wsdl.internal.impl.wsdl4j.WSDLFactoryImpl;
-import org.eclipse.wst.wsdl.internal.util.WSDLDefinitionFactory;
-import org.eclipse.wst.wsdl.internal.util.WSDLUtil;
-import org.eclipse.wst.wsdl.util.WSDLParser;
-import org.jboss.tools.ws.creation.core.data.ServiceModel;
-import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
-import org.jboss.tools.ws.creation.core.utils.WSDLPropertyReader;
-
-public class InitialCommnad extends AbstractDataModelOperation {
-
- private ServiceModel model;
- private IWebService ws;
- private int scenario;
-
- public InitialCommnad(ServiceModel model, IWebService ws, int scenario) {
- this.model = model;
- this.ws = ws;
- this.scenario = scenario;
- }
-
- @Override
- public IStatus execute(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
-
- model.setTarget(JBossWSCreationCoreMessages.getString("VALUE_TARGET_1"));
- if (scenario == WebServiceScenario.TOPDOWN) {
- try{
- model.setWsdlURI(ws.getWebServiceInfo().getWsdlURL());
- WSDLPropertyReader reader = new WSDLPropertyReader();
- reader.readWSDL(ws.getWebServiceInfo().getWsdlURL());
- model.setCustomPackage(reader.packageFromTargetNamespace());
- }catch (WSDLException e) {
- return StatusUtils.errorStatus(e.getLocalizedMessage(), e);
- }
- }else {
- model.setServiceClass(ws.getWebServiceInfo().getImplURL());
- }
-
- return Status.OK_STATUS;
- }
-
- public ServiceModel getWebServiceDataModel() {
-
- return model;
- }
-
-}
Copied:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java
(from rev 7988,
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommnad.java)
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java
(rev 0)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java 2008-05-09
02:49:57 UTC (rev 8017)
@@ -0,0 +1,142 @@
+package org.jboss.tools.ws.creation.core.commands;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+import java.util.List;
+
+import javax.xml.parsers.SAXParserFactory;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+import org.jboss.tools.ws.core.JbossWSCorePlugin;
+import org.jboss.tools.ws.creation.core.data.ServiceModel;
+import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
+
+public class WSDL2JavaCommand extends AbstractDataModelOperation{
+
+ private ServiceModel model;
+
+
+ public WSDL2JavaCommand(ServiceModel model){
+ this.model = model;
+ }
+
+ @Override
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+
+ String runtimeLocation =
JbossWSCorePlugin.getDefault().getPreferenceStore().getString("jbosswsruntimelocation");
+ String commandLocation = runtimeLocation + Path.SEPARATOR + "bin";
+ String command = "sh wsconsume.sh ";
+ if(System.getProperty("os.name").toLowerCase().indexOf("win") >=
0){
+ command = "cmd.exe /c wsconsume.bat ";
+ }
+ String args = getCommandlineArgs();
+ command += " -k " + args + " " + model.getWsdlURI();
+
+ try {
+ Runtime rt = Runtime.getRuntime();
+ Process proc = rt.exec(command, null, new File(commandLocation));
+ InputStreamReader ir = new InputStreamReader(proc.getErrorStream());
+ LineNumberReader input = new LineNumberReader(ir);
+ String str = input.readLine();
+ StringBuffer result = new StringBuffer();
+ while(str != null){
+ System.out.println(str);
+ result.append(str).append("\t\r");
+ str = input.readLine();
+
+ }
+ proc.waitFor();
+ System.out.print(result);
+
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ refreshProject(model.getWebProjectName(), monitor);
+
+
+ return Status.OK_STATUS;
+ }
+
+ private void refreshProject(String project, IProgressMonitor monitor){
+ try {
+ JBossWSCreationUtils.getProjectByName(project).refreshLocal(2, monitor);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ private String getCommandlineArgs(){
+ String commandLine;
+ String project = model.getWebProjectName();
+ String projectRoot = JBossWSCreationUtils.getProjectRoot(project).toOSString();
+ commandLine = "-s " + projectRoot + Path.SEPARATOR + "src";
+
+ if(model.getCustomPackage() != null &&
!"".equals(model.getCustomPackage())){
+ commandLine += " -p " + model.getCustomPackage();
+ }
+
+ List<String> bindingFiles = model.getBindingFiles();
+ for(String bindingFileLocation: bindingFiles){
+ File bindingFile = new File(bindingFileLocation);
+ if(bindingFile.exists()){
+ commandLine += " -b " + bindingFileLocation;
+ }
+ }
+
+ if(model.getCatalog() != null &&
!"".equals(model.getCatalog().trim())){
+ File catalog = new File(model.getCatalog());
+ if(catalog.exists()){
+ commandLine += " -c " + model.getCatalog();
+ }
+ }
+
+ if(model.getTarget() != null){
+ commandLine += " -t " + model.getTarget();
+ }
+
+
+ return commandLine;
+
+ }
+
+/* private List<String> getEnv(){
+ List<String> env = new ArrayList<String>();
+
+ String project = model.getWebProjectName();
+ String projectRoot = JBossWSCreationUtils.getProjectRoot(project).toOSString();
+ env.add("o=" + projectRoot + Path.SEPARATOR + "src");
+
+ String customePkg = model.getPackageText();
+ if(customePkg != null && !"".equals(customePkg)){
+ env.add(" p=" + customePkg);
+ }
+
+ String bindingFileLocation = model.getBindingFileLocation();
+ if(bindingFileLocation != null && !"".equals(bindingFileLocation)){
+ File bindingFile = new File(bindingFileLocation);
+ if(bindingFile.exists()){
+ env.add("b=" + bindingFileLocation);
+ }
+ }
+
+ return env;
+
+ }
+*/
+}
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommnad.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommnad.java 2008-05-09
02:49:47 UTC (rev 8016)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommnad.java 2008-05-09
02:49:57 UTC (rev 8017)
@@ -1,142 +0,0 @@
-package org.jboss.tools.ws.creation.core.commands;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
-import java.util.List;
-
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.jboss.tools.ws.core.JbossWSCorePlugin;
-import org.jboss.tools.ws.creation.core.data.ServiceModel;
-import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
-
-public class WSDL2JavaCommnad extends AbstractDataModelOperation{
-
- private ServiceModel model;
-
-
- public WSDL2JavaCommnad(ServiceModel model){
- this.model = model;
- }
-
- @Override
- public IStatus execute(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
-
- String runtimeLocation =
JbossWSCorePlugin.getDefault().getPreferenceStore().getString("jbosswsruntimelocation");
- String commandLocation = runtimeLocation + Path.SEPARATOR + "bin";
- String command = "sh wsconsume.sh ";
- if(System.getProperty("os.name").toLowerCase().indexOf("win") >=
0){
- command = "cmd.exe /c wsconsume.bat ";
- }
- String args = getCommandlineArgs();
- command += " -k " + args + " " + model.getWsdlURI();
-
- try {
- Runtime rt = Runtime.getRuntime();
- Process proc = rt.exec(command, null, new File(commandLocation));
- InputStreamReader ir = new InputStreamReader(proc.getErrorStream());
- LineNumberReader input = new LineNumberReader(ir);
- String str = input.readLine();
- StringBuffer result = new StringBuffer();
- while(str != null){
- System.out.println(str);
- result.append(str).append("\t\r");
- str = input.readLine();
-
- }
- proc.waitFor();
- System.out.print(result);
-
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- SAXParserFactory spf = SAXParserFactory.newInstance();
- refreshProject(model.getWebProjectName(), monitor);
-
-
- return Status.OK_STATUS;
- }
-
- private void refreshProject(String project, IProgressMonitor monitor){
- try {
- JBossWSCreationUtils.getProjectByName(project).refreshLocal(2, monitor);
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- private String getCommandlineArgs(){
- String commandLine;
- String project = model.getWebProjectName();
- String projectRoot = JBossWSCreationUtils.getProjectRoot(project).toOSString();
- commandLine = "-s " + projectRoot + Path.SEPARATOR + "src";
-
- if(model.getCustomPackage() != null &&
!"".equals(model.getCustomPackage())){
- commandLine += " -p " + model.getCustomPackage();
- }
-
- List<String> bindingFiles = model.getBindingFiles();
- for(String bindingFileLocation: bindingFiles){
- File bindingFile = new File(bindingFileLocation);
- if(bindingFile.exists()){
- commandLine += " -b " + bindingFileLocation;
- }
- }
-
- if(model.getCatalog() != null &&
!"".equals(model.getCatalog().trim())){
- File catalog = new File(model.getCatalog());
- if(catalog.exists()){
- commandLine += " -c " + model.getCatalog();
- }
- }
-
- if(model.getTarget() != null){
- commandLine += " -t " + model.getTarget();
- }
-
-
- return commandLine;
-
- }
-
-/* private List<String> getEnv(){
- List<String> env = new ArrayList<String>();
-
- String project = model.getWebProjectName();
- String projectRoot = JBossWSCreationUtils.getProjectRoot(project).toOSString();
- env.add("o=" + projectRoot + Path.SEPARATOR + "src");
-
- String customePkg = model.getPackageText();
- if(customePkg != null && !"".equals(customePkg)){
- env.add(" p=" + customePkg);
- }
-
- String bindingFileLocation = model.getBindingFileLocation();
- if(bindingFileLocation != null && !"".equals(bindingFileLocation)){
- File bindingFile = new File(bindingFileLocation);
- if(bindingFile.exists()){
- env.add("b=" + bindingFileLocation);
- }
- }
-
- return env;
-
- }
-*/
-}
Copied:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java
(from rev 7988,
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommnad.java)
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java
(rev 0)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommand.java 2008-05-09
02:49:57 UTC (rev 8017)
@@ -0,0 +1,90 @@
+package org.jboss.tools.ws.creation.core.commands;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+import org.jboss.tools.ws.core.JbossWSCorePlugin;
+import org.jboss.tools.ws.creation.core.data.ServiceModel;
+import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
+
+public class WSProviderInvokeCommand extends AbstractDataModelOperation{
+
+ private ServiceModel model;
+
+
+ public WSProviderInvokeCommand(ServiceModel model){
+ this.model = model;
+ }
+
+ @Override
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+
+ String runtimeLocation =
JbossWSCorePlugin.getDefault().getPreferenceStore().getString("jbosswsruntimelocation");
+ String commandLocation = runtimeLocation + Path.SEPARATOR + "bin";
+ String command = "sh wsprovide.sh ";
+ if(System.getProperty("os.name").toLowerCase().indexOf("win") >=
0){
+ command = "cmd.exe /C wsprovide.bat";
+ }
+ String args = getCommandlineArgs();
+ command += " -k " + args;
+
+ try {
+
+ InputStreamReader ir = new InputStreamReader(Runtime.getRuntime().exec(command, null,
new File(commandLocation)).getInputStream());
+ LineNumberReader input = new LineNumberReader(ir);
+ String str = input.readLine();
+ while(str != null){
+ System.out.println(str);
+ str = input.readLine();
+ }
+
+
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ refreshProject(model.getWebProjectName(), monitor);
+
+ return Status.OK_STATUS;
+ }
+
+ private void refreshProject(String project, IProgressMonitor monitor){
+ try {
+ JBossWSCreationUtils.getProjectByName(project).refreshLocal(2, monitor);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ private String getCommandlineArgs(){
+ String commandLine;
+ String project = model.getWebProjectName();
+ String projectRoot = JBossWSCreationUtils.getProjectRoot(project).toOSString();
+ commandLine = "-s " + projectRoot + Path.SEPARATOR + "src";
+
+ if(model.isGenWSDL()){
+ commandLine += " -w ";
+ }
+ commandLine += " -r " + projectRoot + Path.SEPARATOR +
"WebContent" + Path.SEPARATOR + "wsdl ";
+
+ commandLine += " -c " + projectRoot + Path.SEPARATOR +
"build/classes/ ";
+
+ commandLine += model.getServiceClass();
+
+ return commandLine;
+
+ }
+}
Deleted:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommnad.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommnad.java 2008-05-09
02:49:47 UTC (rev 8016)
+++
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSProviderInvokeCommnad.java 2008-05-09
02:49:57 UTC (rev 8017)
@@ -1,90 +0,0 @@
-package org.jboss.tools.ws.creation.core.commands;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.jboss.tools.ws.core.JbossWSCorePlugin;
-import org.jboss.tools.ws.creation.core.data.ServiceModel;
-import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
-
-public class WSProviderInvokeCommnad extends AbstractDataModelOperation{
-
- private ServiceModel model;
-
-
- public WSProviderInvokeCommnad(ServiceModel model){
- this.model = model;
- }
-
- @Override
- public IStatus execute(IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
-
- String runtimeLocation =
JbossWSCorePlugin.getDefault().getPreferenceStore().getString("jbosswsruntimelocation");
- String commandLocation = runtimeLocation + Path.SEPARATOR + "bin";
- String command = "sh wsprovide.sh ";
- if(System.getProperty("os.name").toLowerCase().indexOf("win") >=
0){
- command = "cmd.exe /C wsprovide.bat";
- }
- String args = getCommandlineArgs();
- command += " -k " + args;
-
- try {
-
- InputStreamReader ir = new InputStreamReader(Runtime.getRuntime().exec(command, null,
new File(commandLocation)).getInputStream());
- LineNumberReader input = new LineNumberReader(ir);
- String str = input.readLine();
- while(str != null){
- System.out.println(str);
- str = input.readLine();
- }
-
-
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- refreshProject(model.getWebProjectName(), monitor);
-
- return Status.OK_STATUS;
- }
-
- private void refreshProject(String project, IProgressMonitor monitor){
- try {
- JBossWSCreationUtils.getProjectByName(project).refreshLocal(2, monitor);
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- private String getCommandlineArgs(){
- String commandLine;
- String project = model.getWebProjectName();
- String projectRoot = JBossWSCreationUtils.getProjectRoot(project).toOSString();
- commandLine = "-s " + projectRoot + Path.SEPARATOR + "src";
-
- if(model.isGenWSDL()){
- commandLine += " -w ";
- }
- commandLine += " -r " + projectRoot + Path.SEPARATOR +
"WebContent" + Path.SEPARATOR + "wsdl ";
-
- commandLine += " -c " + projectRoot + Path.SEPARATOR +
"build/classes/ ";
-
- commandLine += model.getServiceClass();
-
- return commandLine;
-
- }
-}