diff options
Diffstat (limited to 'bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension')
6 files changed, 0 insertions, 809 deletions
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/ClientRootFragment.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/ClientRootFragment.java deleted file mode 100644 index 3e4feacd4..000000000 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/ClientRootFragment.java +++ /dev/null @@ -1,117 +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 - * -------- -------- ----------------------------------------------------------- - * 20060131 121071 rsinha@ca.ibm.com - Rupam Kuehner - * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner - * 20060529 141422 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.consumption.ui.extension; - -import org.eclipse.wst.command.internal.env.core.data.DataMappingRegistry; -import org.eclipse.wst.command.internal.env.core.fragment.SequenceFragment; -import org.eclipse.wst.command.internal.env.core.fragment.SimpleFragment; -import org.eclipse.wst.command.internal.env.ui.widgets.DataObjectCommand; -import org.eclipse.wst.ws.internal.extensions.AssembleClientFragment; -import org.eclipse.wst.ws.internal.extensions.DeployClientFragment; -import org.eclipse.wst.ws.internal.extensions.DevelopClientFragment; -import org.eclipse.wst.ws.internal.extensions.InstallClientFragment; -import org.eclipse.wst.ws.internal.extensions.RunClientFragment; - -public class ClientRootFragment extends SequenceFragment -{ - public ClientRootFragment() - { - add( new SimpleFragment( new PreClientDevelopCommand(), "" ) ); - add( new DevelopClientFragment() ); - add( new SimpleFragment( new PreClientAssembleCommand(), "" ) ); - add( new AssembleClientFragment() ); - add( new SimpleFragment( new PreClientDeployCommand(), "" ) ); - add( new DeployClientFragment() ); - add( new SimpleFragment( new PreClientInstallCommand(), "" ) ); - add( new InstallClientFragment() ); - add( new SimpleFragment( new PreClientRunCommand(), - "org.eclipse.jst.ws.internal.consumption.ui.extension.PreClientRunCommand" ) ); - add( new RunClientFragment() ); - } - - public void registerDataMappings(DataMappingRegistry registry) - { - registry.addMapping( PreClientDevelopCommand.class, "WebService", DevelopClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Environment", DevelopClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Context", DevelopClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Selection", DevelopClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Project", DevelopClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Module", DevelopClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "EarProject", DevelopClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Ear", DevelopClientFragment.class ); - - // Map the PreClientDevelopCommand into the dataObject. - registry.addMapping( PreClientDevelopCommand.class, "DataObject", DataObjectCommand.class ); - - registry.addMapping( PreClientDevelopCommand.class, "WebService", AssembleClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Environment", AssembleClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Context", AssembleClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Selection", AssembleClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Project", AssembleClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Module", AssembleClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "EarProject", AssembleClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Ear", AssembleClientFragment.class ); - - registry.addMapping( PreClientDevelopCommand.class, "WebService", DeployClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Environment", DeployClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Context", DeployClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Selection", DeployClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Project", DeployClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Module", DeployClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "EarProject", DeployClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Ear", DeployClientFragment.class ); - - registry.addMapping( PreClientDevelopCommand.class, "WebService", InstallClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Environment", InstallClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Context", InstallClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Selection", InstallClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Project", InstallClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Module", InstallClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "EarProject", InstallClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Ear", InstallClientFragment.class ); - - registry.addMapping( PreClientDevelopCommand.class, "WebService", RunClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Environment", RunClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Context", RunClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Selection", RunClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Project", RunClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Module", RunClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "EarProject", RunClientFragment.class ); - registry.addMapping( PreClientDevelopCommand.class, "Ear", RunClientFragment.class ); - - //Mappings from framework to framework commands - registry.addMapping( PreClientDevelopCommand.class, "Context", PreClientAssembleCommand.class ); - registry.addMapping( PreClientDevelopCommand.class, "Context", PreClientDeployCommand.class ); - - registry.addMapping( PreClientDevelopCommand.class, "WebService", PreClientAssembleCommand.class ); - registry.addMapping( PreClientDevelopCommand.class, "Project", PreClientAssembleCommand.class ); - registry.addMapping( PreClientDevelopCommand.class, "Module", PreClientAssembleCommand.class ); - registry.addMapping( PreClientDevelopCommand.class, "EarProject", PreClientAssembleCommand.class ); - registry.addMapping( PreClientDevelopCommand.class, "Ear", PreClientAssembleCommand.class ); - - registry.addMapping( PreClientDevelopCommand.class, "WebService", PreClientInstallCommand.class ); - registry.addMapping( PreClientDevelopCommand.class, "Project", PreClientInstallCommand.class ); - registry.addMapping( PreClientDevelopCommand.class, "Context", PreClientInstallCommand.class ); - registry.addMapping( PreClientDevelopCommand.class, "Module", PreClientInstallCommand.class ); - registry.addMapping( PreClientDevelopCommand.class, "EarProject", PreClientInstallCommand.class ); - registry.addMapping( PreClientDevelopCommand.class, "Ear", PreClientInstallCommand.class ); - - registry.addMapping( PreClientDevelopCommand.class, "WebService", PreClientRunCommand.class ); - registry.addMapping( PreClientDevelopCommand.class, "Context", PreClientRunCommand.class ); - - } -} diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientAssembleCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientAssembleCommand.java deleted file mode 100644 index 37e5d48ed..000000000 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientAssembleCommand.java +++ /dev/null @@ -1,117 +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 - * -------- -------- ----------------------------------------------------------- - * 20060131 121071 rsinha@ca.ibm.com - Rupam Kuehner - * 20060529 141422 kathy@ca.ibm.com - Kathy Chan - * 20080325 222473 makandre@ca.ibm.com - Andrew Mak, Create EAR version based on the version of modules to be added - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.consumption.ui.extension; - -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.j2ee.internal.plugin.IJ2EEModuleConstants; -import org.eclipse.jst.ws.internal.consumption.command.common.AssociateModuleWithEARCommand; -import org.eclipse.jst.ws.internal.consumption.command.common.CreateFacetedProjectCommand; -import org.eclipse.jst.ws.internal.consumption.common.FacetUtils; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.ws.internal.wsrt.IContext; -import org.eclipse.wst.ws.internal.wsrt.IWebServiceClient; - -public class PreClientAssembleCommand extends AbstractDataModelOperation -{ - private IWebServiceClient webServiceClient_; - private String project_; - private String module_; - private String earProject_; - private String ear_; - private IContext context_; - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IStatus status = Status.OK_STATUS; - - if (context_ != null && context_.getAssemble()) { - IEnvironment environment = getEnvironment(); - - // Check if EAR module is req'd, ie. !=null - if (earProject_==null) - return Status.OK_STATUS; - - // Create the client EAR module - CreateFacetedProjectCommand command = new CreateFacetedProjectCommand(); - command.setProjectName(earProject_); - command.setTemplateId(IJ2EEModuleConstants.JST_EAR_TEMPLATE); - - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(project_); - command.setRequiredFacetVersions(FacetUtils.getRequiredEARFacetVersions(project)); - - command.setServerFactoryId(webServiceClient_.getWebServiceClientInfo().getServerFactoryId()); - command.setServerInstanceId(webServiceClient_.getWebServiceClientInfo().getServerInstanceId()); - status = command.execute( monitor, adaptable ); - if (status.getSeverity() == Status.ERROR) - { - environment.getStatusHandler().reportError( status ); - return status; - } - - - //Associate the client module and service EAR - AssociateModuleWithEARCommand associateCommand = new AssociateModuleWithEARCommand(); - associateCommand.setProject(project_); - associateCommand.setModule(module_); - associateCommand.setEARProject(earProject_); - associateCommand.setEar(ear_); - associateCommand.setEnvironment( environment ); - status = associateCommand.execute( monitor, adaptable ); - if (status.getSeverity()==Status.ERROR) - { - environment.getStatusHandler().reportError( status ); - } - - } - return status; - } - - public void setProject( String project ) - { - project_ = project; - } - - public void setModule( String module ) - { - module_ = module; - } - - public void setEarProject( String earProject ) - { - earProject_ = earProject; - } - - public void setEar( String ear ) - { - ear_ = ear; - } - - public void setWebService( IWebServiceClient webServiceClient ) - { - webServiceClient_ = webServiceClient; - } - - public void setContext (IContext context) { - context_ = context; - } -} diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientDeployCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientDeployCommand.java deleted file mode 100644 index cb571d8b0..000000000 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientDeployCommand.java +++ /dev/null @@ -1,44 +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 - * -------- -------- ----------------------------------------------------------- - * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner - * 20060529 141422 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.consumption.ui.extension; - -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.ws.internal.wsrt.IContext; - -public class PreClientDeployCommand extends AbstractDataModelOperation -{ - private IContext context_; - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - if (context_ != null && context_.getDeploy()) - { - //If and when there are framework specific deploy things to be done, - //do them here. - } - - return Status.OK_STATUS; - } - - public void setContext(IContext context) - { - context_=context; - } -} diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientDevelopCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientDevelopCommand.java deleted file mode 100644 index db2cc0c9e..000000000 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientDevelopCommand.java +++ /dev/null @@ -1,317 +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 - * -------- -------- ----------------------------------------------------------- - * 20060131 121071 rsinha@ca.ibm.com - Rupam Kuehner - * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner - * 20060516 126965 kathy@ca.ibm.com - Kathy Chan - * 20060529 141422 kathy@ca.ibm.com - Kathy Chan - * 20070123 167487 makandre@ca.ibm.com - Andrew Mak - * 20070403 173654 kathy@ca.ibm.com - Kathy Chan - * 20080326 221364 kathy@ca.ibm.com - Kathy Chan - * 20080724 241275 pmoogk@ca.ibm.com - Peter Moogk, Validate WSDL before doing major Web service processing. - * 20081001 243869 ericdp@ca.ibm.com - Eric D. Peters, Web Service tools allowing mixed J2EE levels - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.consumption.ui.extension; - -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.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.ws.internal.consumption.command.common.CreateFacetedProjectCommand; -import org.eclipse.jst.ws.internal.consumption.common.FacetUtils; -import org.eclipse.jst.ws.internal.consumption.common.RequiredFacetVersion; -import org.eclipse.jst.ws.internal.consumption.common.WSDLParserFactory; -import org.eclipse.jst.ws.internal.consumption.ui.ConsumptionUIMessages; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.TimedWSDLSelectionConditionCommand; -import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils2; -import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.command.internal.env.core.context.ResourceContext; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.environment.ILog; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.ws.internal.common.HTTPUtility; -import org.eclipse.wst.ws.internal.parser.wsil.WebServiceEntity; -import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; -import org.eclipse.wst.ws.internal.wsrt.IContext; -import org.eclipse.wst.ws.internal.wsrt.ISelection; -import org.eclipse.wst.ws.internal.wsrt.IWebService; -import org.eclipse.wst.ws.internal.wsrt.IWebServiceClient; -import org.eclipse.wst.ws.internal.wsrt.IWebServiceRuntime; -import org.eclipse.wst.ws.internal.wsrt.SimpleContext; -import org.eclipse.wst.ws.internal.wsrt.WebServiceClientInfo; -import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario; -import org.eclipse.wst.ws.internal.wsrt.WebServiceState; - -public class PreClientDevelopCommand extends AbstractDataModelOperation -{ - - private TypeRuntimeServer typeRuntimeServer_; - private String clientRuntimeId_; - private IContext context_; - private ISelection selection_; - private String project_; - private String module_; - private String moduleType_; - private String earProject_; - private String ear_; - private IWebServiceClient webServiceClient_; - private String j2eeLevel_; - private ResourceContext resourceContext_; - private boolean develop_; - private boolean assemble_; - private boolean deploy_; - private boolean test_; - private boolean install_; - private boolean run_; - private String wsdlURI_; - private Object dataObject_; - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IStatus status = Status.OK_STATUS; - - if (develop_) { - IEnvironment environment = getEnvironment(); - - // Split up the project and module - int index = module_.indexOf("/"); - if (index!=-1){ - project_ = module_.substring(0,index); - module_ = module_.substring(index+1); - } - - if (ear_!=null && ear_.length()>0) - { - int earIndex = ear_.indexOf("/"); - if (earIndex!=-1) { - earProject_ = ear_.substring(0,earIndex); - ear_ = ear_.substring(earIndex+1); - } - } - - environment.getLog().log(ILog.INFO, "ws_framework", 5108, this, "PreClientDevelopCommand", "clientRuntimeId_ = "+ clientRuntimeId_); - IWebServiceRuntime wsrt = WebServiceRuntimeExtensionUtils2 - .getClientRuntime(clientRuntimeId_); - WebServiceClientInfo wsInfo = new WebServiceClientInfo(); - - wsInfo.setServerFactoryId(typeRuntimeServer_.getServerId()); - wsInfo.setServerInstanceId(typeRuntimeServer_.getServerInstanceId()); - wsInfo.setState(WebServiceState.UNKNOWN_LITERAL); - wsInfo.setWebServiceRuntimeId(typeRuntimeServer_.getRuntimeId()); - - // check for redirection in the wsdl - HTTPUtility httpUtil = new HTTPUtility(); - String newWsdlURL = httpUtil.handleRedirect(wsdlURI_); - - wsInfo.setWsdlURL( newWsdlURL ); - - // Validate the url before proceeding. - TimedWSDLSelectionConditionCommand timedCmd = new TimedWSDLSelectionConditionCommand(); - WebServicesParser parser = WSDLParserFactory.getWSDLParser(); - - timedCmd.setWebServicesParser( parser ); - timedCmd.setWebServiceURI( newWsdlURL ); - timedCmd.execute( null, null ); - - WebServiceEntity entity = parser.getWebServiceEntityByURI( newWsdlURL ); - - if( entity == null || entity.getType() != WebServiceEntity.TYPE_WSDL ) - { - // This isn't a wsdl file - status = StatusUtils.errorStatus( ConsumptionUIMessages.PAGE_MSG_SELECTION_MUST_BE_WSDL ); - environment.getStatusHandler().reportError( status ); - return status; - } - - webServiceClient_ = wsrt.getWebServiceClient(wsInfo); - WebServiceScenario scenario = WebServiceScenario.CLIENT_LITERAL; - context_ = new SimpleContext(develop_, assemble_, deploy_, install_, run_, true, test_, - false, scenario, resourceContext_.isOverwriteFilesEnabled(), - resourceContext_.isCreateFoldersEnabled(), resourceContext_ - .isCheckoutFilesEnabled()); - - // Create the client module if needed. - IProject project = ProjectUtilities.getProject(project_); - RequiredFacetVersion[] rfv = WebServiceRuntimeExtensionUtils2.getClientRuntimeDescriptorById(clientRuntimeId_).getRequiredFacetVersions(); - if (!project.exists()) - { - boolean matches = WebServiceRuntimeExtensionUtils2.doesClientRuntimeSupportTemplate(clientRuntimeId_, moduleType_); - if (matches) - { - CreateFacetedProjectCommand command = new CreateFacetedProjectCommand(); - command.setProjectName(project_); - command.setTemplateId(moduleType_); - command.setRequiredFacetVersions(rfv); - command.setServerFactoryId(typeRuntimeServer_.getServerId()); - command.setServerInstanceId(typeRuntimeServer_.getServerInstanceId()); - command.setEarProjectName(earProject_); - status = command.execute( monitor, adaptable ); - if (status.getSeverity() == Status.ERROR) - { - environment.getStatusHandler().reportError( status ); - return status; - } - } - } else { - // add facets required by Web service runtime - if (rfv.length != 0) { - status = FacetUtils.addRequiredFacetsToProject(project, rfv, monitor); - if (status.getSeverity() == Status.ERROR) - { - environment.getStatusHandler().reportError( status ); - return status; - } - } - } - } - return status; - } - - public void setClientTypeRuntimeServer( TypeRuntimeServer typeRuntimeServer ) - { - typeRuntimeServer_ = typeRuntimeServer; - } - - public void setClientRuntimeId( String id) - { - clientRuntimeId_ = id; - } - - public void setClientJ2EEVersion( String j2eeLevel ) - { - j2eeLevel_ = j2eeLevel; - } - - public String getJ2eeLevel() - { - return j2eeLevel_; - } - - public IWebServiceClient getWebService() - { - return webServiceClient_; - } - - public IContext getContext() - { - return context_; - } - - public void setResourceContext( ResourceContext resourceContext ) - { - resourceContext_ = resourceContext; - } - - public ISelection getSelection() - { - return selection_; - } - - public void setSelection( ISelection selection ) - { - selection_ = selection; - } - - public String getProject() - { - return project_; - } - - public String getModule() - { - return module_; - } - - public void setModule( String module ) - { - module_ = module; - } - - public void setModuleType( String moduleType) - { - moduleType_ = moduleType; - } - - public String getEarProject() - { - return earProject_; - } - - public String getEar() - { - return ear_; - } - - public void setEar( String ear ) - { - ear_ = ear; - } - - public void setDevelopClient(boolean developClient) { - develop_ = developClient; - } - - public void setAssembleClient(boolean assembleClient) { - assemble_ = assembleClient; - } - - public void setDeployClient(boolean deployClient) - { - deploy_ = deployClient; - } - - public void setInstallClient(boolean installClient) - { - install_ = installClient; - } - - public void setTestService(boolean testService) - { - test_ = testService; - } - - public void setStartService(boolean startService) - { - run_ = startService; - } - - public void setWsdlURI(String uri) - { - wsdlURI_ = uri; - } - - public void setDataObject( Object object ) - { - dataObject_ = object; - } - - public Object getDataObject() - { - Object result = null; - - if( dataObject_ != null && dataObject_ instanceof IWebService ) - { - // The data object has already been set with an IWebService - // so we will keep this value. - result = dataObject_; - } - else - { - result = webServiceClient_; - } - - return result; - } -} diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientInstallCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientInstallCommand.java deleted file mode 100644 index 4cf8809d2..000000000 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientInstallCommand.java +++ /dev/null @@ -1,151 +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 - * -------- -------- ----------------------------------------------------------- - * 20060529 141422 kathy@ca.ibm.com - Kathy Chan - * 20070815 199626 kathy@ca.ibm.com - Kathy Chan - * 20071130 203826 kathy@ca.ibm.com - Kathy Chan - * 20080425 220985 trungha@ca.ibm.com - Trung Ha, Server is recreated when prev publish failed - * 20080429 220985 trungha@ca.ibm.com - Trung Ha - * 20080520 233065 makandre@ca.ibm.com - Andrew Mak, Server not found error in Web service generation - * 20080722 240231 gilberta@ca.ibm.com - Gilbert Andrews - * - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.consumption.ui.extension; - -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.consumption.command.common.AddModuleToServerCommand; -import org.eclipse.jst.ws.internal.consumption.command.common.CreateServerCommand; -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.wsrt.IContext; -import org.eclipse.wst.ws.internal.wsrt.IWebServiceClient; - -public class PreClientInstallCommand extends AbstractDataModelOperation -{ - private IWebServiceClient webServiceClient_; - private String project_; - private String module_; - private String earProject_; - private String ear_; - private IContext context_; - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - if (context_ != null && context_.getInstall()) - { - IEnvironment environment = getEnvironment(); - - if (webServiceClient_.getWebServiceClientInfo().getServerInstanceId()==null) - { - // Attempt to find a server instance in the workspace matching - // the server id of the webService_ - // If we can find one, we don't need to create a new server. - IServer[] allServers = ServerCore.getServers(); - if (allServers != null && allServers.length > 0) { - for (int i = 0; i < allServers.length; i++) { - IServer oneServer = allServers[i]; - if (oneServer.getServerType().getId().equals( - webServiceClient_.getWebServiceClientInfo().getServerFactoryId())) { - - webServiceClient_.getWebServiceClientInfo().setServerInstanceId(oneServer.getId()); - webServiceClient_.getWebServiceClientInfo().setServerCreated(true); - } - } - } - // Cannot find an appropriate server, so we will create one - if (webServiceClient_.getWebServiceClientInfo().getServerInstanceId() == null) { - CreateServerCommand createServerCommand = new CreateServerCommand(); - createServerCommand.setServerFactoryid(webServiceClient_.getWebServiceClientInfo().getServerFactoryId()); - createServerCommand.setServerRuntimeId(webServiceClient_.getWebServiceClientInfo().getServerRuntimeId()); - createServerCommand.setEnvironment( environment ); - IStatus createServerStatus = createServerCommand.execute(null, null); - if (createServerStatus.getSeverity()==Status.OK) - { - webServiceClient_.getWebServiceClientInfo().setServerInstanceId(createServerCommand.getServerInstanceId()); - webServiceClient_.getWebServiceClientInfo().setServerCreated(true); - } - else - { - if (createServerStatus.getSeverity()==Status.ERROR) - { - environment.getStatusHandler().reportError( createServerStatus ); - } - return createServerStatus; - } - } - } - - AddModuleToServerCommand command = new AddModuleToServerCommand(); - command.setServerInstanceId(webServiceClient_.getWebServiceClientInfo().getServerInstanceId()); - if (earProject_ != null && earProject_.length()>0 && ear_!= null && ear_.length()>0) - { - command.setProject(earProject_); - command.setModule(ear_); - } - else - { - command.setProject(project_); - command.setModule(module_); - } - - command.setEnvironment( environment ); - IStatus status = command.execute( null, null ); - if (status.getSeverity()==Status.ERROR) - { - environment.getStatusHandler().reportError( status ); - } - return status; - } - return Status.OK_STATUS; - } - - public void setProject( String project ) - { - project_ = project; - } - - public boolean getCanRunTestClient(){ - if(webServiceClient_.getWebServiceClientInfo().getServerInstanceId() != null) return true; - - return false; - } - - public void setModule( String module ) - { - module_ = module; - } - - public void setEarProject( String earProject ) - { - earProject_ = earProject; - } - - public void setEar( String ear ) - { - ear_ = ear; - } - - public void setWebService( IWebServiceClient webServiceClient ) - { - webServiceClient_ = webServiceClient; - } - - public void setContext(IContext context) - { - context_ = context; - } -} diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientRunCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientRunCommand.java deleted file mode 100644 index 59315bf22..000000000 --- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/extension/PreClientRunCommand.java +++ /dev/null @@ -1,63 +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 - * -------- -------- ----------------------------------------------------------- - * 20060529 141422 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.consumption.ui.extension; - -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.consumption.ui.command.StartServerCommand; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.ws.internal.wsrt.IContext; -import org.eclipse.wst.ws.internal.wsrt.IWebServiceClient; - -public class PreClientRunCommand extends AbstractDataModelOperation -{ - private IWebServiceClient webServiceClient_; - private IContext context_; - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IStatus status = Status.OK_STATUS; - - if (context_ != null && context_.getRun()) - { - IEnvironment environment = getEnvironment(); - - StartServerCommand command = new StartServerCommand(); - command.setServerInstanceId(webServiceClient_.getWebServiceClientInfo().getServerInstanceId()); - command.setEnvironment( environment ); - status = command.execute( monitor, null ); - if (status.getSeverity()==Status.ERROR) - { - environment.getStatusHandler().reportError( status ); - } - } - - return status; - } - - - public void setWebService( IWebServiceClient webServiceClient ) - { - webServiceClient_ = webServiceClient; - } - - public void setContext(IContext context) - { - context_=context; - } -} |