diff options
Diffstat (limited to 'bundles/org.eclipse.jst.ws.axis.creation.ui/src/org')
36 files changed, 0 insertions, 5123 deletions
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/AxisCreationUI.properties b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/AxisCreationUI.properties deleted file mode 100644 index 1db0f5000..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/AxisCreationUI.properties +++ /dev/null @@ -1,105 +0,0 @@ -############################################################################### -# Copyright (c) 2004, 2007 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -# yyyymmdd bug Email and other contact information -# -------- -------- ----------------------------------------------------------- -# 20060216 126989 pmoogk@ca.ibm.com - Peter Moogk -# 20060329 128827 kathy@ca.ibm.com - Kathy Chan -# 20060329 124667 kathy@ca.ibm.com - Kathy Chan -# 20060607 144978 kathy@ca.ibm.com - Kathy Chan -# 20070509 182274 kathy@ca.ibm.com - Kathy Chan -############################################################################### - -# -# Messages in plugin.xml. -# - -# -# Error messages used in this plugin -# -MSG_ERROR_PROJECT_URL=IWAB0514E Unable to get URL for project {0} -MSG_ERROR_CANNOT_NO_JAVA_BEAN=IWAB0015E A Java bean was not selected -MSG_ERROR_NO_PROJECT=IWAB0016E A project was not selected -MSG_ERROR_CANNOT_LOAD_JAVA_BEAN=IWAB0017E The Java bean, {0}, cannot be loaded from {1} -MSG_ERROR_JAVA_MOF_REFLECT_FAILED=IWAB0521E Failed to analyze the Java bean: {0}. -MSG_ERROR_READ_BEAN=IWAB0522E Error in reading methods from Java bean. -MSG_ERROR_UPDATE_AXIS_WSDD=IWAB0524E Error updating Axis deploy.wsdd file - -# -#JavaToWSDLMethodCommand -# -MSG_ERROR_JAVA_TO_METHOD=IWAB0019E Error in getting method from Java bean. - -# -#UpdateWEBXMLCommand -# -MSG_ERROR_UPDATE_WEB_XML=IWAB0020E Error in adding servlet in web.xml. - -# -#UpdateAxisWSDDFileTask -# -MSG_PLUGIN_FILE_URL=Problem locating plugin file - -# -#WebServiceWSDLAxisSelectionPage -# -PAGE_MSG_NO_FILE_SPECIFIED=No file specified. -PAGE_MSG_NO_METHOD_SELECTED=No methods selected. - -# -#WebServiceSkeletonAxisConfigPage -# -TOOLTIP_PBSC_PAGE= -TOOLTIP_PBCF_TEXT_URI=The SOAP body namespace and unique identifier of the Web service. -TOOLTIP_PBCF_TEXT_WSDL_FOLDER=The folder of the WSDL file. -TOOLTIP_PBCF_TEXT_WSDL_FILE=The name of the WSDL file. -LABEL_URI=Web service URI: -LABEL_OUTPUT_FOLDER_NAME=WSDL folder: -LABEL_OUTPUT_FILE_NAME=WSDL file: - -# -#WebServiceAxisBeanClassPage -# -PAGE_TITLE_WSBEAN_CLASS=Web Service Java Bean Selection -PAGE_DESC_WSBEAN_CLASS=Select a Java bean -LABEL_EXPLORE_MAPPINGS_BEAN2XML=Define custom mapping for package to namespace. -TOOLTIP_P2N_SHOW_MAPPINGS=Define package to namespace mapping for customization. - -# -#WebServiceAxisBeanConfigPage -# -TOOLTIP_PBCF_PAGE= -TOOLTIP_PBME_TREE_METHODS=Java bean methods to include. -PAGE_TITLE_WSBEAN_CONFIG=Web Service Java Bean Identity -PAGE_DESC_WSBEAN_CONFIG=Configure the Java bean as a Web service. -LABEL_STYLE_USE=Style and use -STYLE_RPC_LITERAL=document/literal -STYLE_DOC_LITERAL=document/literal (wrapped) -STYLE_RPC_ENCODED=RPC/encoded - -# -# AxisCheckCompilerLevelCommand -# -MSG_ERROR_COMPILER_LEVEL_NOT_COMPATIBLE=The workbench is running on Java VM version {0}, however, the compiler compliance level of \ -the project "{1}" is set to Java version {2}. \ -Generation of a Web service from Java cannot proceed because the tools will be unable to process the class file compiled within the project. \ -To correct the problem, take one of the following actions: \ -\n1. Open project properties, select Project Facets, and use Add/Remove Project Facet to change Java version to {0} or lower.\ -\n2. Restart the workbench on a version {2} Java VM. - -# -# ModifyWSDLEndpointAddressCommand -# -MSG_ERROR_MODIFY_ENDPOINT=Error in modifying the soap:address location URI for WSDL file {0}. - -# -# Messages for ValidateWSIComplianceCommand -# -WSI_INCOMPLIANCE_RPC_ENCODED=RPC Encoded is selected - diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/AxisCreationUIMessages.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/AxisCreationUIMessages.java deleted file mode 100644 index d037eabb0..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/AxisCreationUIMessages.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060329 128827 kathy@ca.ibm.com - Kathy Chan - * 20060329 124667 kathy@ca.ibm.com - Kathy Chan - * 20060607 144978 kathy@ca.ibm.com - Kathy Chan - * 20070509 182274 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui; - -import org.eclipse.osgi.util.NLS; - -public final class AxisCreationUIMessages extends NLS { - - private static final String BUNDLE_NAME = "org.eclipse.jst.ws.internal.axis.creation.ui.AxisCreationUI";//$NON-NLS-1$ - - private AxisCreationUIMessages() { - // Do not instantiate - } - - public static String MSG_ERROR_PROJECT_URL; - public static String MSG_ERROR_CANNOT_NO_JAVA_BEAN; - public static String MSG_ERROR_NO_PROJECT; - public static String MSG_ERROR_CANNOT_LOAD_JAVA_BEAN; - public static String MSG_ERROR_JAVA_MOF_REFLECT_FAILED; - public static String MSG_ERROR_READ_BEAN; - public static String MSG_ERROR_UPDATE_AXIS_WSDD; - public static String MSG_ERROR_JAVA_TO_METHOD; - public static String MSG_ERROR_UPDATE_WEB_XML; - public static String MSG_PLUGIN_FILE_URL; - public static String PAGE_MSG_NO_FILE_SPECIFIED; - public static String PAGE_MSG_NO_METHOD_SELECTED; - public static String TOOLTIP_PBSC_PAGE; - public static String TOOLTIP_PBCF_TEXT_URI; - public static String TOOLTIP_PBCF_TEXT_WSDL_FOLDER; - public static String TOOLTIP_PBCF_TEXT_WSDL_FILE; - public static String LABEL_URI; - public static String LABEL_OUTPUT_FOLDER_NAME; - public static String LABEL_OUTPUT_FILE_NAME; - public static String PAGE_TITLE_WSBEAN_CLASS; - public static String PAGE_DESC_WSBEAN_CLASS; - public static String LABEL_EXPLORE_MAPPINGS_BEAN2XML; - public static String TOOLTIP_P2N_SHOW_MAPPINGS; - public static String TOOLTIP_PBCF_PAGE; - public static String TOOLTIP_PBME_TREE_METHODS; - public static String PAGE_TITLE_WSBEAN_CONFIG; - public static String PAGE_DESC_WSBEAN_CONFIG; - public static String LABEL_STYLE_USE; - public static String STYLE_RPC_LITERAL; - public static String STYLE_DOC_LITERAL; - public static String STYLE_RPC_ENCODED; - public static String MSG_ERROR_COMPILER_LEVEL_NOT_COMPATIBLE; - public static String MSG_ERROR_MODIFY_ENDPOINT; - public static String WSI_INCOMPLIANCE_RPC_ENCODED; - - static { - NLS.initializeMessages(BUNDLE_NAME, AxisCreationUIMessages.class); - } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/AxisCheckCompilerLevelCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/AxisCheckCompilerLevelCommand.java deleted file mode 100644 index 28363ed1b..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/AxisCheckCompilerLevelCommand.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.command; - -import org.eclipse.core.resources.IProject; -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.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.ws.internal.axis.creation.ui.AxisCreationUIMessages; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; - -/** - * Check to make sure that the project containing the service bean is not at a compiler compliance setting - * that's higher than the Java VM the workbench is launched with. - */ -public class AxisCheckCompilerLevelCommand extends AbstractDataModelOperation { - - private String serverProject_; - - /** - * Default CTOR - */ - public AxisCheckCompilerLevelCommand() { - } - - /* (non-Javadoc) - * @see org.eclipse.core.commands.operations.IUndoableOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ - public IStatus execute(IProgressMonitor monitor, IAdaptable adaptable) { - - IStatus status = Status.OK_STATUS; - String javaSpecVersion = System.getProperty("java.specification.version"); - if (javaSpecVersion != null) - { - IProject project = ProjectUtilities.getProject(serverProject_); - IJavaProject javaProject = JavaCore.create(project); - if (javaProject != null) - { - String projectCompilerLevel = javaProject.getOption("org.eclipse.jdt.core.compiler.compliance", false); - if (projectCompilerLevel == null) - { - projectCompilerLevel = (String)JavaCore.getDefaultOptions().get("org.eclipse.jdt.core.compiler.compliance"); - } - if (projectCompilerLevel != null) - { - if (!compilerLevelsCompatible(javaSpecVersion, projectCompilerLevel)) { - status = StatusUtils.errorStatus( NLS.bind(AxisCreationUIMessages.MSG_ERROR_COMPILER_LEVEL_NOT_COMPATIBLE, new String[] {javaSpecVersion, serverProject_, projectCompilerLevel})); - getEnvironment().getStatusHandler().reportError(status); - } - } - } - } - return status; - } - - /** - * Returns true if and only if the Java specification level - * of the Eclipse JRE (<code>javaSpecVersion</code> is not - * lower than the Java specification level of the compiler - * (<code>projectCompilerLevel</code>. - * @param javaSpecVersion The Java Specification Version of the JRE. - * @param projectCompilerLevel The Java project's compiler level. - * @return True if the Java specification level of the project's - * compiler does not exceed the Java specification level of the - * JRE that Eclipse is running on, and false otherwise. - */ - private boolean compilerLevelsCompatible(String javaSpecVersion, String projectCompilerLevel) { - return (javaSpecVersion.compareTo(projectCompilerLevel) >= 0); - } - - /** - * Sets the project whose compiler level should be checked. - * @param serverProject The project whose compiler level should be checked. - */ - public void setServerProject(String serverProject) { - serverProject_ = serverProject; - } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/AxisOutputCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/AxisOutputCommand.java deleted file mode 100644 index 956da3c2d..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/AxisOutputCommand.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.command; - - -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.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.axis.creation.ui.wsrt.AxisWebService; -import org.eclipse.jst.ws.internal.axis.creation.ui.wsrt.AxisWebServiceInfo; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; - - -public class AxisOutputCommand extends AbstractDataModelOperation { - - private AxisWebService ws_; - private JavaWSDLParameter javaWSDLParam_; - - private String wsdlURI_; - - /** - * Default CTOR - */ - public AxisOutputCommand() { - } - - public AxisOutputCommand(AxisWebService ws) { - ws_ = ws; - } - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IStatus status = Status.OK_STATUS; - ws_.getWebServiceInfo().setWsdlURL(wsdlURI_); - AxisWebServiceInfo axisWSInfo = new AxisWebServiceInfo(); - axisWSInfo.setJavaWSDLParameter(javaWSDLParam_); - ws_.setAxisWebServiceInfo(axisWSInfo); - - return status; - } - - /** - * @param wsdlURI - * The wsdlURI to set. - */ - public void setWsdlURI(String wsdlURI) - { - wsdlURI_ = wsdlURI; - } - - public void setJavaWSDLParam (JavaWSDLParameter javaWSDLParam_) { - this.javaWSDLParam_ = javaWSDLParam_; - } - -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/AxisRunInputCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/AxisRunInputCommand.java deleted file mode 100644 index 6967480e9..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/AxisRunInputCommand.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060330 124667 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.command; - -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.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.axis.creation.ui.wsrt.AxisWebService; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; - -public class AxisRunInputCommand extends AbstractDataModelOperation{ - - private AxisWebService ws_; - private JavaWSDLParameter javaWSDLParam_; - private String serverProject_; - private String serverInstanceId_; - private String serverFactoryId_; - private String wsdlURI_; - - public AxisRunInputCommand() { - } - - public AxisRunInputCommand(AxisWebService ws, String project) { - ws_ = ws; - serverProject_ = project; - } - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - javaWSDLParam_ = ws_.getAxisWebServiceInfo().getJavaWSDLParameter(); - serverInstanceId_ = ws_.getWebServiceInfo().getServerInstanceId(); - serverFactoryId_ = ws_.getWebServiceInfo().getServerFactoryId(); - wsdlURI_ = ws_.getWebServiceInfo().getWsdlURL(); - - return Status.OK_STATUS; - } - - /** - * @return Returns the serverProject. - */ - public String getServerProject() - { - return serverProject_; - } - - public JavaWSDLParameter getJavaWSDLParam() { - return javaWSDLParam_; - } - - public String getServerInstanceId() { - return serverInstanceId_; - } - - public String getServerFactoryId() { - return serverFactoryId_; - } - - public String getWsdlURI() { - return wsdlURI_; - } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/AxisServerDefaulter.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/AxisServerDefaulter.java deleted file mode 100644 index b378b6b78..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/AxisServerDefaulter.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.axis.creation.ui.command; - -import org.eclipse.core.resources.IProject; -import org.eclipse.jst.ws.internal.consumption.common.IServerDefaulter; -import org.eclipse.jst.ws.internal.consumption.common.ServerInfo; - - - -public class AxisServerDefaulter implements IServerDefaulter -{ - /* (non-Javadoc) - * @see org.eclipse.jst.ws.internal.consumption.common.IServerDefaulter#recommendDefaultServer(org.eclipse.core.resources.IProject) - */ - public ServerInfo recommendDefaultServer(IProject project) - { - return null; - } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/BUAxisInputCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/BUAxisInputCommand.java deleted file mode 100644 index c193e2a4c..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/BUAxisInputCommand.java +++ /dev/null @@ -1,129 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060419 132905 cbrealey@ca.ibm.com - Chris Brealey - * 20061004 159356 kathy@ca.ibm.com - Kathy Chan, Get correct module root URL based on server chosen - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.command; - - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -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.internal.axis.consumption.core.context.AxisEmitterContext; -import org.eclipse.jst.ws.internal.axis.consumption.core.plugin.WebServiceAxisConsumptionCorePlugin; -import org.eclipse.jst.ws.internal.conformance.JAXRPCWebServiceAnalyzer; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.environment.StatusException; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.server.core.ServerCore; -import org.eclipse.wst.ws.internal.wsrt.IWebService; - - -public class BUAxisInputCommand extends AbstractDataModelOperation { - - private IWebService ws_; - private String serverProject_; - private String javaBeanName_; - - private String serviceServerTypeID_; - private IServer serviceExistingServer_ = null; - - /** - * Default CTOR - */ - public BUAxisInputCommand() { - } - - public BUAxisInputCommand(IWebService ws, String project) { - ws_ = ws; - serverProject_ = project; - } - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - - String serverInstanceId = ws_.getWebServiceInfo().getServerInstanceId(); - String serverFactoryId = ws_.getWebServiceInfo().getServerFactoryId(); - javaBeanName_ = ws_.getWebServiceInfo().getImplURL(); - - // The following "if" block drives validation of the given - // Java service class (javaBeanName_) against JAX-RPC if the - // JAX-RPC validation preference is switched on. - // For the most part, the JAX-RPC analyzer returns warnings - // for violations of the JAX-RPC spec, and errors only if - // actual JDT model navigation fails due to bad classpaths. - // This allows users the choice of heeding or ignoring the - // messages returned by the analyzer. - IEnvironment environment = getEnvironment(); - AxisEmitterContext context = WebServiceAxisConsumptionCorePlugin.getInstance().getAxisEmitterContext(); - if (javaBeanName_ != null && context.isValidateAgainstJAXRPCEnabled()) - { - JAXRPCWebServiceAnalyzer analyzer = new JAXRPCWebServiceAnalyzer(); - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(serverProject_); - if (project != null) - { - IStatus status = analyzer.analyze(project,javaBeanName_,monitor); - if (!status.isOK()) - { - try - { - environment.getStatusHandler().report(status); - } - catch (StatusException e) - { - return new Status(IStatus.ERROR,"org.eclipse.jst.ws",0,"",null); - } - } - } - } - - if (serverInstanceId != null) { // server exists - serviceExistingServer_ = ServerCore.findServer(serverInstanceId); - if (serviceExistingServer_ != null) - { - serviceServerTypeID_ = serviceExistingServer_.getServerType().getId(); - } - } - else - { - serviceServerTypeID_ = serverFactoryId; - } - - return Status.OK_STATUS; - } - - /** - * @return Returns the serverProject. - */ - public String getServerProject() - { - return serverProject_; - } - - public String getServiceServerTypeID() - { - return serviceServerTypeID_; - } - - public String getJavaBeanName() { - return javaBeanName_; - } - - public IServer getServiceExistingServer() - { - return serviceExistingServer_; - } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/BUCodeGenOperation.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/BUCodeGenOperation.java deleted file mode 100644 index bae225977..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/BUCodeGenOperation.java +++ /dev/null @@ -1,178 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * - * 20060509 125094 sengpl@ca.ibm.com - Seng Phung-Lu, Use WorkspaceModifyOperation - * 20060515 115225 sengpl@ca.ibm.com - Seng Phung-Lu - * 20060517 142327 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.command; - -import org.eclipse.core.resources.IProject; -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.Status; -import org.eclipse.jst.ws.internal.axis.consumption.core.command.Java2WSDLCommand; -import org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaCommand; -import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.axis.consumption.ui.task.CopyAxisJarCommand; -import org.eclipse.jst.ws.internal.axis.consumption.ui.task.RefreshProjectCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.task.UpdateAxisWSDDFileTask; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; - -public class BUCodeGenOperation extends AbstractDataModelOperation { - - // CopyAxisJarCommand - private CopyAxisJarCommand copyAxisJarCommand = null; - - // Java2WSDLCommand - private Java2WSDLCommand java2WSDLCommand = null; - private JavaWSDLParameter javaWSDLParam; - private String wsdlURI; - - // wsdl2JavaCommand - private WSDL2JavaCommand wsdl2JavaCommand = null; - - // UpdateAxisWSDDFileTask - private UpdateAxisWSDDFileTask updateAxisWsddCommand = null; - private IProject serviceProject; - - // UpdateWEBXMLCommand - private UpdateWEBXMLCommand updateWebXMLCommand = null; - - // RefreshProjectCommand - private RefreshProjectCommand refreshProjectCommand = null; - - /** - * This command runs the commands in the constructor in a WorkspaceModifyOperation. - * The commands are listed above, along with their relevant data registry parameters - * @param java2WSDL - * @param wsdl2Java - * @param updateAxisWsdd - * @param updateWebXML - */ - public BUCodeGenOperation(){ - copyAxisJarCommand = new CopyAxisJarCommand(); - java2WSDLCommand = new Java2WSDLCommand(); - wsdl2JavaCommand = new WSDL2JavaCommand(); - updateAxisWsddCommand = new UpdateAxisWSDDFileTask(); - updateWebXMLCommand = new UpdateWEBXMLCommand(); - refreshProjectCommand = new RefreshProjectCommand(); - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) { - - IEnvironment env = getEnvironment(); - BottomUpWSModifyOperation buOperation = new BottomUpWSModifyOperation(info, env); - try { - buOperation.execute(monitor); - } - catch(CoreException ce){ - IStatus status = ce.getStatus(); - return status; - } - return Status.OK_STATUS; - - } - - private class BottomUpWSModifyOperation extends WorkspaceModifyOperation { - - private IAdaptable info = null; - private IEnvironment env = null; - - - protected BottomUpWSModifyOperation(IAdaptable adaptable, IEnvironment environment){ - info = adaptable; - env = environment; - } - - protected void execute(IProgressMonitor monitor) throws CoreException{ - - IStatus status = null; - - // CopyAxisJarCommand - copyAxisJarCommand.setEnvironment(env); - copyAxisJarCommand.setProject(serviceProject); - status = copyAxisJarCommand.execute(monitor, info); - if (status.getSeverity() == Status.ERROR){ - throw new CoreException(status); - } - - // Java2WSDLCommand - java2WSDLCommand.setEnvironment(env); - java2WSDLCommand.setJavaWSDLParam(javaWSDLParam); - status = java2WSDLCommand.execute(monitor, info); - if (status.getSeverity() == Status.ERROR) { - throw new CoreException(status); - } - wsdlURI = java2WSDLCommand.getWsdlURI(); - - // WSDL2JavaCommand - wsdl2JavaCommand.setEnvironment(env); - wsdl2JavaCommand.setJavaWSDLParam(javaWSDLParam); - status = wsdl2JavaCommand.execute(monitor, info); - if (status.getSeverity() == Status.ERROR) { - throw new CoreException(status); - } - javaWSDLParam = wsdl2JavaCommand.getJavaWSDLParam(); - - // UpdateAxisWsddCommand - updateAxisWsddCommand.setEnvironment(env); - updateAxisWsddCommand.setJavaWSDLParam(javaWSDLParam); - updateAxisWsddCommand.setServiceProject(serviceProject); - status = updateAxisWsddCommand.execute(monitor, info); - if (status.getSeverity() == Status.ERROR) { - throw new CoreException(status); - } - javaWSDLParam = updateAxisWsddCommand.getJavaWSDLParam(); - - // UpdateWebXMLCommand - updateWebXMLCommand.setEnvironment(env); - updateWebXMLCommand.setServerProject(serviceProject); - status = updateWebXMLCommand.execute(monitor, info); - if (status.getSeverity() == Status.ERROR) { - throw new CoreException(status); - } - - // RefreshProjectCommand - refreshProjectCommand.setEnvironment(env); - refreshProjectCommand.setProject(serviceProject); - status = refreshProjectCommand.execute(monitor, info); - if (status.getSeverity() == Status.ERROR) { - throw new CoreException(status); - } - - - } - - } - - public String getWsdlURI() { - return wsdlURI; - } - - public JavaWSDLParameter getJavaWSDLParam() { - return javaWSDLParam; - } - - public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) { - this.javaWSDLParam = javaWSDLParam; - } - - public void setServiceProject(IProject serviceProject) { - this.serviceProject = serviceProject; - } - -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/CopyDeploymentFileCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/CopyDeploymentFileCommand.java deleted file mode 100644 index 4efe8467b..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/CopyDeploymentFileCommand.java +++ /dev/null @@ -1,160 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060524 130755 kathy@ca.ibm.com - Kathy Chan - * 20061221 168787 kathy@ca.ibm.com - Kathy Chan - * 20070815 188999 pmoogk@ca.ibm.com - Peter Moogk - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.command; - - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -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.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.ws.internal.axis.consumption.core.AxisConsumptionCoreMessages; -import org.eclipse.jst.ws.internal.common.J2EEUtils; -import org.eclipse.jst.ws.internal.common.ResourceUtils; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.command.internal.env.common.FileResourceUtils; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.command.internal.env.core.context.ResourceContext; -import org.eclipse.wst.command.internal.env.eclipse.BaseEclipseEnvironment; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.componentcore.resources.IVirtualFile; -import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.environment.IStatusHandler; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.server.core.IModule; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.server.core.ServerCore; -import org.eclipse.wst.server.core.ServerUtil; -import org.eclipse.wst.server.core.internal.IModulePublishHelper; - -/** - * - * This command copies the server-config.wsdd file to it's proper location in the module. - * - */ - -public class CopyDeploymentFileCommand extends AbstractDataModelOperation -{ - private final String WEB_INF = "WEB-INF"; - private final String SERVER_CONFIG = "server-config.wsdd"; - private String projectName_; - private String EARProjectName_; - private String serverInstanceId_; - - /** - * Constructor for CopyDeploymentFileCommand. - * @param String description - * @param String name - * - */ - public CopyDeploymentFileCommand( String projectName, String earProjectName ) - { - projectName_ = projectName; - EARProjectName_ = earProjectName; - } - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IStatus status = Status.OK_STATUS; - IEnvironment environment = getEnvironment(); - - FileInputStream finStream = null; - try - { - - IVirtualComponent component = J2EEUtils.getVirtualComponent( projectName_ ); - IServer server = ServerCore.findServer( serverInstanceId_ ); - IProject project = ProjectUtilities.getProject(projectName_); - IModule projectModule = ServerUtil.getModule(project); - - if (server != null && component != null && projectModule != null) { - IModulePublishHelper publishHelper = (IModulePublishHelper) - server.loadAdapter(IModulePublishHelper.class, monitor); - if (publishHelper != null) { - IModule[] serverModules; - if (EARProjectName_ == null) { - serverModules = new IModule [] {projectModule}; - } else { - IProject EARProject = ProjectUtilities.getProject(EARProjectName_); - IModule EARProjectModule = ServerUtil.getModule(EARProject); - serverModules = new IModule [] {EARProjectModule, projectModule}; - } - IPath publishDirPath = publishHelper.getPublishDirectory(serverModules); - - if (publishDirPath != null) { - IVirtualFolder rootFolder = component.getRootFolder(); - IPath rootFolderPath = ResourceUtils.getWorkspaceRoot().getFile(rootFolder.getWorkspaceRelativePath()).getLocation(); - if (rootFolderPath != null) { - File rootFolderFile = rootFolderPath.toFile(); - File publishDirFile = publishDirPath.toFile(); - if (!rootFolderFile.equals(publishDirFile)) { - // copy the server-config.wsdd if the publish directory is not in the same as the project root folder - IPath path = new Path( WEB_INF ).append( SERVER_CONFIG ); - IPath serverConfigPath = publishDirPath.append(path); - if (serverConfigPath != null) { - IVirtualFile newLocation = rootFolder.getFile(path); - IPath targetPath = newLocation.getWorkspaceRelativePath(); - if (targetPath != null) { - finStream = new FileInputStream(serverConfigPath.toString()); - if (finStream != null) - { - IStatusHandler statusHandler = environment.getStatusHandler(); - ResourceContext context = ((BaseEclipseEnvironment)environment).getResourceContext(); - - FileResourceUtils.createFile(context, - targetPath, - finStream, - monitor, - statusHandler); - finStream.close(); - } - } - } - } - } - } - } - } - } - catch( Throwable e ) - { - status = StatusUtils.errorStatus(NLS.bind(AxisConsumptionCoreMessages.MSG_ERROR_MOVE_RESOURCE, new String[]{e.getLocalizedMessage()}), e); - environment.getStatusHandler().reportError(status); - } finally { - if (finStream != null) { - try { - finStream.close(); - } catch (IOException e) { - } - } - } - - return status; - - } - - public void setServerInstanceId(String serverInstanceId) { - this.serverInstanceId_ = serverInstanceId; - } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/JavaToWSDLMethodCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/JavaToWSDLMethodCommand.java deleted file mode 100644 index 8c3418ebc..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/JavaToWSDLMethodCommand.java +++ /dev/null @@ -1,213 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.command; - - -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IProject; -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.jem.java.JavaClass; -import org.eclipse.jem.java.Method; -import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.axis.creation.ui.AxisCreationUIMessages; -import org.eclipse.jst.ws.internal.common.JavaMOFUtils; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.environment.ILog; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; - - -public class JavaToWSDLMethodCommand extends AbstractDataModelOperation { - - private static String JAVA_EXTENSION = ".java"; //$NON-NLS-1$ - private static String CLASS_EXTENSION = ".class"; //$NON-NLS-1$ - - private Hashtable fMethodNames; - private String fClassName; - private String fbeanBaseName; - private JavaWSDLParameter javaWSDLParam_; - private IProject serviceProject_; - - /** - * Default CTOR - */ - public JavaToWSDLMethodCommand() { - } - /** - * Default CTOR - */ - public JavaToWSDLMethodCommand( - JavaWSDLParameter javaParameter, - IProject serviceProject) { - javaWSDLParam_ = javaParameter; - serviceProject_ = serviceProject; - - } - - /** - * JavaToToWSDLMethod execute - */ - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IEnvironment environment = getEnvironment(); - - fbeanBaseName = javaWSDLParam_.getBeanName(); - environment.getLog().log(ILog.INFO, 5070, this, "execute", "beanBaseName = "+fbeanBaseName); - IStatus status; - try { - //Get the qualified bean name; my.package.MyClass - fMethodNames = new Hashtable(); - Hashtable oldMethodsNames = javaWSDLParam_.getMethods(); - String qName = fbeanBaseName; - - if (qName.toLowerCase().endsWith(JAVA_EXTENSION) - || qName.toLowerCase().endsWith(CLASS_EXTENSION)) { - qName = qName.substring(0, qName.lastIndexOf('.')); - } - - JavaClass javaClass = JavaMOFUtils.getJavaClass(qName, serviceProject_); - - if (!javaClass.isExistingType()) { - environment.getLog().log(ILog.ERROR, 5022, this, "execute", - NLS.bind(AxisCreationUIMessages.MSG_ERROR_JAVA_MOF_REFLECT_FAILED, - new String[] { qName })); - - status = StatusUtils.errorStatus( - NLS.bind(AxisCreationUIMessages.MSG_ERROR_JAVA_MOF_REFLECT_FAILED, - new String[] { qName })); - environment.getStatusHandler().reportError(status); - return status; - } - - // Get the qualified name - fClassName = javaClass.getQualifiedName(); - String beanName; - if (fClassName.lastIndexOf('.') != -1) { - beanName = - fClassName.substring( - fClassName.lastIndexOf('.') + 1, - fClassName.length()); - } else - beanName = fClassName; - - // Walk the java class and get the method names - gatherMethods(javaClass, beanName, oldMethodsNames); - /* - Iterator m = javaClass.getPublicMethodsExtended().iterator(); - while (m.hasNext()) { - Method method = (Method) m.next(); - if ( ! method.isConstructor()){ - if (!beanName.equals(method.getName()) - && !(isDuplicateMethodName(method - .getMethodElementSignature())) - && !(method - .getContainingJavaClass() - .getJavaName() - .equalsIgnoreCase("javax.ejb.EJBObject")) //$NON-NLS-1$ - && !(method - .getContainingJavaClass() - .getJavaName() - .equalsIgnoreCase("javax.ejb.EJBObject[]")) //$NON-NLS-1$ - && !(method - .getContainingJavaClass() - .getJavaName() - .equalsIgnoreCase("java.lang.Object")) //$NON-NLS-1$ - && !(method - .getContainingJavaClass() - .getJavaName() - .equalsIgnoreCase("java.lang.Object[]"))) { //$NON-NLS-1$ - // add the method name to our list of method names - String methodName =method.getMethodElementSignature(); - Boolean isSelected = new Boolean(true); - if (oldMethodsNames != null && oldMethodsNames.containsKey(methodName)) - isSelected = (Boolean)oldMethodsNames.get(methodName); - fMethodNames.put(methodName, isSelected); - } - } - } - */ - javaWSDLParam_.setMethods(fMethodNames); - - return Status.OK_STATUS; - - } catch (Exception e) { - environment.getLog().log(ILog.ERROR, 5023, this, "execute", AxisCreationUIMessages.MSG_ERROR_READ_BEAN); - - status = StatusUtils.errorStatus(AxisCreationUIMessages.MSG_ERROR_JAVA_TO_METHOD, e); - environment.getStatusHandler().reportError(status); - return status; - } - } - - private void gatherMethods(JavaClass javaClass, String beanName, Hashtable oldMethodsNames) - { - String javaName = javaClass.getJavaName(); - if (!javaClass.isInterface() - && !javaName.equalsIgnoreCase("javax.ejb.EJBObject[]") - && !javaName.equalsIgnoreCase("javax.ejb.EJBObject") - && !javaName.equalsIgnoreCase("java.lang.Object[]") - && !javaName.equalsIgnoreCase("java.lang.Object")) - { - List publicMethods = javaClass.getPublicMethods(); - for (Iterator it = publicMethods.iterator(); it.hasNext();) - { - Method method = (Method)it.next(); - if (!method.isConstructor() - && !beanName.equals(method.getName()) - && !(isDuplicateMethodName(method.getMethodElementSignature()))) - { - // add the method name to our list of method names - String methodName = method.getMethodElementSignature(); - Boolean isSelected = new Boolean(true); - if (oldMethodsNames != null && oldMethodsNames.containsKey(methodName)) - isSelected = (Boolean)oldMethodsNames.get(methodName); - fMethodNames.put(methodName, isSelected); - } - } - gatherMethods(javaClass.getSupertype(), beanName, oldMethodsNames); - } - } - - //Returns true if the provided method name already exists in the - //fMethodNames vector. This method is used to detect overloaded - //methods in Beans and EJBs, which are currently unsupported. - private boolean isDuplicateMethodName(String methodName) { - return (fMethodNames == null ? false: fMethodNames.containsKey(methodName)); - } - - /** - * Returns the javaWSDLParam. - * @return JavaWSDLParameter - */ - public JavaWSDLParameter getJavaWSDLParam() { - return javaWSDLParam_; - } - - /** - * Sets the javaWSDLParam. - * @param javaWSDLParam The javaWSDLParam to set - */ - public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) { - this.javaWSDLParam_ = javaWSDLParam; - } - - public void setServiceProject(IProject serviceProject) - { - serviceProject_ = serviceProject; - } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/ModifyWSDLEndpointAddressCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/ModifyWSDLEndpointAddressCommand.java deleted file mode 100644 index 4b4f02674..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/ModifyWSDLEndpointAddressCommand.java +++ /dev/null @@ -1,187 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060515 115225 sengpl@ca.ibm.com - Seng Phung-Lu - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.command; - -import java.io.OutputStream; -import java.net.URL; -import java.util.Iterator; -import java.util.Map; - -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.Service; -import javax.wsdl.extensions.soap.SOAPAddress; -import javax.wsdl.factory.WSDLFactory; -import javax.wsdl.xml.WSDLWriter; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -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.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.axis.creation.ui.AxisCreationUIMessages; -import org.eclipse.jst.ws.internal.common.ResourceUtils; -import org.eclipse.jst.ws.internal.common.ServerUtils; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.server.core.ServerCore; -import org.eclipse.wst.ws.internal.parser.discovery.WebServicesParserExt; -import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; -import org.eclipse.wst.wsdl.internal.impl.wsdl4j.WSDLFactoryImpl; - -public class ModifyWSDLEndpointAddressCommand extends AbstractDataModelOperation { - - private String serverInstanceId; - private String serverFactoryId; - private IProject serviceProject; - private String wsdlURI; - private WebServicesParser webServicesParser; - public final String SERVICE_EXT = "/services/"; //$NON-NLS-1$ - private JavaWSDLParameter javaWSDLParam; - - public IStatus execute(IProgressMonitor monitor, IAdaptable adaptable) { - IStatus status; - IEnvironment environment = getEnvironment(); - try { - // the correct project URL has already been obtained, no need to modify <soap:address> location URI - if (!javaWSDLParam.isGuessProjectURL()) { - return Status.OK_STATUS; - } - - String projectURL = null; - - IServer server = null; - if(serverInstanceId!=null) { - server = ServerCore.findServer(serverInstanceId); - } - - if(server!=null) { - projectURL = ServerUtils.getEncodedWebComponentURL(serviceProject, serverFactoryId, server); - } else { - projectURL = ServerUtils.getEncodedWebComponentURL(serviceProject, serverFactoryId); - } - - if(projectURL==null || projectURL.trim().length()==0) { - status = StatusUtils.errorStatus(NLS.bind(AxisCreationUIMessages.MSG_ERROR_PROJECT_URL, new String[] {serviceProject.getName()})); - environment.getStatusHandler().reportError(status); - return status; - } - - if (javaWSDLParam.getProjectURL() == projectURL) { - return Status.OK_STATUS; - } - - javaWSDLParam.setProjectURL(projectURL); // project URL needed for Axis deploy - - // modify the <soap:address> location URI to reflect the correct project URL - if(wsdlURI!=null) { - boolean modified = false; - if (webServicesParser == null) { - webServicesParser = new WebServicesParserExt(); - } - Definition definition = webServicesParser.getWSDLDefinition(wsdlURI); - Map services = definition.getServices(); - for (Iterator it = services.values().iterator(); it.hasNext();) { - Service ser = (Service)it.next(); - Map ports = ser.getPorts(); - for (Iterator it2 = ports.values().iterator(); it2.hasNext();) { - Port p = (Port)it2.next(); - for (Iterator it3 = p.getExtensibilityElements().iterator(); it3.hasNext();) { - Object obj = it3.next(); - if (obj instanceof SOAPAddress) { - SOAPAddress soapAddress = (SOAPAddress)obj; - String wsdlSoapAddress = soapAddress.getLocationURI(); - - // check if the WSDL SOAP address has the right project URL, if not, update it - if(wsdlSoapAddress!=null) { - if (!wsdlSoapAddress.startsWith(projectURL)) { - // e.g. "http://tempuri.org/services/ServiceName" becomes "/services/ServiceName" - String servicesString = wsdlSoapAddress.substring(wsdlSoapAddress.indexOf(SERVICE_EXT)); - soapAddress.setLocationURI(projectURL + servicesString); - modified = true; - } - - } - } - } - } - } - - if (modified) { - // update the WSDL file and refresh in workspace - WSDLFactory wsdlFactory = new WSDLFactoryImpl(); - WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter(); - OutputStream os = environment.getURIFactory().newURI(wsdlURI.toString()).getOutputStream(); - wsdlWriter.writeWSDL(definition, os); - os.close(); - - URL wsdlURL = new URL (wsdlURI); - IResource wsdlFile = ResourceUtils.findResourceAtLocation(wsdlURL.getPath(), serviceProject); - if (wsdlFile != null) { - wsdlFile.refreshLocal(IResource.DEPTH_ZERO, monitor); - } - } - } else { - status = StatusUtils.errorStatus(NLS.bind(AxisCreationUIMessages.MSG_ERROR_MODIFY_ENDPOINT, new String[] {wsdlURI})); - environment.getStatusHandler().reportError(status); - return status; - } - - } catch(Exception e) { - status = StatusUtils.errorStatus(NLS.bind(AxisCreationUIMessages.MSG_ERROR_MODIFY_ENDPOINT, new String[] {wsdlURI})); - environment.getStatusHandler().reportError(status); - return status; - } - - return Status.OK_STATUS; - } - - - public void setServerInstanceId(String serverId) { - this.serverInstanceId = serverId; - } - - public void setServerFactoryId(String serverFactoryId) { - this.serverFactoryId = serverFactoryId; - } - - public void setServiceProject(IProject serviceProject) { - this.serviceProject = serviceProject; - } - - public void setWsdlURI(String wsdlURI) { - this.wsdlURI = wsdlURI; - } - - public void setWebServicesParser(WebServicesParser parser) { - webServicesParser = parser; - } - - - public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) - { - this.javaWSDLParam = javaWSDLParam; - } - - public JavaWSDLParameter getJavaWSDLParam() - { - return javaWSDLParam; - } - -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/TDAxisInputCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/TDAxisInputCommand.java deleted file mode 100644 index dded685f8..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/TDAxisInputCommand.java +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060330 128827 kathy@ca.ibm.com - Kathy Chan - * 20061004 159356 kathy@ca.ibm.com - Kathy Chan, Get correct module root URL based on server chosen - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.command; - - -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.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.server.core.ServerCore; -import org.eclipse.wst.ws.internal.wsrt.IWebService; -import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo; - - -public class TDAxisInputCommand extends AbstractDataModelOperation { - - private IWebService ws_; - private String serverProject_; - - private String serverServer_; - private String serviceServerTypeID_; - private IServer serviceExistingServer_ = null; - private String wsdlURI_; - private WebServiceInfo webServiceInfo_; - - /** - * Default CTOR - */ - public TDAxisInputCommand() { - } - - public TDAxisInputCommand(IWebService ws, String project) { - ws_ = ws; - serverProject_ = project; - } - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - serverServer_ = ws_.getWebServiceInfo().getServerInstanceId(); - - String serverInstanceId = ws_.getWebServiceInfo().getServerInstanceId(); - String serverFactoryId = ws_.getWebServiceInfo().getServerFactoryId(); - if (serverInstanceId != null) { // server exists - serviceExistingServer_ = ServerCore.findServer(serverInstanceId); - if (serviceExistingServer_ != null) - { - serviceServerTypeID_ = serviceExistingServer_.getServerType().getId(); - } - } - else - { - serviceServerTypeID_ = serverFactoryId; - } - - wsdlURI_ = ws_.getWebServiceInfo().getWsdlURL(); - webServiceInfo_ = ws_.getWebServiceInfo(); - - return Status.OK_STATUS; - } - - /** - * @return Returns the serverProject. - */ - public String getServerProject() - { - return serverProject_; - } - - public String getServerServer() - { - return serverServer_; - } - - public String getServiceServerTypeID() - { - return serviceServerTypeID_; - } - - public String getWsdlURI() { - return wsdlURI_; - } - - public WebServiceInfo getWebServiceInfo() { - return webServiceInfo_; - } - - public IServer getServiceExistingServer() - { - return serviceExistingServer_; - } - -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/TDCodeGenOperation.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/TDCodeGenOperation.java deleted file mode 100644 index c4ab91a82..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/TDCodeGenOperation.java +++ /dev/null @@ -1,234 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060509 125094 sengpl@ca.ibm.com - Seng Phung-Lu, Use WorkspaceModifyOperation - * 20060515 115225 sengpl@ca.ibm.com - Seng Phung-Lu - * 20060517 142327 sengpl@ca.ibm.com - Seng Phung-Lu - * 20061004 159356 kathy@ca.ibm.com - Kathy Chan, Get correct module root URL based on server chosen - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.command; - -import org.eclipse.core.resources.IProject; -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.Status; -import org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaCommand; -import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.axis.consumption.ui.task.CopyAxisJarCommand; -import org.eclipse.jst.ws.internal.axis.consumption.ui.task.RefreshProjectCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.task.BackupSkelImplCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.task.Skeleton2WSDLCommand; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; -import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo; - -public class TDCodeGenOperation extends AbstractDataModelOperation { - - // CopyAxisJarCommand - private CopyAxisJarCommand copyAxisJarCommand = null; - - // BackupSkelImplCommand - private BackupSkelImplCommand backupSkelImplCommand = null; - private WebServicesParser webServicesParser; - private JavaWSDLParameter javaWSDLParam; - private WebServiceInfo webServiceInfo; - - // WSDL2JavaCommand - private WSDL2JavaCommand wsdl2JavaCommand = null; - private String wsdlURI; - private String httpBasicAuthUsername; - private String httpBasicAuthPassword; - - // Skeleton2WSDLCommand - private Skeleton2WSDLCommand skeleton2WSDLCommand = null; - private IProject serverProject; - private String serviceServerTypeID; - private IServer serviceExistingServer; - - // UpdateWebXMLCommand - private UpdateWEBXMLCommand updateWebXMLCommand = null; - - // RefreshProjectCommand - private RefreshProjectCommand refreshProjectCommand = null; - - /** - * This command runs the commands passed by the constructor in a WorkspaceModifyOperation. - * The commands are listed above, with only some of their data registry parameters since some appear - * to overlap the commands. - * @param backupSkelImpl - * @param wsdl2Java - * @param skeleton2WSDL - * @param updateWebXML - */ - public TDCodeGenOperation() { - copyAxisJarCommand = new CopyAxisJarCommand(); - backupSkelImplCommand = new BackupSkelImplCommand(); - wsdl2JavaCommand = new WSDL2JavaCommand(); - skeleton2WSDLCommand = new Skeleton2WSDLCommand(); - updateWebXMLCommand = new UpdateWEBXMLCommand(); - refreshProjectCommand = new RefreshProjectCommand(); - } - - public IStatus execute(IProgressMonitor monitor, IAdaptable info) { - IEnvironment env = getEnvironment(); - TopDownWSModifyOperation tdOperation = new TopDownWSModifyOperation(info, env); - try { - tdOperation.execute(monitor); - } - catch(CoreException ce){ - IStatus status = ce.getStatus(); - return status; - } - return Status.OK_STATUS; - } - - - - private class TopDownWSModifyOperation extends WorkspaceModifyOperation { - - private IAdaptable info = null; - private IEnvironment env = null; - - protected TopDownWSModifyOperation(IAdaptable adaptable, IEnvironment environment){ - info = adaptable; - env = environment; - } - - protected void execute(IProgressMonitor monitor) throws CoreException { - - IStatus status = null; - - // CopyAxisJarCommand - copyAxisJarCommand.setEnvironment(env); - copyAxisJarCommand.setProject(serverProject); - status = copyAxisJarCommand.execute(monitor, info); - if (status.getSeverity() == Status.ERROR){ - throw new CoreException(status); - } - - // backupSkelImplCommand - backupSkelImplCommand.setEnvironment(env); - backupSkelImplCommand.setWebServicesParser(webServicesParser); - backupSkelImplCommand.setJavaWSDLParam(javaWSDLParam); - backupSkelImplCommand.setWebServiceInfo(webServiceInfo); - status = backupSkelImplCommand.execute(monitor, info); - if (status.getSeverity() == Status.ERROR) { - throw new CoreException(status); - } - - // wsdl2JavaCommand - wsdl2JavaCommand.setEnvironment(env); - wsdl2JavaCommand.setWsdlURI(wsdlURI); - wsdl2JavaCommand.setHttpBasicAuthUsername(httpBasicAuthUsername); - wsdl2JavaCommand.setHttpBasicAuthPassword(httpBasicAuthPassword); - wsdl2JavaCommand.setJavaWSDLParam(javaWSDLParam); - status = wsdl2JavaCommand.execute(monitor, info); - if (status.getSeverity() == Status.ERROR) { - throw new CoreException(status); - } - javaWSDLParam = wsdl2JavaCommand.getJavaWSDLParam(); - - // Skeleton2WSDLCommand - skeleton2WSDLCommand.setEnvironment(env); - skeleton2WSDLCommand.setWebServicesParser(webServicesParser); - skeleton2WSDLCommand.setJavaWSDLParam(javaWSDLParam); - skeleton2WSDLCommand.setServerProject(serverProject); - skeleton2WSDLCommand.setServiceServerTypeID(serviceServerTypeID); - skeleton2WSDLCommand.setServiceExistingServer(serviceExistingServer); - status = skeleton2WSDLCommand.execute(monitor, info); - if (status.getSeverity() == Status.ERROR) { - throw new CoreException(status); - } - wsdlURI = skeleton2WSDLCommand.getWsdlURI(); - - // UpdateWebXMLCommand - updateWebXMLCommand.setEnvironment(env); - updateWebXMLCommand.setServerProject(serverProject); - status = updateWebXMLCommand.execute(monitor, info); - if (status.getSeverity() == Status.ERROR) { - throw new CoreException(status); - } - - // RefreshProjectCommand - refreshProjectCommand.setEnvironment(env); - refreshProjectCommand.setProject(serverProject); - status = refreshProjectCommand.execute(monitor, info); - if (status.getSeverity() == Status.ERROR) { - throw new CoreException(status); - } - - } - - } - - - - public JavaWSDLParameter getJavaWSDLParam() { - return javaWSDLParam; - } - - public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) { - this.javaWSDLParam = javaWSDLParam; - } - - public void setWebServiceInfo(WebServiceInfo webServiceInfo) { - this.webServiceInfo = webServiceInfo; - } - - public void setWebServicesParser(WebServicesParser webServicesParser) { - this.webServicesParser = webServicesParser; - } - - /** - * @param httpBasicAuthPassword - * The httpBasicAuthPassword to set. - */ - public void setHttpBasicAuthPassword(String httpBasicAuthPassword) { - this.httpBasicAuthPassword = httpBasicAuthPassword; - } - - /** - * @param httpBasicAuthUsername - * The httpBasicAuthUsername to set. - */ - public void setHttpBasicAuthUsername(String httpBasicAuthUsername) { - this.httpBasicAuthUsername = httpBasicAuthUsername; - } - - public void setWsdlURI(String wsdlURI) { - this.wsdlURI = wsdlURI; - } - - public String getWsdlURI() { - return wsdlURI; - } - - /** - * @param serverProject The serverProject to set. - */ - public void setServerProject(IProject serverProject) { - this.serverProject = serverProject; - } - - public void setServiceServerTypeID(String id) { - this.serviceServerTypeID = id; - } - - public void setServiceExistingServer(IServer server) { - this.serviceExistingServer = server; - } - -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/UpdateWEBXMLCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/UpdateWEBXMLCommand.java deleted file mode 100644 index 0efea660a..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/UpdateWEBXMLCommand.java +++ /dev/null @@ -1,218 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060515 115225 sengpl@ca.ibm.com - Seng Phung-Lu - * 20070528 186056 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.command; - - -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import org.eclipse.core.resources.IProject; -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.j2ee.model.IModelProvider; -import org.eclipse.jst.j2ee.model.ModelProviderManager; -import org.eclipse.jst.j2ee.webapplication.Servlet; -import org.eclipse.jst.j2ee.webapplication.ServletMapping; -import org.eclipse.jst.j2ee.webapplication.ServletType; -import org.eclipse.jst.j2ee.webapplication.WebApp; -import org.eclipse.jst.j2ee.webapplication.WebapplicationFactory; -import org.eclipse.jst.javaee.core.DisplayName; -import org.eclipse.jst.javaee.core.JavaeeFactory; -import org.eclipse.jst.javaee.core.UrlPatternType; -import org.eclipse.jst.javaee.web.WebFactory; -import org.eclipse.jst.ws.internal.axis.creation.ui.AxisCreationUIMessages; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; - -public class UpdateWEBXMLCommand extends AbstractDataModelOperation { - - private IProject serverProject; - - public UpdateWEBXMLCommand( ) - { - } - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IEnvironment environment = getEnvironment(); - if (serverProject != null) { - IStatus status = null; - status = addServlet(serverProject, getAxisServletDescriptor()); - if (status.getSeverity() == Status.ERROR) { - environment.getStatusHandler().reportError(status); - return status; - } - addServlet(serverProject, getAdmintServletDescriptor()); - if (status.getSeverity() == Status.ERROR) { - environment.getStatusHandler().reportError(status); - return status; - } - } - return Status.OK_STATUS; - } - - private ServletDescriptor getAxisServletDescriptor() { - - ServletDescriptor sd = new ServletDescriptor(); - sd._name = "AxisServlet"; //$NON-NLS-1$ - sd._displayName = "Apache-Axis Servlet"; //$NON-NLS-1$ - sd._className = "org.apache.axis.transport.http.AxisServlet"; //$NON-NLS-1$ - sd._mappings = new String[] { "/servlet/AxisServlet", //$NON-NLS-1$ - "*.jws", //$NON-NLS-1$ - "/services/*" }; //$NON-NLS-1$ - return sd; - } - - private ServletDescriptor getAdmintServletDescriptor() { - ServletDescriptor sd = new ServletDescriptor(); - sd._name = "AdminServlet"; //$NON-NLS-1$ - sd._displayName = "Axis Admin Servlet"; //$NON-NLS-1$ - sd._className = "org.apache.axis.transport.http.AdminServlet"; //$NON-NLS-1$ - sd._mappings = new String[] { "/servlet/AdminServlet" }; //$NON-NLS-1$ - sd._loadOnStartup = new Integer(100); - return sd; - } - - public IStatus addServlet(final IProject webProject, final ServletDescriptor servletDescriptor) { - - try { - - final IModelProvider provider = ModelProviderManager.getModelProvider(webProject); - - provider.modify(new Runnable() { - public void run() { - Object object = provider.getModelObject(); - if (object instanceof org.eclipse.jst.javaee.web.WebApp) { - org.eclipse.jst.javaee.web.WebApp javaeeWebApp = (org.eclipse.jst.javaee.web.WebApp) object; - addJavaeeServlet(webProject, servletDescriptor, javaeeWebApp); - } else if (object instanceof org.eclipse.jst.j2ee.webapplication.WebApp) { - WebApp webApp = (WebApp) object; - addServlet(webProject, servletDescriptor, webApp); - } - - } - } - , null); - - return Status.OK_STATUS; - } catch (Exception e) { - - return StatusUtils.errorStatus( - AxisCreationUIMessages.MSG_ERROR_UPDATE_WEB_XML, - e); - } - } - - private void addServlet(IProject webProject, ServletDescriptor servletDescriptor, WebApp webapp) { - - List theServlets = webapp.getServlets(); - for (int i = 0; i < theServlets.size(); i++) { - Servlet aServlet = (Servlet) theServlets.get(i); - if (aServlet.getServletName().equals(servletDescriptor._name)) { - return; - } - } - - WebapplicationFactory factory = WebapplicationFactory.eINSTANCE; - - Servlet servlet = factory.createServlet(); - ServletType servletType = factory.createServletType(); - servlet.setWebType(servletType); - servlet.setServletName(servletDescriptor._name); - servletType.setClassName(servletDescriptor._className); - if(servletDescriptor._displayName != null){ - servlet.setDisplayName(servletDescriptor._displayName); - } - if(servletDescriptor._loadOnStartup != null){ - servlet.setLoadOnStartup(servletDescriptor._loadOnStartup); - } - if(servletDescriptor._params != null){ - Properties properties = servlet.getParamsAsProperties(); - properties.putAll(servletDescriptor._params); - } - webapp.getServlets().add(servlet); - - if(servletDescriptor._mappings != null){ - for(int i=0; i<servletDescriptor._mappings.length; i++){ - ServletMapping servletMapping = factory.createServletMapping(); - servletMapping.setServlet(servlet); - servletMapping.setUrlPattern(servletDescriptor._mappings[i]); - webapp.getServletMappings().add(servletMapping); - } - } - } - - private void addJavaeeServlet(IProject webProject, ServletDescriptor servletDescriptor, org.eclipse.jst.javaee.web.WebApp webapp) { - - List theServlets = webapp.getServlets(); - for (int i = 0; i < theServlets.size(); i++) { - org.eclipse.jst.javaee.web.Servlet aServlet = (org.eclipse.jst.javaee.web.Servlet) theServlets.get(i); - if (aServlet.getServletName().equals(servletDescriptor._name)) { - return; - } - } - - WebFactory factory = WebFactory.eINSTANCE; - - org.eclipse.jst.javaee.web.Servlet servlet = factory.createServlet(); - - servlet.setServletName(servletDescriptor._name); - servlet.setServletClass(servletDescriptor._className); - - if(servletDescriptor._displayName != null){ - DisplayName displayNameObj = JavaeeFactory.eINSTANCE.createDisplayName(); - displayNameObj.setValue(servletDescriptor._displayName); - servlet.getDisplayNames().add(displayNameObj); - } - if(servletDescriptor._loadOnStartup != null){ - servlet.setLoadOnStartup(servletDescriptor._loadOnStartup); - } -// if(servletDescriptor._params != null){ -// Properties properties = servlet.getParamsAsProperties(); -// properties.putAll(servletDescriptor._params); -// } - webapp.getServlets().add(servlet); - - if(servletDescriptor._mappings != null){ - for(int i=0; i<servletDescriptor._mappings.length; i++){ - org.eclipse.jst.javaee.web.ServletMapping servletMapping = factory.createServletMapping(); - servletMapping.setServletName(servlet.getServletName()); - UrlPatternType url = JavaeeFactory.eINSTANCE.createUrlPatternType(); - url.setValue(servletDescriptor._mappings[i]); - servletMapping.getUrlPatterns().add(url); - webapp.getServletMappings().add(servletMapping); - } - } -} - - public void setServerProject(IProject serverProject) - { - this.serverProject = serverProject; - } - - public class ServletDescriptor { - String _name; - String _className; - String _displayName; - Map _params; - String[] _mappings; - Integer _loadOnStartup; - } - -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/ValidateWSIComplianceCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/ValidateWSIComplianceCommand.java deleted file mode 100644 index ce5635f6f..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/ValidateWSIComplianceCommand.java +++ /dev/null @@ -1,99 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060607 144978 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.axis.creation.ui.command; - -import java.util.Vector; - -import org.eclipse.core.resources.IProject; -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.internal.axis.consumption.core.AxisConsumptionCoreMessages; -import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.axis.creation.ui.AxisCreationUIMessages; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.ws.internal.preferences.PersistentWSIContext; -import org.eclipse.wst.ws.internal.preferences.WSIComplianceUtils; - - -public class ValidateWSIComplianceCommand extends AbstractDataModelOperation -{ - private JavaWSDLParameter javaWSDLParam = null; - private Vector status = null; - private IProject serviceProject_ = null; - - public ValidateWSIComplianceCommand() { - } - - public IStatus execute (IProgressMonitor monitor, IAdaptable adaptable) - { - - IEnvironment environment = getEnvironment(); - - if (javaWSDLParam == null) { - IStatus simpleStatus = StatusUtils.errorStatus( AxisConsumptionCoreMessages.MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET); - environment.getStatusHandler().reportError(simpleStatus); - return simpleStatus; - } - - status = new Vector(); - - PersistentWSIContext wsiContext = new PersistentWSIContext(); - int severity = WSIComplianceUtils.getWSISeverity(serviceProject_, wsiContext); - checkRPCEncoded(severity); - Status[] statuses = (Status[]) status.toArray(new Status[status.size()]); - - if (statuses.length == 0 || - WSIComplianceUtils.checkWSICompliance (environment.getStatusHandler(), statuses, serviceProject_, wsiContext)) - return Status.OK_STATUS; - else { - return StatusUtils.errorStatus(""); - } - } - - private void checkRPCEncoded(int severity) - { - if (JavaWSDLParameter.STYLE_RPC.equals(javaWSDLParam.getStyle()) && - JavaWSDLParameter.USE_ENCODED.equals(javaWSDLParam.getUse())) - status.add (new Status(severity, "ValidateWSIComplianceCommand", 0, - AxisCreationUIMessages.WSI_INCOMPLIANCE_RPC_ENCODED, null)); - - } - - /** - * Returns the message string identified by the given key from - * plugin.properties. - * @return The String message. - */ - -/** - * @param javaWSDLParam The javaWSDLParam to set. - * @todo Generated comment - */ -public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) { - this.javaWSDLParam = javaWSDLParam; -} - -/** - * @param serviceProject_ The serviceProject_ to set. - * @todo Generated comment - */ -public void setServiceProject(IProject serviceProject_) { - this.serviceProject_ = serviceProject_; -} -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/plugin/WebServiceAxisCreationUIPlugin.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/plugin/WebServiceAxisCreationUIPlugin.java deleted file mode 100644 index 4addd2ced..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/plugin/WebServiceAxisCreationUIPlugin.java +++ /dev/null @@ -1,133 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060424 115690 sengpl@ca.ibm.com - Seng Phung-Lu - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.plugin; - - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.eclipse.wst.common.environment.EnvironmentService; -import org.eclipse.wst.common.environment.ILog; -import org.osgi.framework.BundleContext; - -/** -* This is the plugin class for the Web Services plugin. -* <p> -* This plugin contains the graphic user interface to the -* Web Services runtime found in org.eclipse.jst.ws. -*/ -public class WebServiceAxisCreationUIPlugin extends AbstractUIPlugin -{ - - /** - * The identifier of the descriptor of this plugin in plugin.xml. - */ - public static final String ID = "org.eclipse.jst.ws.axis.creation.ui"; //$NON-NLS-1$ - - /** - * The reference to the singleton instance of this plugin. - */ - private static WebServiceAxisCreationUIPlugin instance_; - private ILog log_; - - /** - * Constructs a runtime plugin object for this plugin. - * The "plugin" element in plugin.xml should include the attribute - * class = "org.eclipse.jst.ws.internal.ui.plugin.WebServicePlugin". - * @param descriptor The descriptor of this plugin. - */ - public WebServiceAxisCreationUIPlugin() - { - super(); - if (instance_ == null) - { - instance_ = this; - } - log_ = EnvironmentService.getEclipseLog(); - - } - - // This method is needed to keep the logging from blowing up. - public String toString() - { - return ID; - } - - /** - * Returns the singleton instance of this plugin. Equivalent to calling - * (WebServiceWasCreationUIPlugin)Platform.getPlugin("org.eclipse.jst.ws.was.v5.tp.ui"); - * @return The WebServiceConsumptionUIPlugin singleton. - */ - static public WebServiceAxisCreationUIPlugin getInstance () - { - return instance_; - } - - /** - * Called once by the platform when this plugin is first loaded. - * @throws CoreException If this plugin fails to start. - */ - public void start( BundleContext context ) throws CoreException - { - log_.log(ILog.INFO, 5068, this, "start", "Starting plugin org.eclipse.jst.ws.axis.creation.ui"); - - try - { - super.start( context ); - } - catch( Exception exc ) - { - log_.log( ILog.ERROR, 5068, this, "start", exc ); - } - - setPreferences(); - } - - /** - * Called once by the platform when this plugin is unloaded. - * @throws CoreException If this plugin fails to shutdown. - */ - public void stop( BundleContext context ) throws CoreException - { - log_.log(ILog.INFO, 5069, this, "stop", "Shutting plugin org.eclipse.jst.ws.axis.creation.ui"); - - try - { - super.stop( context ); - } - catch( Exception exc ) - { - log_.log( ILog.ERROR, 5068, this, "start", exc ); - } - } - - - /** - * Sets the general preferences to the values in the preferences store. - **/ - public void setPreferences() - { - // setDialogsPreferences(); - } - - /** - * @see AbstractUIPlugin#initializeDefaultPreferences - */ - protected void initializeDefaultPreferences(IPreferenceStore preferenceStore) { - - // Set the defaults Preference -// ActionDialogsPreferenceHelper.initializeDefaults(preferenceStore); - } - -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/BUConfigCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/BUConfigCommand.java deleted file mode 100644 index 108ef4054..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/BUConfigCommand.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060424 120137 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.axis.creation.ui.task; - -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.wst.common.frameworks.datamodel.AbstractDataModelOperation; - -public class BUConfigCommand extends AbstractDataModelOperation { - public BUConfigCommand() { - } - - /* - * The execute method of this command do nothing. It is merely an anchor point for UI page - */ - public IStatus execute(IProgressMonitor monitor, IAdaptable adaptable) { - return Status.OK_STATUS; - } - -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/BackupSkelImplCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/BackupSkelImplCommand.java deleted file mode 100644 index e706321c7..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/BackupSkelImplCommand.java +++ /dev/null @@ -1,174 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060330 128827 kathy@ca.ibm.com - Kathy Chan - * 20060403 128827 kathy@ca.ibm.com - Kathy Chan - * 20060524 127343 mahutch@ca.ibm.com - Mark Hutchinson - * 20070116 169138 mahutch@ca.ibm.com - Mark Hutchinson - * 20070815 188999 pmoogk@ca.ibm.com - Peter Moogk - * 20071113 209075 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.task; - - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Map; - -import javax.wsdl.Binding; -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.Service; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -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.jst.ws.internal.axis.consumption.core.AxisConsumptionCoreMessages; -import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.axis.consumption.ui.AxisConsumptionUIMessages; -import org.eclipse.jst.ws.internal.axis.consumption.ui.util.PlatformUtils; -import org.eclipse.jst.ws.internal.axis.consumption.ui.util.WSDLUtils; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; -import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo; - -public class BackupSkelImplCommand extends AbstractDataModelOperation -{ - private final String IMPL = "Impl"; //$NON-NLS-1$ - private final String DOT = "."; //$NON-NLS-1$ - private final String JAVA = "java"; //$NON-NLS-1$ - private WebServicesParser webServicesParser; - private JavaWSDLParameter javaWSDLParam; - - private WebServiceInfo webServiceInfo; - - public BackupSkelImplCommand( ) { - } - - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IEnvironment environment = getEnvironment(); - if (javaWSDLParam == null) - { - IStatus status = StatusUtils.errorStatus(AxisConsumptionCoreMessages.MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET); - environment.getStatusHandler().reportError(status); - return status; - } - - IStatus status = Status.OK_STATUS; - // Read WSDL - Definition definition = null; - String wsdlURL = javaWSDLParam.getInputWsdlLocation(); - try - { - URL url = new URL(wsdlURL); - definition = webServicesParser.getWSDLDefinition(url.toString()); - } - catch(MalformedURLException e) - { - wsdlURL = PlatformUtils.getFileURLFromPath(new Path(wsdlURL)); - definition = webServicesParser.getWSDLDefinition(wsdlURL); - } - - // Compute the qualified name of the Java bean skeleton - Service service = null; - Port port = null; - ArrayList implURLList = new ArrayList(); - if (definition != null) { - StringBuffer beanName = new StringBuffer(); - - //first check if there is a mapping for this namespace to a package name - //if not then compute package name from namespace - String beanPackageName = null; - Map mappings = javaWSDLParam.getMappings(); - if (mappings != null) - { - String targetNamespace = definition.getTargetNamespace(); - beanPackageName = (String)mappings.get(targetNamespace); - } - if (beanPackageName == null) - { - beanPackageName = WSDLUtils.getPackageName(definition); - } - - javaWSDLParam.setBeanPackage(beanPackageName); - beanName.append(beanPackageName); - beanName.append(DOT); - - service = (Service) definition.getServices().values().iterator().next(); - port = (Port) service.getPorts().values().iterator().next(); - Binding binding = port.getBinding(); - - String qName = binding.getQName().getLocalPart(); - beanName.append(qName.substring(0,1).toUpperCase());//Fix for bug 169138, need to ensure first char is uppercase - beanName.append(qName.substring(1)); - - beanName.append(IMPL); - String beanNameString = beanName.toString(); - javaWSDLParam.setBeanName(beanNameString); - - // Defect 209075 - Do not back up anymore since skeleton merge is defaulted to on. - - String beanNamePathString = beanNameString.replace('.',IPath.SEPARATOR); - IPath skelImplPath = new Path (javaWSDLParam.getJavaOutput()).append(new Path (beanNamePathString)).addFileExtension(JAVA); - - // store the name of the implURL - String implURLString; - try { - implURLString = skelImplPath.toFile().toURL().toString(); - } catch (MalformedURLException e1) { - implURLString = PlatformUtils.getFileURLFromPath(skelImplPath); - } - implURLList.add( implURLString ); - - String[] implURLArray = new String[implURLList.size()]; - webServiceInfo.setImplURLs( (String[]) (implURLList.toArray(implURLArray))); - - } - else { - status = StatusUtils.errorStatus( NLS.bind(AxisConsumptionUIMessages.MSG_ERROR_WSDL_NO_DEFINITION, new String[] {wsdlURL})); - environment.getStatusHandler().reportError(status); - } - - return status; - } - - - /** - * Sets the javaWSDLParam. - * @param javaWSDLParam The javaWSDLParam to set - */ - public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) { - this.javaWSDLParam = javaWSDLParam; - } - - /** - * @param webServicesParser The webServicesParser to set. - */ - public void setWebServicesParser(WebServicesParser webServicesParser) { - this.webServicesParser = webServicesParser; - } - - -public void setWebServiceInfo(WebServiceInfo webServiceInfo) { - this.webServiceInfo = webServiceInfo; -} - - -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/DefaultsForServerJavaWSDLCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/DefaultsForServerJavaWSDLCommand.java deleted file mode 100644 index eb5636e5f..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/DefaultsForServerJavaWSDLCommand.java +++ /dev/null @@ -1,261 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner - * 20060330 124667 kathy@ca.ibm.com - Kathy Chan - * 20060524 128601 andyzhai@ca.ibm.com - Andy Zhai - * 20061004 159356 kathy@ca.ibm.com - Kathy Chan, Get correct module root URL based on server chosen - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.task; - - -import java.io.File; - -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -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.jface.viewers.IStructuredSelection; -import org.eclipse.jst.ws.internal.axis.consumption.core.AxisConsumptionCoreMessages; -import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.axis.consumption.ui.AxisConsumptionUIMessages; -import org.eclipse.jst.ws.internal.axis.consumption.ui.util.ClasspathUtils; -import org.eclipse.jst.ws.internal.axis.consumption.ui.util.FileUtil; -import org.eclipse.jst.ws.internal.axis.consumption.ui.util.PlatformUtils; -import org.eclipse.jst.ws.internal.axis.consumption.ui.util.WSDLUtils; -import org.eclipse.jst.ws.internal.common.J2EEUtils; -import org.eclipse.jst.ws.internal.common.ResourceUtils; -import org.eclipse.jst.ws.internal.common.ServerUtils; -import org.eclipse.jst.ws.internal.consumption.ui.wsil.Utils; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.ws.internal.parser.discovery.WebServicesParserExt; -import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; - -public class DefaultsForServerJavaWSDLCommand extends AbstractDataModelOperation { - - private JavaWSDLParameter javaWSDLParam_ = null; - private IProject serviceProject_; - private String javaBeanName_; // this needs to be set by the extension with initial selection - private String WSDLServiceURL_; - private String WSDLServicePathname_; - private WebServicesParser WSParser_; - private String serviceServerTypeID_; - - private final String WSDL_FOLDER = "wsdl"; //$NON-NLS-1$ - public final String SERVICE_EXT = "/services/"; //$NON-NLS-1$ - private final String WSDL_EXT = "wsdl"; //$NON-NLS-1$ - public final byte MODE_BEAN = (byte) 0; - public final String SERVICE_NAME_EXT = "Service"; //$NON-NLS-1$ - private final String TEMP_URI = "http://tempuri.org/"; //$NON-NLS-1$ - private IServer serviceExistingServer; - - public DefaultsForServerJavaWSDLCommand( ) - { - } - - - /** - * Execute DefaultsForJavaToWSDLTask - */ - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IEnvironment environment = getEnvironment(); - - IStatus status; - if (javaWSDLParam_ == null) { - status = StatusUtils.errorStatus( AxisConsumptionCoreMessages.MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET); - environment.getStatusHandler().reportError(status); - return status; - } - - if (javaBeanName_ == null) { // either set by extension point or bean class page - javaBeanName_ = javaWSDLParam_.getBeanName(); - if (javaBeanName_ == null) { - //rm javaBeanName_ = isdElement.getJavaBeanName(); - javaWSDLParam_.setBeanName(javaBeanName_); - } - } - // rm WSParser_ = (WebServicesParser) wse_.getWSParser(); - - javaWSDLParam_.setServerSide(JavaWSDLParameter.SERVER_SIDE_BEAN); - javaWSDLParam_.setSkeletonDeploy(false); - - javaWSDLParam_.setBeanName(javaBeanName_); - String classpath = ClasspathUtils.getInstance().getClasspathString(serviceProject_); - javaWSDLParam_.setClasspath(classpath); - - String simpleBeanName = javaBeanName_; - if (javaBeanName_ != null) { - int index = javaBeanName_.lastIndexOf('.'); - if (index != -1) { - simpleBeanName = javaBeanName_.substring(index + 1); - } - } - String namespace = WSDLUtils.makeNamespace(javaWSDLParam_.getBeanName()); - javaWSDLParam_.setNamespace(namespace); - - javaWSDLParam_.setPortTypeName(simpleBeanName); - javaWSDLParam_.setServiceName(simpleBeanName + SERVICE_NAME_EXT); - - IPath moduleServerRoot = null; - - IPath modulePath = serviceProject_.getFullPath(); - IPath webinfPath = serviceProject_.getFullPath(); - try { - if (J2EEUtils.isWebComponent(serviceProject_)){ - moduleServerRoot = ResourceUtils.getJavaSourceLocation(serviceProject_); - modulePath = J2EEUtils.getWebContentPath(serviceProject_); - webinfPath = J2EEUtils.getWebInfPath( serviceProject_ ); - } - } catch (Exception e) { - status = StatusUtils.errorStatus( AxisConsumptionUIMessages.MSG_ERROR_DEFAULT_BEAN, e ); - environment.getStatusHandler().reportError(status); - return status; - } - - IPath wsdlPath = - modulePath.append(WSDL_FOLDER).append(simpleBeanName).addFileExtension(WSDL_EXT); - - try{ - IFolder folder = ResourceUtils.getWorkspaceRoot().getFolder(modulePath.append(WSDL_FOLDER)); - FileUtil.createFolder(folder, true, true); - - } - catch(CoreException e){ - status = StatusUtils.errorStatus( AxisConsumptionUIMessages.MSG_ERROR_WRITE_WSDL, e ); - environment.getStatusHandler().reportError(status); - return status; - } - - String wsdlLocation = ResourceUtils.getWorkspaceRoot().getFile(wsdlPath).getLocation().toString(); - - javaWSDLParam_.setOutputWsdlLocation(wsdlLocation); - javaWSDLParam_.setInputWsdlLocation(new File(wsdlLocation).toURI().toString()); - WSDLServicePathname_ = wsdlPath.toString(); - - if (wsdlPath != null) { - String wsdlURL = PlatformUtils.getFileURLFromPath(new Path(wsdlLocation)); - WSDLServiceURL_ = wsdlURL; - // set parser - if (wsdlURL == null || wsdlURL.length() <= 0) { - IResource res = - ResourceUtils.findResource(WSDLServicePathname_); - if (res != null) - wsdlURL = (new Utils()).toFileSystemURI(res); - } - if (wsdlURL != null && wsdlURL.length() > 0) { - if (WSParser_ == null) { - WSParser_ = new WebServicesParserExt(); - } - } - } - - javaWSDLParam_.setStyle(JavaWSDLParameter.STYLE_WRAPPED); - javaWSDLParam_.setUse(JavaWSDLParameter.USE_LITERAL); - - String projectURL = null; - if (serviceServerTypeID_ != null && serviceServerTypeID_.length()>0) - { - projectURL = ServerUtils.getEncodedWebComponentURL(serviceProject_, serviceServerTypeID_, serviceExistingServer); - } - if (projectURL == null) // either no server type defined or server not able to get project URL - { - projectURL = TEMP_URI + serviceProject_.getName(); - javaWSDLParam_.setGuessProjectURL(true); - } - javaWSDLParam_.setProjectURL(projectURL); - String serviceURL = projectURL + SERVICE_EXT + simpleBeanName; - javaWSDLParam_.setUrlLocation(serviceURL); - - javaWSDLParam_.setMetaInfOnly(true); - - String javaOutput = ResourceUtils.findResource(moduleServerRoot).getLocation().toString(); - - String serviceName = javaWSDLParam_.getServiceName(); - IPath outputPath = ResourceUtils.findResource(webinfPath).getLocation(); - String output = serviceProject_.getFullPath().toString(); - if (outputPath!=null) - output = outputPath.append(serviceName).toString(); - - javaWSDLParam_.setJavaOutput(javaOutput); - javaWSDLParam_.setOutput(output); - - return Status.OK_STATUS; - } - - /** - * Returns the javaWSDLParam. - * @return JavaWSDLParameter - */ - public JavaWSDLParameter getJavaWSDLParam() { - return javaWSDLParam_; - } - - /** - * Sets the javaWSDLParam. - * @param javaWSDLParam The javaWSDLParam to set - */ - public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) { - this.javaWSDLParam_ = javaWSDLParam; - } - - public void setServiceProject(IProject serviceProject) { - this.serviceProject_ = serviceProject; - } - - public void setJavaBeanName(String javaBeanName) { - this.javaBeanName_ = javaBeanName; - } - - public String getWSDLServiceURL() { - return WSDLServiceURL_; - } - - public String getWSDLServicePathname() { - return WSDLServicePathname_; - } - - public void setParser(WebServicesParser wsParser) { - this.WSParser_ = wsParser; - } - - public WebServicesParser getParser() { - return WSParser_; - } - - public void setObjectSelection(IStructuredSelection objectSelection) - { - if (objectSelection != null && !objectSelection.isEmpty()) - { - Object object = objectSelection.getFirstElement(); - if (object instanceof String) - setJavaBeanName((String)object); - } - } - - public void setServiceServerTypeID(String id) - { - serviceServerTypeID_ = id; - } - - public void setServiceExistingServer(IServer existingServer) { - serviceExistingServer = existingServer; - } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/Skeleton2WSDLCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/Skeleton2WSDLCommand.java deleted file mode 100644 index f8f6c412a..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/Skeleton2WSDLCommand.java +++ /dev/null @@ -1,294 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner - * 20060330 124667 kathy@ca.ibm.com - Kathy Chan - * 20061004 159356 kathy@ca.ibm.com - Kathy Chan, Get correct module root URL based on server chosen - * 20070112 165721 makandre@ca.ibm.com - Andrew Mak, WSDL import cannot use relative import with to parent directories - * 20070125 171071 makandre@ca.ibm.com - Andrew Mak, Create public utility method for copying WSDL files - * 20070409 181635 makandre@ca.ibm.com - Andrew Mak, WSDLCopier utility should create target folder - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.task; - - -import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Iterator; -import java.util.Map; - -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.Service; -import javax.wsdl.extensions.soap.SOAPAddress; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -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.jst.ws.internal.axis.consumption.core.AxisConsumptionCoreMessages; -import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.axis.consumption.ui.AxisConsumptionUIMessages; -import org.eclipse.jst.ws.internal.axis.consumption.ui.util.FileUtil; -import org.eclipse.jst.ws.internal.axis.consumption.ui.util.PlatformUtils; -import org.eclipse.jst.ws.internal.axis.consumption.ui.util.WSDLUtils; -import org.eclipse.jst.ws.internal.common.J2EEUtils; -import org.eclipse.jst.ws.internal.common.ResourceUtils; -import org.eclipse.jst.ws.internal.common.ServerUtils; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; -import org.eclipse.wst.ws.internal.util.WSDLCopier; - -public class Skeleton2WSDLCommand extends AbstractDataModelOperation -{ - - private static final String SERVICE_EXT = "/services/"; //$NON-NLS-1$ - private static final String WSDL_EXT = "wsdl"; //$NON-NLS-1$ - private final String WSDL_FOLDER = "wsdl"; //$NON-NLS-1$ - private WebServicesParser webServicesParser; - private JavaWSDLParameter javaWSDLParam; - private IProject serverProject; - private String serviceServerTypeID_; - private IServer serviceExistingServer; - private final String TEMP_URI = "http://tempuri.org/"; //$NON-NLS-1$ - - public Skeleton2WSDLCommand( ) { - } - - /** - * Execute Skeleton2WSDLCommand - */ - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IEnvironment environment = getEnvironment(); - if (javaWSDLParam == null) - { - IStatus status = StatusUtils.errorStatus(AxisConsumptionCoreMessages.MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET); - environment.getStatusHandler().reportError(status); - return status; - } - - // Read WSDL - Definition definition = null; - String wsdlURL = javaWSDLParam.getInputWsdlLocation(); - try - { - URL url = new URL(wsdlURL); - definition = webServicesParser.getWSDLDefinition(url.toString()); - } - catch(MalformedURLException e) - { - wsdlURL = PlatformUtils.getFileURLFromPath(new Path(wsdlURL)); - definition = webServicesParser.getWSDLDefinition(wsdlURL); - } - - // Compute the qualified name of the Java bean skeleton - Service service = null; - Port port = null; - if (definition != null) { - - // beanName and beanPackageName are now set in BackupSkelImplCommand - - service = (Service) definition.getServices().values().iterator().next(); - port = (Port) service.getPorts().values().iterator().next(); - - javaWSDLParam.setPortTypeName(WSDLUtils.getPortTypeName(definition)); - javaWSDLParam.setServiceName(WSDLUtils.getServiceElementName(definition)); - - } - else { - IStatus status = StatusUtils.errorStatus( NLS.bind(AxisConsumptionUIMessages.MSG_ERROR_WSDL_NO_DEFINITION, new String[] {wsdlURL})); - environment.getStatusHandler().reportError(status); - return status; - } - - // Modify WSDL endpoint - if (port == null) { - IStatus status = StatusUtils.errorStatus( NLS.bind(AxisConsumptionUIMessages.MSG_ERROR_WSDL_NO_PORT, new String[] {wsdlURL})); - environment.getStatusHandler().reportError(status); - return status; - } - Map services = definition.getServices(); - for (Iterator servicesIt = services.values().iterator(); servicesIt.hasNext();) - { - Service s = (Service)servicesIt.next(); - Map ports = s.getPorts(); - for (Iterator portsIt = ports.values().iterator(); portsIt.hasNext();) - { - Port p = (Port)portsIt.next(); - modifyEndpoint(p); - } - } - - // Set WSDL file name: javaWSDLParam.setOutputWsdlLocation(); - IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot(); - - String wsdlLocation = javaWSDLParam.getOutputWsdlLocation(); - IPath wsdlPath = null; - IFile outputFile = null; - try { - if(wsdlLocation != null){ - outputFile = workspace.getFileForLocation( new Path(wsdlLocation)); - } - else{ -// wsdlPath = serverProject.getFullPath(); -// -// if (serverProject.hasNature(IWebNatureConstants.J2EE_NATURE_ID)) { -// J2EEWebNatureRuntime webProject = -// (J2EEWebNatureRuntime) serverProject.getNature( -// IWebNatureConstants.J2EE_NATURE_ID); -// wsdlPath = J2EEUtils.getWebContentPath( serverProject, moduleName_ ); -// //wsdlPath = wsdlPath.append(webProject.getWEBINFPath()); -// } -// else if (serverProject.hasNature(IEJBNatureConstants.NATURE_ID)) -// { -// EJBNatureRuntime ejbProject = EJBNatureRuntime.getRuntime(serverProject); -// wsdlPath = wsdlPath.append(ejbProject.getMetaFolder().getProjectRelativePath().addTrailingSeparator()); -// } -// TODO: handle EJB case - wsdlPath = J2EEUtils.getWebContentPath( serverProject ); - IPath wsdlFilePath = wsdlPath.append(WSDL_FOLDER).append(port.getName()).addFileExtension(WSDL_EXT); - IFolder folder = ResourceUtils - .getWorkspaceRoot() - .getFolder(wsdlPath.append(WSDL_FOLDER)); - FileUtil.createFolder(folder, true, true); - outputFile = workspace.getFile(wsdlFilePath); - wsdlLocation = outputFile.getLocation().toString(); - javaWSDLParam.setOutputWsdlLocation(wsdlLocation); - - } - - String folder = outputFile.getParent().getLocation().toFile().toURL().toString(); - String filename = outputFile.getName(); - - WSDLCopier copier = new WSDLCopier(webServicesParser); - copier.setSourceURI(wsdlURL, definition); - copier.setTargetFolderURI(folder); - copier.setTargetFilename(filename); - - ResourceUtils.getWorkspace().run(copier, monitor); - - String newPath = outputFile.getParent().getLocation().append(copier.getRelativePath()).toString(); - javaWSDLParam.setOutputWsdlLocation(newPath); - } - catch (Exception e) { - IStatus status = StatusUtils.errorStatus( NLS.bind(AxisConsumptionUIMessages.MSG_ERROR_WRITE_WSDL, new String[] { wsdlLocation }), e); - environment.getStatusHandler().reportError(status); - return status; - } - return Status.OK_STATUS; - } - - private IStatus modifyEndpoint(Port port) - { - Iterator it = port.getExtensibilityElements().iterator(); - SOAPAddress soapAddress = null; - while (it.hasNext()) - { - Object obj = it.next(); - if (obj instanceof SOAPAddress) - { - soapAddress = (SOAPAddress)obj; - break; - } - } - if (soapAddress != null) - { - - String projectURL = null; - if (serviceServerTypeID_ != null && serviceServerTypeID_.length()>0) - { - projectURL = ServerUtils.getEncodedWebComponentURL(serverProject, serviceServerTypeID_, serviceExistingServer); - } - - if (projectURL == null) // either no server type defined or server not able to get project URL - { - projectURL = TEMP_URI + serverProject.getName(); - javaWSDLParam.setGuessProjectURL(true); - } - javaWSDLParam.setProjectURL(projectURL); - StringBuffer serviceURL = new StringBuffer(projectURL); - serviceURL.append(SERVICE_EXT).append(port.getName()); - javaWSDLParam.setUrlLocation(serviceURL.toString()); - soapAddress.setLocationURI(serviceURL.toString()); - } - return Status.OK_STATUS; - } - - /** - * Returns the javaWSDLParam. - * @return JavaWSDLParameter - */ - public JavaWSDLParameter getJavaWSDLParam() { - return javaWSDLParam; - } - - /** - * Sets the javaWSDLParam. - * @param javaWSDLParam The javaWSDLParam to set - */ - public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) { - this.javaWSDLParam = javaWSDLParam; - } - - /** - * @param serverProject The serverProject to set. - */ - public void setServerProject(IProject serverProject) { - this.serverProject = serverProject; - } - - /** - * @return Returns the webServicesParser. - */ - public WebServicesParser getWebServicesParser() { - return webServicesParser; - } - - /** - * @param webServicesParser The webServicesParser to set. - */ - public void setWebServicesParser(WebServicesParser webServicesParser) { - this.webServicesParser = webServicesParser; - } - - public String getWsdlURI() - { - File file = new File(getJavaWSDLParam().getOutputWsdlLocation()); - String url = ""; - try { - url = file.toURL().toString(); - } - catch(MalformedURLException mue){} - return url; - } - - public void setServiceServerTypeID(String id) - { - serviceServerTypeID_ = id; - } - -public void setServiceExistingServer(IServer existingServer) { - serviceExistingServer = existingServer; -} - -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/TDConfigCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/TDConfigCommand.java deleted file mode 100644 index 4c412ef2f..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/TDConfigCommand.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060424 120137 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.axis.creation.ui.task; - -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.wst.common.frameworks.datamodel.AbstractDataModelOperation; - -public class TDConfigCommand extends AbstractDataModelOperation -{ - public TDConfigCommand() - { - } - - /* - * The execute method of this command do nothing. It is merely an anchor point for UI page - */ - public IStatus execute(IProgressMonitor monitor, IAdaptable adaptable) { - return Status.OK_STATUS; - } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/UpdateAxisWSDDFileTask.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/UpdateAxisWSDDFileTask.java deleted file mode 100644 index f925cb17e..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/UpdateAxisWSDDFileTask.java +++ /dev/null @@ -1,172 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner - * 20060330 124667 kathy@ca.ibm.com - Kathy Chan - * 20060517 134104 kathy@ca.ibm.com - Kathy Chan - * 20071030 128419 kelvinhc@ca.ibm.com - Kelvin H. Cheung - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.task; - - -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; - -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.stream.StreamSource; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -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.jst.ws.internal.axis.consumption.core.AxisConsumptionCoreMessages; -import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.axis.consumption.ui.util.FileUtil; -import org.eclipse.jst.ws.internal.axis.creation.ui.AxisCreationUIMessages; -import org.eclipse.jst.ws.internal.axis.creation.ui.plugin.WebServiceAxisCreationUIPlugin; -import org.eclipse.jst.ws.internal.common.J2EEUtils; -import org.eclipse.jst.ws.internal.common.ResourceUtils; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; - -public class UpdateAxisWSDDFileTask extends AbstractDataModelOperation { - - private final String DEPLOY_XSL = "deploy.xsl"; //$NON-NLS-1$ - private final String DEPLOY_BAK = "deploy.wsdd.bak"; //$NON-NLS-1$ - private final String CLASSNAME_PARAM = "newClassName"; //$NON-NLS-1$ - private JavaWSDLParameter javaWSDLParam_; - private IProject serviceProject_; - - public UpdateAxisWSDDFileTask() - { - } - - /** - * Execute UpdateAxisWSDDFileTask - */ - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IEnvironment environment = getEnvironment(); - IStatus status = Status.OK_STATUS; - if (javaWSDLParam_ == null) { - status = StatusUtils.errorStatus(AxisConsumptionCoreMessages.MSG_ERROR_JAVA_WSDL_PARAM_NOT_SET); - environment.getStatusHandler().reportError(status); - return status; - } - - IProject project = serviceProject_; - - String outputLocation = javaWSDLParam_.getJavaOutput(); - if (outputLocation == null) { - return status; - } - - String webContentPath = J2EEUtils.getWebContentContainer( project ).getLocation().toString(); - try { - - if (javaWSDLParam_.getDeploymentFiles() != null - && javaWSDLParam_.getDeploymentFiles().length > 0) { - - String wsdd_deploy = javaWSDLParam_.getDeploymentFiles()[0]; - IPath deployPath = new Path(wsdd_deploy); - String deployBackup = - deployPath - .removeLastSegments(1) - .append(DEPLOY_BAK) - .toString(); - FileUtil.createTargetFile(wsdd_deploy, deployBackup, true); - - TransformerFactory tFactory = TransformerFactory.newInstance(); - - // Use the TransformerFactory to instantiate a Transformer that will work with - // the stylesheet you specify. This method call also processes the stylesheet - // into a compiled Templates object. - Transformer transformer = - tFactory.newTransformer(new StreamSource(getPluginFileAsInputStream(DEPLOY_XSL))); - transformer.setParameter(CLASSNAME_PARAM, javaWSDLParam_.getBeanName()); - - // Use the Transformer to apply the associated Templates object to an XML document - // (foo.xml) and write the output to a file (foo.out). - FileOutputStream wsddStream = new FileOutputStream( wsdd_deploy ); - - try - { - transformer.transform( new StreamSource(deployBackup), new StreamResult(wsddStream) ); - } - finally - { - wsddStream.close(); - } - - - IResource deployFile = ResourceUtils.findResourceAtLocation(wsdd_deploy, project); - if( deployFile != null ) - { - deployFile.refreshLocal( IResource.DEPTH_ZERO, monitor ); - } - - } - - } catch (Exception e) { - String[] errorMsgStrings = new String[]{project.toString(), outputLocation.toString(), webContentPath.toString()}; - status = StatusUtils.errorStatus(NLS.bind(AxisCreationUIMessages.MSG_ERROR_UPDATE_AXIS_WSDD, errorMsgStrings), e); - environment.getStatusHandler().reportError(status); - return status; - } - - return status; - } - - private InputStream getPluginFileAsInputStream(String pluginfileName) throws CoreException { - try { - InputStream is = WebServiceAxisCreationUIPlugin.getInstance().getBundle().getEntry(pluginfileName).openStream(); - - return is; - } catch (IOException e) { - throw new CoreException( - new org.eclipse.core.runtime.Status( - IStatus.WARNING, - WebServiceAxisCreationUIPlugin.ID, - 0, - AxisCreationUIMessages.MSG_PLUGIN_FILE_URL, - e)); - } - } - - /** - * Sets the javaWSDLParam. - * @param javaWSDLParam The javaWSDLParam to set - */ - public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) { - javaWSDLParam_ = javaWSDLParam; - } - - public JavaWSDLParameter getJavaWSDLParam() - { - return javaWSDLParam_; - } - - public void setServiceProject(IProject serviceProject) - { - serviceProject_ = serviceProject; - } - -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/BUAxisDefaultingCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/BUAxisDefaultingCommand.java deleted file mode 100644 index 8b795a208..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/BUAxisDefaultingCommand.java +++ /dev/null @@ -1,187 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.bean; - -import org.eclipse.core.resources.IProject; -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.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.axis.creation.ui.AxisCreationUIMessages; -import org.eclipse.jst.ws.internal.consumption.datamodel.validate.ValidationManager; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.ws.internal.parser.discovery.WebServicesParserExt; -import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; - -/** - * - */ -public class BUAxisDefaultingCommand extends AbstractDataModelOperation -{ - - //Provide - private IServer serviceExistingServer_; - private JavaWSDLParameter javaWSDLParam_; - private String javaBeanName_; - private WebServicesParser parser_; - private boolean forceBuild_ = true; - private Boolean IsWebProjectStartupRequested = Boolean.TRUE; // rsk revisit - private ValidationManager validationManager_; - private boolean customizeServiceMappings_ = false; - - //This is proxy and client related information - //which can be nulled for commands dealing - //with service creation. - //rsk revisit - private Boolean isProxyProject_ = Boolean.FALSE; - private String clientRuntimeID_ = null; - private IProject proxyProject_ = null; - private IProject sampleProject_ = null; - private String sampleServerTypeID_ = null; - private IServer sampleExistingServer_ = null; - - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IEnvironment environment = getEnvironment(); - - //javaWSDLParam - javaWSDLParam_ = new JavaWSDLParameter(); - - if (javaBeanName_ == null) { - IStatus status = StatusUtils.errorStatus( - AxisCreationUIMessages.MSG_ERROR_CANNOT_NO_JAVA_BEAN); - environment.getStatusHandler().reportError(status); - return status; - } - - //parser - parser_ = new WebServicesParserExt(); - - //validationManager - validationManager_ = new ValidationManager(); - - return Status.OK_STATUS; - } - - - /** - * @return Returns the clientRuntimeID_. - */ - public String getClientRuntimeID() - { - return clientRuntimeID_; - } - /** - * @return Returns the forceBuild_. - */ - public boolean getForceBuild() - { - return forceBuild_; - } - /** - * @return Returns the isProxyProject_. - */ - public Boolean getIsProxyProject() - { - return isProxyProject_; - } - /** - * @return Returns the javaBeanName_. - */ - public String getJavaBeanName() - { - return javaBeanName_; - } - /** - * @return Returns the javaWSDLParam_. - */ - public JavaWSDLParameter getJavaWSDLParam() - { - return javaWSDLParam_; - } - /** - * @return Returns the parser_. - */ - public WebServicesParser getParser() - { - return parser_; - } - /** - * @return Returns the proxyProject_. - */ - public IProject getProxyProject() - { - return proxyProject_; - } - /** - * @return Returns the sampleExistingServer_. - */ - public IServer getSampleExistingServer() - { - return sampleExistingServer_; - } - /** - * @return Returns the sampleProject_. - */ - public IProject getSampleProject() - { - return sampleProject_; - } - /** - * @return Returns the sampleServerTypeID_. - */ - public String getSampleServerTypeID() - { - return sampleServerTypeID_; - } - /** - * @return Returns the validationManager_. - */ - public ValidationManager getValidationManager() - { - return validationManager_; - } - - /** - * @return Returns the serviceExistingServer_. - */ - public IServer getServiceExistingServer() - { - return serviceExistingServer_; - } - - - public boolean getCustomizeServiceMappings() - { - return customizeServiceMappings_; - } - /** - * @return Returns the isWebProjectStartupRequested. - */ - public Boolean getIsWebProjectStartupRequested() - { - return IsWebProjectStartupRequested; - } - -public void setJavaBeanName(String javaBeanName) { - this.javaBeanName_ = javaBeanName; -} - -// public void setServiceTypeRuntimeServer(TypeRuntimeServer ids) -// { -// serviceIds_ = ids; -// } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/BeanConfigWidget.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/BeanConfigWidget.java deleted file mode 100644 index 768f72a8d..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/BeanConfigWidget.java +++ /dev/null @@ -1,301 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060321 128827 joan - Joan Haggarty, remove redundant wsdl URI, folder and file controls - * 20060524 128601 andyzhai@ca.ibm.com - Andy Zhai - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.bean; - -import java.io.File; -import java.util.Enumeration; -import java.util.Hashtable; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.axis.creation.ui.AxisCreationUIMessages; -import org.eclipse.jst.ws.internal.consumption.ui.ConsumptionUIMessages; -import org.eclipse.jst.ws.internal.ui.common.UIUtils; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.swt.widgets.TreeItem; -import org.eclipse.ui.PlatformUI; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; - - -public class BeanConfigWidget extends SimpleWidgetDataContributor -{ - - private Button rpcEncodedButton_; - private Button rpcLiteralButton_; - private Button docLiteralButton_; - - private Listener statusListener_; - - private JavaWSDLParameter javaParameter_; - - /* CONTEXT_ID PBCF0001 for the Bean Config Page */ - private final String INFOPOP_PBCF_PAGE = "PBCF0001"; //$NON-NLS-1$ - - private String wsdlFolder_; - - private Text wsdlFileText_; - /* CONTEXT_ID PBCF0007 for the WSDL File field of the Bean Config Page */ - private final String INFOPOP_PBCF_TEXT_WSDL_FILE = "PBCF0007"; //$NON-NLS-1$ - - private Tree methodsTree_; - /* CONTEXT_ID PBME0002 for the Methods tree of the Bean Methods Page */ - private final String INFOPOP_PBME_TREE_METHODS = "PBME0002"; //$NON-NLS-1$ - - private Button selectAllMethodsButton_; - /* CONTEXT_ID PBME0010 for the Select All button of the Bean Methods Page */ - private final String INFOPOP_PBME_BUTTON_SELECT_ALL = "PBME0010"; //$NON-NLS-1$ - - private Button deselectAllMethodsButton_; - /* CONTEXT_ID PBME0011 for the Deselect All button of the Bean Methods Page */ - private final String INFOPOP_PBME_BUTTON_DESELECT_ALL = "PBME0011"; //$NON-NLS-1$ - - private Button showMappingsCheckbox_; - /* CONTEXT_ID PBCF0016 for the Show Mappings checkbox of the Bean Methods Page */ - private String INFOPOP_P2N_SHOW_MAPPINGS = "PBCF0016"; //$NON-NLS-1$ - - public WidgetDataEvents addControls( Composite parent, Listener statusListener ) - { - String pluginId_ = "org.eclipse.jst.ws.axis.creation.ui"; - - UIUtils uiUtils = new UIUtils( pluginId_ ); - UIUtils baseConUiUtils = new UIUtils( pluginId_ ); - - statusListener_ = statusListener; - parent.setToolTipText( AxisCreationUIMessages.TOOLTIP_PBCF_PAGE ); - PlatformUI.getWorkbench().getHelpSystem().setHelp( parent, pluginId_ + "." + INFOPOP_PBCF_PAGE ); - - Composite configGroup = uiUtils.createComposite( parent, 2 ); - - wsdlFileText_ = uiUtils.createText( configGroup, AxisCreationUIMessages.LABEL_OUTPUT_FILE_NAME, - AxisCreationUIMessages.TOOLTIP_PBCF_TEXT_WSDL_FILE, - INFOPOP_PBCF_TEXT_WSDL_FILE, - SWT.SINGLE | SWT.BORDER ); - wsdlFileText_.addListener( SWT.Modify, statusListener ); - - // TODO this group has no TOOLTIP or INFOPOP. - Group methodsGroup = baseConUiUtils.createGroup( parent, ConsumptionUIMessages.LABEL_METHODS, null, null ); - methodsGroup.setLayoutData( uiUtils.createFillAll() ); - - GridLayout layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - methodsGroup.setLayout( layout ); - - methodsTree_ = uiUtils.createTree( methodsGroup, AxisCreationUIMessages.TOOLTIP_PBME_TREE_METHODS, - INFOPOP_PBME_TREE_METHODS, - SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.CHECK ); - methodsTree_.addListener( SWT.Selection, statusListener ); - - Composite selectButtons = uiUtils.createComposite( methodsGroup, 2 ); - - selectAllMethodsButton_ - = baseConUiUtils.createPushButton( selectButtons, ConsumptionUIMessages.BUTTON_SELECT_ALL, - ConsumptionUIMessages.TOOLTIP_PBME_BUTTON_SELECT_ALL, - INFOPOP_PBME_BUTTON_SELECT_ALL ); - selectAllMethodsButton_.addSelectionListener( new SelectionAdapter() - { - public void widgetSelected( SelectionEvent evt ) - { - handleSelectAll( true ); - } - }); - - deselectAllMethodsButton_ - = baseConUiUtils.createPushButton( selectButtons, ConsumptionUIMessages.BUTTON_DESELECT_ALL, - ConsumptionUIMessages.TOOLTIP_PBME_BUTTON_DESELECT_ALL, - INFOPOP_PBME_BUTTON_DESELECT_ALL ); - deselectAllMethodsButton_.addSelectionListener( new SelectionAdapter() - { - public void widgetSelected( SelectionEvent evt ) - { - handleSelectAll( false ); - } - }); - - // TODO this group has no TOOLTIP or INFOPOP. - Group styleGroup = uiUtils.createGroup( parent, AxisCreationUIMessages.LABEL_STYLE_USE, null, null ); - - // TODO radio buttons have no TOOLTIP or INFOPOP. - docLiteralButton_ = uiUtils.createRadioButton( styleGroup, AxisCreationUIMessages.STYLE_DOC_LITERAL, null, null ); - rpcLiteralButton_ = uiUtils.createRadioButton( styleGroup, AxisCreationUIMessages.STYLE_RPC_LITERAL, null, null ); - rpcEncodedButton_ = uiUtils.createRadioButton( styleGroup, AxisCreationUIMessages.STYLE_RPC_ENCODED, null, null ); - - showMappingsCheckbox_ = uiUtils.createCheckbox( parent, AxisCreationUIMessages.LABEL_EXPLORE_MAPPINGS_BEAN2XML, - AxisCreationUIMessages.TOOLTIP_P2N_SHOW_MAPPINGS, - INFOPOP_P2N_SHOW_MAPPINGS ); - - return this; - } - - public void handleSelectAll( boolean value ) - { - TreeItem[] items = methodsTree_.getItems(); - - for( int i = 0; i < items.length; i++ ) - { - items[i].setChecked(value); - } - - statusListener_.handleEvent( null ); - } - - public void setCustomizeServiceMappings( boolean value ) - { - showMappingsCheckbox_.setSelection( value ); - } - - public boolean getCustomizeServiceMappings() - { - return showMappingsCheckbox_ == null ? false : showMappingsCheckbox_.getSelection(); - } - - public void setJavaParameter( JavaWSDLParameter javaParameter ) - { - javaParameter_ = javaParameter; - - String wsdlLocation = javaParameter.getOutputWsdlLocation(); - IPath wsdlPath = new Path( wsdlLocation ); - - wsdlFolder_ = wsdlPath.removeLastSegments(1).toString(); - wsdlFileText_.setText(wsdlPath.lastSegment()); - - methodsTree_.removeAll(); - Hashtable methods = javaParameter.getMethods(); - Enumeration e = methods.keys(); - - while( e.hasMoreElements() ) - { - String name = (String) e.nextElement(); - TreeItem item = new TreeItem(methodsTree_, SWT.NULL); - - item.setData(name); - item.setText(name); - item.setChecked((((Boolean) methods.get(name)).booleanValue())); - } - - TreeItem[] items = methodsTree_.getItems(); - - if( items.length > 0 ) - { - methodsTree_.setSelection( new TreeItem[]{ items[0] } ); - } - - String style = javaParameter.getStyle(); - - if( style.equals( JavaWSDLParameter.STYLE_RPC ) ) - { - rpcEncodedButton_.setSelection(true); - } - else if( style.equals( JavaWSDLParameter.STYLE_DOCUMENT ) ) - { - rpcLiteralButton_.setSelection(true); - } - else - { - docLiteralButton_.setSelection(true); - } - } - - public JavaWSDLParameter getJavaParameter() - { - - IPath wsdlPath - = new Path( wsdlFolder_.trim() ).append( wsdlFileText_.getText().trim() ); - - // TODO Do we need to go to the eclipse file system?? - //String wsdlLocation = workspace.getFile(wsdlPath).getLocation().toString(); - String wsdlLocation = wsdlPath.toString(); - - javaParameter_.setOutputWsdlLocation(wsdlLocation); - javaParameter_.setInputWsdlLocation(new File(wsdlLocation).toURI().toString()); - - Hashtable methods = new Hashtable(); - - TreeItem[] items = methodsTree_.getItems(); - - for( int i = 0; i < items.length; i++ ) - { - TreeItem item = items[i]; - methods.put((String)item.getData(), new Boolean(item.getChecked())); - } - - javaParameter_.setMethods(methods); - - if( rpcEncodedButton_.getSelection()) - { - javaParameter_.setStyle(JavaWSDLParameter.STYLE_RPC); - javaParameter_.setUse(JavaWSDLParameter.USE_ENCODED); - } - else if( rpcLiteralButton_.getSelection()) - { - javaParameter_.setStyle(JavaWSDLParameter.STYLE_DOCUMENT); - javaParameter_.setUse(JavaWSDLParameter.USE_LITERAL); - } - else - { - javaParameter_.setStyle(JavaWSDLParameter.STYLE_WRAPPED); - javaParameter_.setUse(JavaWSDLParameter.USE_LITERAL); - } - - return javaParameter_; - } - - /* (non-Javadoc) - * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#getStatus() - */ - public IStatus getStatus() - { - IStatus result = null; - - if( wsdlFileText_.getText().equals( "" ) ) - { - result = StatusUtils.errorStatus( AxisCreationUIMessages.PAGE_MSG_NO_FILE_SPECIFIED ); - } - else - { - TreeItem[] items = methodsTree_.getItems(); - boolean itemSelected = false; - - for( int index = 0; index < items.length; index++ ) - { - if( items[index].getChecked() ) - { - itemSelected = true; - break; - } - } - - if( !itemSelected ) - { - result = StatusUtils.errorStatus( AxisCreationUIMessages.PAGE_MSG_NO_METHOD_SELECTED ); - } - } - - return result; - } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/ValidateObjectSelectionCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/ValidateObjectSelectionCommand.java deleted file mode 100644 index dac0747df..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/bean/ValidateObjectSelectionCommand.java +++ /dev/null @@ -1,172 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.bean; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -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.Status; -import org.eclipse.jem.java.JavaClass; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jst.ws.internal.axis.creation.ui.AxisCreationUIMessages; -import org.eclipse.jst.ws.internal.common.JavaMOFUtils; -import org.eclipse.jst.ws.internal.common.ResourceUtils; -import org.eclipse.jst.ws.internal.consumption.common.JavaResourceFilter; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; - - -public class ValidateObjectSelectionCommand extends AbstractDataModelOperation -{ - private String JAVA_EXTENSION = ".java"; //$NON-NLS-1$ - private String CLASS_EXTENSION = ".class"; //$NON-NLS-1$ - private IStructuredSelection objectSelection; - private String serviceProjectName; - - - /** - * Validates that the selected Java bean can be loaded from the service project. If it can't, an error is displayed. - */ - public ValidateObjectSelectionCommand() - { - super(); - } - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IEnvironment environment = getEnvironment(); - //Make sure a bean is selected - String javaBeanName = null; - if (objectSelection != null && !objectSelection.isEmpty()) - { - Object object = objectSelection.getFirstElement(); - if (object instanceof String) - { - javaBeanName = ((String)object); - } - else - { - //The ObjectSelectionWidget never appeared and so the IStucturedSelection from - //ObjectSelectionWidgetOutputCommand is the initial selection. - //Get the Java bean name from the selection. - try - { - System.out.println(object.getClass().toString()); - javaBeanName = getJavaBeanFromObjectSelection(objectSelection); - } catch (CoreException ce) - { - IStatus errorStatus = StatusUtils.errorStatus(AxisCreationUIMessages.MSG_ERROR_CANNOT_NO_JAVA_BEAN); - environment.getStatusHandler().reportError(errorStatus); - return errorStatus; - } - } - } - - if (javaBeanName==null || javaBeanName.length()==0) - { - IStatus errorStatus = StatusUtils.errorStatus(AxisCreationUIMessages.MSG_ERROR_CANNOT_NO_JAVA_BEAN); - environment.getStatusHandler().reportError(errorStatus); - return errorStatus; - } - - //Make sure a project is selected - IProject serviceProject = ProjectUtilities.getProject(serviceProjectName); - if (serviceProject==null) - { - IStatus errorStatus = StatusUtils.errorStatus(AxisCreationUIMessages.MSG_ERROR_NO_PROJECT); - environment.getStatusHandler().reportError(errorStatus); - return errorStatus; - } - - //Make sure the selected bean can be loaded from the selected project - if (javaBeanName.toLowerCase().endsWith(JAVA_EXTENSION) - || javaBeanName.toLowerCase().endsWith(CLASS_EXTENSION)) { - javaBeanName = javaBeanName.substring(0, javaBeanName.lastIndexOf('.')); - } - - try - { - JavaClass javaClass = JavaMOFUtils.getJavaClass(javaBeanName, serviceProject); - if (!javaClass.isExistingType()) - { - IStatus errorStatus = StatusUtils.errorStatus( NLS.bind(AxisCreationUIMessages.MSG_ERROR_CANNOT_LOAD_JAVA_BEAN, new String[] { javaBeanName, serviceProjectName })); - environment.getStatusHandler().reportError(errorStatus); - return errorStatus; - } - } catch (CoreException ce) - { - IStatus errorStatus = StatusUtils.errorStatus( NLS.bind(AxisCreationUIMessages.MSG_ERROR_CANNOT_LOAD_JAVA_BEAN, new String[] { javaBeanName, serviceProjectName })); - environment.getStatusHandler().reportError(errorStatus); - return errorStatus; - } - - return Status.OK_STATUS; - } - - /** - * @param serviceProjectName The serviceProjectName to set. - */ - public void setServiceProjectName(String serviceProjectName) - { - this.serviceProjectName = serviceProjectName; - } - - /** - * @param objectSelection The objectSelection to set. - */ - public void setObjectSelection(IStructuredSelection objectSelection) - { - this.objectSelection = objectSelection; - } - - private String getJavaBeanFromObjectSelection(IStructuredSelection objectSelection) throws CoreException - { - String beanClass = ""; - JavaResourceFilter filter = new JavaResourceFilter(); - //IStructuredSelection selection = initialSelection_; - // - if (objectSelection != null) - { - Object obj = objectSelection.getFirstElement(); - if (obj != null) - { - // get the IResource represented by the selection - IResource res = null; - - res = ResourceUtils.getResourceFromSelection(obj); - - if (filter.accepts(res)) - { - // get the package-qualified class name without file extensions - String beanPackage = ResourceUtils.getJavaResourcePackageName(res.getFullPath()); - if (beanPackage==null) - beanPackage = ""; - else - beanPackage = beanPackage + "."; - - beanClass = beanPackage + res.getName(); - - if (beanClass.toLowerCase().endsWith(".java") || beanClass.toLowerCase().endsWith(".class")) { - beanClass = beanClass.substring(0,beanClass.lastIndexOf('.')); - } - } - } - } - - // - return beanClass; - } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/AxisSkeletonDefaultingCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/AxisSkeletonDefaultingCommand.java deleted file mode 100644 index 47cb1e1e5..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/AxisSkeletonDefaultingCommand.java +++ /dev/null @@ -1,128 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton; - -import org.eclipse.core.resources.IFile; -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.jface.viewers.IStructuredSelection; -import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.consumption.common.WSDLParserFactory; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; - - -public class AxisSkeletonDefaultingCommand extends AbstractDataModelOperation -{ - private IStructuredSelection initialSelection; - private WebServicesParser webServicesParser; - private String wsdlURI_; - private JavaWSDLParameter javaWSDLParam; - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - javaWSDLParam = new JavaWSDLParameter(); - javaWSDLParam.setServerSide(JavaWSDLParameter.SERVER_SIDE_BEAN); - javaWSDLParam.setSkeletonDeploy(true); - javaWSDLParam.setMetaInfOnly(false); - javaWSDLParam.setInputWsdlLocation(wsdlURI_); - return Status.OK_STATUS; - - } - - public void setInitialSelection(IStructuredSelection initialSelection) - { - this.initialSelection = initialSelection; - } - - public void setObjectSelection(IStructuredSelection objectSelection) - { - } - - public void setWebServicesParser(WebServicesParser webServicesParser) - { - this.webServicesParser = webServicesParser; - } - - public WebServicesParser getWebServicesParser() - { - if (webServicesParser == null) - webServicesParser = WSDLParserFactory.getWSDLParser(); - return webServicesParser; - } - - public String getWebServiceURI() - { - if (initialSelection != null && !initialSelection.isEmpty()) - { - Object firstElement = initialSelection.getFirstElement(); - if (firstElement instanceof IFile) - { - IFile ifile = (IFile)firstElement; - String fileExtension = ifile.getFileExtension(); - if (fileExtension.equals("wsdl") || - fileExtension.equals("wsil") || - fileExtension.equals("html")) - { - return ifile.getFullPath().toString(); - } - } - } - return ""; - } - - public String getWsdlURI() - { - return wsdlURI_; - } - - public void setWsdlURI(String wsdlURI) - { - wsdlURI_ = wsdlURI; - - } - - public boolean getGenWSIL() - { - return false; - } - - public String getWsilURI() - { - String wsURI = getWsdlURI(); - int index = wsURI.lastIndexOf('.'); - if (index != -1) - { - StringBuffer sb = new StringBuffer(wsURI.substring(0, index)); - sb.append(".wsil"); - return sb.toString(); - } - return ""; - } - - public JavaWSDLParameter getJavaWSDLParam() - { - return javaWSDLParam; - } - - public String getHttpBasicAuthPassword() - { - return getWebServicesParser().getHTTPBasicAuthPassword(); - } - - public String getHttpBasicAuthUsername() - { - return getWebServicesParser().getHTTPBasicAuthUsername(); - } - -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/SkeletonConfigWidget.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/SkeletonConfigWidget.java deleted file mode 100644 index 2960305e8..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/SkeletonConfigWidget.java +++ /dev/null @@ -1,174 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060106 121199 jesper@selskabet.org - Jesper Møller - * 20060321 128827 joan - Joan Haggarty, remove redundant wsdl URI, folder and file controls - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; -import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.axis.consumption.ui.AxisConsumptionUIMessages; -import org.eclipse.jst.ws.internal.axis.creation.ui.AxisCreationUIMessages; -import org.eclipse.jst.ws.internal.common.ResourceUtils; -import org.eclipse.jst.ws.internal.consumption.ui.ConsumptionUIMessages; -import org.eclipse.jst.ws.internal.ui.common.UIUtils; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.ui.PlatformUI; -import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; - - -public class SkeletonConfigWidget extends SimpleWidgetDataContributor -{ - private JavaWSDLParameter javaWSDLParam; - - /* CONTEXT_ID PBSC0001 for the Skeleton Config Page */ - private static final String INFOPOP_PBSC_PAGE = "PBSC0001"; //$NON-NLS-1$ - - // private Text uriText_; - /* CONTEXT_ID PBCF0002 for the URI field of the Bean Config Page */ - //private final String INFOPOP_PBCF_TEXT_URI = "PBCF0002"; //$NON-NLS-1$ - - private Combo skeletonFolderText_; - /* CONTEXT_ID PBSC0004 for the Skeleton Folder field of the Skeleton Config Page */ - private static final String INFOPOP_PBSC_TEXT_SKELETON_FOLDER = "PBSC0004"; //$NON-NLS-1$ - - - /* CONTEXT_ID PBSC0005 for the Skeleton Folder Browse button of the Skeleton Config Page */ - // private static final String INFOPOP_PBSC_BUTTON_SKELETON_FOLDER_BROWSE = "PBSC0005"; //$NON-NLS-1$ - // private static final String TOOLTIP_PBSC_BUTTON_SKELETON_FOLDER_BROWSE = "TOOLTIP_PBSC_BUTTON_SKELETON_FOLDER_BROWSE"; - - private Button showMappingsCheckbox_; - /* CONTEXT_ID PBSC0016 for the Show Mappings checkbox of the Bean Methods Page */ - private String INFOPOP_N2P_SHOW_MAPPINGS = "PBSC0016"; //$NON-NLS-1$ - - private IProject serverProject_; - - public WidgetDataEvents addControls( Composite parent, Listener statusListener) - { - String pluginId = "org.eclipse.jst.ws.axis.creation.ui"; - - UIUtils uiUtils = new UIUtils( pluginId ); - UIUtils conUiUtils = new UIUtils( pluginId ); - UIUtils baseConUiUtils = new UIUtils( pluginId ); - - PlatformUI.getWorkbench().getHelpSystem().setHelp( parent, pluginId + "." + INFOPOP_PBSC_PAGE ); - parent.setToolTipText( AxisCreationUIMessages.TOOLTIP_PBSC_PAGE ); - - Composite textGroup = uiUtils.createComposite( parent, 2, 0, 0 ); - - /* - uriText_ = uiUtils.createText( textGroup, "LABEL_URI", - TOOLTIP_PBCF_TEXT_URI, - INFOPOP_PBCF_TEXT_URI, - SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY ); - */ - - skeletonFolderText_ = baseConUiUtils.createCombo( textGroup, ConsumptionUIMessages.LABEL_SKELETON_ROOT_NAME, - ConsumptionUIMessages.TOOLTIP_PBSC_TEXT_SKELETON_FOLDER, - INFOPOP_PBSC_TEXT_SKELETON_FOLDER, - SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY ); - - showMappingsCheckbox_ = conUiUtils.createCheckbox( parent, AxisConsumptionUIMessages.LABEL_EXPLORE_MAPPINGS_XML2BEAN, - AxisConsumptionUIMessages.TOOLTIP_N2P_SHOW_MAPPINGS, - INFOPOP_N2P_SHOW_MAPPINGS ); - - return this; - } - - public void setEndpointURI(String endpointURI) - { - /* - if (endpointURI != null) - uriText_.setText(endpointURI); - */ - } - - public void setOutputJavaFolder(String outputJavaFolder) - { - if (outputJavaFolder != null) - { - int index = skeletonFolderText_.indexOf(outputJavaFolder); - if (index != -1) - skeletonFolderText_.select(index); - else if (skeletonFolderText_.getItemCount() <= 0) - { - String root = getWorkspaceRootLocation(); - if (outputJavaFolder.startsWith(root)) - skeletonFolderText_.setText(outputJavaFolder.substring(root.length())); - else - skeletonFolderText_.setText(outputJavaFolder); - } - } - } - - public void setShowMapping(boolean showMapping) - { - showMappingsCheckbox_.setSelection(showMapping); - } - - public boolean getShowMapping() - { - return showMappingsCheckbox_.getSelection(); - } - - /** - * @return Returns the javaWSDLParam. - */ - public JavaWSDLParameter getJavaWSDLParam() { - -// Do not base Java output directory on workspace root since the project could be not -// physically located in the workspace root, get the project specific root instead - - String projectSpecificRoot = serverProject_.getLocation().toString(); - String skeletonFolder = skeletonFolderText_.getText(); - String projectPathString = serverProject_.getFullPath().toString(); - if (skeletonFolder.startsWith(projectPathString)) { - skeletonFolder = skeletonFolder.substring(projectPathString.length()); - } - javaWSDLParam.setJavaOutput(projectSpecificRoot + skeletonFolder); - return javaWSDLParam; - } - - /** - * @param javaWSDLParam The javaWSDLParam to set. - */ - public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) { - this.javaWSDLParam = javaWSDLParam; - } - - public void setServerProject(IProject serviceProject) - { - serverProject_ = serviceProject; - String originalSkeletonFolder = skeletonFolderText_.getText(); - skeletonFolderText_.removeAll(); - IPath[] paths = ResourceUtils.getAllJavaSourceLocations(serviceProject); - for (int i = 0; i < paths.length ; i++) - skeletonFolderText_.add(paths[i].toString()); - int index = skeletonFolderText_.indexOf(originalSkeletonFolder); - if (index != -1) - skeletonFolderText_.select(index); - else - skeletonFolderText_.select(0); - } - - private String getWorkspaceRootLocation() - { - return ResourcesPlugin.getWorkspace().getRoot().getLocation().removeTrailingSeparator().toString(); - } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/SkeletonConfigWidgetDefaultingCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/SkeletonConfigWidgetDefaultingCommand.java deleted file mode 100644 index 03be88a93..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/widgets/skeleton/SkeletonConfigWidgetDefaultingCommand.java +++ /dev/null @@ -1,118 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner - * 20060330 124667 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter; -import org.eclipse.jst.ws.internal.common.J2EEUtils; -import org.eclipse.jst.ws.internal.common.ResourceUtils; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; - -public class SkeletonConfigWidgetDefaultingCommand extends AbstractDataModelOperation -{ - private String wsdlURI; - private IProject serverProject; - private JavaWSDLParameter javaWSDLParam; - private String serviceServerTypeID_; - - public SkeletonConfigWidgetDefaultingCommand( ) - { - } - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - - String outputDir = ResourceUtils.findResource(J2EEUtils.getWebInfPath( serverProject )).getLocation().toString(); - javaWSDLParam.setOutput( outputDir ); -// Do not base Java output directory on workspace root since the project could be not physically located in the workspace root -// javaWSDLParam.setJavaOutput(getRootURL() + getOutputJavaFolder()); - String javaOutput = ResourceUtils.findResource(getOutputJavaFolder()).getLocation().toString(); - javaWSDLParam.setJavaOutput(javaOutput); - - return Status.OK_STATUS; - - } - - public void setWsdlURI(String wsdlURI) - { - this.wsdlURI = wsdlURI; - } - - public void setServerProject(String serverProject) - { - this.serverProject = ResourcesPlugin.getWorkspace().getRoot().getProject(serverProject); - } - - public String getEndpointURI() - { - return null; - } - - public String getOutputWSDLFolder() - { - IPath wsdlPath = J2EEUtils.getWebContentPath(serverProject ).append("wsdl"); - return wsdlPath.toString(); - } - - public String getOutputWSDLFile() - { - int index = wsdlURI.lastIndexOf('/'); - if (index == -1) - index = wsdlURI.lastIndexOf('\\'); - return wsdlURI.substring(index+1, wsdlURI.length()); - } - - public String getOutputJavaFolder() - { - if (serverProject!=null){ - return ResourceUtils.getJavaSourceLocation(serverProject).toString(); - } - return null; - } - - public boolean getShowMapping() - { - return false; - } - - public boolean isShowMapping() - { - return getShowMapping(); - } - - public void setJavaWSDLParam(JavaWSDLParameter javaWSDLParam) - { - this.javaWSDLParam = javaWSDLParam; - } - - public JavaWSDLParameter getJavaWSDLParam() - { - return javaWSDLParam; - } - -public String getServiceServerTypeID() { - return serviceServerTypeID_; -} - -public void setServiceServerTypeID(String serviceServerTypeID) { - this.serviceServerTypeID_ = serviceServerTypeID; -} -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wizard/beans/WSBeanAxisType.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wizard/beans/WSBeanAxisType.java deleted file mode 100644 index 044bce113..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wizard/beans/WSBeanAxisType.java +++ /dev/null @@ -1,227 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060424 120137 kathy@ca.ibm.com - Kathy Chan - * 20060523 143284 sengpl@ca.ibm.com - Seng Phung-Lu - * 20060605 145407 sengpl@ca.ibm.com - Seng Phung-Lu - * 20060607 144978 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.wizard.beans; - - -import org.eclipse.jst.ws.internal.axis.consumption.ui.AxisConsumptionUIMessages; -import org.eclipse.jst.ws.internal.axis.consumption.ui.widgets.AxisMappingsWidget; -import org.eclipse.jst.ws.internal.axis.creation.ui.AxisCreationUIMessages; -import org.eclipse.jst.ws.internal.axis.creation.ui.command.BUCodeGenOperation; -import org.eclipse.jst.ws.internal.axis.creation.ui.command.JavaToWSDLMethodCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.command.ValidateWSIComplianceCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.task.DefaultsForServerJavaWSDLCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.widgets.bean.BeanConfigWidget; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.ObjectSelectionWidget; -import org.eclipse.wst.command.internal.env.core.data.DataMappingRegistry; -import org.eclipse.wst.command.internal.env.core.fragment.CommandFragment; -import org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentFactory; -import org.eclipse.wst.command.internal.env.core.fragment.SimpleFragment; -import org.eclipse.wst.command.internal.env.ui.widgets.CanFinishRegistry; -import org.eclipse.wst.command.internal.env.ui.widgets.CommandWidgetBinding; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetContributor; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetContributorFactory; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetRegistry; - - -/** -* This is the class for the -* Axis bottom up Java Bean scenario -* -*/ -public class WSBeanAxisType implements CommandWidgetBinding -{ - private String serverName_; - private String runtimeName_; - private boolean isWebModuleRequired_; - - - /** - * Returns a locale specific label for the Server supported by this Web Service type - * @return A locale specific server label from server plugins - */ - public String getServerLabel() - { - return serverName_; - } - - /** - * Sets the server label to the appropriate name found in the server plugins. - * @param server name - */ - public void setServerLabel(String serverLabel) - { - serverName_ = serverLabel; - } - - /** - * Returns a locale specific label for the deployment runtime of this Web Service type - * @return A locale specific label for the deployment runtime - */ - public String getRuntimeLabel() - { - return runtimeName_; - } - - /** - * Sets the runtime label for the appropriate runtime - * @param server name - */ - public void setRuntimeLabel(String runtimeLabel) - { - runtimeName_ = runtimeLabel; - } - - - /** - * Returns whether or not a Web Module is required for this WebServiceServerRuntimeType - * @return true if requireWebModule - */ - public boolean isWebModuleRequired() - { - return isWebModuleRequired_; - } - - /** - * Sets the boolean value at runtime according to requireWebModule attribute from the manifest file - * @param requireWebModule - */ - public void setWebModuleRequired(boolean requireWebModule) - { - isWebModuleRequired_ = requireWebModule; - } - - - /* (non-Javadoc) - * @see org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeType#isEJBModuleRequired() - */ - public boolean isEJBModuleRequired() { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeType#setEJBModuleRequired(boolean) - */ - public void setEJBModuleRequired(boolean arg0) { - return; - - } - - /* (non-Javadoc) - * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry) - */ - public void registerCanFinish(CanFinishRegistry canFinishRegistry) - { - } - - /* (non-Javadoc) - * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.internal.env.core.data.DataMappingRegistry) - */ - public void registerDataMappings(DataMappingRegistry dataRegistry) - { - /* - dataRegistry.addMapping( CurrentPageCommand.class, "CurrentPage", BeanClassWidget.class ); - //BeanClassWidget - as target - dataRegistry.addMapping(BUAxisDefaultingCommand.class, "JavaBeanName", BeanClassWidget.class, "BeanClassName", null); - //BeanClassWidget - as source - dataRegistry.addMapping(BeanClassWidget.class, "BeanClassName", DefaultsForServerJavaWSDLCommand.class, "JavaBeanName", null); //BeanConfigWidget - */ - // ObjectSelectionWidget - dataRegistry.addMapping(ObjectSelectionWidget.class, "ObjectSelection", DefaultsForServerJavaWSDLCommand.class); - - //BeanConfigWidget - as target - dataRegistry.addMapping(JavaToWSDLMethodCommand.class, "JavaWSDLParam", BeanConfigWidget.class, "JavaParameter", null ); - //BeanConfigWidget - as source - - // ValidateWSIComplianceCommand - dataRegistry.addMapping(BeanConfigWidget.class, "JavaParameter",ValidateWSIComplianceCommand.class, "JavaWSDLParam", null); - - //dataRegistry.addMapping(BeanConfigWidget.class, "JavaParameter", Java2WSDLCommand.class, "JavaWSDLParam", null); - //dataRegistry.addMapping(BeanConfigWidget.class, "JavaParameter", WSDL2JavaCommand.class, "JavaWSDLParam", null); - dataRegistry.addMapping(BeanConfigWidget.class, "JavaParameter",BUCodeGenOperation.class, "JavaWSDLParam", null); - //AxisMappingsWidget - as target - dataRegistry.addMapping(BeanConfigWidget.class, "JavaParameter", AxisMappingsWidget.class); - - //AxisMappingsWidget - as source - - dataRegistry.addMapping(AxisMappingsWidget.class, "JavaParameter", BUCodeGenOperation.class, "JavaWSDLParam", null); - - - //dataRegistry.addMapping( DefaultsForConfig.class, "JavaParameter", BeanConfigWidget.class ); - //dataRegistry.addMapping( DefaultsForConfig.class, "CustomizeServiceMappings", BeanConfigWidget.class ); - } - /* (non-Javadoc) - * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry) - */ - public void registerWidgetMappings(WidgetRegistry widgetRegistry) - { - - /* - widgetRegistry.add( "BeanSelection", - AxisCreationUIMessages.PAGE_TITLE_WSBEAN_CLASS, - AxisCreationUIMessages.PAGE_DESC_WSBEAN_CLASS, - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new BeanClassWidget(); - } - } ); - */ - - widgetRegistry.add( "BeanConfig", - AxisCreationUIMessages.PAGE_TITLE_WSBEAN_CONFIG, - AxisCreationUIMessages.PAGE_DESC_WSBEAN_CONFIG, - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new BeanConfigWidget(); - } - } ); - - - widgetRegistry.add( "AxisServiceBeanMapping", - AxisConsumptionUIMessages.PAGE_TITLE_WS_BEAN2XML, - AxisConsumptionUIMessages.PAGE_DESC_P2N_MAPPINGS, - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new AxisMappingsWidget(AxisMappingsWidget.MODE_BEAN2XML ); - } - } ); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentFactoryFactory#create() - */ - public CommandFragmentFactory create() - { - return new CommandFragmentFactory() - { - public CommandFragment create() - { - //dead code - doesn't matter what gets returned here. - return new SimpleFragment(); - } - }; - } - -} - - - diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wizard/wsdl/WSWSDLAxisType.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wizard/wsdl/WSWSDLAxisType.java deleted file mode 100644 index 413db8637..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wizard/wsdl/WSWSDLAxisType.java +++ /dev/null @@ -1,216 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060321 128827 joan - Joan Haggarty, remove redundant wsdl URI, folder and file controls - * 20060523 143284 sengpl@ca.ibm.com - Seng Phung-Lu - * 20060605 145407 sengpl@ca.ibm.com - Seng Phung-Lu - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.wizard.wsdl; - - -import org.eclipse.jst.ws.internal.axis.consumption.ui.widgets.AxisMappingsFragment; -import org.eclipse.jst.ws.internal.axis.consumption.ui.widgets.AxisMappingsWidget; -import org.eclipse.jst.ws.internal.axis.creation.ui.command.TDCodeGenOperation; -import org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton.AxisSkeletonDefaultingCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton.SkeletonConfigWidget; -import org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton.SkeletonConfigWidgetDefaultingCommand; -import org.eclipse.jst.ws.internal.consumption.ui.ConsumptionUIMessages; -import org.eclipse.jst.ws.internal.consumption.ui.command.data.ProjectName2IProjectTransformer; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ServerExtensionDefaultingCommand; -import org.eclipse.wst.command.internal.env.core.data.DataMappingRegistry; -import org.eclipse.wst.command.internal.env.core.fragment.CommandFragment; -import org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentFactory; -import org.eclipse.wst.command.internal.env.core.fragment.SimpleFragment; -import org.eclipse.wst.command.internal.env.ui.widgets.CanFinishRegistry; -import org.eclipse.wst.command.internal.env.ui.widgets.CommandWidgetBinding; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetContributor; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetContributorFactory; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetRegistry; - -/** -* This is the class for the Axis Web service type. -*/ -public class WSWSDLAxisType implements CommandWidgetBinding -{ - private String serverName_; - private String runtimeName_; - private boolean isWebModuleRequired_; - - /** - * Returns a locale specific label for the Server supported by this Web Service type - * @return A locale specific server label from server plugins - */ - public String getServerLabel() { - return serverName_; - } - - /** - * Sets the server label to the appropriate name found in the server plugins. - * @param server name - */ - public void setServerLabel(String serverLabel) { - serverName_ = serverLabel; - } - - /** - * Returns a locale specific label for the deployment runtime of this Web Service type - * @return A locale specific label for the deployment runtime - */ - public String getRuntimeLabel() { - return runtimeName_; - } - - /** - * Sets the runtime label for the appropriate runtime - * @param server name - */ - public void setRuntimeLabel(String runtimeLabel) { - runtimeName_ = runtimeLabel; - } - - /** - * Returns whether or not a Web Module is required for this WebServiceServerRuntimeType - * @return true if requireWebModule - */ - public boolean isWebModuleRequired() { - return isWebModuleRequired_; - } - - /** - * Sets the boolean value at runtime according to requireWebModule attribute from the manifest file - * @param requireWebModule - */ - public void setWebModuleRequired(boolean requireWebModule) { - isWebModuleRequired_ = requireWebModule; - } - - - /* (non-Javadoc) - * @see org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeType#isEJBModuleRequired() - */ - public boolean isEJBModuleRequired() { - - return false; - } - - - /* (non-Javadoc) - * @see org.eclipse.jst.ws.internal.consumption.ui.wizard.WebServiceServerRuntimeType#setEJBModuleRequired(boolean) - */ - public void setEJBModuleRequired(boolean arg0) { - return; - - } - - /* (non-Javadoc) - * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerCanFinish(org.eclipse.wst.command.env.ui.widgets.CanFinishRegistry) - */ - public void registerCanFinish(CanFinishRegistry canFinishRegistry) - { - } - /* (non-Javadoc) - * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.internal.env.core.data.DataMappingRegistry) - */ - public void registerDataMappings(DataMappingRegistry dataRegistry) - { - // SkeletonConfigWidget - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", SkeletonConfigWidget.class, "ServerProject", new ProjectName2IProjectTransformer()); - dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "JavaWSDLParam", SkeletonConfigWidget.class); - dataRegistry.addMapping(SkeletonConfigWidgetDefaultingCommand.class, "EndpointURI", SkeletonConfigWidget.class); - dataRegistry.addMapping(SkeletonConfigWidgetDefaultingCommand.class, "OutputJavaFolder", SkeletonConfigWidget.class); - dataRegistry.addMapping(SkeletonConfigWidgetDefaultingCommand.class, "ShowMapping", SkeletonConfigWidget.class); - - // BackupSkelImplCommand - dataRegistry.addMapping(SkeletonConfigWidget.class, "JavaWSDLParam", TDCodeGenOperation.class, "JavaWSDLParam", null); - - // AxisMappingsFragment - dataRegistry.addMapping(SkeletonConfigWidgetDefaultingCommand.class, "ShowMapping", AxisMappingsFragment.class); - dataRegistry.addMapping(SkeletonConfigWidget.class, "ShowMapping", AxisMappingsFragment.class); - - // AxisMappingsWidget - dataRegistry.addMapping(SkeletonConfigWidgetDefaultingCommand.class, "JavaWSDLParam", AxisMappingsWidget.class, "JavaParameter", null); - dataRegistry.addMapping(SkeletonConfigWidget.class, "JavaWSDLParam", AxisMappingsWidget.class, "JavaParameter", null); - - // WSDL2JavaCommand - //dataRegistry.addMapping(SkeletonConfigWidgetDefaultingCommand.class, "JavaWSDLParam", WSDL2JavaCommand.class); - //dataRegistry.addMapping(SkeletonConfigWidget.class, "JavaWSDLParam", WSDL2JavaCommand.class); - dataRegistry.addMapping(SkeletonConfigWidget.class, "JavaWSDLParam", TDCodeGenOperation.class, "JavaWSDLParam", null); - dataRegistry.addMapping(AxisMappingsWidget.class, "JavaParameter", TDCodeGenOperation.class, "JavaWSDLParam", null); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerWidgetMappings(org.eclipse.wst.command.env.ui.widgets.WidgetRegistry) - */ - public void registerWidgetMappings(WidgetRegistry widgetRegistry) - { - - /* - widgetRegistry.add( "WSDLSelection", - ConsumptionUIMessages.PAGE_TITLE_WS_SELECTION, - ConsumptionUIMessages.PAGE_DESC_WS_SELECTION, - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new WSDLSelectionWidget(); - } - } ); - - widgetRegistry.add( "WSDLSelectionTreeWidget", - ConsumptionUIMessages.PAGE_TITLE_WSDL_SELECTION, - ConsumptionUIMessages.PAGE_DESC_WSDL_SELECTION, - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new WSDLSelectionTreeWidget(); - } - }); - */ - - widgetRegistry.add( "SkeletonConfig", - ConsumptionUIMessages.PAGE_TITLE_WSSKEL_CONFIG, - ConsumptionUIMessages.PAGE_DESC_WSSKEL_CONFIG, - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new SkeletonConfigWidget(); - } - } ); - - widgetRegistry.add( "AxisMappingsWidget", - ConsumptionUIMessages.PAGE_TITLE_WS_XML2BEAN, - ConsumptionUIMessages.PAGE_DESC_N2P_MAPPINGS, - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new AxisMappingsWidget(AxisMappingsWidget.MODE_XML2BEAN); - } - } ); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentFactoryFactory#create() - */ - public CommandFragmentFactory create() - { - return new CommandFragmentFactory() - { - public CommandFragment create() - { - //dead code - doesn't matter what gets returned here. - return new SimpleFragment(); - } - }; - } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisBeanConfigWidgetFactory.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisBeanConfigWidgetFactory.java deleted file mode 100644 index 77e6b55e6..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisBeanConfigWidgetFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.axis.creation.ui.wsrt; - -import org.eclipse.jst.ws.internal.axis.creation.ui.widgets.bean.BeanConfigWidget; -import org.eclipse.jst.ws.internal.axis.creation.ui.wizard.beans.WSBeanAxisType; -import org.eclipse.wst.command.internal.env.core.data.DataMappingRegistry; -import org.eclipse.wst.command.internal.env.ui.widgets.INamedWidgetContributor; -import org.eclipse.wst.command.internal.env.ui.widgets.INamedWidgetContributorFactory; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetBindingToWidgetFactoryAdapter; - -public class AxisBeanConfigWidgetFactory implements INamedWidgetContributorFactory { - - private INamedWidgetContributor beanConfigWidget_; - private INamedWidgetContributor mappingsWidget_; - private BeanConfigWidget beanWidget_; - private WidgetBindingToWidgetFactoryAdapter adapter_; - - public AxisBeanConfigWidgetFactory() - { - adapter_ = new WidgetBindingToWidgetFactoryAdapter( new WSBeanAxisType() ); - - beanConfigWidget_ = adapter_.getWidget( "BeanConfig" ); - beanWidget_ = (BeanConfigWidget)beanConfigWidget_.getWidgetContributorFactory().create(); - mappingsWidget_ = adapter_.getWidget( "AxisServiceBeanMapping" ); - } - - public INamedWidgetContributor getFirstNamedWidget() - { - return beanConfigWidget_; - } - - public INamedWidgetContributor getNextNamedWidget( INamedWidgetContributor widgetContributor) - { - return widgetContributor == beanConfigWidget_ && beanWidget_.getCustomizeServiceMappings() ? mappingsWidget_ : null; - } - - public void registerDataMappings(DataMappingRegistry dataRegistry) - { - adapter_.registerDataMappings( dataRegistry ); - } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisSkeletonConfigWidgetFactory.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisSkeletonConfigWidgetFactory.java deleted file mode 100644 index 0d8b8fecc..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisSkeletonConfigWidgetFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.axis.creation.ui.wsrt; - -import org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton.SkeletonConfigWidget; -import org.eclipse.jst.ws.internal.axis.creation.ui.wizard.wsdl.WSWSDLAxisType; -import org.eclipse.wst.command.internal.env.core.data.DataMappingRegistry; -import org.eclipse.wst.command.internal.env.ui.widgets.INamedWidgetContributor; -import org.eclipse.wst.command.internal.env.ui.widgets.INamedWidgetContributorFactory; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetBindingToWidgetFactoryAdapter; - -public class AxisSkeletonConfigWidgetFactory implements INamedWidgetContributorFactory { - - private INamedWidgetContributor skelConfigWidget_; - private INamedWidgetContributor mappingsWidget_; - private SkeletonConfigWidget skelWidget_; - private WidgetBindingToWidgetFactoryAdapter adapter_; - - public AxisSkeletonConfigWidgetFactory() - { - adapter_ = new WidgetBindingToWidgetFactoryAdapter( new WSWSDLAxisType() ); - - skelConfigWidget_ = adapter_.getWidget( "SkeletonConfig" ); - skelWidget_ = (SkeletonConfigWidget)skelConfigWidget_.getWidgetContributorFactory().create(); - mappingsWidget_ = adapter_.getWidget( "AxisMappingsWidget" ); - } - - public INamedWidgetContributor getFirstNamedWidget() - { - return skelConfigWidget_; - } - - public INamedWidgetContributor getNextNamedWidget( INamedWidgetContributor widgetContributor) - { - return widgetContributor == skelConfigWidget_ && skelWidget_.getShowMapping() ? mappingsWidget_ : null; - } - - public void registerDataMappings(DataMappingRegistry dataRegistry) - { - adapter_.registerDataMappings( dataRegistry ); - } -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisWebService.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisWebService.java deleted file mode 100644 index 8356366d2..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisWebService.java +++ /dev/null @@ -1,331 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060330 124667 kathy@ca.ibm.com - Kathy Chan - * 20060330 128827 kathy@ca.ibm.com - Kathy Chan - * 20060424 120137 kathy@ca.ibm.com - Kathy Chan - * 20060509 125094 sengpl@ca.ibm.com - Seng Phung-Lu, Use WorkspaceModifyOperation - * 20060515 115225 sengpl@ca.ibm.com - Seng Phung-Lu - * 20060517 142327 sengpl@ca.ibm.com - Seng Phung-Lu - * 20060524 130755 kathy@ca.ibm.com - Kathy Chan - * 20060607 144978 kathy@ca.ibm.com - Kathy Chan - * 20060810 135395 makandre@ca.ibm.com - Andrew Mak, Enable WTP Web service framework opening Java editor - * 20061004 159356 kathy@ca.ibm.com - Kathy Chan, Get correct module root URL based on server chosen - * 20080227 119964 trungha@ca.ibm.com - Trung Ha - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.axis.creation.ui.wsrt; - -import java.util.Vector; - -import org.eclipse.jst.ws.internal.axis.consumption.core.command.AxisDeployCommand; -import org.eclipse.jst.ws.internal.axis.consumption.core.command.GeronimoAxisDeployCommand; -import org.eclipse.jst.ws.internal.axis.consumption.ui.task.RefreshProjectCommand; -import org.eclipse.jst.ws.internal.axis.consumption.ui.task.ValidateWSDLCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.command.AxisCheckCompilerLevelCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.command.AxisOutputCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.command.AxisRunInputCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.command.BUAxisInputCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.command.BUCodeGenOperation; -import org.eclipse.jst.ws.internal.axis.creation.ui.command.CopyDeploymentFileCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.command.JavaToWSDLMethodCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.command.ModifyWSDLEndpointAddressCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.command.TDAxisInputCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.command.TDCodeGenOperation; -import org.eclipse.jst.ws.internal.axis.creation.ui.command.ValidateWSIComplianceCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.task.BUConfigCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.task.DefaultsForServerJavaWSDLCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.task.TDConfigCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.widgets.bean.BUAxisDefaultingCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton.AxisSkeletonDefaultingCommand; -import org.eclipse.jst.ws.internal.axis.creation.ui.widgets.skeleton.SkeletonConfigWidgetDefaultingCommand; -import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer; -import org.eclipse.jst.ws.internal.consumption.command.common.BuildProjectCommand; -import org.eclipse.jst.ws.internal.consumption.ui.command.data.ProjectName2IProjectTransformer; -import org.eclipse.wst.command.internal.env.common.WaitForAutoBuildCommand; -import org.eclipse.wst.command.internal.env.core.ICommandFactory; -import org.eclipse.wst.command.internal.env.core.SimpleCommandFactory; -import org.eclipse.wst.command.internal.env.core.data.DataMappingRegistry; -import org.eclipse.wst.command.internal.env.eclipse.EclipseEnvironment; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.ws.internal.wsrt.AbstractWebService; -import org.eclipse.wst.ws.internal.wsrt.IContext; -import org.eclipse.wst.ws.internal.wsrt.ISelection; -import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo; -import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario; - -public class AxisWebService extends AbstractWebService -{ - private AxisWebServiceInfo axisWebServiceInfo_; - - public AxisWebService(WebServiceInfo info) - { - super(info); - } - - public ICommandFactory assemble(IEnvironment env, IContext ctx, - ISelection sel, String project, String earProject) - { - return null; - } - - public ICommandFactory deploy(IEnvironment env, IContext ctx, ISelection sel, - String project, String earProject) - { - return null; - } - - public ICommandFactory develop(IEnvironment env, IContext ctx, ISelection sel, - String project, String earProject) - { - - Vector commands = new Vector(); - EclipseEnvironment environment = (EclipseEnvironment)env; - - if (ctx.getScenario().getValue() == WebServiceScenario.BOTTOMUP) { - - registerBUDataMappings( environment.getCommandManager().getMappingRegistry()); - - commands.add(new BUAxisInputCommand(this, project)); - commands.add(new AxisCheckCompilerLevelCommand()); -// commands.add(new ValidateObjectSelectionCommand()); - commands.add(new BUAxisDefaultingCommand()); - commands.add(new DefaultsForServerJavaWSDLCommand()); - commands.add(new JavaToWSDLMethodCommand()); - // commands.add(new SimpleFragment( "BeanConfig" )); - // commands.add(new SimpleFragment( "AxisServiceBeanMapping" )); - commands.add(new BUConfigCommand()); - commands.add(new ValidateWSIComplianceCommand()); - commands.add(new WaitForAutoBuildCommand()); - commands.add(new BUCodeGenOperation()); -// commands.add(new RefreshProjectCommand()); - commands.add(new BuildProjectCommand()); - commands.add(new AxisOutputCommand(this)); - - } else if (ctx.getScenario().getValue() == WebServiceScenario.TOPDOWN) { - - registerTDDataMappings( environment.getCommandManager().getMappingRegistry()); - - commands.add(new TDAxisInputCommand(this, project)); - commands.add(new AxisSkeletonDefaultingCommand()); - commands.add(new ValidateWSDLCommand()); - commands.add(new SkeletonConfigWidgetDefaultingCommand()); -// commands.add(new SimpleFragment( "SkeletonConfig" )); -// commands.add(new SimpleFragment( "AxisMappingsWidget" )); - commands.add(new TDConfigCommand()); - commands.add(new TDCodeGenOperation()); -// commands.add(new RefreshProjectCommand()); - commands.add(new BuildProjectCommand()); - commands.add(new AxisOutputCommand(this)); - - } else { - //TODO: Remove println and reassess this "error". - System.out.println("Error - WebServiceScenario should not be Client for AxisWebService"); - return null; - } - - - return new SimpleCommandFactory(commands); - } - - public ICommandFactory install(IEnvironment env, IContext ctx, ISelection sel, - String project, String earProject) - { - return null; - } - - public ICommandFactory run(IEnvironment env, IContext ctx, ISelection sel, - String project, String earProject) - { - Vector commands = new Vector(); - - if (ctx.getScenario().getValue() == WebServiceScenario.CLIENT) { - //TODO: Remove println and reassess this "error". - System.out.println("Error - WebServiceScenario should not be Client for AxisWebService"); - return null; - } else {// For BOTTOM_UP and TOP_DOWN - commands.add(new AxisRunInputCommand(this, project)); - commands.add(new ModifyWSDLEndpointAddressCommand()); - commands.add(new AxisDeployCommand(project)); - - commands.add(new RefreshProjectCommand()); - - return new SimpleCommandFactory(commands); - } - } - - public void registerBUDataMappings(DataMappingRegistry registry) - { - //BUAxisInputCommand -// registry.addMapping(BUAxisInputCommand.class, "ServiceServerTypeID", StartProjectCommand.class); - registry.addMapping(BUAxisInputCommand.class, "JavaBeanName", BUAxisDefaultingCommand.class ); - - //ValidateObjectSelectionCommand -// registry.addMapping(ObjectSelectionOutputCommand.class, "ObjectSelection", ValidateObjectSelectionCommand.class); -// registry.addMapping(BUAxisInputCommand.class, "ServerProject", ValidateObjectSelectionCommand.class,"ServiceProjectName", null ); - - //BUAxisDefaultingCommand -// registry.addMapping(SelectionCommand.class, "InitialSelection", BUAxisDefaultingCommand.class ); -//KSC registry.addMapping(BUAxisInputCommand.class, "ServiceTypeRuntimeServer", BUAxisDefaultingCommand.class ); - - // AxisCheckCompilerLevelCommand - registry.addMapping(BUAxisInputCommand.class, "ServerProject", AxisCheckCompilerLevelCommand.class); - - //BUAxisCommands2 - these run after BeanClassWidget - //DefaultsForServerJavaWSDLCommand - registry.addMapping(BUAxisDefaultingCommand.class, "JavaWSDLParam", DefaultsForServerJavaWSDLCommand.class); - registry.addMapping(BUAxisInputCommand.class, "ServerProject", DefaultsForServerJavaWSDLCommand.class, "ServiceProject", new StringToIProjectTransformer()); - registry.addMapping(BUAxisInputCommand.class, "ServiceServerTypeID", DefaultsForServerJavaWSDLCommand.class); - registry.addMapping(BUAxisInputCommand.class, "ServiceExistingServer", DefaultsForServerJavaWSDLCommand.class); - registry.addMapping(BUAxisDefaultingCommand.class, "JavaBeanName", DefaultsForServerJavaWSDLCommand.class); - registry.addMapping(BUAxisDefaultingCommand.class, "Parser", DefaultsForServerJavaWSDLCommand.class); - - //JavaWSDLMethodCommand - registry.addMapping(DefaultsForServerJavaWSDLCommand.class, "JavaWSDLParam", JavaToWSDLMethodCommand.class); - registry.addMapping(BUAxisInputCommand.class, "ServerProject", JavaToWSDLMethodCommand.class, "ServiceProject", new StringToIProjectTransformer()); - - // BUAxisCommands3 - these run after BeanConfigWidget - - //CopyAxisJarCommand - //registry.addMapping(BUAxisInputCommand.class, "ServerProject", CopyAxisJarCommand.class, "Project", new StringToIProjectTransformer()); - - // ValidateWSIComplianceCommand - registry.addMapping(DefaultsForServerJavaWSDLCommand.class, "JavaWSDLParam", ValidateWSIComplianceCommand.class); - registry.addMapping(BUAxisInputCommand.class, "ServerProject", ValidateWSIComplianceCommand.class, "ServiceProject", new StringToIProjectTransformer()); - - //Java2WSDLCommand - registry.addMapping(JavaToWSDLMethodCommand.class, "JavaWSDLParam", BUCodeGenOperation.class); - - //RefreshProjectCommand - registry.addMapping(BUAxisInputCommand.class, "ServerProject", RefreshProjectCommand.class, "Project", new StringToIProjectTransformer()); - - //UpdateWEBXMLCommand - registry.addMapping(BUAxisInputCommand.class, "ServerProject", BUCodeGenOperation.class, "ServiceProject", new StringToIProjectTransformer()); - - //BuildProjectCommand - registry.addMapping(BUAxisInputCommand.class, "ServerProject", BuildProjectCommand.class, "Project", new StringToIProjectTransformer()); - registry.addMapping(BUAxisDefaultingCommand.class, "ForceBuild", BuildProjectCommand.class); - registry.addMapping(BUAxisDefaultingCommand.class, "ValidationManager", BuildProjectCommand.class); - - //StartProjectCommand -// registry.addMapping(BUAxisInputCommand.class, "ServerProject", StartProjectCommand.class, "ServiceProject", new StringToIProjectTransformer()); -// registry.addMapping(BUAxisDefaultingCommand.class, "SampleProject", StartProjectCommand.class); -//KSC registry.addMapping(BUAxisDefaultingCommand.class, "ServiceServerTypeID", StartProjectCommand.class); -// registry.addMapping(BUAxisDefaultingCommand.class, "SampleServerTypeID", StartProjectCommand.class); -// registry.addMapping(BUAxisDefaultingCommand.class, "ServiceExistingServer", StartProjectCommand.class); -// registry.addMapping(BUAxisDefaultingCommand.class, "SampleExistingServer", StartProjectCommand.class); -// registry.addMapping(BUAxisDefaultingCommand.class, "IsWebProjectStartupRequested",StartProjectCommand.class); - - // AxisOutputCommand - registry.addMapping(BUCodeGenOperation.class, "WsdlURI", AxisOutputCommand.class); - registry.addMapping(BUCodeGenOperation.class, "JavaWSDLParam", AxisOutputCommand.class); - - - // Run extension - -// ModifyWSDLEndpointAddressCommand - registry.addMapping(AxisRunInputCommand.class, "JavaWSDLParam", ModifyWSDLEndpointAddressCommand.class); - registry.addMapping(AxisRunInputCommand.class, "ServerInstanceId", ModifyWSDLEndpointAddressCommand.class); - registry.addMapping(AxisRunInputCommand.class, "ServerFactoryId", ModifyWSDLEndpointAddressCommand.class); - registry.addMapping(AxisRunInputCommand.class, "ServerProject", ModifyWSDLEndpointAddressCommand.class, "ServiceProject", new StringToIProjectTransformer()); - registry.addMapping(AxisRunInputCommand.class, "WsdlURI", ModifyWSDLEndpointAddressCommand.class); - registry.addMapping(BUAxisDefaultingCommand.class, "Parser", ModifyWSDLEndpointAddressCommand.class, "WebServicesParser", null); - - // GeronimoAxisDeployCommand - registry.addMapping(ModifyWSDLEndpointAddressCommand.class, "JavaWSDLParam", GeronimoAxisDeployCommand.class); - - //AxisDeployCommand - registry.addMapping(ModifyWSDLEndpointAddressCommand.class, "JavaWSDLParam", AxisDeployCommand.class); - - // CopyDeploymentFileCommand - registry.addMapping(AxisRunInputCommand.class, "ServerInstanceId", CopyDeploymentFileCommand.class); - - //RefreshProjectCommand - registry.addMapping(AxisRunInputCommand.class, "ServerProject", RefreshProjectCommand.class, "Project", new StringToIProjectTransformer()); - - } - - public void registerTDDataMappings(DataMappingRegistry dataRegistry) - { - // Transformers - ProjectName2IProjectTransformer projectTransformer = new ProjectName2IProjectTransformer(); - - // TODO: map "InitialSelection" and "ObjectSelection" from TDAxisInputCommand - -// dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", AxisSkeletonDefaultingCommand.class); -// dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "ObjectSelection", AxisSkeletonDefaultingCommand.class); -// dataRegistry.addMapping(TDAxisInputCommand.class, "WebServicesParser", AxisSkeletonDefaultingCommand.class); - - dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "JavaWSDLParam", SkeletonConfigWidgetDefaultingCommand.class); - dataRegistry.addMapping(TDAxisInputCommand.class, "WsdlURI", AxisSkeletonDefaultingCommand.class); - // ValidateWSDLCommand - dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "WebServicesParser", ValidateWSDLCommand.class); - dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "WsdlURI", ValidateWSDLCommand.class); - - // SkeletonConfigWidgetDefaultingCommand - dataRegistry.addMapping(TDAxisInputCommand.class, "ServerProject", SkeletonConfigWidgetDefaultingCommand.class); - dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "WsdlURI", SkeletonConfigWidgetDefaultingCommand.class); - dataRegistry.addMapping(TDAxisInputCommand.class, "ServiceServerTypeID", SkeletonConfigWidgetDefaultingCommand.class); - - // AxisSkeletonDefaultingCommand - dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "WsdlURI", TDCodeGenOperation.class); - dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "HttpBasicAuthUsername", TDCodeGenOperation.class); - dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "HttpBasicAuthPassword", TDCodeGenOperation.class); - dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "JavaWSDLParam", TDCodeGenOperation.class); - - // CopyAxisJarCommand - //dataRegistry.addMapping(TDAxisInputCommand.class, "ServerProject", CopyAxisJarCommand.class, "Project", projectTransformer); - - // BackupSkelImplCommand - dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "WebServicesParser", TDCodeGenOperation.class); - dataRegistry.addMapping(TDAxisInputCommand.class, "WebServiceInfo", TDCodeGenOperation.class); - - // Skeleton2WSDLCommand - dataRegistry.addMapping(TDAxisInputCommand.class, "ServerProject", TDCodeGenOperation.class, "ServerProject", projectTransformer); - dataRegistry.addMapping(TDAxisInputCommand.class, "ServiceServerTypeID", TDCodeGenOperation.class); - dataRegistry.addMapping(TDAxisInputCommand.class, "ServiceExistingServer", TDCodeGenOperation.class); - - // RefreshProjectCommand - dataRegistry.addMapping(TDAxisInputCommand.class, "ServerProject", RefreshProjectCommand.class, "Project", projectTransformer); - - // BuildProjectCommand - dataRegistry.addMapping(TDAxisInputCommand.class, "ServerProject", BuildProjectCommand.class, "Project", projectTransformer); - - // ModifyWSDLEndpointAddressCommand - dataRegistry.addMapping(AxisRunInputCommand.class, "JavaWSDLParam", ModifyWSDLEndpointAddressCommand.class); - dataRegistry.addMapping(AxisRunInputCommand.class, "ServerInstanceId", ModifyWSDLEndpointAddressCommand.class); - dataRegistry.addMapping(AxisRunInputCommand.class, "ServerFactoryId", ModifyWSDLEndpointAddressCommand.class); - dataRegistry.addMapping(AxisRunInputCommand.class, "ServerProject", ModifyWSDLEndpointAddressCommand.class, "ServiceProject", new StringToIProjectTransformer()); - dataRegistry.addMapping(AxisRunInputCommand.class, "WsdlURI", ModifyWSDLEndpointAddressCommand.class); - dataRegistry.addMapping(AxisSkeletonDefaultingCommand.class, "WebServicesParser", ModifyWSDLEndpointAddressCommand.class); - - // GeronimoAxisDeployCommand - dataRegistry.addMapping(ModifyWSDLEndpointAddressCommand.class, "JavaWSDLParam", GeronimoAxisDeployCommand.class); - - // AxisDeployCommand - dataRegistry.addMapping(ModifyWSDLEndpointAddressCommand.class, "JavaWSDLParam", AxisDeployCommand.class); - - // CopyDeploymentFileCommand - dataRegistry.addMapping(AxisRunInputCommand.class, "ServerInstanceId", CopyDeploymentFileCommand.class); - - // AxisOutputCommand - dataRegistry.addMapping(TDCodeGenOperation.class, "WsdlURI", AxisOutputCommand.class); - dataRegistry.addMapping(TDCodeGenOperation.class, "JavaWSDLParam", AxisOutputCommand.class); - } - public AxisWebServiceInfo getAxisWebServiceInfo() { - return axisWebServiceInfo_; - } - - public void setAxisWebServiceInfo(AxisWebServiceInfo axisWebServiceInfo) { - axisWebServiceInfo_ = axisWebServiceInfo; - } -} - diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisWebServiceInfo.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisWebServiceInfo.java deleted file mode 100644 index 1e7f78be2..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisWebServiceInfo.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.axis.creation.ui.wsrt; - -import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter; - -public class AxisWebServiceInfo { - - private JavaWSDLParameter javaWSDLParameter; - - public JavaWSDLParameter getJavaWSDLParameter() { - return javaWSDLParameter; - } - - public void setJavaWSDLParameter(JavaWSDLParameter javaWSDLParameter) { - this.javaWSDLParameter = javaWSDLParameter; - } - -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisWebServiceRuntime.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisWebServiceRuntime.java deleted file mode 100644 index bbbd10dd1..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisWebServiceRuntime.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.axis.creation.ui.wsrt; - -import org.eclipse.jst.ws.internal.axis.consumption.ui.wsrt.AxisWebServiceClient; -import org.eclipse.wst.ws.internal.wsrt.AbstractWebServiceRuntime; -import org.eclipse.wst.ws.internal.wsrt.IWebService; -import org.eclipse.wst.ws.internal.wsrt.IWebServiceClient; -import org.eclipse.wst.ws.internal.wsrt.WebServiceClientInfo; -import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo; - -public class AxisWebServiceRuntime extends AbstractWebServiceRuntime -{ - - public IWebService getWebService(WebServiceInfo info) - { - return new AxisWebService(info); - } - - public IWebServiceClient getWebServiceClient(WebServiceClientInfo info) - { - return new AxisWebServiceClient(info); - } - -} diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisWebServiceRuntimeChecker.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisWebServiceRuntimeChecker.java deleted file mode 100644 index 041a41f19..000000000 --- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/wsrt/AxisWebServiceRuntimeChecker.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20080326 198439 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ -package org.eclipse.jst.ws.internal.axis.creation.ui.wsrt; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jst.ws.internal.consumption.ui.ConsumptionUIMessages; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.ws.internal.wsrt.AbstractWebServiceRuntimeChecker; -import org.eclipse.wst.ws.internal.wsrt.IWebServiceRuntimeChecker; - -public class AxisWebServiceRuntimeChecker extends - AbstractWebServiceRuntimeChecker implements IWebServiceRuntimeChecker { - - public IStatus checkServiceClientCompatibility(boolean serviceNeedEAR, - String serviceEARName, String serviceProjectName, - boolean clientNeedEAR, String clientEARName, - String clientProjectName) { - - if (serviceProjectName != null && serviceProjectName.equalsIgnoreCase(clientProjectName)) { - return StatusUtils - .errorStatus(ConsumptionUIMessages.MSG_SAME_CLIENT_AND_SERVICE_PROJECTS); - } - if (serviceNeedEAR && clientNeedEAR) { - if (serviceEARName != null && serviceEARName.equals(clientEARName)) { - return StatusUtils.warningStatus(NLS.bind( - ConsumptionUIMessages.MSG_SAME_CLIENT_AND_SERVICE_EARS, - new String[] { "EAR" })); - } - } - return Status.OK_STATUS; - } - -} |