diff options
Diffstat (limited to 'bundles/org.eclipse.jst.ws.creation.ui/src')
23 files changed, 0 insertions, 4060 deletions
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/creation/ui/plugin.properties b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/creation/ui/plugin.properties deleted file mode 100644 index 6a4c47a05..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/creation/ui/plugin.properties +++ /dev/null @@ -1,25 +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 -############################################################################### - -# -# WSDL Test Errors -# -MSG_ERROR_UNABLE_TO_LAUNCH_WSDL_TEST=IWAB0361E An error occurred. Unable to launch WSDL test facility. - - -# -# Wizard pages -# -PAGE_TITLE_OBJECT_SELECTION=Object Selection Page -PAGE_DESC_OBJECT_SELECTION=Object Selection Page - - - diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceAssembleCommand.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceAssembleCommand.java deleted file mode 100644 index 11f8a4c60..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceAssembleCommand.java +++ /dev/null @@ -1,107 +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.creation.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.AssociateModuleWithEARCommand; -import org.eclipse.jst.ws.internal.consumption.command.common.CreateModuleCommand; -import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; -import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.ws.internal.provisional.wsrt.IWebService; - -public class PreServiceAssembleCommand extends EnvironmentalOperation -{ - private IWebService webService_; - private String project_; - private String module_; - private String earProject_; - private String ear_; - private String j2eeLevel_; - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - Environment environment = getEnvironment(); - - System.out.println( "In Pre service assemble command." ); - - // Check if EAR module is req'd, ie. !=null - if (earProject_==null) - return Status.OK_STATUS; - - - //Create the service EAR module - CreateModuleCommand command = new CreateModuleCommand(); - command.setProjectName(earProject_); - command.setModuleName(ear_); - command.setModuleType(CreateModuleCommand.EAR); - command.setServerFactoryId(webService_.getWebServiceInfo().getServerFactoryId()); - command.setServerInstanceId( webService_.getWebServiceInfo().getServerInstanceId() ); - command.setJ2eeLevel(j2eeLevel_); - command.setEnvironment( environment ); - IStatus status = command.execute( monitor, null ); - if (status.getSeverity()==Status.ERROR) - { - environment.getStatusHandler().reportError(status); - return status; - } - - - //Associate the service 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, null ); - 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 setJ2eeLevel( String j2eeLevel ) - { - j2eeLevel_ = j2eeLevel; - } - - public void setWebService( IWebService webService ) - { - webService_ = webService; - } -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceDeployCommand.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceDeployCommand.java deleted file mode 100644 index b6383048a..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceDeployCommand.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.creation.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.command.internal.provisional.env.core.EnvironmentalOperation; - -public class PreServiceDeployCommand extends EnvironmentalOperation -{ - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - System.out.println( "In Pre service deploy command." ); - - return Status.OK_STATUS; - } -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceDevelopCommand.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceDevelopCommand.java deleted file mode 100644 index 3bb5ec0de..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceDevelopCommand.java +++ /dev/null @@ -1,255 +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.creation.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.CreateModuleCommand; -import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils; -import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; -import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; -import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.context.ResourceContext; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.ws.internal.provisional.wsrt.IContext; -import org.eclipse.wst.ws.internal.provisional.wsrt.ISelection; -import org.eclipse.wst.ws.internal.provisional.wsrt.IWebService; -import org.eclipse.wst.ws.internal.provisional.wsrt.IWebServiceRuntime; -import org.eclipse.wst.ws.internal.provisional.wsrt.WebServiceInfo; -import org.eclipse.wst.ws.internal.provisional.wsrt.WebServiceScenario; -import org.eclipse.wst.ws.internal.provisional.wsrt.WebServiceState; -import org.eclipse.wst.ws.internal.wsrt.SimpleContext; - -public class PreServiceDevelopCommand extends EnvironmentalOperation -{ - private TypeRuntimeServer typeRuntimeServer_; - private IContext context_; - private ISelection selection_; - private String project_; - private String module_; - private String moduleType_; - private String earProject_; - private String ear_; - - private IWebService webService_; - private String j2eeLevel_; - private ResourceContext resourceContext_; - - private boolean run_; - private boolean client_; - private boolean test_; - private boolean publish_; - - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - Environment 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); - } - } - - - IWebServiceRuntime wsrt = WebServiceRuntimeExtensionUtils.getWebServiceRuntime( typeRuntimeServer_.getRuntimeId() ); - WebServiceInfo wsInfo = new WebServiceInfo(); - - System.out.println( "In Pre service develop command." ); - - wsInfo.setJ2eeLevel( j2eeLevel_ ); - wsInfo.setServerFactoryId( typeRuntimeServer_.getServerId() ); - wsInfo.setServerInstanceId( typeRuntimeServer_.getServerInstanceId()); - wsInfo.setState( WebServiceState.UNKNOWN_LITERAL ); - wsInfo.setWebServiceRuntimeId( typeRuntimeServer_.getRuntimeId() ); - - webService_ = wsrt.getWebService( wsInfo ); - - //Set up the IContext - WebServiceScenario scenario = null; - int scenarioInt = WebServiceRuntimeExtensionUtils.getScenarioFromTypeId(typeRuntimeServer_.getTypeId()); - if (scenarioInt == WebServiceScenario.BOTTOMUP) - { - scenario = WebServiceScenario.BOTTOMUP_LITERAL; - String impl = (String)(selection_.getSelection())[0]; - wsInfo.setImplURL(impl); - } - else if (scenarioInt == WebServiceScenario.TOPDOWN) - { - scenario = WebServiceScenario.TOPDOWN_LITERAL; - String wsdlURL = (String)(selection_.getSelection())[0]; - wsInfo.setWsdlURL(wsdlURL); - } - - context_ = new SimpleContext(true, true, true, true, run_, client_, test_, publish_, - scenario, - resourceContext_.isOverwriteFilesEnabled(), - resourceContext_.isCreateFoldersEnabled(), - resourceContext_.isCheckoutFilesEnabled()); - - //Create the service module - - //rsk todo -- pick the correct module type based on the Web service type, it's hard coded to WEB for now. - int intModuleType = convertModuleType(moduleType_); - - - CreateModuleCommand command = new CreateModuleCommand(); - command.setProjectName(project_); - command.setModuleName(module_); - command.setModuleType(intModuleType); - command.setServerFactoryId(typeRuntimeServer_.getServerId()); - command.setServerInstanceId(typeRuntimeServer_.getServerInstanceId()); - command.setJ2eeLevel(j2eeLevel_); - command.setEnvironment(environment); - IStatus status = command.execute( monitor, null); - - - if (status.getSeverity()==Status.ERROR) - { - environment.getStatusHandler().reportError(status); - } - return status; - } - - private int convertModuleType(String type) - { - if (type.equals(IModuleConstants.JST_WEB_MODULE)) - { - return CreateModuleCommand.WEB; - } - else if (type.equals(IModuleConstants.JST_EJB_MODULE)) - { - return CreateModuleCommand.EJB; - } - else if (type.equals(IModuleConstants.JST_APPCLIENT_MODULE)) - { - return CreateModuleCommand.APPCLIENT; - } - else if (type.equals(IModuleConstants.JST_EAR_MODULE)) - { - return CreateModuleCommand.EAR; - } - else - { - return -1; - } - } - - public void setServiceTypeRuntimeServer( TypeRuntimeServer typeRuntimeServer ) - { - typeRuntimeServer_ = typeRuntimeServer; - } - - public void setServiceJ2EEVersion( String j2eeLevel ) - { - j2eeLevel_ = j2eeLevel; - } - - public String getJ2eeLevel() - { - return j2eeLevel_; - } - - public IWebService getWebService() - { - return webService_; - } - - 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 type) - { - moduleType_ = type; - } - - public String getEarProject() - { - return earProject_; - } - - public String getEar() - { - return ear_; - } - - public void setEar( String ear ) - { - ear_ = ear; - } - - public void setStartService(boolean startService) - { - run_ = startService; - } - - public void setTestService(boolean testService) - { - test_ = testService; - } - - public void setPublishService(boolean publishService) - { - publish_ = publishService; - } - - public void setGenerateProxy(boolean genProxy) - { - client_ = genProxy; - } - - -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceInstallCommand.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceInstallCommand.java deleted file mode 100644 index 966a64e3a..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceInstallCommand.java +++ /dev/null @@ -1,107 +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.creation.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.command.internal.provisional.env.core.EnvironmentalOperation; -import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.ws.internal.provisional.wsrt.IWebService; - -public class PreServiceInstallCommand extends EnvironmentalOperation -{ - private IWebService webService_; - private String project_; - private String module_; - private String earProject_; - private String ear_; - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - Environment environment = getEnvironment(); - - System.out.println( "In Pre service install command." ); - - if (webService_.getWebServiceInfo().getServerInstanceId()==null) - { - CreateServerCommand createServerCommand = new CreateServerCommand(); - createServerCommand.setServerFactoryid(webService_.getWebServiceInfo().getServerFactoryId()); - createServerCommand.setEnvironment( environment ); - IStatus createServerStatus = createServerCommand.execute( monitor, null); - if (createServerStatus.getSeverity()==Status.OK) - { - webService_.getWebServiceInfo().setServerInstanceId(createServerCommand.getServerInstanceId()); - } - else - { - if (createServerStatus.getSeverity()==Status.ERROR) - { - environment.getStatusHandler().reportError(createServerStatus); - } - return createServerStatus; - } - } - - - - AddModuleToServerCommand command = new AddModuleToServerCommand(); - command.setServerInstanceId(webService_.getWebServiceInfo().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( monitor, null ); - 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( IWebService webService ) - { - webService_ = webService; - } - -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceRunCommand.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceRunCommand.java deleted file mode 100644 index 1ffd28930..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceRunCommand.java +++ /dev/null @@ -1,50 +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.creation.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.StartServerCommand; -import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; -import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.ws.internal.provisional.wsrt.IWebService; - -public class PreServiceRunCommand extends EnvironmentalOperation -{ - private IWebService webService_; - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - Environment environment = getEnvironment(); - - System.out.println( "In Pre service run command." ); - - StartServerCommand command = new StartServerCommand(); - command.setServerInstanceId(webService_.getWebServiceInfo().getServerInstanceId()); - command.setEnvironment( environment ); - IStatus status = command.execute( monitor, null ); - if (status.getSeverity()==Status.ERROR) - { - environment.getStatusHandler().reportError(status); - } - return status; - - } - - public void setWebService( IWebService webService ) - { - webService_ = webService; - } - -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/ServiceRootFragment.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/ServiceRootFragment.java deleted file mode 100644 index 86a7020ff..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/ServiceRootFragment.java +++ /dev/null @@ -1,111 +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.creation.ui.extension; - -import org.eclipse.jst.ws.internal.consumption.ui.extension.PreClientDevelopCommand; -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.command.internal.provisional.env.core.data.DataMappingRegistry; -import org.eclipse.wst.ws.internal.extensions.AssembleServiceFragment; -import org.eclipse.wst.ws.internal.extensions.DeployServiceFragment; -import org.eclipse.wst.ws.internal.extensions.DevelopServiceFragment; -import org.eclipse.wst.ws.internal.extensions.InstallServiceFragment; -import org.eclipse.wst.ws.internal.extensions.RunServiceFragment; - -public class ServiceRootFragment extends SequenceFragment -{ - public ServiceRootFragment() - { - add( new SimpleFragment( new PreServiceDevelopCommand(), "" ) ); - add( new DevelopServiceFragment() ); - add( new SimpleFragment( new PreServiceAssembleCommand(), "" ) ); - add( new AssembleServiceFragment() ); - add( new SimpleFragment( new PreServiceDeployCommand(), "" ) ); - add( new DeployServiceFragment() ); - add( new SimpleFragment( new PreServiceInstallCommand(), "" ) ); - add( new InstallServiceFragment() ); - add( new SimpleFragment( new PreServiceRunCommand(), - "org.eclipse.jst.ws.internal.creation.ui.extension.PreServiceRunCommand" ) ); - add( new RunServiceFragment() ); - } - - public void registerDataMappings(DataMappingRegistry registry) - { - //Mappings from framework to extension fragments - registry.addMapping( PreServiceDevelopCommand.class, "WebService", DevelopServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Environment", DevelopServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Context", DevelopServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Selection", DevelopServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Project", DevelopServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Module", DevelopServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "EarProject", DevelopServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Ear", DevelopServiceFragment.class ); - - // Map the PreServiceDevelopCommand into the dataObject and the PreClientDevelopCommand. - registry.addMapping( PreServiceDevelopCommand.class, "WebService", DataObjectCommand.class, "DataObject", null ); - registry.addMapping( PreServiceDevelopCommand.class, "WebService", PreClientDevelopCommand.class, "DataObject", null ); - - registry.addMapping( PreServiceDevelopCommand.class, "WebService", AssembleServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Environment", AssembleServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Context", AssembleServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Selection", AssembleServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Project", AssembleServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Module", AssembleServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "EarProject", AssembleServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Ear", AssembleServiceFragment.class ); - - registry.addMapping( PreServiceDevelopCommand.class, "WebService", DeployServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Environment", DeployServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Context", DeployServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Selection", DeployServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Project", DeployServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Module", DeployServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "EarProject", DeployServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Ear", DeployServiceFragment.class ); - - registry.addMapping( PreServiceDevelopCommand.class, "WebService", InstallServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Environment", InstallServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Context", InstallServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Selection", InstallServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Project", InstallServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Module", InstallServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "EarProject", InstallServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Ear", InstallServiceFragment.class ); - - registry.addMapping( PreServiceDevelopCommand.class, "WebService", RunServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Environment", RunServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Context", RunServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Selection", RunServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Project", RunServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Module", RunServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "EarProject", RunServiceFragment.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Ear", RunServiceFragment.class ); - - //Mappings from framework to framework commands - registry.addMapping( PreServiceDevelopCommand.class, "WebService", PreServiceAssembleCommand.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Project", PreServiceAssembleCommand.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Module", PreServiceAssembleCommand.class ); - registry.addMapping( PreServiceDevelopCommand.class, "EarProject", PreServiceAssembleCommand.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Ear", PreServiceAssembleCommand.class ); - registry.addMapping( PreServiceDevelopCommand.class, "J2eeLevel", PreServiceAssembleCommand.class ); - - registry.addMapping( PreServiceDevelopCommand.class, "WebService", PreServiceInstallCommand.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Project", PreServiceInstallCommand.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Module", PreServiceInstallCommand.class ); - registry.addMapping( PreServiceDevelopCommand.class, "EarProject", PreServiceInstallCommand.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Ear", PreServiceInstallCommand.class ); - - registry.addMapping( PreServiceDevelopCommand.class, "WebService", PreServiceRunCommand.class ); - - } -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/plugin/WebServiceCreationUIPlugin.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/plugin/WebServiceCreationUIPlugin.java deleted file mode 100644 index 42317407b..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/plugin/WebServiceCreationUIPlugin.java +++ /dev/null @@ -1,114 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002, 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.creation.ui.plugin; - -import java.net.MalformedURLException; -import java.net.URL; -import java.text.MessageFormat; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; - - -/** -* This is the plugin class for the Web Services Creation UI plugin. -* <p> -* The Web Services Creation UI plugin's sole function is to add -* user interface of the Web Services Creation Wizard, contained in -* the org.eclipse.jst.ws.ui plugin. -*/ -public class WebServiceCreationUIPlugin extends Plugin -{ - // Copyright - public static final String copyright = "(c) Copyright IBM Corporation 2002."; - - /** - * The identifier of the descriptor of this plugin in plugin.xml. - */ - public static final String ID = "org.eclipse.jst.ws.creation.ui"; - - /** - * The reference to the singleton instance of this plugin. - */ - private static WebServiceCreationUIPlugin instance_; - - /** - * Constructs a runtime plugin object for this plugin. - * The "plugin" element in plugin.xml should include the attribute - * class = "org.eclipse.jst.ws.internal.creation.ui.plugin.WebServiceCreationUIPlugin". - * @param descriptor The descriptor of this plugin. - */ - public WebServiceCreationUIPlugin () - { - super(); - instance_ = this; - } - - /** - * Returns the singleton instance of this plugin. Equivalent to calling - * (WebServiceCreationUIPlugin)Platform.getPlugin("org.eclipse.jst.ws.creation.ui"); - * @return The WebServiceCreationUIPlugin singleton. - */ - public static WebServiceCreationUIPlugin getInstance () - { - return instance_; - } - - /** - * Returns the message string identified by the given key from - * plugin.properties. - * @return The String message. - */ - public static String getMessage ( String key ) - { - MessageUtils msgUtils = new MessageUtils( "org.eclipse.jst.ws.creation.ui.plugin", instance_ ); - - if( key.startsWith("%")) - { - key = key.substring( 1, key.length() ); - } - - return msgUtils.getMessage(key); - } - - /** - * Returns the message string identified by the given key from - * plugin.properties. Substitution sequences in the message string - * are replaced by the given array of substitution objects (which - * are most frequently strings). See the JDK's - * {@link java.text.MessageFormat java.text.MessageFormat} - * class for further details on substitution. - * @return The String message. - */ - public static String getMessage ( String key, Object[] args ) - { - return MessageFormat.format(getMessage(key),args); - } - - /** - * Returns an image descriptor for the named resource - * as relative to the plugin install location. - * @return An image descriptor, possibly null. - */ - public static ImageDescriptor getImageDescriptor ( String name ) - { - try - { - URL installURL = instance_.getBundle().getEntry("/"); - URL imageURL = new URL(installURL,name); - return ImageDescriptor.createFromURL(imageURL); - } - catch (MalformedURLException e) - { - return null; - } - } -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/preferences/ScenarioDefaultsPreferencePage.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/preferences/ScenarioDefaultsPreferencePage.java deleted file mode 100644 index d0ab4aa0a..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/preferences/ScenarioDefaultsPreferencePage.java +++ /dev/null @@ -1,136 +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.creation.ui.preferences; - -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jst.ws.internal.context.ScenarioContext; -import org.eclipse.jst.ws.internal.creation.ui.widgets.ServerWizardWidget; -import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; -import org.eclipse.jst.ws.internal.plugin.WebServicePlugin; -import org.eclipse.jst.ws.internal.ui.common.UIUtils; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - - - -/** - * - */ -public class ScenarioDefaultsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage -{ - private ServerWizardWidget serverWidget_ = null; - - public void init(IWorkbench workbench) { } - /* (non-Javadoc) - * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite) - */ - - protected Control createContents(Composite parent) - { - UIUtils utils = new UIUtils(null, null); - - Composite page = utils.createComposite( parent, 1 ); - - serverWidget_ = new ServerWizardWidget( false ); - serverWidget_.addControls( page, new Listener() - { - public void handleEvent( Event evt ){} - } ); - initializeValues(); - return page; - } - - private void initializeValues() - { - ScenarioContext context = WebServicePlugin.getInstance().getScenarioContext(); - - // Set values from context. - TypeRuntimeServer serverIds = new TypeRuntimeServer(); - TypeRuntimeServer clientIds = new TypeRuntimeServer(); - - serverIds.setTypeId( context.getWebServiceType() ); - clientIds.setTypeId( context.getClientWebServiceType() ); - - serverWidget_.setServiceTypeRuntimeServer( serverIds ); - serverWidget_.setClientTypeRuntimeServer( clientIds ); - serverWidget_.setGenerateProxy( new Boolean(context.getGenerateProxy()) ); - serverWidget_.setPublishService( new Boolean(context.getLaunchWebServiceExplorer()) ); - serverWidget_.setStartService( new Boolean(context.getStartWebService()) ); - serverWidget_.setTestService( new Boolean(context.getTestWebService()) ); - serverWidget_.setMonitorService(new Boolean(context.getMonitorWebService())); - serverWidget_.internalize(); - } - - /** - * Does anything necessary because the default button has been pressed. - */ - protected void performDefaults() - { - super.performDefaults(); - setToDefaults(); - } - - private void setToDefaults() - { - ScenarioContext context = WebServicePlugin.getInstance().getScenarioContext(); - - // Set values from context. - TypeRuntimeServer serverIds = new TypeRuntimeServer(); - TypeRuntimeServer clientIds = new TypeRuntimeServer(); - - serverIds.setTypeId( context.getWebServiceTypeDefault() ); - clientIds.setTypeId( context.getClientWebServiceTypeDefault() ); - - serverWidget_.setServiceTypeRuntimeServer( serverIds ); - serverWidget_.setClientTypeRuntimeServer( clientIds ); - serverWidget_.setGenerateProxy( new Boolean(context.getGenerateProxyDefault()) ); - serverWidget_.setPublishService( new Boolean(context.getLaunchWebServiceExplorerDefault()) ); - serverWidget_.setStartService( new Boolean(context.getStartWebServiceDefault()) ); - serverWidget_.setTestService( new Boolean(context.getTestWebServiceDefault()) ); - serverWidget_.setMonitorService(new Boolean(context.getMonitorWebServiceDefault())); - serverWidget_.internalize(); - } - - /** - * Do anything necessary because the OK button has been pressed. - * @return whether it is okay to close the preference page - */ - public boolean performOk() - { - storeValues(); - return true; - } - - private void storeValues() - { - ScenarioContext context = WebServicePlugin.getInstance().getScenarioContext(); - - TypeRuntimeServer serverIds = serverWidget_.getServiceTypeRuntimeServer(); - TypeRuntimeServer clientIds = serverWidget_.getClientTypeRuntimeServer(); - - context.setWebServiceType( serverIds.getTypeId() ); - context.setClientWebServiceType( clientIds.getTypeId() ); - context.setGenerateProxy( serverWidget_.getGenerateProxy().booleanValue() ); - context.setLaunchWebServiceExplorer( serverWidget_.getPublishService().booleanValue() ); - context.setStartWebService( serverWidget_.getStartService().booleanValue() ); - context.setTestWebService( serverWidget_.getTestService().booleanValue() ); - context.setMonitorWebService(serverWidget_.getMonitorService().booleanValue()); - } - - protected void performApply() - { - performOk(); - } -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/server/StartServerWidgetContributor.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/server/StartServerWidgetContributor.java deleted file mode 100644 index d63a7eb2c..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/server/StartServerWidgetContributor.java +++ /dev/null @@ -1,57 +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.creation.ui.server; - -import org.eclipse.jst.ws.internal.consumption.ui.server.StartServerWidget; -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.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.ui.widgets.INamedWidgetContributor; -import org.eclipse.wst.server.core.IServer; - -public class StartServerWidgetContributor implements INamedWidgetContributor -{ - private IServer server_; - private MessageUtils msgUtils_; - - public StartServerWidgetContributor( IServer server ) - { - server_ = server; - msgUtils_ = new MessageUtils( "org.eclipse.jst.ws.consumption.ui.plugin", this ); - } - - public String getDescription() - { - return msgUtils_.getMessage( "PAGE_DESC_WS_START_SERVER" ); - } - - public String getName() - { - return ""; - } - - public String getTitle() - { - return msgUtils_.getMessage( "PAGE_TITLE_WS_START_SERVER" ); - } - - public WidgetContributorFactory getWidgetContributorFactory() - { - return new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new StartServerWidget( server_ ); - } - }; - } -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/server/StartServerWidgetFactory.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/server/StartServerWidgetFactory.java deleted file mode 100644 index 4c0341ae0..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/server/StartServerWidgetFactory.java +++ /dev/null @@ -1,57 +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.creation.ui.server; - -import org.eclipse.jst.ws.internal.creation.ui.extension.PreServiceDevelopCommand; -import org.eclipse.wst.command.internal.provisional.env.core.data.DataMappingRegistry; -import org.eclipse.wst.command.internal.provisional.env.ui.widgets.INamedWidgetContributor; -import org.eclipse.wst.command.internal.provisional.env.ui.widgets.INamedWidgetContributorFactory; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.server.core.ServerCore; -import org.eclipse.wst.ws.internal.provisional.wsrt.IWebService; - -public class StartServerWidgetFactory implements INamedWidgetContributorFactory -{ - private IWebService webservice_; - - public INamedWidgetContributor getFirstNamedWidget() - { - IServer server = null; - - if( webservice_ != null ) - { - server = ServerCore.findServer(webservice_.getWebServiceInfo().getServerInstanceId() ); - } - - if( server != null && server.getServerState() != IServer.STATE_STARTED ) - { - return new StartServerWidgetContributor( server ); - } - - return null; - } - - public INamedWidgetContributor getNextNamedWidget( INamedWidgetContributor widgetContributor) - { - return null; - } - - public void registerDataMappings(DataMappingRegistry dataRegistry) - { - dataRegistry.addMapping( PreServiceDevelopCommand.class, "WebService", StartServerWidgetFactory.class ); - } - - public void setWebService( IWebService webservice ) - { - webservice_ = webservice; - } -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidget.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidget.java deleted file mode 100644 index 8b68cb85b..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidget.java +++ /dev/null @@ -1,303 +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.creation.ui.widgets; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.PreferencesSelectionWidget; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.WebServiceClientTypeWidget; -import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils; -import org.eclipse.jst.ws.internal.data.LabelsAndIds; -import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; -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.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; -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; -import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; -import org.eclipse.wst.command.internal.provisional.env.core.context.ResourceContext; - - -public class ServerWizardWidget extends SimpleWidgetDataContributor -{ - private WebServiceClientTypeWidget clientWidget_; - private PreferencesSelectionWidget preferencesWidget_; - private Listener statusListener_; - private TypeRuntimeServer ids_; - private LabelsAndIds labelIds_; - private boolean displayPreferences_; - - /*CONTEXT_ID PWPR0001 for the Project Page*/ - private String INFOPOP_PWPR_PAGE = "PWPR0001"; - - /*CONTEXT_ID PWPR0005 for the Generate Proxy check box of the Project Page*/ - private String INFOPOP_PWPR_CHECKBOX_GENERATE_PROXY = "PWPR0005"; - private Button generateProxy_; - - /*CONTEXT_ID PWPR0010 for the Web Service Type combo box of the Project Page*/ - private String INFOPOP_PWPR_COMBO_TYPE = "PWPR0010"; - private Combo webserviceType_; - - /*CONTEXT_ID PWPR0011 for the Wizard Scenario Service group of the Project Page*/ - private String INFOPOP_PWPR_GROUP_SCENARIO_SERVICE = "PWPR0011"; - private Button startService_; - - /*CONTEXT_ID PWPR0009 for the Start Web Project check box check box of the Project Page*/ - private String INFOPOP_PWPR_CHECKBOX_START_WEB_PROJECT = "PWPR0009"; - - /*CONTEXT_ID PWPR0013 for the test service checkbox of the project page*/ - private String INFOPOP_PWPR_CHECKBOX_TEST_SERVICE = "PWPR0013"; - private Button testService_; - - /*CONTEXT_ID PWPR0014 for the monitor service checkbox of the projec page*/ - private String INFOPOP_PWPR_CHECKBOX_MONITOR_SERVICE = "PWPR0014"; - private Button monitorService; - - /*CONTEXT_ID PWPR0012 for the Launch UDDI check box of the Project Page*/ - private String INFOPOP_PWPR_CHECKBOX_LAUNCH_WS = "PWPR0012"; - private Button launchUddi_; - - public ServerWizardWidget( boolean displayPreferences ) - { - displayPreferences_ = displayPreferences; - } - - public WidgetDataEvents addControls( Composite parent, Listener statusListener) - { - String pluginId = "org.eclipse.jst.ws.consumption.ui"; - String createPluginId = "org.eclipse.jst.ws.creation.ui"; - MessageUtils msgUtils = new MessageUtils( pluginId + ".plugin", this ); - UIUtils utils = new UIUtils( msgUtils, createPluginId ); - - statusListener_ = statusListener; - - PlatformUI.getWorkbench().getHelpSystem().setHelp( parent, pluginId + "." + INFOPOP_PWPR_PAGE ); - - Composite serverComposite = utils.createComposite( parent, 1 ); - - Group serviceGroup = utils.createGroup( serverComposite, "GROUP_SCENARIO_SERVICE", - "TOOLTIP_PWPR_GROUP_SCENARIO_SERVICE", - INFOPOP_PWPR_GROUP_SCENARIO_SERVICE, - 2, 10, 10); - - - // Create webservice combo box. - webserviceType_ = utils.createCombo( serviceGroup, "LABEL_WEBSERVICETYPE", - "TOOLTIP_PWPR_COMBO_TYPE", - INFOPOP_PWPR_COMBO_TYPE, - SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY ); - webserviceType_.addListener( SWT.Modify, statusListener ); - - Composite buttonsGroup = utils.createComposite( serviceGroup, 1 ); - GridData buttonGrid = new GridData(); - buttonGrid.horizontalSpan = 2; - buttonsGroup.setLayoutData( buttonGrid ); - - // Create start service check box. - startService_ = utils.createCheckbox( buttonsGroup, "BUTTON_START_WEB_PROJECT", - "TOOLTIP_PWPR_CHECKBOX_START_WEB_PROJECT", - INFOPOP_PWPR_CHECKBOX_START_WEB_PROJECT ); - startService_.addSelectionListener( new SelectionAdapter() - { - public void widgetSelected( SelectionEvent evt ) - { - handleStartPressed(); - } - }); - - launchUddi_ = utils.createCheckbox( buttonsGroup, "BUTTON_WS_PUBLISH", - "TOOLTIP_PWPR_CHECKBOX_LAUNCH_WS", - INFOPOP_PWPR_CHECKBOX_LAUNCH_WS ); - - Composite proxyComposite = utils.createComposite( serverComposite, 1, 5, 0 ); - - // Create generate proxy check box. - generateProxy_ = utils.createCheckbox( proxyComposite, "BUTTON_GENERATE_PROXY", - "TOOLTIP_PWPR_CHECKBOX_GENERATE_PROXY", - INFOPOP_PWPR_CHECKBOX_GENERATE_PROXY ); - generateProxy_.addSelectionListener( new SelectionAdapter() - { - public void widgetSelected( SelectionEvent evt ) - { - clientWidget_.enableWidget( generateProxy_.getSelection() ); - } - }); - - // Create client selection widget. - clientWidget_ = new WebServiceClientTypeWidget(); - clientWidget_.addControls( serverComposite, statusListener ); - - Composite testGroup = utils.createComposite(serverComposite,1); - - // Create test service check box. - testService_ = utils.createCheckbox( testGroup, "CHECKBOX_TEST_WEBSERVICE", - "TOOLTIP_PWPR_CHECKBOX_TEST_SERVICE", - INFOPOP_PWPR_CHECKBOX_TEST_SERVICE ); - - monitorService = utils.createCheckbox( testGroup, "CHECKBOX_MONITOR_WEBSERVICE", - "TOOLTIP_PWPR_CHECKBOX_MONITOR_SERVICE", - INFOPOP_PWPR_CHECKBOX_MONITOR_SERVICE ); - - if( displayPreferences_ ) - { - // Create the preferences widgets. - preferencesWidget_ = new PreferencesSelectionWidget(); - preferencesWidget_.addControls( serverComposite, statusListener ); - } - - return this; - } - - private void handleStartPressed() - { - boolean enabled = startService_.getSelection(); - - testService_.setEnabled( enabled ); - monitorService.setEnabled(enabled); - launchUddi_.setEnabled( enabled ); - generateProxy_.setEnabled( enabled ); - clientWidget_.enableWidget( getGenerateProxy().booleanValue() ); - } - - public void setClientTypeRuntimeServer( TypeRuntimeServer ids ) - { - clientWidget_.setTypeRuntimeServer( ids ); - } - - public TypeRuntimeServer getClientTypeRuntimeServer() - { - return clientWidget_.getTypeRuntimeServer(); - } - - public void setServiceTypeRuntimeServer( TypeRuntimeServer ids ) - { - LabelsAndIds labelIds = WebServiceRuntimeExtensionUtils.getServiceTypeLabels(); - //rskreg - int selection = 0; - String[] serviceIds = labelIds.getIds_(); - String selectedId = ids.getTypeId(); - - webserviceType_.removeListener( SWT.Modify, statusListener_ ); - webserviceType_.setItems( labelIds.getLabels_() ); - - // Now find the selected one. - for( int index = 0; index < serviceIds.length; index++ ) - { - if( selectedId.equals( serviceIds[index ]) ) - { - selection = index; - break; - } - } - - webserviceType_.select( selection ); - webserviceType_.addListener( SWT.Modify, statusListener_ ); - ids_ = ids; - labelIds_ = labelIds; - } - - public TypeRuntimeServer getServiceTypeRuntimeServer() - { - int selectionIndex = webserviceType_.getSelectionIndex(); - - ids_.setTypeId( labelIds_.getIds_()[selectionIndex] ); - - return ids_; - } - - public Boolean getStartService() - { - return new Boolean( startService_.getSelection() ); - } - - public void setStartService( Boolean value ) - { - startService_.setSelection( value.booleanValue() ); - } - - public Boolean getTestService() - { - return new Boolean( testService_.getSelection() && startService_.getSelection() ); - } - - public void setTestService( Boolean value ) - { - testService_.setSelection( value.booleanValue() ); - } - - public Boolean getMonitorService() - { - return new Boolean(monitorService.getSelection() && startService_.getSelection()); - } - - public void setMonitorService(Boolean value) - { - monitorService.setSelection(value.booleanValue()); - } - - public Boolean getPublishService() - { - return new Boolean( launchUddi_.getSelection() && startService_.getSelection() ); - } - - public void setPublishService( Boolean value ) - { - launchUddi_.setSelection( value.booleanValue() ); - } - - public Boolean getGenerateProxy() - { - return new Boolean( generateProxy_.getSelection() && startService_.getSelection() ); - } - - public void setGenerateProxy( Boolean value ) - { - generateProxy_.setSelection( value.booleanValue() ); - } - - public ResourceContext getResourceContext() - { - return preferencesWidget_.getResourceContext(); - } - - public void setResourceContext( ResourceContext context ) - { - preferencesWidget_.setResourceContext( context ); - } - - public void internalize() - { - handleStartPressed(); - } - - public IStatus getStatus() - { - IStatus status = Status.OK_STATUS; - - // If the webservice has not been selected then user can not move - // forward to the next page. - if( webserviceType_.getText().equals("") ) - { - status = StatusUtils.errorStatus( "" ); - } - - return status; - } -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidgetDefaultingCommand.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidgetDefaultingCommand.java deleted file mode 100644 index f447504a8..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidgetDefaultingCommand.java +++ /dev/null @@ -1,79 +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.creation.ui.widgets; - -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.consumption.ui.widgets.ClientWizardWidgetDefaultingCommand; -import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils; -import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; - -public class ServerWizardWidgetDefaultingCommand extends ClientWizardWidgetDefaultingCommand -{ - private TypeRuntimeServer typeRuntimeServer_; - private IStructuredSelection initialSelection_; - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - String type = getScenarioContext().getWebServiceType(); - String runtime = WebServiceRuntimeExtensionUtils.getDefaultRuntimeValueFor( type ); - - String factoryID = WebServiceRuntimeExtensionUtils.getDefaultServerValueFor(type); - typeRuntimeServer_ = new TypeRuntimeServer(); - - typeRuntimeServer_.setTypeId( type ); - typeRuntimeServer_.setRuntimeId( runtime ); - typeRuntimeServer_.setServerId( factoryID ); - - //Default the typeId from the initial selection - String[] typeIds = WebServiceRuntimeExtensionUtils.getWebServiceTypeBySelection(initialSelection_); - - if (typeIds!=null && typeIds.length>0) - { - typeRuntimeServer_.setTypeId(typeIds[0]); - } - - return Status.OK_STATUS; - } - - public void setInitialSelection(IStructuredSelection selection) - { - initialSelection_ = selection; - } - - public TypeRuntimeServer getServiceTypeRuntimeServer() - { - return typeRuntimeServer_; - } - - public Boolean getStartService() - { - return new Boolean( getScenarioContext().getStartWebService() ); - } - - public Boolean getPublishService() - { - return new Boolean( getScenarioContext().getLaunchWebServiceExplorer() ); - } - - public Boolean getGenerateProxy() - { - return new Boolean( getScenarioContext().getGenerateProxy() ); - } - - public Boolean getMonitorService() - { - return new Boolean(getScenarioContext().getMonitorWebService()); - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidgetOutputCommand.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidgetOutputCommand.java deleted file mode 100644 index 2395c95c1..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidgetOutputCommand.java +++ /dev/null @@ -1,98 +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.creation.ui.widgets; - -import org.eclipse.jst.ws.internal.consumption.ui.widgets.ClientWizardWidgetOutputCommand; -import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; -import org.eclipse.wst.command.internal.provisional.env.core.context.ResourceContext; - - -public class ServerWizardWidgetOutputCommand extends ClientWizardWidgetOutputCommand -{ - private TypeRuntimeServer typeRuntimeServer_; - private boolean startService_; - private boolean testService_; - private boolean publishService_; - private boolean generateProxy_; - private ResourceContext resourceContext_; - - - public TypeRuntimeServer getServiceTypeRuntimeServer() - { - return typeRuntimeServer_; - } - - public boolean getStartService() - { - return startService_; - } - - public boolean getTestService() - { - return testService_; - } - - public boolean getPublishService() - { - return publishService_; - } - - public boolean getGenerateProxy() - { - return generateProxy_; - } - - public ResourceContext getResourceContext() - { - return resourceContext_; - } - - /** - * @param generateProxy_ The generateProxy_ to set. - */ - public void setGenerateProxy(boolean generateProxy_) - { - this.generateProxy_ = generateProxy_; - } - /** - * @param publishService_ The publishService_ to set. - */ - public void setPublishService(boolean publishService_) - { - this.publishService_ = publishService_; - } - /** - * @param startService_ The startService_ to set. - */ - public void setStartService(boolean startService_) - { - this.startService_ = startService_; - } - /** - * @param testService_ The testService_ to set. - */ - public void setTestService(boolean testService_) - { - this.testService_ = testService_; - } - /** - * @param typeRuntimeServer_ The typeRuntimeServer_ to set. - */ - public void setServiceTypeRuntimeServer(TypeRuntimeServer typeRuntimeServer_) - { - this.typeRuntimeServer_ = typeRuntimeServer_; - } - - public void setResourceContext(ResourceContext rc) - { - resourceContext_ = rc; - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/ExportWSWidgetBinding.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/ExportWSWidgetBinding.java deleted file mode 100644 index 346307048..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/ExportWSWidgetBinding.java +++ /dev/null @@ -1,105 +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.creation.ui.widgets.binding; - -import org.eclipse.jst.ws.internal.consumption.ui.widgets.PublishToPrivateUDDICommandFragment; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.PublishWSWidget; -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.SequenceFragment; -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; -import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.data.DataMappingRegistry; -import org.eclipse.wst.ws.internal.explorer.WSExplorerLauncherCommand; - - -public class ExportWSWidgetBinding implements CommandWidgetBinding -{ - private CanFinishRegistry canFinishRegistry; - private WidgetRegistry widgetRegistry; - private DataMappingRegistry dataMappingRegistry; - private PublishToPrivateUDDICommandFragment publishToPrivateUDDICmdFrag; - - public ExportWSWidgetBinding() - { - publishToPrivateUDDICmdFrag = new PublishToPrivateUDDICommandFragment(); - } - /* (non-Javadoc) - * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#create() - */ - public CommandFragmentFactory create() - { - return new CommandFragmentFactory() - { - public CommandFragment create() - { - SequenceFragment root = new SequenceFragment(); - root.add(new SimpleFragment("WSExport")); - root.add(publishToPrivateUDDICmdFrag); - root.add(new SimpleFragment(new WSExplorerLauncherCommand(), "")); - return root; - } - }; - } - - /* (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) - { - this.canFinishRegistry = canFinishRegistry; - publishToPrivateUDDICmdFrag.registerCanFinish(this.canFinishRegistry); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.internal.provisional.env.core.data.DataMappingRegistry) - */ - public void registerDataMappings(DataMappingRegistry dataRegistry) - { - this.dataMappingRegistry = dataRegistry; - publishToPrivateUDDICmdFrag.registerDataMappings(this.dataMappingRegistry); - - // PublishToPrivateUDDICommandFragment - dataMappingRegistry.addMapping(PublishWSWidget.class, "PublishToPrivateUDDI", PublishToPrivateUDDICommandFragment.class); - - // LaunchWebServicesExplorerCommand - dataMappingRegistry.addMapping(PublishWSWidget.class, "ForceLaunchOutsideIDE", WSExplorerLauncherCommand.class); - dataMappingRegistry.addMapping(PublishWSWidget.class, "LaunchOptions", WSExplorerLauncherCommand.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) - { - String pluginId_ = "org.eclipse.jst.ws.consumption.ui"; - MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this ); - this.widgetRegistry = widgetRegistry; - publishToPrivateUDDICmdFrag.registerWidgetMappings(this.widgetRegistry); - - widgetRegistry.add("WSExport", - msgUtils.getMessage("PAGE_TITLE_WS_PUBLISH"), - msgUtils.getMessage("PAGE_DESC_WS_PUBLISH"), - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new PublishWSWidget(true); - } - } - ); - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/PublishWSDLWidgetBinding.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/PublishWSDLWidgetBinding.java deleted file mode 100644 index 068d4afd1..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/PublishWSDLWidgetBinding.java +++ /dev/null @@ -1,62 +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.creation.ui.widgets.binding; - -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.WidgetRegistry; -import org.eclipse.wst.command.internal.provisional.env.core.data.DataMappingRegistry; - - -public class PublishWSDLWidgetBinding implements CommandWidgetBinding -{ - public PublishWSDLWidgetBinding() - { - } - - /* (non-Javadoc) - * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#create() - */ - public CommandFragmentFactory create() - { - return new CommandFragmentFactory() - { - public CommandFragment create() - { - return new SimpleFragment(); - } - }; - } - - /* (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.provisional.env.core.data.DataMappingRegistry) - */ - public void registerDataMappings(DataMappingRegistry dataRegistry) - { - } - - /* (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) - { - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/ServerWidgetBinding.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/ServerWidgetBinding.java deleted file mode 100644 index 29615e731..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/ServerWidgetBinding.java +++ /dev/null @@ -1,568 +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.creation.ui.widgets.binding; - -import org.eclipse.jst.ws.internal.common.StringToIProjectTransformer; -import org.eclipse.jst.ws.internal.consumption.command.common.ComputeEndpointCommand; -import org.eclipse.jst.ws.internal.consumption.command.common.CreateMonitorCommand; -import org.eclipse.jst.ws.internal.consumption.command.common.ManageServerStartUpCommand; -import org.eclipse.jst.ws.internal.consumption.common.ScenarioCleanupCommand; -import org.eclipse.jst.ws.internal.consumption.ui.command.data.ServerInstToIServerTransformer; -import org.eclipse.jst.ws.internal.consumption.ui.common.FinishFragment; -import org.eclipse.jst.ws.internal.consumption.ui.extension.ClientRootFragment; -import org.eclipse.jst.ws.internal.consumption.ui.extension.PreClientDevelopCommand; -import org.eclipse.jst.ws.internal.consumption.ui.selection.SelectionTransformer; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.CheckWSDLValidationCommand; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.PublishToPrivateUDDICommandFragment; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.PublishWSWidget; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ClientExtensionDefaultingCommand; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ClientExtensionFragment; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ClientExtensionOutputCommand; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ServerExtensionDefaultingCommand; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ServerExtensionFragment; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.extensions.ServerExtensionOutputCommand; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.ObjectSelectionFragment; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.ObjectSelectionOutputCommand; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.ObjectSelectionWidget; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.ClientTestDelegateCommand; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.ClientTestFragment; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.ClientTestWidget; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.FinishDefaultCommand; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.FinishTestFragment; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.TestDefaultingFragment; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.WSDLTestLaunchCommand; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.WebServiceClientTestArrivalCommand; -import org.eclipse.jst.ws.internal.creation.ui.extension.PreServiceDevelopCommand; -import org.eclipse.jst.ws.internal.creation.ui.extension.ServiceRootFragment; -import org.eclipse.jst.ws.internal.creation.ui.widgets.ServerWizardWidget; -import org.eclipse.jst.ws.internal.creation.ui.widgets.ServerWizardWidgetDefaultingCommand; -import org.eclipse.jst.ws.internal.creation.ui.widgets.ServerWizardWidgetOutputCommand; -import org.eclipse.jst.ws.internal.creation.ui.widgets.runtime.ServerRuntimeSelectionWidget; -import org.eclipse.jst.ws.internal.creation.ui.widgets.runtime.ServerRuntimeSelectionWidgetDefaultingCommand; -import org.eclipse.jst.ws.internal.creation.ui.widgets.test.LaunchFragment; -import org.eclipse.jst.ws.internal.creation.ui.widgets.test.ServiceTestFragment; -import org.eclipse.jst.ws.internal.creation.ui.widgets.test.ServiceTestWidget; -import org.eclipse.jst.ws.internal.creation.ui.widgets.test.WebServiceTestDefaultingCommand; -import org.eclipse.wst.command.internal.env.core.fragment.BooleanFragment; -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.SequenceFragment; -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.SelectionCommand; -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; -import org.eclipse.wst.command.internal.provisional.env.core.common.Condition; -import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.data.DataMappingRegistry; -import org.eclipse.wst.ws.internal.explorer.WSExplorerLauncherCommand; - -public class ServerWidgetBinding implements CommandWidgetBinding -{ - private CanFinishRegistry canFinishRegistry_; - private WidgetRegistry widgetRegistry_; - private DataMappingRegistry dataMappingRegistry_; - private PublishToPrivateUDDICommandFragment publishToPrivateUDDICmdFrag; - - public ServerWidgetBinding() - { - publishToPrivateUDDICmdFrag = new PublishToPrivateUDDICommandFragment(); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#create() - */ - public CommandFragmentFactory create() - { - return new CommandFragmentFactory() - { - public CommandFragment create() - { - return new ServiceRootCommandFragment(); - } - }; - } - - /* (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) - { - canFinishRegistry_ = canFinishRegistry; - publishToPrivateUDDICmdFrag.registerCanFinish(canFinishRegistry_); - } - - /* (non-Javadoc), - * @see org.eclipse.wst.command.env.ui.widgets.CommandWidgetBinding#registerDataMappings(org.eclipse.wst.command.internal.provisional.env.core.data.DataMappingRegistry) - */ - public void registerDataMappings(DataMappingRegistry dataRegistry) - { - dataMappingRegistry_ = dataRegistry; - - // Before ServerWizardWidget - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ServiceTypeRuntimeServer", ServerWizardWidget.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "StartService", ServerWizardWidget.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "TestService", ServerWizardWidget.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "MonitorService", ServerWizardWidget.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "MonitorService", CreateMonitorCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "MonitorService", ComputeEndpointCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "PublishService", ServerWizardWidget.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "GenerateProxy", ServerWizardWidget.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ServerWizardWidget.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ResourceContext", ServerWizardWidget.class); - - // After ServerWizardWidget - dataRegistry.addMapping(ServerWizardWidget.class, "ServiceTypeRuntimeServer", ServerWizardWidgetOutputCommand.class ); - dataRegistry.addMapping(ServerWizardWidget.class, "StartService", ServerWizardWidgetOutputCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "TestService", ServerWizardWidgetOutputCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "MonitorService", CreateMonitorCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "MonitorService", ComputeEndpointCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "PublishService", ServerWizardWidgetOutputCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "GenerateProxy", ServerWizardWidgetOutputCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "ClientTypeRuntimeServer", ServerWizardWidgetOutputCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "ResourceContext", ServerWizardWidgetOutputCommand.class); - - // Before ObjectSelectionWidget - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "TestService", ClientTestWidget.class ); - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "TestService",FinishTestFragment.class); - - // Before ServerRuntimeSelectionWidget - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "GenerateProxy", ServerRuntimeSelectionWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceProject2EARProject", ServerRuntimeSelectionWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceComponentName", ServerRuntimeSelectionWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceEarComponentName", ServerRuntimeSelectionWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceComponentType", ServerRuntimeSelectionWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "Runtime2ClientTypes", ServerRuntimeSelectionWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientComponentName", ServerRuntimeSelectionWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientEarComponentName", ServerRuntimeSelectionWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceTypeRuntimeServer", ServerRuntimeSelectionWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ServerRuntimeSelectionWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceJ2EEVersion", ServerRuntimeSelectionWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientJ2EEVersion", ServerRuntimeSelectionWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceNeedEAR", ServerRuntimeSelectionWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientNeedEAR", ServerRuntimeSelectionWidget.class); - - - // After ServerRuntimeSelectionWidget - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ServiceTypeRuntimeServer", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ServiceJ2EEVersion", ServerExtensionDefaultingCommand.class ); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ClientTypeRuntimeServer", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ClientJ2EEVersion", ClientExtensionDefaultingCommand.class ); - //dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ServiceProject2EARProject", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ServiceProjectName", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ServiceComponentName", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ServiceEarProjectName", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ServiceEarComponentName", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "Runtime2ClientTypes", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ClientProjectName", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ClientEarProjectName", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ClientComponentName", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ClientEarComponentName", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ClientComponentType", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ServiceNeedEAR", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ClientNeedEAR", ClientExtensionDefaultingCommand.class); - - - // Map fragments that depend on data. - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ClientTypeRuntimeServer", ClientExtensionFragment.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidget.class, "ServiceTypeRuntimeServer", ServerExtensionFragment.class); - - // CreateMonitorCommand - dataRegistry.addMapping(CreateMonitorCommand.class, "MonitoredPort", ComputeEndpointCommand.class); - - // ComputeEndpointCommand - dataRegistry.addMapping(ComputeEndpointCommand.class, "Endpoint", ServiceTestWidget.class); - dataRegistry.addMapping(ComputeEndpointCommand.class, "Endpoint", ClientTestDelegateCommand.class); - - //ServiceTestWidget mappings - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServiceTypeRuntimeServer", ServiceTestWidget.class); - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", ServiceTestWidget.class); - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServiceTypeRuntimeServer", CreateMonitorCommand.class); - dataRegistry.addMapping(ServerExtensionOutputCommand.class, "WsdlURI", ServiceTestWidget.class); - dataRegistry.addMapping(ServerExtensionOutputCommand.class, "ServiceServerInstanceId", ServiceTestWidget.class); - dataRegistry.addMapping(ServerExtensionOutputCommand.class, "WsdlURI", ComputeEndpointCommand.class); - dataRegistry.addMapping(ServerExtensionOutputCommand.class, "WebServicesParser", ComputeEndpointCommand.class); - dataRegistry.addMapping(WebServiceTestDefaultingCommand.class, "ServiceTestFacilities", ServiceTestWidget.class); - dataRegistry.addMapping(WebServiceTestDefaultingCommand.class, "Environment", ServiceTestWidget.class); - dataRegistry.addMapping(ServiceTestWidget.class, "LaunchedServiceTestName", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServiceTestWidget.class, "LaunchedServiceTestName", FinishTestFragment.class); - dataRegistry.addMapping(ServiceTestWidget.class, "LaunchedServiceTestName", TestDefaultingFragment.class); - - // Before Client Test widget. - dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ClientTestWidget.class ); - - // Before ClientTestWidget - - dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProject", ClientTestWidget.class ); - dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProjectEAR", ClientTestWidget.class ); - dataRegistry.addMapping(TestDefaultingFragment.class, "TestFacility",ClientTestWidget.class); - dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Folder",ClientTestWidget.class); - dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "JspFolder",ClientTestWidget.class); - dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "RunClientTest",ClientTestWidget.class); - dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Methods",ClientTestWidget.class); - - - // After ClientTestWidget - dataRegistry.addMapping(ClientTestWidget.class, "SampleProjectEAR",FinishDefaultCommand.class); - dataRegistry.addMapping(ClientTestWidget.class, "SampleProject",FinishDefaultCommand.class); - dataRegistry.addMapping(ClientTestWidget.class, "TestFacility",ClientTestDelegateCommand.class); - dataRegistry.addMapping(ClientTestWidget.class, "Folder",ClientTestDelegateCommand.class); - dataRegistry.addMapping(ClientTestWidget.class, "JspFolder",ClientTestDelegateCommand.class); - dataRegistry.addMapping(ClientTestWidget.class, "RunClientTest",ClientTestDelegateCommand.class); - dataRegistry.addMapping(ClientTestWidget.class, "Methods",ClientTestDelegateCommand.class); - dataRegistry.addMapping(ClientTestWidget.class, "TestService",FinishTestFragment.class); - dataRegistry.addMapping(ClientTestWidget.class, "TestID",FinishTestFragment.class); - dataRegistry.addMapping(ClientTestWidget.class, "IsTestWidget",FinishTestFragment.class); - // PublishWSWidget - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "PublishService", PublishWSWidget.class, "PublishToPublicUDDI", null); - - // PublishToPrivateUDDICommandFragment - dataRegistry.addMapping(PublishWSWidget.class, "PublishToPrivateUDDI", PublishToPrivateUDDICommandFragment.class); - - // LaunchWebServicesExplorerCommand - dataRegistry.addMapping(PublishWSWidget.class, "PublishToPrivateUDDI", LaunchFragment.class); - dataRegistry.addMapping(PublishWSWidget.class, "PublishToPublicUDDI", LaunchFragment.class); - // TODO Need defaults for these properties. - dataRegistry.addMapping(PublishWSWidget.class, "ForceLaunchOutsideIDE", WSExplorerLauncherCommand.class); - dataRegistry.addMapping(PublishWSWidget.class, "LaunchOptions", WSExplorerLauncherCommand.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) - { - String pluginId_ = "org.eclipse.jst.ws.consumption.ui"; - MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this ); - - widgetRegistry_ = widgetRegistry; - publishToPrivateUDDICmdFrag.registerWidgetMappings(widgetRegistry_); - - widgetRegistry.add( "ServerWizardWidget", - msgUtils.getMessage("PAGE_TITLE_WS_PROJECT"), - msgUtils.getMessage("PAGE_DESC_WS_PROJECT"), - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new ServerWizardWidget( true ); - } - } ); - - MessageUtils creationUIMessageUtils = new MessageUtils("org.eclipse.jst.ws.creation.ui.plugin", this); - widgetRegistry.add( "ObjectSelectionWidget", - creationUIMessageUtils.getMessage("PAGE_TITLE_OBJECT_SELECTION"), - creationUIMessageUtils.getMessage("PAGE_DESC_OBJECT_SELECTION"), - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new ObjectSelectionWidget(); - } - }); - - widgetRegistry.add( "ServerRuntimeSelectionWidget", - msgUtils.getMessage("PAGE_TITLE_WS_RUNTIME_SELECTION"), - msgUtils.getMessage("PAGE_DESC_WS_RUNTIME_SELECTION"), - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new ServerRuntimeSelectionWidget(); - } - } ); - - widgetRegistry.add( "TestService", - msgUtils.getMessage("PAGE_TITLE_WSTEST"), - msgUtils.getMessage("PAGE_DESC_WSTEST"), - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new ServiceTestWidget(); - } - } ); - - widgetRegistry.add( "ClientTestWidget", - msgUtils.getMessage("PAGE_TITLE_WS_SAMPLE"), - msgUtils.getMessage("PAGE_DESC_WS_SAMPLE"), - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new ClientTestWidget(); - } - }); - - widgetRegistry.add( "Publish", - msgUtils.getMessage("PAGE_TITLE_WS_PUBLISH"), - msgUtils.getMessage("PAGE_DESC_WS_PUBLISH"), - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new PublishWSWidget(true); - } - } ); - } - - private class ClientFragment extends BooleanFragment - { - boolean genProxy_ = false; - - public ClientFragment() - { - setCondition( new Condition() - { - public boolean evaluate() - { - return genProxy_; - } - }); - - SequenceFragment clientRoot = new SequenceFragment(); - - clientRoot.add( new SimpleFragment( new ClientExtensionDefaultingCommand( false ), "")); - //clientRoot.add(new SimpleFragment(new ClientServerDeployableConfigCommand(), "")); //Note: added here for client - //clientRoot.add( new ClientExtensionFragment() ); - clientRoot.add( new ClientRootFragment() ); - clientRoot.add( new SimpleFragment( new ClientExtensionOutputCommand(), "" )); - - setTrueFragment( clientRoot ); - } - - public void setGenerateProxy( boolean genProxy ) - { - genProxy_ = genProxy; - } - - /* (non-Javadoc) - * @see org.eclipse.wst.command.internal.env.core.fragment.CommandFragment#registerDataMappings(org.eclipse.wst.command.internal.provisional.env.core.data.DataMappingRegistry) - */ - public void registerDataMappings(DataMappingRegistry dataRegistry) - { - // Map the output of the service scenario to the client scenario. - dataRegistry.addMapping( ServerExtensionOutputCommand.class, "WebServicesParser", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping( ServerExtensionOutputCommand.class, "WsdlURI", ClientExtensionDefaultingCommand.class ); - dataRegistry.addMapping( ServerExtensionOutputCommand.class, "ServiceServerFactoryId", ClientExtensionDefaultingCommand.class ); - dataRegistry.addMapping( ServerExtensionOutputCommand.class, "ServiceServerInstanceId", ClientExtensionDefaultingCommand.class ); - - - // Setup the PreClientDevelopCommand. - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "TestService", PreClientDevelopCommand.class); - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "ResourceContext", PreClientDevelopCommand.class); - dataRegistry.addMapping( ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", PreClientDevelopCommand.class ); - dataRegistry.addMapping( ClientExtensionDefaultingCommand.class, "ClientJ2EEVersion", PreClientDevelopCommand.class); - dataRegistry.addMapping( ClientExtensionDefaultingCommand.class, "ClientProject", PreClientDevelopCommand.class, "Module", null ); - dataRegistry.addMapping( ClientExtensionDefaultingCommand.class, "ClientProjectType", PreClientDevelopCommand.class, "ModuleType", null); - dataRegistry.addMapping( ClientExtensionDefaultingCommand.class, "ClientProjectEAR", PreClientDevelopCommand.class, "Ear", null ); - dataRegistry.addMapping( ClientExtensionDefaultingCommand.class, "WsdlURI", PreClientDevelopCommand.class); - dataRegistry.addMapping( PreClientDevelopCommand.class, "WebService", ClientExtensionOutputCommand.class, "WebServiceClient", null ); - } - } - - private class ServiceRootCommandFragment extends SequenceFragment - { - public ServiceRootCommandFragment() - { - add( new SimpleFragment( new ScenarioCleanupCommand(), "" )); - - add( new SimpleFragment( new ServerWizardWidgetDefaultingCommand(), "")); - add( new SimpleFragment( "ServerWizardWidget" ) ); - add( new SimpleFragment( new ServerWizardWidgetOutputCommand(), "" )); - add( new ObjectSelectionFragment() ); - add( new SimpleFragment( new CheckWSDLValidationCommand(), "")); - add( new SimpleFragment( new ServerRuntimeSelectionWidgetDefaultingCommand(), "")); - add( new SimpleFragment( "ServerRuntimeSelectionWidget" ) ); - add( new SimpleFragment( new ServerExtensionDefaultingCommand(), "")); - //add(new SimpleFragment(new ServerDeployableConfigurationCommand(), "")); //Note: added here - //add( new ServerExtensionFragment() ); - add( new ServiceRootFragment() ); - add( new SimpleFragment( new ServerExtensionOutputCommand(), "" )); - add(new SimpleFragment(new CreateMonitorCommand(), "")); - add(new SimpleFragment(new ComputeEndpointCommand(), "")); - add( new ServiceTestFragment( "TestService") ); - add( new SimpleFragment(new TestDefaultingFragment(),"")); - add( new ClientFragment() ); -// add( new SimpleFragment(new ManageServerStartUpCommand(),"")); - add( new ClientTestFragment( "ClientTestWidget") ); - add( new SimpleFragment( "Publish") ); - add(publishToPrivateUDDICmdFrag); - add(new LaunchFragment()); - add(new FinishFragment()); - - add( new SimpleFragment( new ScenarioCleanupCommand(), "" )); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.command.internal.env.core.fragment.CommandFragment#registerDataMappings(org.eclipse.wst.command.internal.provisional.env.core.data.DataMappingRegistry) - */ - public void registerDataMappings(DataMappingRegistry dataRegistry) - { - publishToPrivateUDDICmdFrag.registerDataMappings(dataMappingRegistry_); - - dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ServerWizardWidgetDefaultingCommand.class ); - - //dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ServerRuntimeSelectionWidgetDefaultingCommand.class, "InitialSelection", null); - //dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientInitialSelection", null); - - dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "ObjectSelection", ServerRuntimeSelectionWidgetDefaultingCommand.class, "InitialSelection", null); - dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "ObjectSelection", ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientInitialSelection", null); - dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "Project", ServerRuntimeSelectionWidgetDefaultingCommand.class, "InitialProject", null); - dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "Project", ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientInitialProject", null); - dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "ComponentName", ServerRuntimeSelectionWidgetDefaultingCommand.class, "InitialComponentName", null); - dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "ComponentName", ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientInitialComponentName", null); - dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "WebServicesParser", ServerExtensionDefaultingCommand.class ); - - // Map ServerWizardWidgetDefaultingCommand - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ServerWizardWidgetOutputCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ServiceTypeRuntimeServer", ServerWizardWidgetOutputCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "GenerateProxy", ServerWizardWidgetOutputCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "StartService", ServerWizardWidgetOutputCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "TestService", ServerWizardWidgetOutputCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "PublishService", ServerWizardWidgetOutputCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "GenerateProxy", ServerWizardWidgetOutputCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ResourceContext", ServerWizardWidgetOutputCommand.class); - - // Map ServerWizardWidgetOutputCommand. - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "ServiceTypeRuntimeServer", ObjectSelectionFragment.class, "TypeRuntimeServer", null); - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "ClientTypeRuntimeServer", ServerRuntimeSelectionWidgetDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "ServiceTypeRuntimeServer", ServerRuntimeSelectionWidgetDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "StartService", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "TestService", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "PublishService", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "PublishService", PublishWSWidget.class, "PublishToPublicUDDI", null); - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "GenerateProxy", ServerRuntimeSelectionWidgetDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "TestService", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "ResourceContext", ClientExtensionDefaultingCommand.class); - - //to the test wizard - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "GenerateProxy", ServiceTestFragment.class); - dataRegistry.addMapping(ServerExtensionOutputCommand.class, "WsdlURI", WSDLTestLaunchCommand.class); - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", WSDLTestLaunchCommand.class); - - - - // Map ServerRuntimeSelectionWidgetDefaultingCommand - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceTypeRuntimeServer", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ClientExtensionDefaultingCommand.class); - //dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceProject2EARProject", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceProjectName", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceEarProjectName", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceComponentName", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceEarComponentName", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "Runtime2ClientTypes", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientProjectName", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientEarProjectName", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientEarComponentName", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientComponentName", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientComponentType", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceJ2EEVersion", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientJ2EEVersion", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "GenerateProxy", ClientFragment.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "GenerateProxy", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceNeedEAR", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientNeedEAR", ClientExtensionDefaultingCommand.class); - - - // Map ServerExtensionDefaultingCommand - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServiceTypeRuntimeServer", ServerExtensionFragment.class); - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "TestService", ServiceTestFragment.class); - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "Publish", PublishToPrivateUDDICommandFragment.class); - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServiceTypeRuntimeServer",WSDLTestLaunchCommand.class); - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServiceTypeRuntimeServer", ClientTestDelegateCommand.class); - - // Setup the PreServiceDevelopCommand. - // - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "StartService", PreServiceDevelopCommand.class); - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "TestService", PreServiceDevelopCommand.class); - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "PublishService", PreServiceDevelopCommand.class); - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "GenerateProxy", PreServiceDevelopCommand.class); - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "ResourceContext", PreServiceDevelopCommand.class); - // - dataRegistry.addMapping( ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceComponentType", PreServiceDevelopCommand.class, "ModuleType", null); - dataRegistry.addMapping( ServerExtensionDefaultingCommand.class, "ServiceTypeRuntimeServer", PreServiceDevelopCommand.class ); - dataRegistry.addMapping( ServerExtensionDefaultingCommand.class, "ServiceJ2EEVersion", PreServiceDevelopCommand.class); - dataRegistry.addMapping( ServerExtensionDefaultingCommand.class, "ServerProject", PreServiceDevelopCommand.class, "Module", null ); - dataRegistry.addMapping( ServerExtensionDefaultingCommand.class, "ServerProjectEAR", PreServiceDevelopCommand.class, "Ear", null ); - // - dataRegistry.addMapping( ObjectSelectionOutputCommand.class, "ObjectSelection", PreServiceDevelopCommand.class, "Selection", new SelectionTransformer() ); - - dataRegistry.addMapping( PreServiceDevelopCommand.class, "WebService", ServerExtensionOutputCommand.class ); - - // Map ClientExtensionDefaultingCommand - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", ClientExtensionFragment.class); - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", ClientTestDelegateCommand.class); - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", FinishDefaultCommand.class); - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "TestService", ClientTestFragment.class ); - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "TestService", ClientTestWidget.class ); - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject",ClientTestDelegateCommand.class); - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientNeedEAR", ClientTestDelegateCommand.class); - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientEarProjectName", ClientTestDelegateCommand.class); - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientEarComponentName", ClientTestDelegateCommand.class); - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject", WebServiceClientTestArrivalCommand.class); - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProjectEAR", WebServiceClientTestArrivalCommand.class); - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "LaunchedServiceTestName", WebServiceClientTestArrivalCommand.class); - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServer", ClientTestDelegateCommand.class); - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "GenerateProxy", ClientTestFragment.class); - - - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", ClientTestDelegateCommand.class); - dataRegistry.addMapping(ServerExtensionOutputCommand.class, "WsdlURI", ClientTestDelegateCommand.class); - - dataRegistry.addMapping(ServerExtensionOutputCommand.class, "ServiceServerInstanceId", CreateMonitorCommand.class); - - // Map ServerExtensionOutputCommand for ServerStart() - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProjectEAR", ServerExtensionOutputCommand.class, "EarProjectName", null); - - // MAP post server config call - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProjectEAR", ClientExtensionOutputCommand.class, "EarProjectName", null); - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServerInstance", ClientExtensionOutputCommand.class, "ExistingServerId", null); - - // Map ClientExtensionOutputCommand - dataRegistry.addMapping(ClientExtensionOutputCommand.class, "GenerateProxy", ClientTestFragment.class); - dataRegistry.addMapping(ClientExtensionOutputCommand.class, "GenerateProxy", ClientTestDelegateCommand.class); - dataRegistry.addMapping(ClientExtensionOutputCommand.class, "GenerateProxy", FinishTestFragment.class); - dataRegistry.addMapping(ClientExtensionOutputCommand.class, "ProxyBean", WebServiceClientTestArrivalCommand.class); - dataRegistry.addMapping(ClientExtensionOutputCommand.class, "ProxyBean", ClientTestDelegateCommand.class); - dataRegistry.addMapping(ClientExtensionOutputCommand.class, "SetEndpointMethod", ClientTestDelegateCommand.class); - dataRegistry.addMapping(ClientExtensionOutputCommand.class, "ServerInstanceId", FinishDefaultCommand.class); - - // Map ManageServerStartUpCommand - dataRegistry.addMapping(ServerExtensionOutputCommand.class, "IsWebProjectStartupRequested", ManageServerStartUpCommand.class); - - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "StartService", ManageServerStartUpCommand.class); - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "TestService", ManageServerStartUpCommand.class); - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProject", ManageServerStartUpCommand.class, "ServiceProject", new StringToIProjectTransformer()); - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerServer", ManageServerStartUpCommand.class,"ServiceServerTypeId", null); - - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientProject", ManageServerStartUpCommand.class, "SampleProject", new StringToIProjectTransformer()); - dataRegistry.addMapping(ClientExtensionDefaultingCommand.class, "ClientServerInstance", ManageServerStartUpCommand.class,"SampleExistingServer", new ServerInstToIServerTransformer()); - - // Map WebServiceClientTestArrivalCommand - dataRegistry.addMapping(TestDefaultingFragment.class, "TestFacility",ClientTestDelegateCommand.class); - dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Folder",ClientTestDelegateCommand.class); - dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "JspFolder",ClientTestDelegateCommand.class); - dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "RunClientTest",ClientTestDelegateCommand.class); - dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "Methods",ClientTestDelegateCommand.class); - dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProject",ClientTestDelegateCommand.class); - dataRegistry.addMapping(WebServiceClientTestArrivalCommand.class, "SampleProjectEAR",ClientTestDelegateCommand.class); - - - //Map Finish Command - - - } - } -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/runtime/ServerRuntimeSelectionWidget.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/runtime/ServerRuntimeSelectionWidget.java deleted file mode 100644 index ae66f726e..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/runtime/ServerRuntimeSelectionWidget.java +++ /dev/null @@ -1,462 +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.creation.ui.widgets.runtime; - -import org.eclipse.core.resources.IProject; -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.common.J2EEUtils; -import org.eclipse.jst.ws.internal.consumption.ui.common.ValidationUtils; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ClientRuntimeSelectionWidget; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ProjectSelectionWidget; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.RuntimeServerSelectionWidget; -import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; -import org.eclipse.jst.ws.internal.ui.common.UIUtils; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.ScrolledComposite; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -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.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; -import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; -import org.eclipse.wst.command.internal.provisional.env.core.selection.SelectionListChoices; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; - -/* - * - * ServerRuntimeSelectionWidget - * This widget is the parent widget for server and client deployment/environment settings - * - */ -public class ServerRuntimeSelectionWidget extends SimpleWidgetDataContributor -{ - private String pluginId_ = "org.eclipse.jst.ws.consumption.ui"; - private String createPluginId_ = "org.eclipse.jst.ws.creation.ui"; - - /* CONTEXT_ID PWRS0002 for the Wizard Scenario Service configuration of the Runtime Selection Page */ - private String INFOPOP_PWRS_GROUP_SERVICE = "PWRS0002"; - - private RuntimeServerSelectionWidget runtimeWidget_; - private ProjectSelectionWidget projectWidget_; - private ClientRuntimeSelectionWidget clientWidget_; - private TextModifyListener textListener_; - private MessageUtils msgUtils_; - - private boolean isClientWidgetVisible_ = true; - - public WidgetDataEvents addControls( Composite parent, Listener statusListener ) - { - msgUtils_ = new MessageUtils( pluginId_ + ".plugin", this ); - UIUtils uiUtils = new UIUtils(msgUtils_, createPluginId_ ); - - ScrolledComposite scroller = new ScrolledComposite( parent, SWT.H_SCROLL | SWT.V_SCROLL ); - scroller.setExpandHorizontal(true); - scroller.setExpandVertical(true); - - Composite root = uiUtils.createComposite( scroller, 1 ); - scroller.setContent( root ); - - Composite textComposite = uiUtils.createComposite( root, 1, 0, 0 ); - createMessageText( textComposite, msgUtils_.getMessage("MSG_GENERAL_PROJECT_AND_EAR", new String[] { msgUtils_.getMessage("MSG_SERVICE_SUB")})); - createMessageText( textComposite, msgUtils_.getMessage("MSG_EAR_PROJECT_WILL_BE_CREATED") ); - - Composite serverComp = uiUtils.createComposite( root, 1, 5, 0 ); - - Group serverGroup = uiUtils.createGroup( serverComp, "LABEL_SELECTION_VIEW_TITLE", - null, INFOPOP_PWRS_GROUP_SERVICE, - 2, 5, 5); - - runtimeWidget_ = new RuntimeServerSelectionWidget( false ); - runtimeWidget_.addControls( serverGroup, statusListener ); - textListener_ = new TextModifyListener(); - runtimeWidget_.addModifyListener( textListener_ ); - - projectWidget_ = new ProjectSelectionWidget(); - projectWidget_.addControls( serverGroup, statusListener ); - - clientWidget_ = new ClientRuntimeSelectionWidget(); - clientWidget_.addControls( root, statusListener ); - - Point size = root.computeSize(SWT.DEFAULT, SWT.DEFAULT); - scroller.setMinSize( size ); - root.setSize( size ); - - scroller.setLayoutData( new GridData( GridData.FILL_BOTH ) ); - - return this; - } - - //If generate proxy is not selected, don't show the client portion of the page. - public void setGenerateProxy( Boolean value ) - { - clientWidget_.setVisible( value.booleanValue() ); - isClientWidgetVisible_ = value.booleanValue(); - } - - public TypeRuntimeServer getServiceTypeRuntimeServer() - { - return runtimeWidget_.getTypeRuntimeServer(); - } - - public void setServiceTypeRuntimeServer( TypeRuntimeServer ids ) - { - runtimeWidget_.removeModifyListener( textListener_ ); - runtimeWidget_.setTypeRuntimeServer( ids ); - projectWidget_.setTypeRuntimeServer(ids); - runtimeWidget_.addModifyListener( textListener_ ); - } - - public TypeRuntimeServer getClientTypeRuntimeServer() - { - return clientWidget_.getClientTypeRuntimeServer(); - } - - public void setClientTypeRuntimeServer( TypeRuntimeServer ids ) - { - clientWidget_.setClientTypeRuntimeServer( ids ); - } - - public SelectionListChoices getServiceProject2EARProject() - { - return projectWidget_.getProjectChoices(); - } - - public void setServiceProject2EARProject(SelectionListChoices serviceProject2EARProject) - { - projectWidget_.setProjectChoices(serviceProject2EARProject); - } - - public SelectionListChoices getRuntime2ClientTypes() - { - return clientWidget_.getRuntime2ClientTypes(); - } - - public void setRuntime2ClientTypes(SelectionListChoices runtime2ClientTypes) - { - clientWidget_.setRuntime2ClientTypes(runtime2ClientTypes); - } - - public String getServiceJ2EEVersion() - { - return runtimeWidget_.getJ2EEVersion(); - } - - public void setServiceJ2EEVersion(String j2eeVersion) - { - runtimeWidget_.setJ2EEVersion(j2eeVersion); - projectWidget_.setJ2EEVersion(j2eeVersion); - } - - public String getClientJ2EEVersion() - { - return clientWidget_.getJ2EEVersion(); - } - - public void setClientJ2EEVersion(String j2eeVersion) - { - clientWidget_.setJ2EEVersion(j2eeVersion); - } - - public boolean getServiceNeedEAR() - { - return projectWidget_.getNeedEAR(); - } - - public void setServiceNeedEAR(boolean b) - { - projectWidget_.setNeedEAR(b); - } - - public boolean getClientNeedEAR() - { - return clientWidget_.getClientNeedEAR(); - } - - public void setClientNeedEAR(boolean b) - { - clientWidget_.setClientNeedEAR(b); - } - - public String getServiceComponentName() - { - return projectWidget_.getComponentName(); - } - - public void setServiceComponentName( String name ) - { - projectWidget_.setComponentName( name ); - } - - public String getServiceEarComponentName() - { - return projectWidget_.getEarComponentName(); - } - - public void setServiceEarComponentName( String name ) - { - projectWidget_.setEarComponentName( name ); - } - - public void setServiceComponentType( String type ) - { - projectWidget_.setComponentType( type ); - } - - public String getClientComponentName() - { - return clientWidget_.getClientComponentName(); - } - - public void setClientComponentName( String name ) - { - clientWidget_.setClientComponentName( name ); - } - - public String getClientEarComponentName() - { - return clientWidget_.getClientEarComponentName(); - } - - public void setClientEarComponentName( String name ) - { - clientWidget_.setClientEarComponentName( name ); - } - - public String getClientComponentType() - { - return clientWidget_.getClientComponentType(); - } - - public void setComponentType( String type ) - { - clientWidget_.setClientComponentType( type ); - } - - public String getServiceProjectName() - { - return projectWidget_.getProjectName(); - } - - public String getServiceEarProjectName() - { - return projectWidget_.getEarProjectName(); - } - - public String getClientProjectName() - { - return clientWidget_.getClientProjectName(); - } - - public String getClientEarProjectName() - { - return clientWidget_.getClientEarProjectName(); - } - - private class TextModifyListener implements ModifyListener - { - public void modifyText(ModifyEvent e) - { - if( clientWidget_.isVisible() ) - { - TypeRuntimeServer serviceIds = runtimeWidget_.getTypeRuntimeServer(); - TypeRuntimeServer clientIds = clientWidget_.getClientTypeRuntimeServer(); - - clientIds.setRuntimeId( serviceIds.getRuntimeId() ); - clientIds.setServerId( serviceIds.getServerId() ); - clientIds.setServerInstanceId( serviceIds.getServerInstanceId() ); - - clientWidget_.setClientTypeRuntimeServer( clientIds ); - clientWidget_.setJ2EEVersion(runtimeWidget_.getJ2EEVersion()); - } - - //Set the current server selection and J2EE level on the ProjectSelectionWidget - projectWidget_.setTypeRuntimeServer(runtimeWidget_.getTypeRuntimeServer()); - projectWidget_.setJ2EEVersion(runtimeWidget_.getJ2EEVersion()); - } - } - - - /* (non-Javadoc) - * @see org.eclipse.wst.command.env.ui.widgets.WidgetContributor#getStatus() - */ - public IStatus getStatus() - { - IStatus serviceStatus = runtimeWidget_.getStatus(); - IStatus projectStatus = projectWidget_.getStatus(); - IStatus clientStatus = clientWidget_.getStatus(); - IStatus finalStatus = Status.OK_STATUS; - - // call child widgets' getStatus() - if( serviceStatus.getSeverity() == Status.ERROR ) - { - finalStatus = serviceStatus; - } - else if( clientStatus.getSeverity() == Status.ERROR ) - { - if (isClientWidgetVisible_) - finalStatus = clientStatus; - } - else if ( projectStatus.getSeverity()== Status.ERROR) { - finalStatus = projectStatus; - } - - //Validate service side server target and J2EE level - ValidationUtils valUtils = new ValidationUtils(); - String serviceEARName = projectWidget_.getEarProjectName(); - String serviceProjName = projectWidget_.getProjectName(); - String serviceServerFactoryId = runtimeWidget_.getTypeRuntimeServer().getServerId(); - String serviceJ2EElevel = runtimeWidget_.getJ2EEVersion(); - String serviceComponentName = projectWidget_.getComponentName(); - String serviceEARComponentName = projectWidget_.getEarComponentName(); - IStatus serviceProjectStatus = valUtils.validateProjectTargetAndJ2EE(serviceProjName,serviceComponentName, serviceEARName, serviceEARComponentName, serviceServerFactoryId, serviceJ2EElevel); - if(serviceProjectStatus.getSeverity()==Status.ERROR) - { - finalStatus = serviceProjectStatus; - } - - //Ensure the service project type (Web/EJB) is valid - if (serviceProjName!=null && serviceProjName.length()>0) - { - IProject serviceProj = ProjectUtilities.getProject(serviceProjName); - if (serviceProj.exists()) - { - // rskreg - //WebServiceServerRuntimeTypeRegistry wssrtRegistry = WebServiceServerRuntimeTypeRegistry.getInstance(); - //String serverTypeId = wssrtRegistry.getWebServiceServerByFactoryId(serviceServerFactoryId).getId(); - //String serverTypeId = wssrtRegistry.getWebServiceServerByFactoryId(serviceServerFactoryId).getId(); - /* rskejb - boolean isEJBRequired = WebServiceRuntimeExtensionUtils.requiresEJBModuleFor(serviceServerFactoryId, webServiceRuntimeId, webServiceTypeId); - if (!isEJBRequired) - { - //Check the Web service type to see if an EJB project is required - //isEJBRequired = wssrtRegistry.requiresEJBProject(webServiceTypeId); - isEJBRequired = WebServiceRuntimeExtensionUtils.requiresEJBProject(webServiceTypeId); - } - rskejb */ - if (serviceComponentName!=null && serviceComponentName.length()>0) - { - String compTypeId = J2EEUtils.getComponentTypeId(serviceProj, serviceComponentName); - if (!compTypeId.equals(projectWidget_.getComponentType())) - { - //Construct the error message - String compTypeLabel = getCompTypeLabel(projectWidget_.getComponentType()); - finalStatus = StatusUtils.errorStatus( msgUtils_.getMessage("MSG_INVALID_PROJECT_TYPE",new String[]{serviceProjName, compTypeLabel}) ); - } - } - // begin remove - /* - boolean isEJBRequired = WebServiceRuntimeExtensionUtils.requiresEJBProject(webServiceRuntimeId, webServiceTypeId); - if (isEJBRequired && serviceComponentName!=null && serviceComponentName.length()>0 && !J2EEUtils.isEJBComponent(serviceProj, serviceComponentName)) - { - finalStatus = new SimpleStatus("",msgUtils_.getMessage("MSG_INVALID_EJB_PROJECT",new String[]{serviceProjName}),Status.ERROR); - } - if (!isEJBRequired && serviceComponentName!=null && serviceComponentName.length()>0 && !J2EEUtils.isWebComponent(serviceProj, serviceComponentName)) - { - finalStatus = new SimpleStatus("",msgUtils_.getMessage("MSG_INVALID_WEB_PROJECT",new String[]{serviceProjName}),Status.ERROR); - } - */ - // end remove - } - } - - if (isClientWidgetVisible_) - { - String clientEARName = clientWidget_.getClientEarProjectName(); - String clientProjName = clientWidget_.getClientProjectName(); - - String clientComponentName = clientWidget_.getClientComponentName(); - - // check same EAR-ness ----- - String warning_msg = getEARProjectWarningMessage(serviceEARName, clientEARName); - - if (serviceComponentName.equalsIgnoreCase(clientComponentName)){ - String err_msg = msgUtils_.getMessage( "MSG_SAME_CLIENT_AND_SERVICE_COMPONENTS", new String[]{ "WEB" } ); - finalStatus = StatusUtils.errorStatus( err_msg ); - } - - if( clientProjName != null && serviceProjName != null && - clientProjName.equalsIgnoreCase( serviceProjName )) - { - String error_msg = msgUtils_.getMessage("MSG_SAME_CLIENT_AND_SERVICE_PROJECTS"); - finalStatus = StatusUtils.errorStatus( error_msg ); - } - - if (warning_msg != null) - { - if (finalStatus.getSeverity()!=Status.ERROR) - return StatusUtils.warningStatus( warning_msg ); - } - - } - - return finalStatus; - } - - private void createMessageText( Composite parent, String value ) - { - Text messageText = new Text( parent, SWT.WRAP | SWT.MULTI | SWT.READ_ONLY ); - GridData gridData = new GridData( GridData.FILL_BOTH ); - - gridData.horizontalIndent = 10; - messageText.setLayoutData( gridData ); - messageText.setText( value ); - } - - private String getEARProjectWarningMessage(String serviceEARName, String clientEARName ) { - - // check if service and client share the same EAR - if (serviceEARName!=null && clientEARName!=null) { - - if (clientEARName.equalsIgnoreCase(serviceEARName) && clientEARName.length()>0) { - return msgUtils_.getMessage("MSG_SAME_CLIENT_AND_SERVICE_EARS", new String[]{ "EAR" }); - } - } - - return null; - - } - - //Returns a label corresponding to the componentTypeId. This is hard-coded for now. - //This is something the flexible project framework should provide. Enhancement 106785 has been - //opened. - private String getCompTypeLabel(String typeId) - { - if (typeId.equals(IModuleConstants.JST_WEB_MODULE)) - { - return msgUtils_.getMessage("LABEL_CLIENT_COMP_TYPE_WEB"); - } - else if (typeId.equals(IModuleConstants.JST_EJB_MODULE)) - { - return msgUtils_.getMessage("LABEL_CLIENT_COMP_TYPE_EJB"); - } - else if (typeId.equals(IModuleConstants.JST_APPCLIENT_MODULE)) - { - return msgUtils_.getMessage("LABEL_CLIENT_COMP_TYPE_APP_CLIENT"); - } - else if (typeId.equals(IModuleConstants.JST_UTILITY_MODULE)) - { - return msgUtils_.getMessage("LABEL_CLIENT_COMP_TYPE_CONTAINERLESS"); - } - else - { - //No known label, return the typeId itself. - return typeId; - } - } -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/runtime/ServerRuntimeSelectionWidgetDefaultingCommand.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/runtime/ServerRuntimeSelectionWidgetDefaultingCommand.java deleted file mode 100644 index cfab20259..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/runtime/ServerRuntimeSelectionWidgetDefaultingCommand.java +++ /dev/null @@ -1,933 +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.creation.ui.widgets.runtime; - -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.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jface.viewers.IStructuredSelection; -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.common.ServerSelectionUtils; -import org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin; -import org.eclipse.jst.ws.internal.consumption.ui.preferences.PersistentServerRuntimeContext; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ClientRuntimeSelectionWidgetDefaultingCommand; -import org.eclipse.jst.ws.internal.consumption.ui.wsrt.ServiceType; -import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils; -import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeInfo; -import org.eclipse.jst.ws.internal.context.ProjectTopologyContext; -import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; -import org.eclipse.jst.ws.internal.plugin.WebServicePlugin; -import org.eclipse.wst.command.internal.env.common.FileResourceUtils; -import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.common.StatusUtils; -import org.eclipse.wst.command.internal.provisional.env.core.selection.SelectionList; -import org.eclipse.wst.command.internal.provisional.env.core.selection.SelectionListChoices; -import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.server.core.IRuntime; -import org.eclipse.wst.ws.internal.provisional.wsrt.WebServiceScenario; - -public class ServerRuntimeSelectionWidgetDefaultingCommand extends ClientRuntimeSelectionWidgetDefaultingCommand -{ - private String DEFAULT_CLIENT_EAR_PROJECT_EXT = "EAR"; - private boolean generateProxy_; - - // webServiceRuntimeJ2EEType contains the default Web service runtime and J2EE level based on the initial selection. - // If the initialSeleciton does not result in a valid Web service runtime and J2EE level, webServiceRuntimeJ2EEType - // should remain null for the life of this instance. - private WSRuntimeJ2EEType webServiceRuntimeJ2EEType = null; - - private TypeRuntimeServer serviceIds_; - private SelectionListChoices serviceProject2EARProject_; - private String serviceComponentName_; - private String serviceEarComponentName_; - private String serviceComponentType_; - private IProject initialProject_; - private String initialComponentName_; - private String serviceJ2EEVersion_; - private boolean serviceNeedEAR_ = true; - - public ServerRuntimeSelectionWidgetDefaultingCommand() - { - super(); - } - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - Environment env = getEnvironment(); - - try - { - IStatus clientSideStatus = super.execute(monitor, null); - if (clientSideStatus.getSeverity()==Status.ERROR) - { - return clientSideStatus; - } - IStatus status = Status.OK_STATUS; - - - setDefaultServiceRuntimeFromPreference(); - setDefaultServiceJ2EEVersionFromPreference(); - webServiceRuntimeJ2EEType = getWSRuntimeAndJ2EEFromProject(initialProject_, initialComponentName_); - if (webServiceRuntimeJ2EEType != null) - { - serviceJ2EEVersion_ = webServiceRuntimeJ2EEType.getJ2eeVersionId(); - serviceIds_.setRuntimeId(webServiceRuntimeJ2EEType.getWsrId()); - } - - setServiceComponentType(); - // Default projects EARs and servers. - setDefaultProjects(); - setDefaultEARs(); - IStatus serverStatus = setDefaultServer(); - if (serverStatus.getSeverity()== Status.ERROR) - { - env.getStatusHandler().reportError(serverStatus); - return serverStatus; - } - updateServiceEARs(); - //updateClientProject(getServiceProject2EARProject().getList().getSelection(), serviceComponentName_, serviceIds_.getTypeId()); - updateClientEARs(); - - return status; - } catch (Exception e) - { - //Catch all Exceptions in order to give some feedback to the user - IStatus errorStatus = StatusUtils.errorStatus( msgUtils_.getMessage("MSG_ERROR_TASK_EXCEPTED",new String[]{e.getMessage()}), e); - env.getStatusHandler().reportError(errorStatus); - return errorStatus; - } - - } - - private void setServiceComponentType() - { - ServiceType st = WebServiceRuntimeExtensionUtils.getServiceType(serviceIds_.getRuntimeId(), serviceIds_.getTypeId()); - int scenario = WebServiceRuntimeExtensionUtils.getScenarioFromTypeId(serviceIds_.getTypeId()); - String[] includeComponentTypes = null; - switch (scenario) - { - case WebServiceScenario.BOTTOMUP: - includeComponentTypes = st.getBottomUpModuleTypesInclude(); - break; - case WebServiceScenario.TOPDOWN: - includeComponentTypes = st.getTopDownModuleTypesInclude(); - } - - if (includeComponentTypes == null || includeComponentTypes.length==0) - { - serviceComponentType_ = IModuleConstants.JST_WEB_MODULE; - } - else - { - serviceComponentType_ = includeComponentTypes[0]; - } - } - - /* - private void setWebClientType() - { - SelectionListChoices choices = getRuntime2ClientTypes(); - String webId = "org.eclipse.jst.ws.consumption.ui.clientProjectType.Web"; - - if( choices != null ) - { - choices.getChoice().getList().setSelectionValue( webId ); - } - } - */ - - /** - * Returns an object with target Runtime and J2EE value - * @param project - * @return - */ - - private WSRuntimeJ2EEType getWSRuntimeAndJ2EEFromProject(IProject project, String componentName) - { - WSRuntimeJ2EEType wsrJ2EE = null; - //If there is a valid initial selection, use it to determine - //reasonable J2EE version and Web service runtime values - - if (project != null && project.exists()) - { - boolean isValidComponentType = false; - if (componentName != null && componentName.length()>0) - { - isValidComponentType = J2EEUtils.isWebComponent(project, componentName) || - J2EEUtils.isEJBComponent(project, componentName); - } - if (isValidComponentType) - { - //WebServiceServerRuntimeTypeRegistry wssrtReg = WebServiceServerRuntimeTypeRegistry.getInstance(); - - //Get the J2EE level - int versionId = J2EEUtils.getJ2EEVersion(project, componentName); - String versionString = String.valueOf(versionId); - - //Get the runtime target of the project - IRuntime runtimeTarget = ServerSelectionUtils.getRuntimeTarget(project.getName()); - String runtimeTargetId = null; - if (runtimeTarget != null) - runtimeTargetId = runtimeTarget.getRuntimeType().getId(); - - //If the preferred Web service runtime supports this J2EE level and this server target, keep it - if (WebServiceRuntimeExtensionUtils.doesRuntimeSupportJ2EELevel(versionString, serviceIds_.getRuntimeId()) && - ((runtimeTarget == null) || - (runtimeTarget != null && WebServiceRuntimeExtensionUtils.doesRuntimeSupportServerTarget(runtimeTargetId, serviceIds_.getRuntimeId())) - ) - ) - - { - //Set the J2EE level and Web service runtime - wsrJ2EE = new WSRuntimeJ2EEType(); - wsrJ2EE.setWsrId(serviceIds_.getRuntimeId()); - wsrJ2EE.setJ2eeVersionId(versionString); - return wsrJ2EE; - - } else - { - //Look for a runtime that matches both the J2EE level and the server target. - String[] validRuntimes = WebServiceRuntimeExtensionUtils.getRuntimesByType(serviceIds_.getTypeId()); - for (int i = 0; i < validRuntimes.length; i++) - { - if (WebServiceRuntimeExtensionUtils.doesRuntimeSupportJ2EELevel(versionString, validRuntimes[i]) && - ((runtimeTarget == null) || - (runtimeTarget!=null && WebServiceRuntimeExtensionUtils.doesRuntimeSupportServerTarget(runtimeTargetId, validRuntimes[i])) - ) - ) - { - wsrJ2EE = new WSRuntimeJ2EEType(); - wsrJ2EE.setWsrId(validRuntimes[i]); - wsrJ2EE.setJ2eeVersionId(versionString); - return wsrJ2EE; - } - } - } - } - } - return wsrJ2EE; - } - - private void setDefaultServiceRuntimeFromPreference() - { - - PersistentServerRuntimeContext context = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext(); - String pRuntimeId = context.getRuntimeId(); - //WebServiceServerRuntimeTypeRegistry wssrtReg = WebServiceServerRuntimeTypeRegistry.getInstance(); - //if the preferred runtime in compatible with the type, select it. - if (WebServiceRuntimeExtensionUtils.isRuntimeSupportedForType(serviceIds_.getTypeId(), pRuntimeId)) - { - serviceIds_.setRuntimeId(pRuntimeId); - } - else - { - //Set the Web service runtime to one that is supported by the selected type. - String[] validRuntimes = WebServiceRuntimeExtensionUtils.getRuntimesByType(serviceIds_.getTypeId()); - if (validRuntimes != null && validRuntimes.length>0) - { - serviceIds_.setRuntimeId(validRuntimes[0]); - } - } - } - - - - private void setDefaultServiceJ2EEVersionFromPreference() - { - if (serviceIds_ != null) - { - String runtimeId = serviceIds_.getRuntimeId(); - if (runtimeId != null) - { - //IWebServiceRuntime wsr = WebServiceServerRuntimeTypeRegistry.getInstance().getWebServiceRuntimeById(runtimeId); - WebServiceRuntimeInfo wsrt = WebServiceRuntimeExtensionUtils.getWebServiceRuntimeById(runtimeId); - if (wsrt != null) - { - String[] versions = wsrt.getJ2eeLevels(); - //If the preferred J2EE version is in versions, pick the preferred one. - //Otherwise, pick the first one. - if (versions != null && versions.length > 0) - { - PersistentServerRuntimeContext context = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext(); - String pJ2EE = context.getJ2EEVersion(); - if (pJ2EE!=null && pJ2EE.length()>0) - { - for (int i=0;i<versions.length;i++) - { - if (versions[i].equals(pJ2EE)) - { - serviceJ2EEVersion_ = versions[i]; - return; - } - } - } - serviceJ2EEVersion_ = versions[0]; - return; - } - - } - } - } - } - - - /** - * This method needs a lot of work. It does not take into account the component types supported by the - * selected Web service type or the fact that there are multiple components in a project. - */ - //rskrem93309 - /* - private void setDefaultProjectsNew() - { - if (initialProject_ != null) - { - getServiceProject2EARProject().getList().setSelectionValue(initialProject_.getName()); - String moduleName = null; - if (initialComponentName_!=null && initialComponentName_.length()>0) - { - moduleName = initialComponentName_; - } - else - { - moduleName = J2EEUtils.getFirstWebModuleName(initialProject_); - } - - serviceComponentName_ = moduleName; - String version = String.valueOf(J2EEUtils.getJ2EEVersion(initialProject_, moduleName)); - String[] validVersions = WebServiceRuntimeExtensionUtils.getWebServiceRuntimeById(serviceIds_.getRuntimeId()).getJ2eeLevels(); - for (int i=0; i< validVersions.length; i++) - { - if (validVersions[i].equals(version)) - { - serviceJ2EEVersion_ = validVersions[i]; - } - } - } - else - { - //Pick the first one - IProject[] projects = WebServiceRuntimeExtensionUtils.getAllProjects(); - if (projects.length>0) - { - getServiceProject2EARProject().getList().setSelectionValue(projects[0].getName()); - String moduleName = J2EEUtils.getFirstWebModuleName(projects[0]); - serviceComponentName_ = moduleName; - String version = String.valueOf(J2EEUtils.getJ2EEVersion(projects[0], moduleName)); - String[] validVersions = WebServiceRuntimeExtensionUtils.getWebServiceRuntimeById(serviceIds_.getRuntimeId()).getJ2eeLevels(); - for (int i=0; i< validVersions.length; i++) - { - if (validVersions[i].equals(version)) - { - serviceJ2EEVersion_ = validVersions[i]; - } - } - - } - else - { - //there are no projects in the workspace. Pass the default names for new projects. - - if (serviceComponentType_.equals(IModuleConstants.JST_EJB_MODULE)) - { - getServiceProject2EARProject().getList().setSelectionValue(ResourceUtils.getDefaultEJBProjectName()); - serviceComponentName_ = ResourceUtils.getDefaultEJBComponentName(); - } - else - { - getServiceProject2EARProject().getList().setSelectionValue(ResourceUtils.getDefaultWebProjectName()); - serviceComponentName_ = ResourceUtils.getDefaultWebComponentName(); - } - } - - - } - } - */ - // - - private void setDefaultProjects() - { - - //Handle the case where no valid initial selection exists - if (initialProject_== null || (initialProject_!=null && webServiceRuntimeJ2EEType==null)) - { - //Select the first existing project that is valid. - setServiceProjectToFirstValid(); - String serviceProjectName = getServiceProject2EARProject().getList().getSelection(); - - //Select a client project with "client" added to the above project name. - updateClientProject(serviceProjectName, serviceComponentName_, serviceIds_.getTypeId()); - //String clientProjectName = ResourceUtils.getClientWebProjectName(serviceProjectName, serviceIds_.getTypeId() ); - //getRuntime2ClientTypes().getChoice().getChoice().getList().setSelectionValue(clientProjectName); - - return; - } - - - //Set the service project selection to this initialProject - getServiceProject2EARProject().getList().setSelectionValue(initialProject_.getName()); - serviceComponentName_ = initialComponentName_; - updateClientProject(initialProject_.getName(), serviceComponentName_, serviceIds_.getTypeId()); - //String clientProjectName = ResourceUtils.getClientWebProjectName(initialProject_.getName(), serviceIds_.getTypeId() ); - //Set the client project selection to clientProject - //getRuntime2ClientTypes().getChoice().getChoice().getList().setSelectionValue(clientProjectName); - - } - - - private void setServiceProjectToFirstValid() - { - //WebServiceServerRuntimeTypeRegistry wssrtReg = WebServiceServerRuntimeTypeRegistry.getInstance(); - String[] projectNames = getServiceProject2EARProject().getList().getList(); - for (int i=0;i<projectNames.length; i++) - { - IProject project = ProjectUtilities.getProject(projectNames[i]); - IVirtualComponent[] vcs = J2EEUtils.getComponentsByType(project, serviceComponentType_); - if (project.isOpen() && vcs!=null && vcs.length>0) - { - //Get the runtime target of the project - IRuntime runtimeTarget = ServerSelectionUtils.getRuntimeTarget(project.getName()); - String runtimeTargetId = null; - if (runtimeTarget != null) - runtimeTargetId = runtimeTarget.getRuntimeType().getId(); - - for (int j=0; j < vcs.length; j++) - { - //Get the J2EE level - int versionId = J2EEUtils.getJ2EEVersion(vcs[j]); - String versionString = String.valueOf(versionId); - - - if (serviceJ2EEVersion_!=null && serviceJ2EEVersion_.length()>0 && serviceJ2EEVersion_.equals(versionString)) - { - if (WebServiceRuntimeExtensionUtils.doesRuntimeSupportJ2EELevel(versionString, serviceIds_.getRuntimeId()) && - ((runtimeTarget == null) || - ((runtimeTarget!=null) && WebServiceRuntimeExtensionUtils.doesRuntimeSupportServerTarget(runtimeTargetId, serviceIds_.getRuntimeId()))) - ) - { - getServiceProject2EARProject().getList().setSelectionValue(projectNames[i]); - serviceComponentName_ = vcs[j].getName(); - - return; - } - } - } - } - } - - //Didn't find a single project that worked. Default to a new project name. - //getServiceProject2EARProject().getList().setSelectionValue(ResourceUtils.getDefaultWebProjectName()); - //serviceComponentName_ = ResourceUtils.getDefaultWebProjectName(); - if (serviceComponentType_.equals(IModuleConstants.JST_EJB_MODULE)) - { - getServiceProject2EARProject().getList().setSelectionValue(ResourceUtils.getDefaultEJBProjectName()); - serviceComponentName_ = ResourceUtils.getDefaultEJBComponentName(); - } - else - { - getServiceProject2EARProject().getList().setSelectionValue(ResourceUtils.getDefaultWebProjectName()); - serviceComponentName_ = ResourceUtils.getDefaultWebComponentName(); - } - } - - - private void setDefaultEARs() - { - //Service side - String initialProjectName = getServiceProject2EARProject().getList().getSelection(); - IProject initialProject = FileResourceUtils.getWorkspaceRoot().getProject(initialProjectName); - boolean earIsSet = false; - if (initialProject != null && initialProject.exists()) - { - IVirtualComponent[] earComps = J2EEUtils.getReferencingEARComponents(initialProject, serviceComponentName_); - if (earComps.length > 0) - { - // Pick the first one - IVirtualComponent earComp = earComps[0]; - String earProjectName = earComp.getProject().getName(); - String earComponentName = earComp.getName(); - getServiceProject2EARProject().getChoice().getList().setSelectionValue(earProjectName); - serviceEarComponentName_ = earComponentName; - earIsSet = true; - } - } - - if (!earIsSet) - { - // Either the component is not associated with any EARs or the project - // does not exist, - // so pick the first EAR yousee with the correct J2EE version. - IVirtualComponent[] allEarComps = J2EEUtils.getAllEARComponents(); - if (allEarComps.length > 0) - { - for (int i = 0; i < allEarComps.length; i++) - { - IRuntime runtime = ServerSelectionUtils.getRuntimeTarget(allEarComps[i].getProject().getName()); - if (runtime != null && serviceIds_.getRuntimeId() != null && WebServiceRuntimeExtensionUtils.doesRuntimeSupportServerTarget(runtime.getRuntimeType().getId(), serviceIds_.getRuntimeId()) && serviceJ2EEVersion_.equals(String.valueOf(J2EEUtils.getJ2EEVersion(allEarComps[i])))) - { - String earProjectName = allEarComps[i].getProject().getName(); - getServiceProject2EARProject().getChoice().getList().setSelectionValue(earProjectName); - serviceEarComponentName_ = allEarComps[i].getName(); - earIsSet = true; - } - - } - } - } - - if (!earIsSet) - { - // there are no suitable existing EARs - getServiceProject2EARProject().getChoice().getList().setSelectionValue(ResourceUtils.getDefaultServiceEARProjectName()); - serviceEarComponentName_ = ResourceUtils.getDefaultServiceEARComponentName(); - } - - - - //Client side - String initialClientProjectName = getRuntime2ClientTypes().getChoice().getChoice().getList().getSelection(); - IProject initialClientProject = ProjectUtilities.getProject(initialClientProjectName); - String[] clientEARInfo = getDefaultEARFromClientProject(initialClientProject, getClientComponentName()); - - //If the client project exists and the default EAR is the same as that of the service project, - //pick the defaultClientEAR - if(initialClientProject!=null && initialClientProject.exists() - && clientEARInfo[1].equalsIgnoreCase(serviceEarComponentName_)) - { - getRuntime2ClientTypes().getChoice().getChoice().getChoice().getList().setSelectionValue(clientEARInfo[0]); - setClientEARComponentName(clientEARInfo[1]); - } - else - { - ProjectTopologyContext ptc= WebServicePlugin.getInstance().getProjectTopologyContext(); - String serviceEARName = getServiceProject2EARProject().getChoice().getList().getSelection(); - if (!ptc.isUseTwoEARs()) { - getRuntime2ClientTypes().getChoice().getChoice().getChoice().getList().setSelectionValue(serviceEARName); - setClientEARComponentName(serviceEarComponentName_); - } - else { - //I am here - IProject proxyEARProject = getUniqueClientEAR(clientEARInfo[0], serviceEARName, initialClientProjectName); - getRuntime2ClientTypes().getChoice().getChoice().getChoice().getList().setSelectionValue(proxyEARProject.getName()); - setClientEARComponentName(proxyEARProject.getName()); - } - } - - } - - -/* - private void setDefaultEARs() { - // Service-side - String initialProjectName = getServiceProject2EARProject().getList().getSelection(); - IProject initialProject = FileResourceUtils.getWorkspaceRoot().getProject(initialProjectName); - IProject defaultServiceEAR = getDefaultEARFromServiceProject(initialProject); - getServiceProject2EARProject().getChoice().getList().setSelectionValue(defaultServiceEAR.getName()); - // Client-side - String initialClientProjectName = getRuntime2ClientTypes().getChoice().getChoice().getList().getSelection(); - IProject initialClientProject = (IProject)((new StringToIProjectTransformer()).transform(initialClientProjectName)); - IProject defaultClientEAR = getDefaultEARFromClientProject(initialClientProject); // If the client project exists and the default EAR is the same as that of the service - project, // pick the defaultClientEAR - if(initialClientProject!=null && initialClientProject.exists() && defaultClientEAR.getName().equalsIgnoreCase(defaultServiceEAR.getName())) { - getRuntime2ClientTypes().getChoice().getChoice().getChoice().getList().setSelectionValue(defaultClientEAR.getName()); } - else { ProjectTopologyContext ptc= - WebServicePlugin.getInstance().getProjectTopologyContext(); if - (!ptc.isUseTwoEARs()) { - getRuntime2ClientTypes().getChoice().getChoice().getChoice().getList().setSelectionValue(defaultServiceEAR.getName()); } - else { IProject proxyEARProject = - getUniqueClientEAR(defaultClientEAR.getName(), defaultServiceEAR.getName(), - initialClientProjectName); - getRuntime2ClientTypes().getChoice().getChoice().getChoice().getList().setSelectionValue(proxyEARProject.getName()); } } } - */ - - private IProject getUniqueClientEAR(String earProject, String serviceProject, String clientProjectName) { - - String projectName = new String(); - if (!earProject.equalsIgnoreCase(serviceProject)) { - projectName = earProject; - } - else { - projectName = clientProjectName+DEFAULT_CLIENT_EAR_PROJECT_EXT; - int i=1; - while (projectName.equalsIgnoreCase(serviceProject)) { - projectName = projectName+i; - i++; - } - } - return projectName.equals("") ? null : ResourceUtils.getWorkspaceRoot().getProject(projectName); - - } - - /* - private void setDefaultServer() - { - String initialProjectName = getServiceProject2EARProject().getList().getSelection(); - IRuntime runtimeTarget = ServerSelectionUtils.getRuntimeTarget(initialProjectName); - String runtimeTargetId = null; - if (runtimeTarget != null) - { - runtimeTargetId = runtimeTarget.getRuntimeType().getId(); - //Pick a compatible existing server if one exists. - IServer[] servers = ServerSelectionUtils.getCompatibleExistingServers(runtimeTarget); - if (servers!=null && servers.length>0) - { - for (int i=0; i<servers.length; i++) - { - String thisFactoryId = servers[0].getServerType().getId(); - //if (WebServiceRuntimeExtensionUtils.doesRuntimeSupportServer(serviceIds_.getRuntimeId(), thisFactoryId)) - //{ - //Pick this server and return. - serviceIds_.setServerId(thisFactoryId); - serviceIds_.setServerInstanceId(servers[0].getId()); - return; - //} - } - } - - //No compatible existing server, set the factory id to something the runtime supports - String[] factoryIds = WebServiceRuntimeExtensionUtils.getWebServiceRuntimeById(serviceIds_.getRuntimeId()).getServerFactoryIds(); - if (factoryIds!=null && factoryIds.length>0) - { - for (int i=0; i<factoryIds.length; i++) - { - IServerType serverType = ServerCore.findServerType(factoryIds[i]); - if (serverType != null) - { - String serverRuntimeTypeId = serverType.getRuntimeType().getId(); - if (serverRuntimeTypeId.equals(runtimeTargetId)) - { - //Found a match - serviceIds_.setServerId(factoryIds[i]); - return; - } - } - } - } - else - { - //Runtime does not specify any server factory ids - IServerType[] serverTypes = ServerCore.getServerTypes(); - serviceIds_.setServerId(serverTypes[0].getId()); - } - - } - else - { - // The project has no server target so pick a server factory id that is supported by the runtime - String[] fids = WebServiceRuntimeExtensionUtils.getWebServiceRuntimeById(serviceIds_.getRuntimeId()).getServerFactoryIds(); - if (fids!=null && fids.length>0) - { - serviceIds_.setServerId(fids[0]); - } - else - { - //Runtime does not specify any server factory ids - IServerType[] serverTypes = ServerCore.getServerTypes(); - serviceIds_.setServerId(serverTypes[0].getId()); - } - - } - } - */ - - private IStatus setDefaultServer() - { - IStatus status = Status.OK_STATUS; - //Calculate reasonable default server based on the default project selection. - - String initialProjectName = getServiceProject2EARProject().getList().getSelection(); - IProject initialProject = ProjectUtilities.getProject(initialProjectName); - if (initialProject.exists()) - { - String[] serverInfo = ServerSelectionUtils.getServerInfoFromExistingProject(initialProject, serviceComponentName_, serviceIds_.getRuntimeId(), true); - if (serverInfo!=null) - { - if (serverInfo[0]!=null && serverInfo[0].length()>0) - { - serviceIds_.setServerId(serverInfo[0]); - } - if (serverInfo[1]!=null && serverInfo[1].length()>0) - { - serviceIds_.setServerInstanceId(serverInfo[1]); - } - } - } - else //the project does not exist. - { - //Does the EAR exist? - String initialEARProjectName = getServiceProject2EARProject().getChoice().getList().getSelection(); - IProject initialEARProject = ProjectUtilities.getProject(initialEARProjectName); - if (initialEARProject.exists()) - { - String[] serverInfo = ServerSelectionUtils.getServerInfoFromExistingProject(initialEARProject, serviceEarComponentName_, serviceIds_.getRuntimeId(), false); - if (serverInfo!=null) - { - if (serverInfo[0]!=null && serverInfo[0].length()>0) - { - serviceIds_.setServerId(serverInfo[0]); - } - if (serverInfo[1]!=null && serverInfo[1].length()>0) - { - serviceIds_.setServerInstanceId(serverInfo[1]); - } - } - } - else - { - //We have a new project and EAR. Use the runtime/server selection - //preferences to set the default server/server type. - //Pick a server type that is compatible with the Web service runtime - //If there is an existing server that works, pick that one. - - String[] serverInfo = ServerSelectionUtils.getServerFromWebServceRuntimeAndJ2EE(serviceIds_.getRuntimeId(), serviceJ2EEVersion_); - if (serverInfo!=null) - { - if (serverInfo[0]!=null && serverInfo[0].length()>0) - { - serviceIds_.setServerId(serverInfo[0]); - } - if (serverInfo[1]!=null && serverInfo[1].length()>0) - { - serviceIds_.setServerInstanceId(serverInfo[1]); - } - } - else - { - //Since the project and the EAR are both new, try changing the J2EE level - boolean foundServer = false; - WebServiceRuntimeInfo wsrt = WebServiceRuntimeExtensionUtils.getWebServiceRuntimeById(serviceIds_.getRuntimeId()); - if (wsrt != null) - { - String[] versions = wsrt.getJ2eeLevels(); - if (versions != null && versions.length > 0) - { - for (int k=0; k<versions.length; k++) - { - //If this J2EE version is different from the current one, see if there is - //a server available. - if (serviceJ2EEVersion_!=versions[k]) - { - String[] si = ServerSelectionUtils.getServerFromWebServceRuntimeAndJ2EE(serviceIds_.getRuntimeId(), versions[k]); - if (si!=null) - { - if (si[0]!=null && si[0].length()>0) - { - serviceIds_.setServerId(si[0]); - } - if (si[1]!=null && si[1].length()>0) - { - serviceIds_.setServerInstanceId(si[1]); - } - serviceJ2EEVersion_ = versions[k]; - foundServer = true; - break; - } - - } - } - } - } - //No valid server runtimes appear to be configured, this is an error condition. - if (!foundServer) - { - String runtimeLabel = WebServiceRuntimeExtensionUtils.getRuntimeLabelById(serviceIds_.getRuntimeId()); - String serverLabels = getServerLabels(serviceIds_.getRuntimeId()); - status = StatusUtils.errorStatus( msgUtils_.getMessage("MSG_ERROR_NO_SERVER_RUNTIME", new String[]{runtimeLabel, serverLabels}) ); - } - - } - } - - } - - return status; - } - - - private void updateServiceEARs() - { - //Set EAR selection to null if the project/server defaults imply an EAR should not be created - String serviceProjectName = getServiceProject2EARProject().getList().getSelection(); - IProject serviceProject = FileResourceUtils.getWorkspaceRoot().getProject(serviceProjectName); - if (serviceProject != null && serviceProject.exists()) - { - //Get the runtime target on the serviceProject - IRuntime serviceTarget = ServerSelectionUtils.getRuntimeTarget(serviceProjectName); - String j2eeVersion = String.valueOf(J2EEUtils.getJ2EEVersion(serviceProject, serviceComponentName_)); - if (serviceTarget != null) - { - if (!ServerUtils.isTargetValidForEAR(serviceTarget.getRuntimeType().getId(),j2eeVersion)) - { - //Default the EAR selection to be empty - getServiceProject2EARProject().getChoice().getList().setIndex(-1); - serviceEarComponentName_ = ""; - serviceNeedEAR_ = false; - } - - } - } - else - { - String serverId = serviceIds_.getServerId(); - if (serverId != null) - { - //Use the server type - String serverTargetId = ServerUtils.getRuntimeTargetIdFromFactoryId(serverId); - if (serverTargetId!=null && serverTargetId.length()>0) - { - if (!ServerUtils.isTargetValidForEAR(serverTargetId,serviceJ2EEVersion_)) - { - //Default the EAR selection to be empty - getServiceProject2EARProject().getChoice().getList().setIndex(-1); - serviceEarComponentName_ = ""; - serviceNeedEAR_ = false; - } - } - } - } - - - } - public void setInitialSelection(IStructuredSelection selection) - { - } - - public void setInitialProject(IProject initialProject) - { - initialProject_ = initialProject; - } - - public void setInitialComponentName(String name) - { - initialComponentName_ = name; - } - - public void setServiceTypeRuntimeServer( TypeRuntimeServer ids ) - { - serviceIds_ = ids; - } - - public TypeRuntimeServer getServiceTypeRuntimeServer() - { - return serviceIds_; - } - - public SelectionListChoices getServiceProject2EARProject() - { - if (serviceProject2EARProject_ == null) - { - // rskreg - //IProject[] projects = WebServiceServerRuntimeTypeRegistry.getInstance().getProjectsByWebServiceType(serviceIds_.getTypeId()); - //Populate the list with all the projects in the workspace except Servers and ones that start with "." - // rskreg - String[] projectNames = getAllFlexibleProjects(); - SelectionList list = new SelectionList(projectNames, 0); - Vector choices = new Vector(); - for (int i = 0; i < projectNames.length; i++) { - IProject project = ProjectUtilities.getProject(projectNames[i]); - choices.add(getProjectEARChoice(project)); - } - serviceProject2EARProject_ = new SelectionListChoices(list, choices, getEARProjects()); - } - return serviceProject2EARProject_; - } - - /** - * @return Returns the generateProxy_. - */ - public boolean getGenerateProxy() - { - return generateProxy_; - } - /** - * @param generateProxy_ The generateProxy_ to set. - */ - public void setGenerateProxy(boolean generateProxy_) - { - this.generateProxy_ = generateProxy_; - } - - public String getServiceJ2EEVersion() - { - return serviceJ2EEVersion_; - } - - public String getServiceProjectName() - { - return getServiceProject2EARProject().getList().getSelection(); - } - - public String getServiceEarProjectName() - { - return getServiceProject2EARProject().getChoice().getList().getSelection(); - } - - public String getServiceComponentName() - { - return serviceComponentName_; - } - - public String getServiceEarComponentName() - { - return serviceEarComponentName_; - } - - public String getServiceComponentType() - { - return serviceComponentType_; - } - - public boolean getServiceNeedEAR() - { - return serviceNeedEAR_; - } - - /** - * Returns the first EAR for a given project - * @param project - * @return - */ - /* - private IProject getDefaultEARFromServiceProject(IProject project) - { - if (project!=null && project.exists()) - { - IServer[] configuredServers = ServerUtil.getServersByModule(ResourceUtils.getModule(project), null); - IServer firstSupportedServer = ServerSelectionUtils.getFirstSupportedServer(configuredServers, serviceIds_.getTypeId() ); - - EARNatureRuntime[] earProjects = J2EEUtils.getEARProjects(project, firstSupportedServer); - if (earProjects!=null && earProjects[0] instanceof EARNatureRuntime) - return earProjects[0].getProject(); - } - - int versionId = -1; - if (serviceJ2EEVersion_ != null && serviceJ2EEVersion_.length()>0) - { - versionId = Integer.parseInt(serviceJ2EEVersion_); - } - EARNatureRuntime newEAR = J2EEUtils.getEAR(versionId); - IProject earProject = ResourceUtils.getWorkspaceRoot().getProject(ResourceUtils.getDefaultServiceEARProjectName()); - - if (newEAR!=null) - earProject = newEAR.getProject(); - - return earProject; - } - */ - -}
\ No newline at end of file diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/LaunchFragment.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/LaunchFragment.java deleted file mode 100644 index 72e0589c1..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/LaunchFragment.java +++ /dev/null @@ -1,49 +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.creation.ui.widgets.test; - -import org.eclipse.wst.command.internal.env.core.fragment.BooleanFragment; -import org.eclipse.wst.command.internal.env.core.fragment.SimpleFragment; -import org.eclipse.wst.command.internal.provisional.env.core.common.Condition; -import org.eclipse.wst.ws.internal.explorer.WSExplorerLauncherCommand; - - -public class LaunchFragment extends BooleanFragment -{ - private boolean publishToPublicUDDI_; - private boolean publishToPrivateUDDI_; - - public LaunchFragment() - { - Condition condition = new Condition() - { - public boolean evaluate() - { - return (publishToPublicUDDI_ || publishToPrivateUDDI_); - } - }; - setCondition( condition ); - setTrueFragment( new SimpleFragment( new WSExplorerLauncherCommand(), "" ) ); - } - - public void setPublishToPublicUDDI(boolean publishToPublicUDDI) - { - publishToPublicUDDI_ = publishToPublicUDDI; - } - - public void setPublishToPrivateUDDI(boolean publishToPrivateUDDI) - { - publishToPrivateUDDI_ = publishToPrivateUDDI; - } - -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/ServiceTestFragment.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/ServiceTestFragment.java deleted file mode 100644 index 99d82143c..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/ServiceTestFragment.java +++ /dev/null @@ -1,78 +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.creation.ui.widgets.test; - -import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.WSDLTestLaunchCommand; -import org.eclipse.wst.command.internal.env.core.fragment.BooleanFragment; -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.provisional.env.core.common.Condition; -import org.eclipse.wst.command.internal.provisional.env.core.data.DataMappingRegistry; - - -public class ServiceTestFragment extends BooleanFragment -{ - private boolean testService; - private boolean generateProxy; - - - public ServiceTestFragment( String id ) - { - SequenceFragment testRoot = new SequenceFragment(); - Condition condition = new Condition() - { - public boolean evaluate() - { - return testService; - } - }; - setCondition( condition ); - - testRoot.add( new SimpleFragment( new WebServiceTestDefaultingCommand(), "" ) ); - testRoot.add( new SimpleFragment( id ) ); - setTrueFragment( testRoot ); - - } - - - public void registerDataMappings(DataMappingRegistry dataRegistry) - { - - dataRegistry.addMapping(WebServiceTestDefaultingCommand.class, "TestID",WSDLTestLaunchCommand.class); - - //from the wizard - dataRegistry.addMapping(ServiceTestWidget.class, "TestID",WSDLTestLaunchCommand.class); - dataRegistry.addMapping(WebServiceTestDefaultingCommand.class, "ExternalBrowser",WSDLTestLaunchCommand.class); - } - - public void setGenerateProxy(boolean generateProxy) - { - this.generateProxy = generateProxy; - } - - public boolean getGenerateProxy() - { - return generateProxy; - } - - /** - * @return Returns the testService. - */ - public void setTestService( boolean testService ) - { - this.testService = testService; - } - - - -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/ServiceTestWidget.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/ServiceTestWidget.java deleted file mode 100644 index f9d1a53d2..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/ServiceTestWidget.java +++ /dev/null @@ -1,172 +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.creation.ui.widgets.test; - -import java.util.List; -import java.util.Vector; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.test.WSDLTestLaunchCommand; -import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; -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.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; -import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.common.MessageUtils; -import org.eclipse.wst.command.internal.provisional.env.core.selection.SelectionList; - - -public class ServiceTestWidget extends SimpleWidgetDataContributor -{ - private String pluginId_ = "org.eclipse.jst.ws.consumption.ui"; - private String createPluginId_ = "org.eclipse.jst.ws.creation.ui"; - - private Combo testTypeCombo_; - /*CONTEXT_ID PSTP0001 for the Test Type Combo box of the Service Test Page*/ - private final String INFOPOP_PSTP_COMBOBOX_TEST = "PSTP0001"; - private final String TOOLTIP_PSTP_COMBOBOX_TEST = "TOOLTIP_PSTP_COMBOBOX_TEST"; - - private Button launchButton_; - /*CONTEXT_ID PSTP0002 for the launch button of the Service Test Page*/ - private final String INFOPOP_PSTP_LAUNCH_BUTTON = "PSTP0002"; - private final String TOOLTIP_PSTP_LAUNCH_BUTTON = "TOOLTIP_PSTP_LAUNCH_BUTTON"; - - private SelectionList facilities_; - - private String serviceServerInstanceId = null; - - public WidgetDataEvents addControls( Composite parent, Listener statusListener ) - { - MessageUtils msgUtils = new MessageUtils( pluginId_ + ".plugin", this ); - UIUtils uiUtils = new UIUtils(msgUtils, createPluginId_ ); - - Composite testComposite = uiUtils.createComposite( parent, 3, 0, 0 ); - - testTypeCombo_ = uiUtils.createCombo( testComposite, "LABEL_TEST_TYPES", - TOOLTIP_PSTP_COMBOBOX_TEST, - INFOPOP_PSTP_COMBOBOX_TEST, - SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY ); - - launchButton_ = uiUtils.createPushButton( testComposite, "BUTTON_LAUNCH_SERVICE_TEST", - TOOLTIP_PSTP_LAUNCH_BUTTON, - INFOPOP_PSTP_LAUNCH_BUTTON ); - launchButton_.addSelectionListener( new SelectionAdapter() - { - public void widgetSelected( SelectionEvent event ) - { - handleLaunchButton(); - } - }); - - - return this; - } - - private TypeRuntimeServer serviceids; - private String serverProject; - private String module; - private String wsdlURI; - private String launchedServiceTestName = ""; - private Environment env; - private List endpoints; - - private void handleLaunchButton() - { - // Split up the project and module - int p = serverProject.indexOf("/"); - if (p != -1){ - module = serverProject.substring(p+1); - serverProject = serverProject.substring(0,p); - } - - String testID = testTypeCombo_.getText(); - launchedServiceTestName = testID; - WSDLTestLaunchCommand wtlc = new WSDLTestLaunchCommand(); - wtlc.setTestID(testID); - wtlc.setServiceTypeRuntimeServer(serviceids); - wtlc.setServiceServerInstanceId(serviceServerInstanceId); - wtlc.setServerProject(serverProject); - wtlc.setServerModule(module); - wtlc.setWsdlURI(wsdlURI); - wtlc.setExternalBrowser(true); - wtlc.setEndpoint(endpoints); - wtlc.setEnvironment( env ); - wtlc.execute( null, null ); - } - - public void setServiceTestFacilities( SelectionList facilities ) - { - facilities_ = facilities; - testTypeCombo_.setItems( facilities.getList() ); - testTypeCombo_.select( facilities.getIndex() ); - } - - public SelectionList getServiceTestFacilities() - { - facilities_.setIndex( testTypeCombo_.getSelectionIndex() ); - return facilities_; - } - - public String getTestID() - { - return testTypeCombo_.getText(); - } - - public void setWsdlURI(String wsdlURI) - { - this.wsdlURI = wsdlURI; - } - - public void setServerProject(String serverProject) - { - this.serverProject = serverProject; - } - - public void setServiceTypeRuntimeServer(TypeRuntimeServer serviceids) - { - this.serviceids = serviceids; - } - - public String getLaunchedServiceTestName() - { - return launchedServiceTestName; - } - - public void setEnvironment(Environment env) - { - this.env = env; - } - - public void setEndpoint(String endpoint) - { - if (endpoint != null && endpoint.length() > 0) - { - Vector v = new Vector(); - v.add(endpoint); - setEndpoints(v); - } - } - - public void setEndpoints(List endpoints) - { - this.endpoints = endpoints; - } - - public void setServiceServerInstanceId(String ssInstanceId){ - this.serviceServerInstanceId = ssInstanceId; - } - -} diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/WebServiceTestDefaultingCommand.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/WebServiceTestDefaultingCommand.java deleted file mode 100644 index f09c0b78c..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/WebServiceTestDefaultingCommand.java +++ /dev/null @@ -1,104 +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 - *******************************************************************************/ -/* - * Created on Apr 15, 2004 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.eclipse.jst.ws.internal.creation.ui.widgets.test; - -import java.util.Enumeration; -import java.util.Vector; -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.context.ScenarioContext; -import org.eclipse.jst.ws.internal.ext.test.WebServiceTestExtension; -import org.eclipse.jst.ws.internal.ext.test.WebServiceTestRegistry; -import org.eclipse.jst.ws.internal.plugin.WebServicePlugin; -import org.eclipse.wst.command.internal.provisional.env.core.EnvironmentalOperation; -import org.eclipse.wst.command.internal.provisional.env.core.common.Environment; -import org.eclipse.wst.command.internal.provisional.env.core.selection.SelectionList; - - -/** - * @author gilberta - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -public class WebServiceTestDefaultingCommand extends EnvironmentalOperation -{ - - private SelectionList serviceTestFacilities; - private Environment environment; - private String testID; - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - Environment env = getEnvironment(); - - ScenarioContext scenarioContext = WebServicePlugin.getInstance().getScenarioContext().copy(); - testID = scenarioContext.getNonJavaTestService(); - String[] testTypes = scenarioContext.getWebServiceTestTypes(); - - - environment = env; - IStatus status = Status.OK_STATUS; - WebServiceTestRegistry wsttRegistry = WebServiceTestRegistry.getInstance(); - - - Vector wsdlNames = new Vector(); - for(int i =0 ;i<testTypes.length;i++){ - WebServiceTestExtension wscte = (WebServiceTestExtension)wsttRegistry.getWebServiceExtensionsByName(testTypes[i]); - if(wscte.testWSDL()){ - wsdlNames.addElement(testTypes[i]); - } - } - - String javaNamesArray[] = new String[wsdlNames.size()]; - Enumeration e = wsdlNames.elements(); - int i = 0; - while(e.hasMoreElements()){ - javaNamesArray[i] = (String)e.nextElement(); - i++; - } - - - serviceTestFacilities = new SelectionList(javaNamesArray,0); - - return status; - } - - public SelectionList getServiceTestFacilities() - { - return serviceTestFacilities; - } - - public String getTestID() - { - return testID; - } - - public Environment getEnvironment() - { - return environment; - } - - public boolean getExternalBrowser() - { - return false; - } - - -} |