|
Lines 1-15
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2004 IBM Corporation and others. |
2 |
* Copyright (c) 2004, 2006 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
| 6 |
* http://www.eclipse.org/legal/epl-v10.html |
6 |
* http://www.eclipse.org/legal/epl-v10.html |
| 7 |
* |
7 |
* |
| 8 |
* Contributors: |
8 |
* Contributors: |
| 9 |
* IBM Corporation - initial API and implementation |
9 |
* IBM Corporation - initial API and implementation |
| 10 |
* yyyymmdd bug Email and other contact information |
10 |
* yyyymmdd bug Email and other contact information |
| 11 |
* -------- -------- ----------------------------------------------------------- |
11 |
* -------- -------- ----------------------------------------------------------- |
| 12 |
* 20060131 121071 rsinha@ca.ibm.com - Rupam Kuehner |
12 |
* 20060131 121071 rsinha@ca.ibm.com - Rupam Kuehner |
|
|
13 |
* 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner |
| 13 |
*******************************************************************************/ |
14 |
*******************************************************************************/ |
| 14 |
package org.eclipse.jst.ws.internal.creation.ui.widgets.runtime; |
15 |
package org.eclipse.jst.ws.internal.creation.ui.widgets.runtime; |
| 15 |
|
16 |
|
|
Lines 35-42
Link Here
|
| 35 |
import org.eclipse.jst.ws.internal.consumption.ui.preferences.ProjectTopologyContext; |
36 |
import org.eclipse.jst.ws.internal.consumption.ui.preferences.ProjectTopologyContext; |
| 36 |
import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ClientRuntimeSelectionWidgetDefaultingCommand; |
37 |
import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ClientRuntimeSelectionWidgetDefaultingCommand; |
| 37 |
import org.eclipse.jst.ws.internal.consumption.ui.wsrt.FacetMatchCache; |
38 |
import org.eclipse.jst.ws.internal.consumption.ui.wsrt.FacetMatchCache; |
|
|
39 |
import org.eclipse.jst.ws.internal.consumption.ui.wsrt.RuntimeDescriptor; |
| 38 |
import org.eclipse.jst.ws.internal.consumption.ui.wsrt.ServiceRuntimeDescriptor; |
40 |
import org.eclipse.jst.ws.internal.consumption.ui.wsrt.ServiceRuntimeDescriptor; |
| 39 |
import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils; |
|
|
| 40 |
import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils2; |
41 |
import org.eclipse.jst.ws.internal.consumption.ui.wsrt.WebServiceRuntimeExtensionUtils2; |
| 41 |
import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; |
42 |
import org.eclipse.jst.ws.internal.data.TypeRuntimeServer; |
| 42 |
import org.eclipse.osgi.util.NLS; |
43 |
import org.eclipse.osgi.util.NLS; |
|
Lines 308-317
Link Here
|
| 308 |
} |
309 |
} |
| 309 |
|
310 |
|
| 310 |
//No suitable server was found. Popup an error. |
311 |
//No suitable server was found. Popup an error. |
| 311 |
String runtimeLabel = WebServiceRuntimeExtensionUtils2.getRuntimeLabelById(serviceIds_.getRuntimeId()); |
312 |
RuntimeDescriptor runtimeDescriptor = WebServiceRuntimeExtensionUtils2.getRuntimeById(serviceIds_.getRuntimeId()); |
| 312 |
String serverLabels = getServerLabels(serviceIds_.getRuntimeId()); |
313 |
if (runtimeDescriptor.getServerRequired()) |
| 313 |
IStatus status = StatusUtils.errorStatus(NLS.bind(ConsumptionUIMessages.MSG_ERROR_NO_SERVER_RUNTIME, new String[]{runtimeLabel, serverLabels}) ); |
314 |
{ |
| 314 |
return status; |
315 |
String runtimeLabel = WebServiceRuntimeExtensionUtils2.getRuntimeLabelById(serviceIds_.getRuntimeId()); |
|
|
316 |
IStatus status = StatusUtils.errorStatus(NLS.bind(ConsumptionUIMessages.MSG_ERROR_NO_SERVER_RUNTIME, new String[]{runtimeLabel}) ); |
| 317 |
return status; |
| 318 |
} |
| 319 |
|
| 320 |
return Status.OK_STATUS; |
| 315 |
} |
321 |
} |
| 316 |
|
322 |
|
| 317 |
private IServer getServerFromServiceRuntimeId() |
323 |
private IServer getServerFromServiceRuntimeId() |
|
Lines 352-392
Link Here
|
| 352 |
return null; |
358 |
return null; |
| 353 |
} |
359 |
} |
| 354 |
|
360 |
|
| 355 |
/* |
|
|
| 356 |
private IServer getFirstSupportedServer(IServer[] servers, String serviceRuntimeId, IProject serviceProject) |
| 357 |
{ |
| 358 |
if (servers != null && servers.length > 0) { |
| 359 |
for (int i = 0; i < servers.length; i++) |
| 360 |
{ |
| 361 |
String serverFactoryId = servers[i].getServerType().getId(); |
| 362 |
if (WebServiceRuntimeExtensionUtils2.doesServiceRuntimeSupportServer(serviceRuntimeId, serverFactoryId)) |
| 363 |
{ |
| 364 |
//TODO check if the server type supports the project before returning. |
| 365 |
return servers[i]; |
| 366 |
} |
| 367 |
} |
| 368 |
} |
| 369 |
return null; |
| 370 |
} |
| 371 |
*/ |
| 372 |
|
361 |
|
| 373 |
private String getServerLabels(String serviceRuntimeId) |
|
|
| 374 |
{ |
| 375 |
String[] validServerFactoryIds = WebServiceRuntimeExtensionUtils2.getServerFactoryIdsByServiceRuntime(serviceRuntimeId); |
| 376 |
//String[] validServerLabels = new String[validServerFactoryIds.length]; |
| 377 |
StringBuffer validServerLabels = new StringBuffer(); |
| 378 |
for (int i=0; i<validServerFactoryIds.length; i++) |
| 379 |
{ |
| 380 |
if (i>0) |
| 381 |
{ |
| 382 |
validServerLabels.append(", "); |
| 383 |
} |
| 384 |
validServerLabels.append(WebServiceRuntimeExtensionUtils.getServerLabelById(validServerFactoryIds[i])); |
| 385 |
|
| 386 |
} |
| 387 |
return validServerLabels.toString(); |
| 388 |
} |
| 389 |
|
| 390 |
private String getDefaultServiceProjectTemplate() |
362 |
private String getDefaultServiceProjectTemplate() |
| 391 |
{ |
363 |
{ |
| 392 |
String[] templates = WebServiceRuntimeExtensionUtils2.getServiceProjectTemplates(serviceIds_.getTypeId(), serviceIds_.getRuntimeId()); |
364 |
String[] templates = WebServiceRuntimeExtensionUtils2.getServiceProjectTemplates(serviceIds_.getTypeId(), serviceIds_.getRuntimeId()); |
|
Lines 604-607
Link Here
|
| 604 |
return serviceNeedEAR_; |
576 |
return serviceNeedEAR_; |
| 605 |
} |
577 |
} |
| 606 |
|
578 |
|
| 607 |
} |
579 |
} |