diff options
Diffstat (limited to 'bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse')
26 files changed, 0 insertions, 4917 deletions
diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/CreationUI.properties b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/CreationUI.properties deleted file mode 100644 index 14c74bf2f..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/CreationUI.properties +++ /dev/null @@ -1,19 +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 -############################################################################### - -# -# 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/CreationUIMessages.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/CreationUIMessages.java deleted file mode 100644 index eb19e8bc6..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/CreationUIMessages.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.ws.internal.creation.ui; - -import org.eclipse.osgi.util.NLS; - -public final class CreationUIMessages extends NLS { - - private static final String BUNDLE_NAME = "org.eclipse.jst.ws.internal.creation.ui.CreationUI";//$NON-NLS-1$ - - private CreationUIMessages() { - // Do not instantiate - } - - public static String PAGE_TITLE_OBJECT_SELECTION; - public static String PAGE_DESC_OBJECT_SELECTION; - - static { - NLS.initializeMessages(BUNDLE_NAME, CreationUIMessages.class); - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/ant/AntServiceRootCommandFragment.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/ant/AntServiceRootCommandFragment.java deleted file mode 100644 index f26be7534..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/ant/AntServiceRootCommandFragment.java +++ /dev/null @@ -1,132 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner - *******************************************************************************/ -package org.eclipse.jst.ws.internal.creation.ui.ant; - -import org.eclipse.jst.ws.internal.consumption.common.ScenarioCleanupCommand; -import org.eclipse.jst.ws.internal.consumption.ui.command.AntDefaultingOperation; -import org.eclipse.jst.ws.internal.consumption.ui.command.ListOptionsCommand; -import org.eclipse.jst.ws.internal.consumption.ui.common.FinishFragment; -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.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.creation.ui.extension.PreServiceDevelopCommand; -import org.eclipse.jst.ws.internal.creation.ui.extension.ServiceRootFragment; -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.ServerRuntimeSelectionWidgetDefaultingCommand; -import org.eclipse.wst.command.internal.env.core.data.DataMappingRegistry; -import org.eclipse.wst.command.internal.env.core.fragment.SequenceFragment; -import org.eclipse.wst.command.internal.env.core.fragment.SimpleFragment; - -/** - * - * Command fragment for generating web service top down or bottom up using Ant task. - * Run headless Eclipse or within workspace using Run as Ant Build. This fragment eliminates any UI specific - * commands and data mappings between commands and widgets. Widget to command mappings are - * replaced by Ant property file to command mappings which are enabled by a antDataMapping extension - * point in the org.eclipse.wst.command.env plugin. - * - * @author joan - * - */ - -public class AntServiceRootCommandFragment extends SequenceFragment -{ - - public AntServiceRootCommandFragment() - { - add( new SimpleFragment( new ScenarioCleanupCommand(), "" )); - add( new SimpleFragment(new ListOptionsCommand(), "")); - add (new SimpleFragment(new AntDefaultingOperation(), "")); - add( new SimpleFragment( new ServerWizardWidgetDefaultingCommand(), "")); - add( new SimpleFragment( new ServerWizardWidgetOutputCommand(), "" )); - add( new ObjectSelectionFragment() ); - add( new SimpleFragment( new CheckWSDLValidationCommand(), "")); - add( new SimpleFragment( new ServerRuntimeSelectionWidgetDefaultingCommand(), "")); - add( new SimpleFragment( new ServerExtensionDefaultingCommand(), "")); - add( new ServiceRootFragment() ); - add( new SimpleFragment( new ServerExtensionOutputCommand(), "" )); - add(new FinishFragment()); - add( new SimpleFragment( new ScenarioCleanupCommand(), "" )); - } - - public void registerDataMappings(DataMappingRegistry dataRegistry) - { - 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 ); - - 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, "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, "GenerateProxy", ServerRuntimeSelectionWidgetDefaultingCommand.class); - - //Map AntDefaultingFragment - dataRegistry.addMapping(AntDefaultingOperation.class, "ServiceIdsFixed", ServerRuntimeSelectionWidgetDefaultingCommand.class); - dataRegistry.addMapping(AntDefaultingOperation.class, "ClientIdsFixed", ServerRuntimeSelectionWidgetDefaultingCommand.class); - dataRegistry.addMapping(AntDefaultingOperation.class, "StartService", PreServiceDevelopCommand.class); - dataRegistry.addMapping(AntDefaultingOperation.class, "InstallService", PreServiceDevelopCommand.class); - dataRegistry.addMapping(AntDefaultingOperation.class, "DeployService", PreServiceDevelopCommand.class); - - // Map ServerRuntimeSelectionWidgetDefaultingCommand - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceTypeRuntimeServer", 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, "ServiceJ2EEVersion", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceNeedEAR", ServerExtensionDefaultingCommand.class); - - - // Map ServerExtensionDefaultingCommand - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServiceTypeRuntimeServer", ServerExtensionFragment.class); - - // Setup the PreServiceDevelopCommand. - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "StartService", 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(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceRuntimeId", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping( ServerExtensionDefaultingCommand.class, "ServiceTypeRuntimeServer", PreServiceDevelopCommand.class ); - dataRegistry.addMapping( ServerExtensionDefaultingCommand.class, "ServiceRuntimeId", 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 ServerExtensionOutputCommand for ServerStart() - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "ServerProjectEAR", ServerExtensionOutputCommand.class, "EarProjectName", null); - - } - -} 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 90c375f00..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceAssembleCommand.java +++ /dev/null @@ -1,132 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060131 121071 rsinha@ca.ibm.com - Rupam Kuehner - * 20060330 128827 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ - -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.j2ee.internal.plugin.IJ2EEModuleConstants; -import org.eclipse.jst.ws.internal.consumption.command.common.AssociateModuleWithEARCommand; -import org.eclipse.jst.ws.internal.consumption.command.common.CreateFacetedProjectCommand; -import org.eclipse.jst.ws.internal.consumption.command.common.SkeletonMergeCommand; -import org.eclipse.jst.ws.internal.consumption.common.RequiredFacetVersion; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.ws.internal.wsrt.IContext; -import org.eclipse.wst.ws.internal.wsrt.IWebService; -import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario; - -public class PreServiceAssembleCommand extends AbstractDataModelOperation -{ - private IWebService webService_; - private String project_; - private String module_; - private String earProject_; - private String ear_; - private IContext context_; - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IEnvironment environment = getEnvironment(); - IStatus status; - - // For top down scenarios, merge the content of the skeleton files with the previous version stored. - // The Web service extensions triggers the storing of the content of the old skeleton file by - // calling WebServiceInfo.setImplURLs() before the new skeleton is generated in the extension's - // develop() method. - - if (context_.getScenario().getValue() == WebServiceScenario.TOPDOWN) { - SkeletonMergeCommand skeletonMergeCommand = new SkeletonMergeCommand(); - skeletonMergeCommand.setUrls(webService_.getWebServiceInfo().getImplURLs()); - skeletonMergeCommand.setEnvironment(environment); - status = skeletonMergeCommand.execute( monitor, adaptable ); - if (status.getSeverity() == Status.ERROR) { - environment.getStatusHandler().reportError(status); - return status; - } - } - - // Check if EAR module is req'd, ie. !=null - if (earProject_==null) - return Status.OK_STATUS; - - - - //Create the service EAR module - - CreateFacetedProjectCommand command = new CreateFacetedProjectCommand(); - command.setProjectName(earProject_); - command.setTemplateId(IJ2EEModuleConstants.JST_EAR_TEMPLATE); - - // RequiredFacetVersions is set to an empty array because we don't need to impose any additional constraints. - // We just want to create the highest level of EAR project that the selected server supports. - command.setRequiredFacetVersions(new RequiredFacetVersion[0]); - - command.setServerFactoryId(webService_.getWebServiceInfo().getServerFactoryId()); - command.setServerInstanceId(webService_.getWebServiceInfo().getServerInstanceId()); - status = command.execute( monitor, adaptable ); - 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 setWebService( IWebService webService ) - { - webService_ = webService; - } - - public void setContext (IContext context) { - context_ = context; - } -} 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 4e557598c..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceDeployCommand.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner - *******************************************************************************/ - -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.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.ws.internal.wsrt.IContext; - -public class PreServiceDeployCommand extends AbstractDataModelOperation -{ - private IContext context_; - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - if (context_.getDeploy()) - { - //If and when there are framework specific deploy things to be done, - //do them here. - } - - return Status.OK_STATUS; - } - - public void setContext(IContext context) - { - context_=context; - } -} diff --git a/bundles/org.eclipse.jst.ws.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 98380f851..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceDevelopCommand.java +++ /dev/null @@ -1,266 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060131 121071 rsinha@ca.ibm.com - Rupam Kuehner - * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner - *******************************************************************************/ - -package org.eclipse.jst.ws.internal.creation.ui.extension; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jst.ws.internal.consumption.command.common.CreateFacetedProjectCommand; -import org.eclipse.jst.ws.internal.consumption.common.FacetUtils; -import org.eclipse.jst.ws.internal.consumption.common.RequiredFacetVersion; -import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils2; -import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; -import org.eclipse.wst.command.internal.env.core.context.ResourceContext; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.ws.internal.wsrt.IContext; -import org.eclipse.wst.ws.internal.wsrt.ISelection; -import org.eclipse.wst.ws.internal.wsrt.IWebService; -import org.eclipse.wst.ws.internal.wsrt.IWebServiceRuntime; -import org.eclipse.wst.ws.internal.wsrt.SimpleContext; -import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo; -import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario; -import org.eclipse.wst.ws.internal.wsrt.WebServiceState; - -public class PreServiceDevelopCommand extends AbstractDataModelOperation -{ - private TypeRuntimeServer typeRuntimeServer_; - private String serviceRuntimeId_; - 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 deploy_; - private boolean install_; - private boolean run_; - private boolean client_; - private boolean test_; - private boolean publish_; - - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IEnvironment environment = getEnvironment(); - - // Split up the project and module - int index = module_.indexOf("/"); - if (index!=-1){ - project_ = module_.substring(0,index); - module_ = module_.substring(index+1); - } - - if (ear_!=null && ear_.length()>0) - { - int earIndex = ear_.indexOf("/"); - if (earIndex!=-1) { - earProject_ = ear_.substring(0,earIndex); - ear_ = ear_.substring(earIndex+1); - } - } - - - IWebServiceRuntime wsrt = WebServiceRuntimeExtensionUtils2.getServiceRuntime( serviceRuntimeId_ ); - WebServiceInfo wsInfo = new WebServiceInfo(); - - 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 = WebServiceRuntimeExtensionUtils2.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, deploy_, install_, run_, client_, test_, publish_, - scenario, - resourceContext_.isOverwriteFilesEnabled(), - resourceContext_.isCreateFoldersEnabled(), - resourceContext_.isCheckoutFilesEnabled()); - - IStatus status = Status.OK_STATUS; - - // Create the service module if needed. - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(project_); - if (!project.exists()) - { - boolean matches = WebServiceRuntimeExtensionUtils2.doesServiceRuntimeSupportTemplate(serviceRuntimeId_, moduleType_); - if (matches) - { - RequiredFacetVersion[] rfv = WebServiceRuntimeExtensionUtils2.getServiceRuntimeDescriptorById(serviceRuntimeId_).getRequiredFacetVersions(); - CreateFacetedProjectCommand command = new CreateFacetedProjectCommand(); - command.setProjectName(project_); - command.setTemplateId(moduleType_); - command.setRequiredFacetVersions(rfv); - command.setServerFactoryId(typeRuntimeServer_.getServerId()); - command.setServerInstanceId(typeRuntimeServer_.getServerInstanceId()); - status = command.execute( monitor, adaptable ); - if (status.getSeverity() == Status.ERROR) - { - environment.getStatusHandler().reportError( status ); - return status; - } - } - } - - //The project should now exist. Add facets if needed. - RequiredFacetVersion[] rfvs = WebServiceRuntimeExtensionUtils2.getServiceRuntimeDescriptorById(serviceRuntimeId_).getRequiredFacetVersions(); - status = FacetUtils.addRequiredFacetsToProject(project, rfvs, monitor); - if (status.getSeverity() == Status.ERROR) - { - environment.getStatusHandler().reportError( status ); - return status; - } - - return status; - } - - public void setServiceTypeRuntimeServer( TypeRuntimeServer typeRuntimeServer ) - { - typeRuntimeServer_ = typeRuntimeServer; - } - - public void setServiceRuntimeId(String id) - { - serviceRuntimeId_ = id; - } - - 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 setInstallService(boolean installService) - { - install_ = installService; - } - - public void setDeployService(boolean deployService) - { - deploy_ = deployService; - } - - 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 7bea4682b..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceInstallCommand.java +++ /dev/null @@ -1,116 +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.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.ws.internal.wsrt.IContext; -import org.eclipse.wst.ws.internal.wsrt.IWebService; - -public class PreServiceInstallCommand extends AbstractDataModelOperation -{ - private IWebService webService_; - private String project_; - private String module_; - private String earProject_; - private String ear_; - private IContext context_; - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - if (context_.getInstall()) - { - IEnvironment environment = getEnvironment(); - - 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; - } - return Status.OK_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; - } - - public void setContext(IContext context) - { - context_=context; - } - -} 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 b758bca54..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/PreServiceRunCommand.java +++ /dev/null @@ -1,59 +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.ui.command.StartServerCommand; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; -import org.eclipse.wst.ws.internal.wsrt.IContext; -import org.eclipse.wst.ws.internal.wsrt.IWebService; - -public class PreServiceRunCommand extends AbstractDataModelOperation -{ - private IWebService webService_; - private IContext context_; - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IStatus status = Status.OK_STATUS; - if (context_.getRun()) - { - IEnvironment environment = getEnvironment(); - - StartServerCommand command = new StartServerCommand(); - command.setServerInstanceId(webService_.getWebServiceInfo().getServerInstanceId()); - command.setEnvironment( environment ); - status = command.execute( monitor, null ); - if (status.getSeverity()==Status.ERROR) - { - environment.getStatusHandler().reportError(status); - } - } - - return status; - } - - public void setWebService( IWebService webService ) - { - webService_ = webService; - } - - public void setContext (IContext context) - { - context_ = context; - } - -} 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 2ab439ac4..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/extension/ServiceRootFragment.java +++ /dev/null @@ -1,120 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060131 121071 rsinha@ca.ibm.com - Rupam Kuehner - * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner - * 20060331 128827 kathy@ca.ibm.com - Kathy Chan - *******************************************************************************/ - -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.data.DataMappingRegistry; -import org.eclipse.wst.command.internal.env.core.fragment.SequenceFragment; -import org.eclipse.wst.command.internal.env.core.fragment.SimpleFragment; -import org.eclipse.wst.command.internal.env.ui.widgets.DataObjectCommand; -import org.eclipse.wst.ws.internal.extensions.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, "Context", PreServiceAssembleCommand.class ); - - registry.addMapping( PreServiceDevelopCommand.class, "Context", PreServiceDeployCommand.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, "Context", PreServiceInstallCommand.class ); - - registry.addMapping( PreServiceDevelopCommand.class, "WebService", PreServiceRunCommand.class ); - registry.addMapping( PreServiceDevelopCommand.class, "Context", 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 2a18e14d4..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/plugin/WebServiceCreationUIPlugin.java +++ /dev/null @@ -1,112 +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.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 -{ - - /** - * 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 0e6301405..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/preferences/ScenarioDefaultsPreferencePage.java +++ /dev/null @@ -1,151 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060417 136391 joan@ca.ibm.com - Joan Haggarty - *******************************************************************************/ -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); - - Composite page = utils.createComposite( parent, 1 ); - - serverWidget_ = new ServerWizardWidget( false, true ); - serverWidget_.addControls( page, new Listener() - { - public void handleEvent( Event evt ){} - } ); - initializeValues(); - serverWidget_.disableNonPreferenceWidgets(); - 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 ); - //jvh serverWidget_.setGenerateProxy( new Boolean(context.getGenerateProxy()) ); - serverWidget_.setPublishService( new Boolean(context.getLaunchWebServiceExplorer()) ); - serverWidget_.setInstallService( new Boolean(context.getInstallWebService()) ); - serverWidget_.setInstallClient( new Boolean(context.getInstallClient()) ); - serverWidget_.setStartService( new Boolean(context.getStartWebService()) ); - serverWidget_.setTestService( new Boolean(context.getTestWebService()) ); - serverWidget_.setMonitorService(new Boolean(context.getMonitorWebService())); - serverWidget_.setServiceGeneration(context.getGenerateWebService()); //jvh - serverWidget_.setClientGeneration(context.getGenerateClient()); //jvh - 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_.setPublishService( new Boolean(context.getLaunchWebServiceExplorerDefault()) ); - serverWidget_.setInstallService( new Boolean(context.getInstallWebServiceDefault()) ); - serverWidget_.setInstallClient( new Boolean(context.getInstallClientDefault()) ); - serverWidget_.setStartService( new Boolean(context.getStartWebServiceDefault()) ); - serverWidget_.setTestService( new Boolean(context.getTestWebServiceDefault()) ); - serverWidget_.setMonitorService(new Boolean(context.getMonitorWebServiceDefault())); - serverWidget_.setServiceGeneration(context.getGenerateWebServiceDefault()); //jvh - serverWidget_.setClientGeneration(context.getGenerateClientDefault()); //jvh - 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.setInstallWebService( serverWidget_.getInstallService().booleanValue() ); - context.setInstallClient( serverWidget_.getInstallClient().booleanValue() ); - context.setStartWebService( serverWidget_.getStartService().booleanValue() ); - context.setTestWebService( serverWidget_.getTestService().booleanValue() ); - context.setMonitorWebService(serverWidget_.getMonitorService().booleanValue()); - context.setGenerateWebService(serverWidget_.getServiceGeneration()); - context.setGenerateClient(serverWidget_.getClientGeneration()); - } - - 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 fc96c1c97..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/server/StartServerWidgetContributor.java +++ /dev/null @@ -1,55 +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.ConsumptionUIMessages; -import org.eclipse.jst.ws.internal.consumption.ui.server.StartServerWidget; -import org.eclipse.wst.command.internal.env.ui.widgets.INamedWidgetContributor; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetContributor; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetContributorFactory; -import org.eclipse.wst.server.core.IServer; - -public class StartServerWidgetContributor implements INamedWidgetContributor -{ - private IServer server_; - - public StartServerWidgetContributor( IServer server ) - { - server_ = server; - } - - public String getDescription() - { - return ConsumptionUIMessages.PAGE_DESC_WS_START_SERVER; - } - - public String getName() - { - return ""; - } - - public String getTitle() - { - return ConsumptionUIMessages.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 942845f6e..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/server/StartServerWidgetFactory.java +++ /dev/null @@ -1,64 +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.env.core.data.DataMappingRegistry; -import org.eclipse.wst.command.internal.env.ui.widgets.INamedWidgetContributor; -import org.eclipse.wst.command.internal.env.ui.widgets.INamedWidgetContributorFactory; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.server.core.ServerCore; -import org.eclipse.wst.ws.internal.wsrt.IContext; -import org.eclipse.wst.ws.internal.wsrt.IWebService; - -public class StartServerWidgetFactory implements INamedWidgetContributorFactory -{ - private IWebService webservice_; - private IContext context_; - - public INamedWidgetContributor getFirstNamedWidget() - { - IServer server = null; - - if( webservice_ != null && context_.getInstall()) - { - 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 ); - dataRegistry.addMapping( PreServiceDevelopCommand.class, "Context", StartServerWidgetFactory.class ); - } - - public void setWebService( IWebService webservice ) - { - webservice_ = webservice; - } - public void setContext ( IContext context ) - { - context_ = context; - } -} 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 cd31ab808..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidget.java +++ /dev/null @@ -1,1116 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060407 135415 rsinha@ca.ibm.com - Rupam Kuehner - * 20060407 135443 joan@ca.ibm.com - Joan Haggarty - * 20060410 135442 kathy@ca.ibm.com - Kathy Chan - * 20060410 135441 joan@ca.ibm.com - Joan Haggarty - * 20060410 135562 joan@ca.ibm.com - Joan Haggarty - * 20060411 136167 kathy@ca.ibm.com - Kathy Chan - * 20060417 136390/136391/136159 joan@ca.ibm.com - Joan Haggarty - *******************************************************************************/ -package org.eclipse.jst.ws.internal.creation.ui.widgets; - - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.jst.ws.internal.common.ResourceUtils; -import org.eclipse.jst.ws.internal.consumption.common.FacetUtils; -import org.eclipse.jst.ws.internal.consumption.ui.ConsumptionUIMessages; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.IObjectSelectionLaunchable; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.ProjectSelectionDialog; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.WebServiceClientTypeWidget; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.ObjectSelectionOutputCommand; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.ObjectSelectionRegistry; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.ObjectSelectionWidget; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ProjectSelectionWidget; -import org.eclipse.jst.ws.internal.consumption.ui.wizard.RuntimeServerSelectionDialog; -import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceImpl; -import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils2; -import org.eclipse.jst.ws.internal.context.ScenarioContext; -import org.eclipse.jst.ws.internal.creation.ui.plugin.WebServiceCreationUIPlugin; -import org.eclipse.jst.ws.internal.creation.ui.widgets.runtime.ServerRuntimeSelectionWidgetDefaultingCommand; -import org.eclipse.jst.ws.internal.data.LabelsAndIds; -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.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Scale; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.forms.HyperlinkGroup; -import org.eclipse.ui.forms.HyperlinkSettings; -import org.eclipse.ui.forms.events.HyperlinkEvent; -import org.eclipse.ui.forms.events.IHyperlinkListener; -import org.eclipse.ui.forms.widgets.Hyperlink; -import org.eclipse.ui.internal.Workbench; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.command.internal.env.core.context.ResourceContext; -import org.eclipse.wst.command.internal.env.ui.widgets.PageInfo; -import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; -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.WidgetDataEvents; -import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; -import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario; - -public class ServerWizardWidget extends SimpleWidgetDataContributor { - - //INFOPOPS - /* CONTEXT_ID WSWSCEN0001 for the Scenario Page */ - private String INFOPOP_WSWSCEN_PAGE = "WSWSCEN0001"; - /* CONTEXT_ID WSWSCEN0010 for the Web Service Type combo box of the Scenario Page */ - private String INFOPOP_WSWSCEN_COMBO_SERVICETYPE = "WSWSCEN0010"; - /* CONTEXT_ID WSWSCEN0014 for the monitor service checkbox of the Scenario page */ - private String INFOPOP_WSWSCEN_CHECKBOX_MONITOR_SERVICE = "WSWSCEN0014"; - /* CONTEXT_ID WSWSCEN0012 for the Launch UDDI check box of the Scenario Page */ - private String INFOPOP_WSWSCEN_CHECKBOX_LAUNCH_WS = "WSWSCEN0012"; - /* CONTEXT_ID WSWSCEN0020 for the Service Implemenation text field of the Scenario Page */ - private String INFOPOP_WSWSCEN_TEXT_SERVICE_IMPL = "WSWSCEN0020"; - /* CONTEXT_ID WSWSCEN0021 for theService Slider of the Scenario Page */ - private String INFOPOP_WSWSCEN_SCALE_SERVICE = "WSWSCEN0021"; - /* CONTEXT_ID WSWSCEN0022 for the Server hyperlink of the Scenario Page */ - private String INFOPOP_WSWSCEN_HYPERLINK_SERVER = "WSWSCEN0022"; - /* CONTEXT_ID WSWSCEN0023 for the Runtime hyperlink of the Scenario Page */ - private String INFOPOP_WSWSCEN_HYPERLINK_RUNTIME = "WSWSCEN0023"; - /* CONTEXT_ID WSWSCEN0024 for theProjects hyperlink of the Scenario Page */ - private String INFOPOP_WSWSCEN_HYPERLINK_PROJECTS = "WSWSCEN0024"; - /* CONTEXT_ID WSWSCEN0030 for the Overwrite Files checkbox of the Scenario Page */ - private String INFOPOP_WSWSCEN_CHECKBOX_OVERWRITE = "WSWSCEN0030"; - - private ScaleSelectionListener scaleSelectionListener = new ScaleSelectionListener(); - private Listener statusListener_; - - private ImageRegistry imageReg_; - - private TypeRuntimeServer ids_; - private LabelsAndIds labelIds_; - private String serviceProjectName_; - private String serviceEarProjectName_; - private String serviceComponentType_; - private WebServicesParser parser_; - private String serviceRuntimeId_; - private boolean needEar_; - - private IStructuredSelection objectSelection_; - private Boolean testService_; - private Boolean startService_; - private Boolean installService_; - - private boolean displayPreferences_; - private boolean preferencesPage_; - - private Composite groupComposite_; - private Composite hCompService_; - private WebServiceClientTypeWidget clientWidget_; - private Label serviceLabel_; - private Combo webserviceType_; - private Text serviceImpl_; - private Scale serviceScale_; - private Label topologySpot_; - private Button browseButton_; - private Button publishButton_; - private Button monitorButton_; - private Button overwriteButton_; - private ServiceImplSelectionDialog browseDialog_; - private ProjectSelectionDialog projectDialog_; - private Hyperlink hLinkServiceRuntime_; - private Hyperlink hLinkServiceServer_; - private Hyperlink hLinkServiceProject_; - private Hyperlink hLinkServiceEAR_; - - private Object objectSelectionWidget_; //may be IObjectSelectionLaunchable or IObjectSelectionWidget - - private ResourceContext resourceContext_; - - private String GRAPHIC_SERVICE_0="icons/service_test.jpg"; //$NON-NLS-N$ - private String GRAPHIC_SERVICE_1="icons/service_run.jpg"; //$NON-NLS-N$ - private String GRAPHIC_SERVICE_2="icons/service_install.jpg"; //$NON-NLS-N$ - private String GRAPHIC_SERVICE_3="icons/service_deploy.jpg"; //$NON-NLS-N$ - private String GRAPHIC_SERVICE_4="icons/service_assemble.jpg"; //$NON-NLS-N$ - private String GRAPHIC_SERVICE_5="icons/service_develop.jpg"; //$NON-NLS-N$ - - private String ICON_SCALE_BG_0="icons/scale0_bground.jpg"; //$NON-NLS-N$ - private String ICON_SCALE_BG_1="icons/scale1_bground.jpg"; //$NON-NLS-N$ - private String ICON_SCALE_BG_2="icons/scale2_bground.jpg"; //$NON-NLS-N$ - private String ICON_SCALE_BG_3="icons/scale3_bground.jpg"; //$NON-NLS-N$ - private String ICON_SCALE_BG_4="icons/scale4_bground.jpg"; //$NON-NLS-N$ - private String ICON_SCALE_BG_5="icons/scale5_bground.jpg"; //$NON-NLS-N$ - private String ICON_SCALE_BG_6="icons/scale6_bground.jpg"; //$NON-NLS-N$ - - private String SERVICE_RUNTIME_PREFIX = ConsumptionUIMessages.LABEL_RUNTIMES_LIST ; - private String SERVICE_SERVER_PREFIX = ConsumptionUIMessages.LABEL_SERVERS_LIST; - private String SERVICE_PROJECT_PREFIX = ConsumptionUIMessages.LABEL_SERVICE_PROJECT; - private String SERVICE_EAR_PREFIX = ConsumptionUIMessages.LABEL_SERVICE_EAR_PROJECT; - - /** - * @param displayPreferences Set to true if preferences such as overwrite should be displayed on the wizard page - * @param prefPage Set to true if the widget is being used on the preferences page. Alters widget layout. - */ - public ServerWizardWidget(boolean displayPreferences, boolean prefPage) { - displayPreferences_ = displayPreferences; - preferencesPage_ = prefPage; - initImageRegistry(); - } - - public WidgetDataEvents addControls(Composite parent, - Listener statusListener) { - - String createPluginId = "org.eclipse.jst.ws.creation.ui"; - UIUtils utils = new UIUtils(createPluginId); - statusListener_ = statusListener; - utils.createInfoPop(parent, INFOPOP_WSWSCEN_PAGE); - - Composite typeComposite = utils.createComposite(parent, 3); - - webserviceType_ = utils.createCombo(typeComposite, - ConsumptionUIMessages.LABEL_WEBSERVICETYPE, - ConsumptionUIMessages.TOOLTIP_PWPR_COMBO_TYPE, - INFOPOP_WSWSCEN_COMBO_SERVICETYPE, SWT.SINGLE | SWT.BORDER - | SWT.READ_ONLY); - GridData gdata1 = (GridData) webserviceType_.getLayoutData(); - gdata1.horizontalSpan = 2; - webserviceType_.setLayoutData(gdata1); - - webserviceType_.addSelectionListener(new SelectionListener(){ - public void widgetDefaultSelected(SelectionEvent e) {} - - public void widgetSelected(SelectionEvent e) { - objectSelectionWidget_ = getSelectionWidget(); - - //change the label for the service implementation/definition based on the web service type - handleTypeChange(); - } - }); - - webserviceType_.addListener(SWT.Modify, statusListener); - - // Create text field and browse for object selection if not on preferences page - if (!preferencesPage_) - { - //text of this label is based on the web service type selected in webserviceType_ combo - serviceLabel_ = new Label( typeComposite, SWT.WRAP); - serviceLabel_.setText(ConsumptionUIMessages.LABEL_WEBSERVICEIMPL); - serviceLabel_.setToolTipText(ConsumptionUIMessages.TOOLTIP_WSWSCEN_TEXT_IMPL); - - serviceImpl_ = new Text(typeComposite, SWT.LEFT | SWT.BORDER | SWT.READ_ONLY); - GridData griddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); - serviceImpl_.setLayoutData( griddata ); - serviceImpl_.setToolTipText(ConsumptionUIMessages.TOOLTIP_WSWSCEN_TEXT_IMPL); - utils.createInfoPop(serviceImpl_, INFOPOP_WSWSCEN_TEXT_SERVICE_IMPL); - - browseButton_ = utils.createPushButton(typeComposite, - ConsumptionUIMessages.BUTTON_BROWSE, ConsumptionUIMessages.TOOLTIP_WSWSCEN_BUTTON_BROWSE_IMPL, null); - - browseDialog_ = new ServiceImplSelectionDialog(Workbench.getInstance().getActiveWorkbenchWindow().getShell(), - new PageInfo(ConsumptionUIMessages.DIALOG_TITILE_SERVICE_IMPL_SELECTION, "", - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new ObjectSelectionWidget(); - } - })); - browseButton_.addSelectionListener(new ServiceImplBrowseListener()); - browseButton_.addListener(SWT.Modify, statusListener); - } - - // Service Lifecycle section - scales for service & client, graphic - - groupComposite_ = new Composite(parent, SWT.NONE); - GridLayout gclayout = new GridLayout(); - gclayout.numColumns = 2; - gclayout.horizontalSpacing=0; - gclayout.marginHeight=0; - gclayout.marginBottom=5; - groupComposite_.setLayout( gclayout ); - GridData gcGridData = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true); - groupComposite_.setLayoutData(gcGridData); - - Composite serviceComposite = new Composite(groupComposite_, SWT.NONE); - GridLayout gridlayout = new GridLayout(); - gridlayout.numColumns = 2; - gridlayout.horizontalSpacing=0; - gridlayout.marginHeight=0; - serviceComposite.setLayout( gridlayout ); - GridData scGridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); - serviceComposite.setLayoutData(scGridData); - - serviceComposite.setToolTipText(ConsumptionUIMessages.TOOLTIP_WSWSCEN_SCALE_SERVICE); - - - serviceScale_ = new Scale(serviceComposite, SWT.VERTICAL | SWT.BORDER | SWT.CENTER); - utils.createInfoPop(serviceScale_, INFOPOP_WSWSCEN_SCALE_SERVICE); - serviceScale_.setMinimum(0); - serviceScale_.setMaximum(6); - serviceScale_.setIncrement(1); - serviceScale_.addSelectionListener(scaleSelectionListener); - serviceScale_.setSelection(getServiceGeneration()); - serviceScale_.setToolTipText(ConsumptionUIMessages.TOOLTIP_WSWSCEN_SCALE_SERVICE); - - GridData layoutData1 = new GridData(); - layoutData1.horizontalAlignment=SWT.BEGINNING; - layoutData1.verticalAlignment = SWT.BEGINNING; - Rectangle scaleR = (imageReg_.get(ICON_SCALE_BG_0)).getBounds(); - layoutData1.heightHint=scaleR.height; - layoutData1.widthHint=scaleR.width; - serviceScale_.setLayoutData(layoutData1); - - topologySpot_ = new Label(serviceComposite, SWT.BORDER | SWT.TOP ); - topologySpot_.setBackground(new Color(Display.getCurrent(), 255, 255, 255)); - topologySpot_.setToolTipText(ConsumptionUIMessages.TOOLTIP_WSWSCEN_SCALE_SERVICE); - - GridData layoutData2 = new GridData(); - layoutData2.horizontalAlignment=SWT.BEGINNING; - layoutData2.verticalAlignment = SWT.BEGINNING; - Rectangle topR = (imageReg_.get(GRAPHIC_SERVICE_0)).getBounds(); - layoutData2.heightHint=topR.height; - layoutData2.widthHint=topR.width; - topologySpot_.setLayoutData(layoutData2); - - setGraphics(getServiceGeneration()); - - hCompService_ = utils.createComposite(groupComposite_, 1); - - Label serviceDetailsLabel = new Label(hCompService_, SWT.NONE); - serviceDetailsLabel.setText(ConsumptionUIMessages.LABEL_SUMMARY); - - hLinkServiceServer_= new Hyperlink(hCompService_, SWT.NULL); - utils.createInfoPop(hLinkServiceServer_, INFOPOP_WSWSCEN_HYPERLINK_SERVER); - hLinkServiceServer_.setToolTipText(ConsumptionUIMessages.TOOLTIP_PWRS_TEXT_SERVER); - hLinkServiceServer_.addHyperlinkListener(new IHyperlinkListener(){ - public void linkActivated(HyperlinkEvent e){ - launchRuntimeSelectionDialog(false); - } - public void linkEntered(HyperlinkEvent e){} - public void linkExited(HyperlinkEvent e){} - }); - - hLinkServiceRuntime_ = new Hyperlink(hCompService_, SWT.NULL); - utils.createInfoPop(hLinkServiceRuntime_, INFOPOP_WSWSCEN_HYPERLINK_RUNTIME); - hLinkServiceRuntime_.setToolTipText(ConsumptionUIMessages.TOOLTIP_PWRS_TEXT_RUNTIME); - hLinkServiceRuntime_.addHyperlinkListener(new IHyperlinkListener(){ - public void linkActivated(HyperlinkEvent e){ - launchRuntimeSelectionDialog(false); - } - public void linkEntered(HyperlinkEvent e){} - public void linkExited(HyperlinkEvent e){} - }); - - projectDialog_ = new ProjectSelectionDialog(Workbench.getInstance().getActiveWorkbenchWindow().getShell(), - new PageInfo(ConsumptionUIMessages.DIALOG_TITILE_SERVICE_PROJECT_SETTINGS, "", - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new ProjectSelectionWidget(); - } - })); - - hLinkServiceProject_= new Hyperlink(hCompService_, SWT.NULL); - utils.createInfoPop(hLinkServiceRuntime_, INFOPOP_WSWSCEN_HYPERLINK_PROJECTS); - hLinkServiceProject_.setToolTipText(ConsumptionUIMessages.TOOLTIP_WSWSCEN_SERVICEPROJECT_LINK); - hLinkServiceProject_.addHyperlinkListener(new IHyperlinkListener(){ - public void linkActivated(HyperlinkEvent e){ - launchProjectDialog(); - } - public void linkEntered(HyperlinkEvent e){} - public void linkExited(HyperlinkEvent e){} - }); - - hLinkServiceEAR_= new Hyperlink(hCompService_, SWT.NULL); - utils.createInfoPop(hLinkServiceRuntime_, INFOPOP_WSWSCEN_HYPERLINK_PROJECTS); - hLinkServiceEAR_.setToolTipText(ConsumptionUIMessages.TOOLTIP_WSWSCEN_SERVICEPROJECT_LINK); - hLinkServiceEAR_.addHyperlinkListener(new IHyperlinkListener(){ - public void linkActivated(HyperlinkEvent e){ - launchProjectDialog(); - } - public void linkEntered(HyperlinkEvent e){} - public void linkExited(HyperlinkEvent e){} - }); - - hLinkServiceServer_.setText(SERVICE_SERVER_PREFIX); - hLinkServiceRuntime_.setText(SERVICE_RUNTIME_PREFIX); - hLinkServiceProject_.setText(SERVICE_PROJECT_PREFIX); - hLinkServiceEAR_.setText(SERVICE_EAR_PREFIX); - - HyperlinkGroup serverRuntimeGroup = new HyperlinkGroup(Display.getCurrent()); - - serverRuntimeGroup.add(hLinkServiceServer_); - serverRuntimeGroup.add(hLinkServiceRuntime_); - serverRuntimeGroup.add(hLinkServiceProject_); - serverRuntimeGroup.add(hLinkServiceEAR_); - serverRuntimeGroup.setHyperlinkUnderlineMode(HyperlinkSettings.UNDERLINE_ALWAYS); - - utils.createHorizontalSeparator(parent, 1); - - // Add client widgets... - clientWidget_ = new WebServiceClientTypeWidget(false); - clientWidget_.addControls(parent, statusListener ); - clientWidget_.enableClientSlider(serviceScale_.getSelection()<=ScenarioContext.WS_START); - - // Advanced buttons section - utils.createHorizontalSeparator(parent, 3); - - Composite advancedButtonPanel = utils.createComposite(parent, 1); - - publishButton_ = utils.createCheckbox(advancedButtonPanel, - ConsumptionUIMessages.BUTTON_WSWSCEN_PUBLISH, ConsumptionUIMessages.TOOLTIP_PWPR_CHECKBOX_LAUNCH_WS, INFOPOP_WSWSCEN_CHECKBOX_LAUNCH_WS); - monitorButton_ = utils.createCheckbox(advancedButtonPanel, - ConsumptionUIMessages.CHECKBOX_MONITOR_WEBSERVICE, ConsumptionUIMessages.TOOLTIP_PWPR_CHECKBOX_MONITOR_SERVICE, INFOPOP_WSWSCEN_CHECKBOX_MONITOR_SERVICE); - - if (displayPreferences_ && getResourceContext().isOverwriteFilesEnabled()) { - utils.createHorizontalSeparator(parent, 1); - Composite prefButtonPanel = utils.createComposite(parent, 1); - overwriteButton_ = utils.createCheckbox(prefButtonPanel, - ConsumptionUIMessages.CHECKBOX_OVERWRITE_FILES, ConsumptionUIMessages.TOOLTIP_WSWSCEN_BUTTON_OVERWRITE_FILES, INFOPOP_WSWSCEN_CHECKBOX_OVERWRITE); - overwriteButton_.setSelection(getResourceContext() - .isOverwriteFilesEnabled()); - } - - return this; - } - - private void launchProjectDialog() - { - projectDialog_.setProjectName(getServiceProjectName()); - projectDialog_.setEarProjectName(getServiceEarProjectName()); - projectDialog_.setProjectComponentType(getServiceComponentType()); - projectDialog_.setNeedEAR(getServiceNeedEAR()); - - int status = projectDialog_.open(); - if (status == Window.OK) - { - setServiceProjectName(projectDialog_.getProjectName()); - setServiceEarProjectName(projectDialog_.getEarProjectName()); - setServiceComponentType(projectDialog_.getProjectComponentType()); - setServiceNeedEAR(projectDialog_.getNeedEAR()); - refreshClientServerRuntimeSelection(); - } - } - - private void launchRuntimeSelectionDialog(boolean clientContext) - { - byte mode = clientContext ? (byte)1 : (byte)0; - - //TODO: jvh - investigate - don't think j2ee version shouldn't be hard coded (last parm) - // question - where to pick it up from? - RuntimeServerSelectionDialog rssd = new RuntimeServerSelectionDialog( - Workbench.getInstance().getActiveWorkbenchWindow().getShell(), mode, getServiceTypeRuntimeServer(), "14"); - int result = rssd.open(); - if (result == Window.OK) - { - setServiceTypeRuntimeServer(rssd.getTypeRuntimeServer()); - refreshClientServerRuntimeSelection(); - } - } - - public void setClientTypeRuntimeServer(TypeRuntimeServer ids) { - clientWidget_.setTypeRuntimeServer( ids ); - } - - public TypeRuntimeServer getClientTypeRuntimeServer() { - return clientWidget_.getTypeRuntimeServer(); - } - - public void setInstallClient(Boolean install) { - clientWidget_.setInstallClient( install ); - } - - public Boolean getInstallClient() { - return clientWidget_.getInstallClient(); - } - - private void handleTypeChange() - { - int index = webserviceType_.getSelectionIndex(); - String typeId = labelIds_.getIds_()[index]; - int scenario = WebServiceRuntimeExtensionUtils2.getScenarioFromTypeId(typeId); - - if (scenario == WebServiceScenario.BOTTOMUP) - { - serviceLabel_.setText(ConsumptionUIMessages.LABEL_WEBSERVICEIMPL); - } - else if (scenario == WebServiceScenario.TOPDOWN) - { - serviceLabel_.setText(ConsumptionUIMessages.LABEL_WEBSERVICEDEF); - } - } - - public void setServiceTypeRuntimeServer(TypeRuntimeServer ids) { - LabelsAndIds labelIds = WebServiceRuntimeExtensionUtils2 - .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; - - if (ids_ != null) - { - String serviceServerText = WebServiceRuntimeExtensionUtils2.getServerLabelById(ids_.getServerId()); - String serviceRuntimeText = WebServiceRuntimeExtensionUtils2.getRuntimeLabelById(ids_.getRuntimeId()); - hLinkServiceServer_.setText(SERVICE_SERVER_PREFIX + " " + serviceServerText); - hLinkServiceRuntime_.setText(SERVICE_RUNTIME_PREFIX + " " + serviceRuntimeText); - groupComposite_.pack(true); - } - - labelIds_ = labelIds; - handleTypeChange(); - - if (projectDialog_ != null) - projectDialog_.setTypeRuntimeServer(ids_); - } - - public TypeRuntimeServer getServiceTypeRuntimeServer() { - int selectionIndex = webserviceType_.getSelectionIndex(); - - ids_.setTypeId(labelIds_.getIds_()[selectionIndex]); - - return ids_; - } - - public void setServiceGeneration(int value) - { - serviceScale_.setSelection(value); - setGraphics(value); - setTestService(new Boolean(value <= ScenarioContext.WS_TEST)); - setInstallService(new Boolean(value <= ScenarioContext.WS_INSTALL)); - setStartService(new Boolean(value <= ScenarioContext.WS_START)); - //enable client widget based on service scale setting - clientWidget_.enableClientSlider(value<=ScenarioContext.WS_START); - } - - public int getServiceGeneration() - { - return serviceScale_.getSelection(); - } - - public Boolean getStartService(){ - return startService_; - } - - public void setStartService(Boolean value) { - startService_=value; - } - - public Boolean getInstallService() { - return installService_; - } - - public void setInstallService(Boolean value) { - installService_=value; - } - - public Boolean getTestService() { - return - new Boolean(testService_.booleanValue() || clientWidget_.getTestClient().booleanValue()); - } - - public void setTestService(Boolean value) { - testService_= value; - } - public Boolean getMonitorService() { - return new Boolean(monitorButton_.getSelection()); - } - - public void setMonitorService(Boolean value) { - monitorButton_.setSelection(value.booleanValue()); - } - - public Boolean getPublishService() { - return new Boolean(publishButton_.getSelection()); - } - - public void setPublishService(Boolean value) { - publishButton_.setSelection( value.booleanValue() ); - } - - public Boolean getGenerateProxy() { - int clientSelection = clientWidget_.getClientGeneration(); - if (clientSelection <= ScenarioContext.WS_DEVELOP) - return new Boolean(true); - return new Boolean(false); - } - - public void setClientGeneration(int value) - { - clientWidget_.setClientGeneration(value); - } - - public String getClientEarProjectName() - { - return clientWidget_.getClientEarProjectName(); - } - - public String getClientProjectName() - { - return clientWidget_.getClientProjectName(); - } - - public int getClientGeneration() - { - return clientWidget_.getClientGeneration(); - } - - public ResourceContext getResourceContext() { - if (resourceContext_ == null) { - resourceContext_ = WebServicePlugin.getInstance() - .getResourceContext(); - } - return resourceContext_; - } - - public void setResourceContext(ResourceContext context) { - resourceContext_ = context; - } - - public IStructuredSelection getObjectSelection() - { - return objectSelection_; - } - - - public void setObjectSelection(IStructuredSelection selection ) - { - objectSelection_ = selection; - if (selection != null && selection.size()==1) - { - //Update the serviceImpl_ field. - Object[] selectionArray = selection.toArray(); - Object selectedObject = selectionArray[0]; - if (selectedObject instanceof String) - { - serviceImpl_.setText((String)selectedObject); - } - } - - } - - public WebServicesParser getWebServicesParser() - { - return parser_; - } - - public void setWebServicesParser(WebServicesParser parser) - { - parser_ = parser; - clientWidget_.setWebServicesParser(parser); - } - - public void internalize() { - } - - 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. - - //TODO: jvh - need to add base object plus minimum service gen to the requirements for the page... - if (webserviceType_.getText().equals("")) { - status = StatusUtils.errorStatus(""); - } - - return status; - } - - protected void initImageRegistry() - { - imageReg_ = new ImageRegistry(Display.getCurrent()); - - imageReg_.put(ICON_SCALE_BG_0, WebServiceCreationUIPlugin - .getImageDescriptor(ICON_SCALE_BG_0)); - imageReg_.put(ICON_SCALE_BG_1, WebServiceCreationUIPlugin - .getImageDescriptor(ICON_SCALE_BG_1)); - imageReg_.put(ICON_SCALE_BG_2, WebServiceCreationUIPlugin - .getImageDescriptor(ICON_SCALE_BG_2)); - imageReg_.put(ICON_SCALE_BG_3, WebServiceCreationUIPlugin - .getImageDescriptor(ICON_SCALE_BG_3)); - imageReg_.put(ICON_SCALE_BG_4, WebServiceCreationUIPlugin - .getImageDescriptor(ICON_SCALE_BG_4)); - imageReg_.put(ICON_SCALE_BG_5, WebServiceCreationUIPlugin - .getImageDescriptor(ICON_SCALE_BG_5)); - imageReg_.put(ICON_SCALE_BG_6, WebServiceCreationUIPlugin - .getImageDescriptor(ICON_SCALE_BG_6)); - - imageReg_.put(GRAPHIC_SERVICE_0, WebServiceCreationUIPlugin - .getImageDescriptor(GRAPHIC_SERVICE_0)); - imageReg_.put(GRAPHIC_SERVICE_1, WebServiceCreationUIPlugin - .getImageDescriptor(GRAPHIC_SERVICE_1)); - imageReg_.put(GRAPHIC_SERVICE_2, WebServiceCreationUIPlugin - .getImageDescriptor(GRAPHIC_SERVICE_2)); - imageReg_.put(GRAPHIC_SERVICE_3, WebServiceCreationUIPlugin - .getImageDescriptor(GRAPHIC_SERVICE_3)); - imageReg_.put(GRAPHIC_SERVICE_4, WebServiceCreationUIPlugin - .getImageDescriptor(GRAPHIC_SERVICE_4)); - imageReg_.put(GRAPHIC_SERVICE_5, WebServiceCreationUIPlugin - .getImageDescriptor(GRAPHIC_SERVICE_5)); - } - - private void setAdvancedOptions(boolean enabled) - { - monitorButton_.setEnabled(enabled); - publishButton_.setEnabled(enabled); - } - - public void setServiceProjectName(String name) - { - serviceProjectName_= name; - hLinkServiceProject_.setText(SERVICE_PROJECT_PREFIX + " " + serviceProjectName_); - hLinkServiceProject_.pack(true); - } - - public void setServiceEarProjectName(String name) - { - serviceEarProjectName_ = name; - refreshEARLink(); - } - - public void refreshEARLink() - { - hLinkServiceEAR_.setVisible(needEar_); - if (needEar_) - { - hLinkServiceEAR_.setText(SERVICE_EAR_PREFIX + " " + serviceEarProjectName_); - hLinkServiceEAR_.pack(true); - } - } - public void setServiceComponentType( String type ) - { - serviceComponentType_ = type; - } - - public void setClientProjectName(String name) - { - clientWidget_.setClientProjectName(name); - } - - public void setClientEarProjectName(String name) - { - clientWidget_.setClientEarProjectName(name); - } - - String componentName_; - IProject project_; - - public void setComponentName(String name) - { - componentName_ = name; - } - - public String getComponentName() - { - return componentName_; - } - - public String getServiceComponentType() - { - return serviceComponentType_; - } - - public void setClientComponentType(String type) - { - clientWidget_.setClientComponentType(type); - } - - public String getClientComponentType() - { - return clientWidget_.getClientComponentType(); - } - - public String getServiceProjectName() - { - return serviceProjectName_; - } - - public String getServiceEarProjectName() - { - return serviceEarProjectName_; - } - - public void setClientProject(IProject project) - { - clientWidget_.setProject(project); - } - - private IProject getClientProject() - { - return clientWidget_.getProject(); - } - - public void setProject(IProject project) - { - project_ = project; - } - - public IProject getProject() - { - return project_; - } - - public void setServiceRuntimeId(String runtimeId) - { - serviceRuntimeId_ = runtimeId; - } - - public String getServiceRuntimeId() - { - return serviceRuntimeId_; - } - - public void setClientRuntimeId(String id) - { - clientWidget_.setClientRuntimeId(id); - } - - public String getClientRuntimeId() - { - return clientWidget_.getClientRuntimeId(); - } - - public void setServiceNeedEAR(boolean b) - { - needEar_ = b; - refreshEARLink(); - } - - public boolean getServiceNeedEAR() - { - return needEar_; - } - - public void setClientNeedEAR(boolean b) - { - clientWidget_.setClientNeedEAR(b); - } - - public boolean getClientNeedEAR() - { - return clientWidget_.getClientNeedEAR(); - } - - // looks through extensions and returns the appropriate selection widget - private Object getSelectionWidget() - { - String wst = getServiceTypeRuntimeServer().getTypeId(); - int scenario = WebServiceRuntimeExtensionUtils2.getScenarioFromTypeId(wst); - String implId = WebServiceRuntimeExtensionUtils2.getWebServiceImplIdFromTypeId(wst); - WebServiceImpl wsimpl = WebServiceRuntimeExtensionUtils2.getWebServiceImplById(implId); - - if (wsimpl != null) - { - String objectSelectionWidgetId = null; - if (scenario == WebServiceScenario.TOPDOWN) - { - objectSelectionWidgetId = "org.eclipse.jst.ws.internal.consumption.ui.widgets.object.WSDLSelectionWidget"; - } - else - { - objectSelectionWidgetId = wsimpl.getObjectSelectionWidget(); - } - - IConfigurationElement[] elements = ObjectSelectionRegistry.getInstance().getConfigurationElements(); - for (int i = 0; i < elements.length; i++) - { - if (objectSelectionWidgetId.equals(elements[i].getAttribute("id"))) - { - try - { - Object object = elements[i].createExecutableExtension("class"); - return object; - } - catch (Throwable t){ } - } - } - } - return null; - } - - // for the purposes of disabling the service implementation controls from the preferences dialog - public void disableNonPreferenceWidgets() - { - if (serviceImpl_ != null) - serviceImpl_.setEnabled(false); - if (browseButton_ != null) - browseButton_.setEnabled(false); - if (hCompService_ != null) - { - hCompService_.setVisible(false); - } - clientWidget_.disableNonPreferenceWidgets(); - } - - private void setGraphics(int value) - { - String iconImage = ""; - String toplogyImage = ""; - switch (value) { - case 0: - iconImage=ICON_SCALE_BG_0; - toplogyImage=GRAPHIC_SERVICE_0; - break; - case 1: - iconImage=ICON_SCALE_BG_1; - toplogyImage=GRAPHIC_SERVICE_1; - break; - case 2: - iconImage=ICON_SCALE_BG_2; - toplogyImage=GRAPHIC_SERVICE_2; - break; - case 3: - iconImage=ICON_SCALE_BG_3; - toplogyImage=GRAPHIC_SERVICE_3; - break; - case 4: - iconImage=ICON_SCALE_BG_4; - toplogyImage=GRAPHIC_SERVICE_4; - break; - case 5: - case 6: - iconImage=ICON_SCALE_BG_5; - toplogyImage=GRAPHIC_SERVICE_5; - break; - default: - break; - } - serviceScale_.setBackgroundImage(imageReg_.get(iconImage)); - topologySpot_.setImage(imageReg_.get(toplogyImage)); - } - - private void refreshServerRuntimeSelection() - { - //new up ServerRuntimeSelectionWidgetDefaultingCommand - ServerRuntimeSelectionWidgetDefaultingCommand serverRTDefaultCmd = new ServerRuntimeSelectionWidgetDefaultingCommand(); - - //call setters of new defaulting command: - serverRTDefaultCmd.setInitialSelection(getObjectSelection()); - serverRTDefaultCmd.setInitialProject(getProject()); - serverRTDefaultCmd.setInitialComponentName(getComponentName()); - serverRTDefaultCmd.setGenerateProxy(clientWidget_.getGenerateProxy()); - serverRTDefaultCmd.setServiceTypeRuntimeServer(getServiceTypeRuntimeServer()); - serverRTDefaultCmd.setWebServicesParser(getWebServicesParser()); - serverRTDefaultCmd.setClientInitialSelection(getObjectSelection()); - serverRTDefaultCmd.setClientInitialProject(getClientProject()); - serverRTDefaultCmd.setClientEarProjectName(clientWidget_.getClientEarProjectName()); - serverRTDefaultCmd.setClientTypeRuntimeServer(getClientTypeRuntimeServer()); - - serverRTDefaultCmd.execute(null, null); - - //perform mappings from the defaulting command to the project settings... - setServiceRuntimeId(serverRTDefaultCmd.getServiceRuntimeId()); - setServiceProjectName(serverRTDefaultCmd.getServiceProjectName()); - setServiceEarProjectName(serverRTDefaultCmd.getServiceEarProjectName()); - setServiceComponentType(serverRTDefaultCmd.getServiceComponentType()); - setClientProjectName(serverRTDefaultCmd.getClientProjectName()); - setClientEarProjectName(serverRTDefaultCmd.getClientEarProjectName()); - setServiceTypeRuntimeServer(serverRTDefaultCmd.getServiceTypeRuntimeServer()); - setClientTypeRuntimeServer(serverRTDefaultCmd.getClientTypeRuntimeServer()); - setServiceNeedEAR(serverRTDefaultCmd.getServiceNeedEAR()); - setClientNeedEAR(serverRTDefaultCmd.getClientNeedEAR()); - setClientRuntimeId(serverRTDefaultCmd.getClientRuntimeId()); - setClientComponentType(serverRTDefaultCmd.getClientComponentType()); - } - - /** - * Update client server and runtime based on service side - */ - private void refreshClientServerRuntimeSelection() - { - TypeRuntimeServer clientTypeRuntimeserver = getClientTypeRuntimeServer(); - clientTypeRuntimeserver.setRuntimeId(getServiceTypeRuntimeServer().getRuntimeId()); - clientTypeRuntimeserver.setServerId(getServiceTypeRuntimeServer().getServerId()); - clientTypeRuntimeserver.setServerInstanceId(getServiceTypeRuntimeServer().getServerInstanceId()); - setClientTypeRuntimeServer(clientTypeRuntimeserver); - setClientNeedEAR(clientProjectNeedEAR()); - } - - /** - * Check if client project need EAR based on service side, project and client type - */ - private boolean clientProjectNeedEAR() - { - // if client did not need EAR originally, check if it's because it's because - // either the project is Java utility project or type is Java utility - if (!getClientNeedEAR()) { - // If the project is a simple Java project or the project type is - // Java utility return false. - String projectName = getClientProjectName(); - if (projectName != null && projectName.length()>0) - { - IProject project = ResourceUtils.getWorkspaceRoot().getProject(projectName); - if (project.exists()) - { - if (FacetUtils.isJavaProject(project)) - { - return false; - } - } - } - - //Project didn't rule out the need for an EAR - //so check the project type - String templateId = getClientComponentType(); - if (templateId != null && templateId.length()>0) - { - if (FacetUtils.isUtilityTemplate(templateId)) - { - return false; - } - } - } // end of !clientNeedEAR - - // have clientNeedEAR follows server side - return getServiceNeedEAR(); - - } - private class ScaleSelectionListener implements SelectionListener - { - public void widgetSelected(SelectionEvent e) { - - Scale scale = (Scale)e.widget; - int selection = scale.getSelection(); - - setTestService(new Boolean(selection <= ScenarioContext.WS_TEST)); - setInstallService(new Boolean(selection <= ScenarioContext.WS_INSTALL)); - setStartService(new Boolean(selection <= ScenarioContext.WS_START)); - setAdvancedOptions(selection <= ScenarioContext.WS_INSTALL); - clientWidget_.enableClientSlider(selection <= ScenarioContext.WS_START); - - setGraphics(selection); - - switch (selection) { - case 0: - serviceScale_.setToolTipText(ConsumptionUIMessages.TOOLTIP_WSWSCEN_SCALE_TEST); - break; - case 1: - serviceScale_.setToolTipText(ConsumptionUIMessages.TOOLTIP_WSWSCEN_SCALE_RUN); - break; - case 2: - serviceScale_.setToolTipText(ConsumptionUIMessages.TOOLTIP_WSWSCEN_SCALE_INSTALL); - break; - case 3: - serviceScale_.setToolTipText(ConsumptionUIMessages.TOOLTIP_WSWSCEN_SCALE_DEPLOY); - break; - case 4: - serviceScale_.setToolTipText(ConsumptionUIMessages.TOOLTIP_WSWSCEN_SCALE_ASSEMBLE); - break; - case 5: - case 6: - scale.setSelection(5); //"no selection" is not allowed...must develop service @ minimum - serviceScale_.setToolTipText(ConsumptionUIMessages.TOOLTIP_WSWSCEN_SCALE_DEVELOP); - break; - default: - break; - } - } - - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - } - } - - private class ServiceImplBrowseListener implements SelectionListener - { - public void widgetDefaultSelected(SelectionEvent e) { - // TODO Auto-generated method stub - } - - public void widgetSelected(SelectionEvent e) { - - if (objectSelectionWidget_ == null) - objectSelectionWidget_ = getSelectionWidget(); - - ObjectSelectionOutputCommand objOutputCommand = new ObjectSelectionOutputCommand(); - IStructuredSelection objectSelection = null; - IProject project = null; - String componentName=""; - int result=Dialog.CANCEL; - - if (objectSelectionWidget_ instanceof IObjectSelectionLaunchable) - { - IObjectSelectionLaunchable launchable = ((IObjectSelectionLaunchable)objectSelectionWidget_); - launchable.setInitialSelection(getObjectSelection()); - result = launchable.launch(Workbench.getInstance().getActiveWorkbenchWindow().getShell()); - if (result == Dialog.OK) - { - serviceImpl_.setText(launchable.getObjectSelectionDisplayableString()); - objectSelection = launchable.getObjectSelection(); - project = launchable.getProject(); - componentName= launchable.getComponentName(); - } - } - else - { - browseDialog_.setTypeRuntimeServer(getServiceTypeRuntimeServer()); - browseDialog_.setInitialSelection(getObjectSelection()); - result = browseDialog_.open(); - if (result == Dialog.OK) - { - serviceImpl_.setText(browseDialog_.getDisplayableSelectionString()); - objectSelection = browseDialog_.getObjectSelection(); - project = browseDialog_.getProject(); - componentName= browseDialog_.getComponentName(); - } - } - - // call ObjectSelectionOutputCommand to carry out any transformation on the objectSelection - if (result == Dialog.OK) - { - objOutputCommand.setTypeRuntimeServer(getServiceTypeRuntimeServer()); - objOutputCommand.setObjectSelection(objectSelection); - objOutputCommand.setProject(project); - objOutputCommand.setComponentName(componentName); - - objOutputCommand.execute(null, null); - - setWebServicesParser(objOutputCommand.getWebServicesParser()); - setObjectSelection(objOutputCommand.getObjectSelection()); - setComponentName(objOutputCommand.getComponentName()); - setProject(objOutputCommand.getProject()); - refreshServerRuntimeSelection(); - } - } - } -} - 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 f9b89330e..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidgetDefaultingCommand.java +++ /dev/null @@ -1,139 +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.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jst.ws.internal.common.ResourceUtils; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.ClientWizardWidgetDefaultingCommand; -import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils2; -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 = WebServiceRuntimeExtensionUtils2.getDefaultRuntimeValueFor( type ); - - String factoryID = WebServiceRuntimeExtensionUtils2.getDefaultServerValueFor(type); - typeRuntimeServer_ = new TypeRuntimeServer(); - - typeRuntimeServer_.setTypeId( type ); - typeRuntimeServer_.setRuntimeId( runtime ); - typeRuntimeServer_.setServerId( factoryID ); - - //Default the typeId from the initial selection - String[] typeIds = WebServiceRuntimeExtensionUtils2.getWebServiceTypeBySelection(initialSelection_); - - if (typeIds!=null && typeIds.length>0) - { - typeRuntimeServer_.setTypeId(typeIds[0]); - } - - return Status.OK_STATUS; - } - - public void setInitialSelection(IStructuredSelection selection) - { - initialSelection_ = selection; - } - - public IStructuredSelection getInitialSelection() - { - return initialSelection_ ; - } - - IProject project_; - - public IProject getInitialProject() - { - if (project_==null) - { - project_ = getProjectFromObjectSelection(initialSelection_); - } - - return project_; - } - - private IProject getProjectFromObjectSelection(IStructuredSelection selection) - { - if (selection != null && selection.size() == 1) - { - Object obj = selection.getFirstElement(); - if (obj != null) - { - try - { - IResource resource = ResourceUtils.getResourceFromSelection(obj); - if (resource==null) - return null; - IProject p = ResourceUtils.getProjectOf(resource.getFullPath()); - return p; - } catch(CoreException e) - { - return null; - } - } - } - return null; - } - - public TypeRuntimeServer getServiceTypeRuntimeServer() - { - return typeRuntimeServer_; - } - - public Boolean getInstallService() - { - return new Boolean( getScenarioContext().getInstallWebService() ); - } - - 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()); - } - - public int getServiceGeneration() - { - return getScenarioContext().getGenerateWebService(); - } - - public int getClientGeneration() - { - return getScenarioContext().getGenerateClient(); - } -}
\ 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 ff2e968a2..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServerWizardWidgetOutputCommand.java +++ /dev/null @@ -1,123 +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.jface.viewers.IStructuredSelection; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.ClientWizardWidgetOutputCommand; -import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; -import org.eclipse.wst.command.internal.env.core.context.ResourceContext; - - -public class ServerWizardWidgetOutputCommand extends ClientWizardWidgetOutputCommand -{ - private TypeRuntimeServer typeRuntimeServer_; - private boolean installService_; - private boolean startService_; - private boolean testService_; - private boolean publishService_; - private boolean generateProxy_; - private ResourceContext resourceContext_; - private IStructuredSelection selection_; - - - public TypeRuntimeServer getServiceTypeRuntimeServer() - { - return typeRuntimeServer_; - } - - public boolean getInstallService() - { - return installService_; - } - - 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 installService_ The installService_ to set. - */ - public void setInstallService(boolean installService_) - { - this.installService_ = installService_; - } - /** - * @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; - } - - public void setObjectSelection(IStructuredSelection selection) - { - selection_ = selection; - } - - public IStructuredSelection getObjectSelection() - { - return selection_; - } -}
\ 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/ServiceImplSelectionDialog.java b/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServiceImplSelectionDialog.java deleted file mode 100644 index bd1c03fc6..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/ServiceImplSelectionDialog.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060410 135441 joan@ca.ibm.com - Joan Haggarty - *******************************************************************************/ -package org.eclipse.jst.ws.internal.creation.ui.widgets; - -import org.eclipse.core.resources.IProject; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.object.ObjectSelectionWidget; -import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.wst.command.internal.env.ui.widgets.AbstractSelectionDialog; -import org.eclipse.wst.command.internal.env.ui.widgets.PageInfo; - -public class ServiceImplSelectionDialog extends AbstractSelectionDialog { - - TypeRuntimeServer trs_; - String titleText_; - IStructuredSelection selection_; - - public ServiceImplSelectionDialog(Shell parent, PageInfo pageInfo) { - super(parent, pageInfo); - titleText_ = pageInfo.getPageName(); - } - - protected void callSetters() - { - ((ObjectSelectionWidget)getWidget()).setTypeRuntimeServer(trs_); - ((ObjectSelectionWidget)getWidget()).setInitialSelection(selection_); - } - - public void setTypeRuntimeServer(TypeRuntimeServer trs) - { - trs_ = trs; - } - - protected void setShellStyle(int newShellStyle) - { - super.setShellStyle( newShellStyle | SWT.RESIZE ); - } - - protected void configureShell(Shell newShell) - { - newShell.setText(titleText_); - super.configureShell(newShell); - } - - public String getDisplayableSelectionString() { - - return ((ObjectSelectionWidget)getWidget()).getObjectSelectionDisplayableString(); - } - - public IStructuredSelection getObjectSelection() { - return ((ObjectSelectionWidget)getWidget()).getObjectSelection(); - } - - public IProject getProject(){ - return ((ObjectSelectionWidget)getWidget()).getProject(); - } - - public String getComponentName(){ - return ((ObjectSelectionWidget)getWidget()).getComponentName(); - } - - public void setInitialSelection(IStructuredSelection selection) - { - selection_ = selection; - } - - protected Point getInitialSize() - { - return ((ObjectSelectionWidget)getWidget()).getWidgetSize(); - } -} 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 804cb29d4..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/ExportWSWidgetBinding.java +++ /dev/null @@ -1,103 +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.ConsumptionUIMessages; -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.data.DataMappingRegistry; -import org.eclipse.wst.command.internal.env.core.fragment.CommandFragment; -import org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentFactory; -import org.eclipse.wst.command.internal.env.core.fragment.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.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.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) - { - this.widgetRegistry = widgetRegistry; - publishToPrivateUDDICmdFrag.registerWidgetMappings(this.widgetRegistry); - - widgetRegistry.add("WSExport", - ConsumptionUIMessages.PAGE_TITLE_WS_PUBLISH, - ConsumptionUIMessages.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 37d757656..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.data.DataMappingRegistry; -import org.eclipse.wst.command.internal.env.core.fragment.CommandFragment; -import org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentFactory; -import org.eclipse.wst.command.internal.env.core.fragment.SimpleFragment; -import org.eclipse.wst.command.internal.env.ui.widgets.CanFinishRegistry; -import org.eclipse.wst.command.internal.env.ui.widgets.CommandWidgetBinding; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetRegistry; - - -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.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 a3ee64784..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/binding/ServerWidgetBinding.java +++ /dev/null @@ -1,564 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060204 124408 rsinha@ca.ibm.com - Rupam Kuehner - * 20060204 121605 rsinha@ca.ibm.com - Rupam Kuehner - * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner - * 20060407 135415 rsinha@ca.ibm.com - Rupam Kuehner - * 20060410 135562 joan@ca.ibm.com - Joan Haggarty - * 20060417 136391 joan@ca.ibm.com - Joan Haggarty - *******************************************************************************/ -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.ConsumptionUIMessages; -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.ObjectSelectionOutputCommand; -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.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.common.Condition; -import org.eclipse.wst.command.internal.env.core.data.DataMappingRegistry; -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.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.env.core.data.DataMappingRegistry) - */ - public void registerDataMappings(DataMappingRegistry dataRegistry) - { - dataMappingRegistry_ = dataRegistry; - - // Before ServerWizardWidget - dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "ObjectSelection", ServerWizardWidget.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ServiceTypeRuntimeServer", ServerWizardWidget.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ServiceGeneration", 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, "ClientGeneration", ServerWizardWidget.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "InstallClient", 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, "InstallService", ServerWizardWidgetOutputCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "InstallClient", 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); - dataRegistry.addMapping(ServerWizardWidget.class, "ObjectSelection", ServerWizardWidgetOutputCommand.class); - - // Before ObjectSelectionWidget - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "TestService", ClientTestWidget.class ); - dataRegistry.addMapping(ServerExtensionDefaultingCommand.class, "TestService",FinishTestFragment.class); - - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "GenerateProxy", TestDefaultingFragment.class); - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "GenerateProxy", ClientFragment.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "GenerateProxy", ServerWizardWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceProjectName", ServerWizardWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceEarProjectName", ServerWizardWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceComponentType", ServerWizardWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientProjectName", ServerWizardWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientEarProjectName", ServerWizardWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceTypeRuntimeServer", ServerWizardWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceRuntimeId", ServerWizardWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ServerWizardWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientRuntimeId", ServerWizardWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceNeedEAR", ServerWizardWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientNeedEAR", ServerWizardWidget.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientComponentType", ServerWizardWidget.class); //jvh - - // After ServerWizardWidget - dataRegistry.addMapping(ServerWizardWidget.class, "ServiceTypeRuntimeServer", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "ServiceRuntimeId", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "ClientTypeRuntimeServer", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "ClientRuntimeId", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "ServiceProjectName", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "ServiceEarProjectName", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "ServiceComponentType", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "ClientProjectName", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "ClientEarProjectName", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "ClientComponentType", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "ServiceNeedEAR", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "ClientNeedEAR", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidget.class, "WebServicesParser", ServerExtensionDefaultingCommand.class ); - - // Map fragments that depend on data. - dataRegistry.addMapping(ServerWizardWidget.class, "ClientTypeRuntimeServer", ClientExtensionFragment.class); - dataRegistry.addMapping(ServerWizardWidget.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) - { - - widgetRegistry_ = widgetRegistry; - publishToPrivateUDDICmdFrag.registerWidgetMappings(widgetRegistry_); - - widgetRegistry.add( "ServerWizardWidget", - ConsumptionUIMessages.PAGE_TITLE_WS_PROJECT, - ConsumptionUIMessages.PAGE_DESC_WS_PROJECT, - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new ServerWizardWidget( true, false ); - } - } ); - - widgetRegistry.add( "TestService", - ConsumptionUIMessages.PAGE_TITLE_WSTEST, - ConsumptionUIMessages.PAGE_DESC_WSTEST, - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new ServiceTestWidget(); - } - } ); - - widgetRegistry.add( "ClientTestWidget", - ConsumptionUIMessages.PAGE_TITLE_WS_SAMPLE, - ConsumptionUIMessages.PAGE_DESC_WS_SAMPLE, - new WidgetContributorFactory() - { - public WidgetContributor create() - { - return new ClientTestWidget(); - } - }); - - widgetRegistry.add( "Publish", - ConsumptionUIMessages.PAGE_TITLE_WS_PUBLISH, - ConsumptionUIMessages.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.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( ServerExtensionDefaultingCommand.class, "TestService", PreClientDevelopCommand.class); - - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "ResourceContext", PreClientDevelopCommand.class); - dataRegistry.addMapping( ClientExtensionDefaultingCommand.class, "DeployClient", PreClientDevelopCommand.class ); - dataRegistry.addMapping( ClientExtensionDefaultingCommand.class, "InstallClient", PreClientDevelopCommand.class ); - dataRegistry.addMapping( ClientExtensionDefaultingCommand.class, "InstallClient", PreClientDevelopCommand.class, "StartService", null); - dataRegistry.addMapping( ClientExtensionDefaultingCommand.class, "ClientTypeRuntimeServer", PreClientDevelopCommand.class ); - dataRegistry.addMapping( ClientExtensionDefaultingCommand.class, "ClientRuntimeId", 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( new ObjectSelectionOutputCommand(), "")); - add( new SimpleFragment( new ServerRuntimeSelectionWidgetDefaultingCommand(), "")); - add( new SimpleFragment( "ServerWizardWidget" ) ); - add( new SimpleFragment( new ServerWizardWidgetOutputCommand(), "" )); - add( new SimpleFragment( new CheckWSDLValidationCommand(), "")); - add( new SimpleFragment( new ServerExtensionDefaultingCommand(), "")); - 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 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.env.core.data.DataMappingRegistry) - */ - public void registerDataMappings(DataMappingRegistry dataRegistry) - { - publishToPrivateUDDICmdFrag.registerDataMappings(dataMappingRegistry_); - - dataRegistry.addMapping(SelectionCommand.class, "InitialSelection", ServerWizardWidgetDefaultingCommand.class ); - - // Map ServerWizardWidgetDefaultingCommand to ObjectSelectionOutputCommand - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "InitialSelection", ObjectSelectionOutputCommand.class, "ObjectSelection", null); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ServiceTypeRuntimeServer", ObjectSelectionOutputCommand.class, "TypeRuntimeServer", null); - - // Map ServerWizardWidgetDefaultingCommand to ServerWizardWidgetOutputCommand - 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, "InstallService", 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(ServerWizardWidgetDefaultingCommand.class, "InitialProject", ServerRuntimeSelectionWidgetDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ServerRuntimeSelectionWidgetDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ServiceTypeRuntimeServer", ServerRuntimeSelectionWidgetDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "InstallService", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "StartService", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "TestService", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "TestService", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "PublishService", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "PublishService", PublishWSWidget.class, "PublishToPublicUDDI", null); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "GenerateProxy", ServerRuntimeSelectionWidgetDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "InstallClient", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "TestService", ClientExtensionDefaultingCommand.class); // KSC - dataRegistry.addMapping(ServerWizardWidgetOutputCommand.class, "GenerateProxy", ClientExtensionDefaultingCommand.class); // KSC - dataRegistry.addMapping(ServerWizardWidgetDefaultingCommand.class, "ResourceContext", ClientExtensionDefaultingCommand.class); - - //Map ObjectSelectionOutputCommand to ServerRuntimeSelectionWidgetDefaultingCommand - 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); - - //Map ObjectSelectionOutputCommand to ServerWizardWidgetOutputCommand - dataRegistry.addMapping(ObjectSelectionOutputCommand.class, "ObjectSelection", ServerWizardWidgetOutputCommand.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, "ServiceRuntimeId", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientTypeRuntimeServer", ClientExtensionDefaultingCommand.class); - dataRegistry.addMapping(ServerRuntimeSelectionWidgetDefaultingCommand.class, "ClientRuntimeId", 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, "ServiceComponentType", 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); - - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "InstallService", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "StartService", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "TestService", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "MonitorService", ServerExtensionDefaultingCommand.class); - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "PublishService", ServerExtensionDefaultingCommand.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( ServerExtensionDefaultingCommand.class, "DeployService", PreServiceDevelopCommand.class); - dataRegistry.addMapping( ServerExtensionDefaultingCommand.class, "InstallService", PreServiceDevelopCommand.class); - dataRegistry.addMapping( ServerExtensionDefaultingCommand.class, "StartService", PreServiceDevelopCommand.class); - dataRegistry.addMapping( ServerExtensionDefaultingCommand.class, "TestService", PreServiceDevelopCommand.class); - dataRegistry.addMapping( ServerExtensionDefaultingCommand.class, "PublishService", PreServiceDevelopCommand.class); - - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "GenerateProxy", PreServiceDevelopCommand.class); - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "ResourceContext", PreServiceDevelopCommand.class); - dataRegistry.addMapping( ServerWizardWidgetOutputCommand.class, "ObjectSelection", PreServiceDevelopCommand.class, "Selection", new SelectionTransformer() ); - - //dataRegistry.addMapping( ServerRuntimeSelectionWidgetDefaultingCommand.class, "ServiceComponentType", PreServiceDevelopCommand.class, "ModuleType", null); - dataRegistry.addMapping( ServerExtensionDefaultingCommand.class, "ServiceTypeRuntimeServer", PreServiceDevelopCommand.class ); - dataRegistry.addMapping( ServerExtensionDefaultingCommand.class, "ServiceRuntimeId", 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( ServerExtensionDefaultingCommand.class, "ServiceComponentType", PreServiceDevelopCommand.class, "ModuleType", null ); - - 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 db7264bf5..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/runtime/ServerRuntimeSelectionWidget.java +++ /dev/null @@ -1,448 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060204 124408 rsinha@ca.ibm.com - Rupam Kuehner - * 20060221 100190 pmoogk@ca.ibm.com - Peter Moogk - * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner - *******************************************************************************/ -package org.eclipse.jst.ws.internal.creation.ui.widgets.runtime; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jst.ws.internal.consumption.common.FacetUtils; -import org.eclipse.jst.ws.internal.consumption.ui.ConsumptionUIMessages; -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.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils2; -import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; -import org.eclipse.jst.ws.internal.ui.common.UIUtils; -import org.eclipse.osgi.util.NLS; -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.core.common.StatusUtils; -import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; - -/* - * - * ServerRuntimeSelectionWidget - * This widget is the parent widget for server and client deployment/environment settings - * - */ -public class ServerRuntimeSelectionWidget extends SimpleWidgetDataContributor -{ - 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 boolean isClientWidgetVisible_ = true; - - public WidgetDataEvents addControls( Composite parent, Listener statusListener ) - { - UIUtils uiUtils = new UIUtils( 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, NLS.bind(ConsumptionUIMessages.MSG_GENERAL_PROJECT_AND_EAR, new String[] {ConsumptionUIMessages.MSG_SERVICE_SUB})); - createMessageText( textComposite, ConsumptionUIMessages.MSG_EAR_PROJECT_WILL_BE_CREATED ); - - Composite serverComp = uiUtils.createComposite( root, 1, 5, 0 ); - - Group serverGroup = uiUtils.createGroup( serverComp, ConsumptionUIMessages.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); - projectWidget_.refreshProjectItems(); - runtimeWidget_.addModifyListener( textListener_ ); - } - - public TypeRuntimeServer getClientTypeRuntimeServer() - { - return clientWidget_.getClientTypeRuntimeServer(); - } - - public void setClientTypeRuntimeServer( TypeRuntimeServer ids ) - { - clientWidget_.setClientTypeRuntimeServer( ids ); - } - - public void setServiceRuntimeId(String id) - { - //TODO This method and any mappings to it - // should be deleted if no longer required. - } - - public String getServiceRuntimeId() - { - //calculate the most appropriate clientRuntimeId based on current settings. - String projectName = projectWidget_.getProjectName(); - String templateId = projectWidget_.getComponentType(); - - //Find the service runtime that fits this profile best. - return WebServiceRuntimeExtensionUtils2.getServiceRuntimeId(runtimeWidget_.getTypeRuntimeServer(), projectName, templateId); - } - - public void setClientRuntimeId(String id) - { - //TODO This method and any mappings to it - // should be deleted if no longer required. - } - - public String getClientRuntimeId() - { - //calculate the most appropriate clientRuntimeId based on current settings. - return clientWidget_.getClientRuntimeId(); - } - - 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 getServiceComponentType() - { - return projectWidget_.getComponentType(); - } - - public void setServiceComponentType( String type ) - { - projectWidget_.setComponentType( type ); - } - - public String getClientComponentType() - { - return clientWidget_.getClientComponentType(); - } - - public void setClientComponentType( String type ) - { - clientWidget_.setClientComponentType( type ); - } - - public String getServiceProjectName() - { - return projectWidget_.getProjectName(); - } - - public void setServiceProjectName(String name) - { - projectWidget_.setProjectName(name); - } - - public String getServiceEarProjectName() - { - return projectWidget_.getEarProjectName(); - } - - public void setServiceEarProjectName(String name) - { - projectWidget_.setEarProjectName(name); - } - - public String getClientProjectName() - { - return clientWidget_.getClientProjectName(); - } - - public void setClientProjectName(String name) - { - clientWidget_.setClientProjectName(name); - } - - public String getClientEarProjectName() - { - return clientWidget_.getClientEarProjectName(); - } - - public void setClientEarProjectName(String name) - { - clientWidget_.setClientEarProjectName(name); - } - - public void setInstallService(boolean b) - { - runtimeWidget_.setInstall(b); - } - - public void setInstallClient(boolean b) - { - clientWidget_.setInstallClient(b); - } - - 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_.refreshProjectItems(); - } - } - - - /* (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 = isClientWidgetVisible_ ? clientWidget_.getStatus() : Status.OK_STATUS; - IStatus finalStatus = Status.OK_STATUS; - - - // call child widgets' getStatus() - if( serviceStatus.getSeverity() == Status.ERROR ) - { - finalStatus = serviceStatus; - } - else if( clientStatus.getSeverity() == Status.ERROR ) - { - finalStatus = clientStatus; - } - else if ( projectStatus.getSeverity()== Status.ERROR) { - finalStatus = projectStatus; - } - - String projectName = projectWidget_.getProjectName(); - if (projectName != null && projectName.length()>0) - { - //If the project exists, ensure that it is suitable for the selected runtime - //and server. - ValidationUtils valUtils = new ValidationUtils(); - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); - String typeId = getServiceTypeRuntimeServer().getTypeId(); - String runtimeId = getServiceTypeRuntimeServer().getRuntimeId(); - String serverFactoryId = getServiceTypeRuntimeServer().getServerId(); - - if (project.exists()) - { - //Check if the runtime supports it. - if (!WebServiceRuntimeExtensionUtils2.doesServiceTypeAndRuntimeSupportProject(typeId, runtimeId, projectName)) - { - String runtimeLabel = WebServiceRuntimeExtensionUtils2.getRuntimeLabelById(runtimeId); - finalStatus = StatusUtils.errorStatus(NLS.bind(ConsumptionUIMessages.MSG_SERVICE_RUNTIME_DOES_NOT_SUPPORT_PROJECT, new String[]{runtimeLabel, projectName})); - } - - //Check if the server supports it. - - if (serverFactoryId!=null && serverFactoryId.length()>0) - { - if (!valUtils.doesServerSupportProject(serverFactoryId, projectName)) - { - String serverLabel = WebServiceRuntimeExtensionUtils2.getServerLabelById(serverFactoryId); - finalStatus = StatusUtils.errorStatus(NLS.bind(ConsumptionUIMessages.MSG_SERVICE_SERVER_DOES_NOT_SUPPORT_PROJECT, new String[]{serverLabel, projectName})); - } - } - } - else - { - //Non-existing project is only permitted if there is a server selected. - if (serverFactoryId==null || serverFactoryId.length()==0) - { - finalStatus = StatusUtils.errorStatus(NLS.bind(ConsumptionUIMessages.MSG_PROJECT_MUST_EXIST, new String[]{projectName})); - } - else - { - // Look at the project type to ensure that it is suitable for the - // selected runtime and server. - String templateId = getServiceComponentType(); - - if (templateId != null && templateId.length() > 0) - { - // Check if the runtime supports it. - if (!WebServiceRuntimeExtensionUtils2.doesServiceTypeAndRuntimeSupportTemplate(typeId, runtimeId, templateId)) - { - String runtimeLabel = WebServiceRuntimeExtensionUtils2.getRuntimeLabelById(runtimeId); - String templateLabel = FacetUtils.getTemplateLabelById(templateId); - finalStatus = StatusUtils.errorStatus(NLS.bind(ConsumptionUIMessages.MSG_SERVICE_RUNTIME_DOES_NOT_SUPPORT_TEMPLATE, - new String[] { runtimeLabel, templateLabel })); - } - - // Check if the server supports it. - if (serverFactoryId != null && serverFactoryId.length() > 0) - { - if (!valUtils.doesServerSupportTemplate(serverFactoryId, templateId)) - { - String serverLabel = WebServiceRuntimeExtensionUtils2.getServerLabelById(serverFactoryId); - String templateLabel = FacetUtils.getTemplateLabelById(templateId); - finalStatus = StatusUtils.errorStatus(NLS.bind( - ConsumptionUIMessages.MSG_SERVICE_SERVER_DOES_NOT_SUPPORT_TEMPLATE, - new String[] { serverLabel, templateLabel })); - } - } - } - } - - - } - } - - if (isClientWidgetVisible_) - { - String clientEARName = clientWidget_.getClientEarProjectName(); - String clientProjName = clientWidget_.getClientProjectName(); - String serviceProjName = projectWidget_.getProjectName(); - String serviceEarName = projectWidget_.getEarProjectName(); - //String clientComponentName = clientWidget_.getClientComponentName(); - - // check same EAR-ness ----- - String warning_msg = getEARProjectWarningMessage(serviceEarName, clientEARName); - - //if (serviceComponentName.equalsIgnoreCase(clientComponentName)){ - //String err_msg = NLS.bind(ConsumptionUIMessages.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 =ConsumptionUIMessages.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 ); - } - - } - - //If finalStatus is still OK, check if there are any warnings. - if (finalStatus.getSeverity()!=Status.ERROR) - { - if( serviceStatus.getSeverity() == Status.WARNING ) - { - finalStatus = serviceStatus; - } - else if (clientStatus.getSeverity() == Status.WARNING) - { - finalStatus = serviceStatus; - } - } - - 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 NLS.bind(ConsumptionUIMessages.MSG_SAME_CLIENT_AND_SERVICE_EARS, new String[]{ "EAR" }); - } - } - - return null; - - } -} 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 b1a8e8b81..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/runtime/ServerRuntimeSelectionWidgetDefaultingCommand.java +++ /dev/null @@ -1,590 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060131 121071 rsinha@ca.ibm.com - Rupam Kuehner - * 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner - * 20060227 124392 rsinha@ca.ibm.com - Rupam Kuehner - * 20060315 131963 rsinha@ca.ibm.com - Rupam Kuehner - *******************************************************************************/ -package org.eclipse.jst.ws.internal.creation.ui.widgets.runtime; - -import java.util.ArrayList; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.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.common.FacetMatcher; -import org.eclipse.jst.ws.internal.consumption.common.FacetUtils; -import org.eclipse.jst.ws.internal.consumption.common.RequiredFacetVersion; -import org.eclipse.jst.ws.internal.consumption.ui.ConsumptionUIMessages; -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.preferences.ProjectTopologyContext; -import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ClientRuntimeSelectionWidgetDefaultingCommand; -import org.eclipse.jst.ws.internal.consumption.ui.wsrt.FacetMatchCache; -import org.eclipse.jst.ws.internal.consumption.ui.wsrt.RuntimeDescriptor; -import org.eclipse.jst.ws.internal.consumption.ui.wsrt.ServiceRuntimeDescriptor; -import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils2; -import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; -import org.eclipse.osgi.util.NLS; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.server.core.IServer; -import org.eclipse.wst.server.core.IServerType; -import org.eclipse.wst.server.core.ServerCore; -import org.eclipse.wst.server.core.ServerUtil; - -public class ServerRuntimeSelectionWidgetDefaultingCommand extends ClientRuntimeSelectionWidgetDefaultingCommand -{ - private boolean generateProxy_=true; //jvh - - private TypeRuntimeServer serviceIds_; - private boolean serviceIdsFixed_ = false; - private String serviceRuntimeId_; - private String serviceProjectName_; - private String serviceEarProjectName_; - private String serviceComponentType_; - private IProject initialProject_; - private boolean serviceNeedEAR_ = true; - private FacetMatcher serviceFacetMatcher_; - - public ServerRuntimeSelectionWidgetDefaultingCommand() - { - super(); - } - - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - IEnvironment env = getEnvironment(); - - try - { - - if (serviceIdsFixed_) - { - //Set the serviceRuntime based on the runtime, server, and initial selection. - DefaultRuntimeTriplet drt = getDefaultServiceRuntimeForFixedRuntimeAndServer(initialProject_); - serviceFacetMatcher_ = drt.getFacetMatcher(); - serviceProjectName_ = drt.getProjectName(); - serviceRuntimeId_ = drt.getRuntimeId(); - } - else - { - // Set the runtime based on the initial selection - DefaultRuntimeTriplet drt = getDefaultRuntime(initialProject_, serviceIds_.getTypeId(), false); - serviceFacetMatcher_ = drt.getFacetMatcher(); - serviceProjectName_ = drt.getProjectName(); - serviceRuntimeId_ = drt.getRuntimeId(); - - if (serviceRuntimeId_ == null) - { - // return and error. - } - serviceIds_.setRuntimeId(WebServiceRuntimeExtensionUtils2.getServiceRuntimeDescriptorById(serviceRuntimeId_).getRuntime() - .getId()); - } - - // Set the project - if (serviceProjectName_ == null) - { - // Project name did not get set when the runtime was set, so set it now - serviceProjectName_ = getDefaultServiceProjectName(); - } - - IProject serviceProject = ResourcesPlugin.getWorkspace().getRoot().getProject(serviceProjectName_); - if (!serviceProject.exists()) - { - // Set the project template - serviceComponentType_ = getDefaultServiceProjectTemplate(); - } - else - { - //Set it to an empty String - serviceComponentType_ = ""; - } - - if (!serviceIdsFixed_) - { - // Set the server - IStatus serverStatus = setServiceDefaultServer(); - if (serverStatus.getSeverity() == Status.ERROR) - { - env.getStatusHandler().reportError(serverStatus); - return serverStatus; - } - } - - setDefaultServiceEarProject(); - - // jvh - for now comment out generate proxy - // need to look at defaulting based on an event - // on page 1 - when client generation goes from none - // to develop... - /*if (generateProxy_) - {*/ - //Default the client-side. - IStatus clientSideStatus = defaultClientSide(monitor); - if (clientSideStatus.getSeverity() == Status.ERROR) - { - return clientSideStatus; - } - // } - - return Status.OK_STATUS; - - } catch (Exception e) - { - // Catch all Exceptions in order to give some feedback to the user - IStatus errorStatus = StatusUtils.errorStatus(NLS.bind(ConsumptionUIMessages.MSG_ERROR_TASK_EXCEPTED, - new String[] { e.getMessage() }), e); - env.getStatusHandler().reportError(errorStatus); - return errorStatus; - } - } - - private IStatus defaultClientSide(IProgressMonitor monitor) - { - IStatus clientDefaultFromServiceStatus = defaultClientSideFromServiceSide(serviceProjectName_, serviceIds_, serviceNeedEAR_, serviceEarProjectName_); - - // If an error status is returned, the only property that was set on - // ClientRuntimeSelectionWidgetDefaultingCommand is clientProjectName_. - // The rest of the properties including clientRuntimeId_, clientComponentType_, - // all the values in clientIds_, clientNeedEAR_, and clientEarProjectName_ - // have not been set because the service side server and - // web service runtime could not be used on the client side. Run the entire - // client-side defaulting algorithm using clientProjectName_ as the - // clientInitialProject_. Then update the clientEarProjectName_ based on the - // service side EAR. - if (clientDefaultFromServiceStatus.getSeverity() == IStatus.ERROR) - { - // 1. Run client side defaulting from scratch with clientInitialProject_ - // set to the new clientProjectName_. - IProject clientProject = ResourcesPlugin.getWorkspace().getRoot().getProject(getClientProjectName()); - setClientInitialProject(clientProject); - IStatus clientExecuteStatus = super.execute(monitor, null); - if (clientExecuteStatus.getSeverity() == Status.ERROR) - { - return clientExecuteStatus; - } - - // 2. Update the client-side EAR if serviceNeedEAR_ is true; - if (serviceNeedEAR_) - { - defaultClientEarFromServiceEar(serviceProjectName_, serviceEarProjectName_); - } - } - - return Status.OK_STATUS; - - } - - private void setDefaultServiceEarProject() - { - //Don't need an ear if this is a Java project, or if the selected template is jst.utility - IProject serviceProject = ResourcesPlugin.getWorkspace().getRoot().getProject(serviceProjectName_); - if (serviceProject.exists()) - { - serviceNeedEAR_ = !(FacetUtils.isJavaProject(serviceProject)); - } - else - { - serviceNeedEAR_ = !(FacetUtils.isUtilityTemplate(serviceComponentType_)); - } - - //If serviceNeedEAR_ is still true, it means that we're not dealing with a Java project - //or Java project type. Check the server. - - - if (serviceNeedEAR_) - { - - // Determine if an ear selection is needed based on the server type. - 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, "13")) - { - // Default the EAR selection to be empty - serviceNeedEAR_ = false; - } - } - } - } - - if (serviceNeedEAR_) - { - serviceEarProjectName_ = getDefaultServiceEarProjectName(); - } - else - { - serviceEarProjectName_ = ""; - } - } - - private String getDefaultServiceEarProjectName() - { - //Choose an appropriate default. - - IProject serviceProject = ResourcesPlugin.getWorkspace().getRoot().getProject(serviceProjectName_); - if (serviceProject != null && serviceProject.exists()) - { - IVirtualComponent[] earComps = J2EEUtils.getReferencingEARComponents(serviceProject); - if (earComps.length > 0) - { - //pick the first one. - return earComps[0].getName(); - - } - } - - - IVirtualComponent[] allEarComps = J2EEUtils.getAllEARComponents(); - - - if (allEarComps.length > 0) - { - if (serviceProject != null && serviceProject.exists()) - { - for (int i=0; i < allEarComps.length; i++) - { - IProject earProject = allEarComps[i].getProject(); - IStatus associationStatus = J2EEUtils.canAssociateProjectToEAR(serviceProject, earProject); - if (associationStatus.getSeverity()==IStatus.OK) - { - return allEarComps[i].getName(); - } - } - } - else - { - return allEarComps[0].getName(); - } - } - - - - // there are no suitable existing EARs - return ResourceUtils.getDefaultServiceEARProjectName(); - - } - - private IStatus setServiceDefaultServer() - { - //Choose an existing server the module is already associated with if possible - IProject serviceProject = ResourcesPlugin.getWorkspace().getRoot().getProject(serviceProjectName_); - IServer[] configuredServers = ServerUtil.getServersByModule(ServerUtils.getModule(serviceProject), null); - if (configuredServers!=null && configuredServers.length>0) - { - serviceIds_.setServerId(configuredServers[0].getServerType().getId()); - serviceIds_.setServerInstanceId(configuredServers[0].getId()); - return Status.OK_STATUS; - } - - //If the project exists, choose a suitable server or server type based on the existing project's runtime or facets - if (serviceProject.exists()) - { - IServer server = getServerFromProject(serviceProjectName_, serviceFacetMatcher_); - if (server != null) - { - serviceIds_.setServerId(server.getServerType().getId()); - serviceIds_.setServerInstanceId(server.getId()); - return Status.OK_STATUS; - } - else - { - IServerType serverType = getServerTypeFromProject(serviceProjectName_, serviceFacetMatcher_); - if (serverType != null) - { - serviceIds_.setServerId(serverType.getId()); - return Status.OK_STATUS; - } - } - } - - //Haven't picked a server/server type on the basis of the project. Pick a server/server type - //that is compatible with the serviceRuntimeId. - IServer server = getServerFromServiceRuntimeId(); - if (server!=null) - { - serviceIds_.setServerId(server.getServerType().getId()); - serviceIds_.setServerInstanceId(server.getId()); - return Status.OK_STATUS; - } - - IServerType serverType = getServerTypeFromServiceRuntimeId(); - if (serverType != null) - { - serviceIds_.setServerId(serverType.getId()); - return Status.OK_STATUS; - } - - //No suitable server was found. Popup an error. - RuntimeDescriptor runtimeDescriptor = WebServiceRuntimeExtensionUtils2.getRuntimeById(serviceIds_.getRuntimeId()); - if (runtimeDescriptor.getServerRequired()) - { - String runtimeLabel = WebServiceRuntimeExtensionUtils2.getRuntimeLabelById(serviceIds_.getRuntimeId()); - IStatus status = StatusUtils.errorStatus(NLS.bind(ConsumptionUIMessages.MSG_ERROR_NO_SERVER_RUNTIME, new String[]{runtimeLabel}) ); - return status; - } - - return Status.OK_STATUS; - } - - private IServer getServerFromServiceRuntimeId() - { - IServer[] servers = ServerCore.getServers(); - if (servers != null && servers.length > 0) { - for (int i = 0; i < servers.length; i++) - { - String serverFactoryId = servers[i].getServerType().getId(); - if (WebServiceRuntimeExtensionUtils2.doesServiceRuntimeSupportServer(serviceRuntimeId_, serverFactoryId)) - { - return servers[i]; - } - } - } - return null; - } - - private IServerType getServerTypeFromServiceRuntimeId() - { - String[] serverTypes = WebServiceRuntimeExtensionUtils2.getServerFactoryIdsByServiceRuntime(serviceRuntimeId_); - if (serverTypes!=null && serverTypes.length>0) - { - //Return the preferred one if it is in the list - PersistentServerRuntimeContext context = WebServiceConsumptionUIPlugin.getInstance().getServerRuntimeContext(); - String preferredServerFactoryId = context.getServerFactoryId(); - for (int i=0; i<serverTypes.length; i++) - { - if (serverTypes[i].equals(preferredServerFactoryId)) - { - return ServerCore.findServerType(serverTypes[i]); - } - } - - return ServerCore.findServerType(serverTypes[0]); - } - - return null; - } - - - private String getDefaultServiceProjectTemplate() - { - String[] templates = WebServiceRuntimeExtensionUtils2.getServiceProjectTemplates(serviceIds_.getTypeId(), serviceIds_.getRuntimeId()); - - //Walk the list of service project types in the project topology preference - ProjectTopologyContext ptc= WebServiceConsumptionUIPlugin.getInstance().getProjectTopologyContext(); - String[] preferredTemplateIds = ptc.getServiceTypes(); - for (int j = 0; j < preferredTemplateIds.length; j++) - { - for (int i = 0; i < templates.length; i++) - { - String templateId = templates[i]; - if (templateId.equals(preferredTemplateIds[j])) - { - boolean matches = WebServiceRuntimeExtensionUtils2.doesServiceRuntimeSupportTemplate(serviceRuntimeId_, templateId); - if (matches) - { - return templates[i]; - } - } - } - } - - //Since the preferredTemplateIds contains the union of all project types for all service runtimes, we are - //guaranteed to have returned by now, so the code below will never be executed under normal - //circumstances. Just return something to satisfy the compiler. - if (templates.length > 0) - return templates[0]; - - return ""; - - } - - private String getDefaultServiceProjectName() - { - IProject[] projects = FacetUtils.getAllProjects(); - ServiceRuntimeDescriptor desc = WebServiceRuntimeExtensionUtils2.getServiceRuntimeDescriptorById(serviceRuntimeId_); - RequiredFacetVersion[] rfvs = desc.getRequiredFacetVersions(); - - //Check each project for compatibility with the serviceRuntime - for (int i=0; i<projects.length; i++) - { - Set facetVersions = FacetUtils.getFacetsForProject(projects[i].getName()); - org.eclipse.wst.common.project.facet.core.runtime.IRuntime fRuntime = null; - String fRuntimeName = null; - fRuntime = FacetUtils.getFacetRuntimeForProject(projects[i].getName()); - if (fRuntime != null) - { - fRuntimeName = fRuntime.getName(); - } - - if (facetVersions != null) - { - FacetMatcher fm = FacetMatchCache.getInstance().getMatchForProject(false, serviceRuntimeId_, projects[i].getName()); - boolean facetRuntimeMatches = true; - if (fRuntimeName != null) - { - facetRuntimeMatches = FacetUtils.isFacetRuntimeSupported(rfvs, fRuntimeName); - } - - if (fm.isMatch() && facetRuntimeMatches) - { - serviceFacetMatcher_ = fm; - return projects[i].getName(); - } - } - } - - //No project was suitable, return a new project name - return ResourceUtils.getDefaultWebProjectName(); - - } - - private DefaultRuntimeTriplet getDefaultServiceRuntimeForFixedRuntimeAndServer(IProject project) - { - String[] serviceRuntimes = WebServiceRuntimeExtensionUtils2.getServiceRuntimesByServiceType(serviceIds_.getTypeId()); - ArrayList validServiceRuntimes = new ArrayList(); - for (int i=0; i<serviceRuntimes.length; i++ ) - { - ServiceRuntimeDescriptor desc = WebServiceRuntimeExtensionUtils2.getServiceRuntimeDescriptorById(serviceRuntimes[i]); - if (desc.getRuntime().getId().equals(serviceIds_.getRuntimeId())) - { - //Check if this service runtime supports the server - if (WebServiceRuntimeExtensionUtils2.doesServiceRuntimeSupportServer(desc.getId(), serviceIds_.getServerId())) - { - validServiceRuntimes.add(desc.getId()); - if (project != null && project.exists()) - { - Set facetVersions = FacetUtils.getFacetsForProject(project.getName()); - if (facetVersions != null) - { - FacetMatcher fm = FacetMatchCache.getInstance().getMatchForProject(false, serviceRuntimes[i], project.getName()); - if (fm.isMatch()) - { - DefaultRuntimeTriplet drt = new DefaultRuntimeTriplet(); - drt.setFacetMatcher(fm); - drt.setProjectName(project.getName()); - drt.setRuntimeId(desc.getId()); - return drt; - } - } - } - - } - } - - } - - if (validServiceRuntimes.size() > 0) - { - //We couldn't match to the initially selected project so return the first valid runtime. - DefaultRuntimeTriplet drt = new DefaultRuntimeTriplet(); - drt.setFacetMatcher(null); - drt.setProjectName(null); - drt.setRuntimeId(((String[])validServiceRuntimes.toArray(new String[0]))[0]); - return drt; - } - else - { - //There are no service runtimes that match the fixed runtime and server. Fall back to original algorithm. - serviceIdsFixed_ = false; - return getDefaultRuntime(project, serviceIds_.getTypeId(), false); - } - } - - - - public void setInitialSelection(IStructuredSelection selection) - { - } - - public void setInitialProject(IProject initialProject) - { - initialProject_ = initialProject; - } - - public void setInitialComponentName(String name) - { - //TODO This method and any mappings to it - // should be removed if no longer needed. - } - - public void setServiceTypeRuntimeServer( TypeRuntimeServer ids ) - { - serviceIds_ = ids; - } - - public void setServiceIdsFixed(boolean b) - { - serviceIdsFixed_ = b; - } - - public TypeRuntimeServer getServiceTypeRuntimeServer() - { - return serviceIds_; - } - - public String getServiceRuntimeId() - { - return serviceRuntimeId_; - } - /** - * @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 getServiceProjectName() - { - return serviceProjectName_; - } - - public String getServiceEarProjectName() - { - return serviceEarProjectName_; - } - - public String getServiceComponentType() - { - return serviceComponentType_; - } - - public boolean getServiceNeedEAR() - { - return serviceNeedEAR_; - } - -} 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 a00645bc3..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.common.Condition; -import org.eclipse.wst.command.internal.env.core.fragment.BooleanFragment; -import org.eclipse.wst.command.internal.env.core.fragment.SimpleFragment; -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 196ed3649..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.common.Condition; -import org.eclipse.wst.command.internal.env.core.data.DataMappingRegistry; -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; - - -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 2096c8d90..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/ServiceTestWidget.java +++ /dev/null @@ -1,170 +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.ConsumptionUIMessages; -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.core.selection.SelectionList; -import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor; -import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; -import org.eclipse.wst.common.environment.IEnvironment; - - -public class ServiceTestWidget extends SimpleWidgetDataContributor -{ - 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 Button launchButton_; - /*CONTEXT_ID PSTP0002 for the launch button of the Service Test Page*/ - private final String INFOPOP_PSTP_LAUNCH_BUTTON = "PSTP0002"; - - - private SelectionList facilities_; - - private String serviceServerInstanceId = null; - - public WidgetDataEvents addControls( Composite parent, Listener statusListener ) - { - UIUtils uiUtils = new UIUtils(createPluginId_ ); - - Composite testComposite = uiUtils.createComposite( parent, 3, 0, 0 ); - - testTypeCombo_ = uiUtils.createCombo( testComposite, ConsumptionUIMessages.LABEL_TEST_TYPES, - ConsumptionUIMessages.TOOLTIP_PSTP_COMBOBOX_TEST, - INFOPOP_PSTP_COMBOBOX_TEST, - SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY ); - - launchButton_ = uiUtils.createPushButton( testComposite, ConsumptionUIMessages.BUTTON_LAUNCH_SERVICE_TEST, - ConsumptionUIMessages.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 IEnvironment 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(IEnvironment 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 20971001b..000000000 --- a/bundles/org.eclipse.jst.ws.creation.ui/src/org/eclipse/jst/ws/internal/creation/ui/widgets/test/WebServiceTestDefaultingCommand.java +++ /dev/null @@ -1,93 +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.env.core.selection.SelectionList; -import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; - - -/** - * @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 AbstractDataModelOperation -{ - - private SelectionList serviceTestFacilities; - private String[] testID; - - public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) - { - ScenarioContext scenarioContext = WebServicePlugin.getInstance().getScenarioContext().copy(); - testID = scenarioContext.getNonJavaTestService(); - String[] testTypes = scenarioContext.getWebServiceTestTypes(); - - 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 boolean getExternalBrowser() - { - return false; - } - - -} |