|
Lines 11-16
Link Here
|
| 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 |
* 20060221 119111 rsinha@ca.ibm.com - Rupam Kuehner |
|
|
14 |
* 20060227 124392 rsinha@ca.ibm.com - Rupam Kuehner |
| 14 |
*******************************************************************************/ |
15 |
*******************************************************************************/ |
| 15 |
package org.eclipse.jst.ws.internal.creation.ui.widgets.runtime; |
16 |
package org.eclipse.jst.ws.internal.creation.ui.widgets.runtime; |
| 16 |
|
17 |
|
|
Lines 363-395
Link Here
|
| 363 |
{ |
364 |
{ |
| 364 |
String[] templates = WebServiceRuntimeExtensionUtils2.getServiceProjectTemplates(serviceIds_.getTypeId(), serviceIds_.getRuntimeId()); |
365 |
String[] templates = WebServiceRuntimeExtensionUtils2.getServiceProjectTemplates(serviceIds_.getTypeId(), serviceIds_.getRuntimeId()); |
| 365 |
|
366 |
|
| 366 |
//Pick the Web one if it's there, otherwise pick the first one. |
367 |
//Walk the list of service project types in the project topology preference |
| 367 |
for (int i=0; i<templates.length; i++) |
368 |
ProjectTopologyContext ptc= WebServiceConsumptionUIPlugin.getInstance().getProjectTopologyContext(); |
|
|
369 |
String[] preferredTemplateIds = ptc.getServiceTypes(); |
| 370 |
for (int j = 0; j < preferredTemplateIds.length; j++) |
| 368 |
{ |
371 |
{ |
| 369 |
String templateId = templates[i]; |
372 |
for (int i = 0; i < templates.length; i++) |
| 370 |
if (templateId.indexOf("web") != -1) |
|
|
| 371 |
{ |
373 |
{ |
| 372 |
boolean matches = WebServiceRuntimeExtensionUtils2.doesServiceRuntimeSupportTemplate(serviceRuntimeId_, templateId); |
374 |
String templateId = templates[i]; |
| 373 |
if (matches) |
375 |
if (templateId.equals(preferredTemplateIds[j])) |
| 374 |
{ |
376 |
{ |
| 375 |
return templates[i]; |
377 |
boolean matches = WebServiceRuntimeExtensionUtils2.doesServiceRuntimeSupportTemplate(serviceRuntimeId_, templateId); |
| 376 |
} |
378 |
if (matches) |
| 377 |
} |
379 |
{ |
| 378 |
} |
380 |
return templates[i]; |
| 379 |
|
381 |
} |
| 380 |
//Didn't find a "web" type. Return the first one that is a match. Calculate the facet matcher for the template |
382 |
} |
| 381 |
//so that we know what to create and what to add during module creation. |
|
|
| 382 |
for (int j = 0; j < templates.length; j++) |
| 383 |
{ |
| 384 |
String templateId = templates[j]; |
| 385 |
boolean matches = WebServiceRuntimeExtensionUtils2.doesServiceRuntimeSupportTemplate(serviceRuntimeId_, templateId); |
| 386 |
if (matches) |
| 387 |
{ |
| 388 |
return templates[j]; |
| 389 |
} |
383 |
} |
| 390 |
} |
384 |
} |
| 391 |
|
385 |
|
| 392 |
//Still nothing, return the first one if available. |
386 |
//Since the preferredTemplateIds contains the union of all project types for all service runtimes, we are |
|
|
387 |
//guaranteed to have returned by now, so the code below will never be executed under normal |
| 388 |
//circumstances. Just return something to satisfy the compiler. |
| 393 |
if (templates.length > 0) |
389 |
if (templates.length > 0) |
| 394 |
return templates[0]; |
390 |
return templates[0]; |
| 395 |
|
391 |
|