|
Lines 227-233
Link Here
|
| 227 |
|
227 |
|
| 228 |
setClientDefaultProject(); |
228 |
setClientDefaultProject(); |
| 229 |
setClientDefaultEAR(); |
229 |
setClientDefaultEAR(); |
| 230 |
setClientDefaultServer(); |
230 |
Status serverStatus = setClientDefaultServer(); |
|
|
231 |
if (serverStatus.getSeverity()== Status.ERROR) |
| 232 |
{ |
| 233 |
environment.getStatusHandler().reportError(serverStatus); |
| 234 |
return serverStatus; |
| 235 |
} |
| 231 |
updateClientEARs(); |
236 |
updateClientEARs(); |
| 232 |
|
237 |
|
| 233 |
//Calculate default IWebServiceClient |
238 |
//Calculate default IWebServiceClient |
|
Lines 411-421
Link Here
|
| 411 |
//reasonable J2EE version and Web service runtime values |
416 |
//reasonable J2EE version and Web service runtime values |
| 412 |
|
417 |
|
| 413 |
if (project != null && project.exists()) |
418 |
if (project != null && project.exists()) |
| 414 |
{ |
419 |
{ |
| 415 |
boolean isValidComponentType = J2EEUtils.isWebComponent(project, componentName) || |
420 |
boolean isValidComponentType = false; |
|
|
421 |
if (componentName != null && componentName.length()>0) |
| 422 |
{ |
| 423 |
isValidComponentType = J2EEUtils.isWebComponent(project, componentName) || |
| 416 |
J2EEUtils.isEJBComponent(project, componentName) || |
424 |
J2EEUtils.isEJBComponent(project, componentName) || |
| 417 |
J2EEUtils.isAppClientComponent(project, componentName) || |
425 |
J2EEUtils.isAppClientComponent(project, componentName) || |
| 418 |
J2EEUtils.isJavaComponent(project, componentName); |
426 |
J2EEUtils.isJavaComponent(project, componentName); |
|
|
427 |
} |
| 428 |
|
| 419 |
if (isValidComponentType) |
429 |
if (isValidComponentType) |
| 420 |
{ |
430 |
{ |
| 421 |
//WebServiceClientTypeRegistry wsctReg = WebServiceClientTypeRegistry.getInstance(); |
431 |
//WebServiceClientTypeRegistry wsctReg = WebServiceClientTypeRegistry.getInstance(); |
|
Lines 819-826
Link Here
|
| 819 |
} |
829 |
} |
| 820 |
} |
830 |
} |
| 821 |
|
831 |
|
| 822 |
private void setClientDefaultServer() |
832 |
private Status setClientDefaultServer() |
| 823 |
{ |
833 |
{ |
|
|
834 |
Status status = new SimpleStatus(""); |
| 824 |
//Calculate reasonable default server based on initial project selection. |
835 |
//Calculate reasonable default server based on initial project selection. |
| 825 |
String initialClientProjectName = runtimeClientTypes_.getChoice().getChoice().getList().getSelection(); |
836 |
String initialClientProjectName = runtimeClientTypes_.getChoice().getChoice().getList().getSelection(); |
| 826 |
IProject initialClientProject = ProjectUtilities.getProject(initialClientProjectName); |
837 |
IProject initialClientProject = ProjectUtilities.getProject(initialClientProjectName); |
|
Lines 872-883
Link Here
|
| 872 |
{ |
883 |
{ |
| 873 |
clientIds_.setServerInstanceId(serverInfo[1]); |
884 |
clientIds_.setServerInstanceId(serverInfo[1]); |
| 874 |
} |
885 |
} |
| 875 |
} |
886 |
} |
|
|
887 |
else |
| 888 |
{ |
| 889 |
//Since the project and the EAR are both new, try changing the J2EE level |
| 890 |
boolean foundServer = false; |
| 891 |
WebServiceRuntimeInfo wsrt = WebServiceRuntimeExtensionUtils.getWebServiceRuntimeById(clientIds_.getRuntimeId()); |
| 892 |
if (wsrt != null) |
| 893 |
{ |
| 894 |
String[] versions = wsrt.getJ2eeLevels(); |
| 895 |
if (versions != null && versions.length > 0) |
| 896 |
{ |
| 897 |
for (int k=0; k<versions.length; k++) |
| 898 |
{ |
| 899 |
//If this J2EE version is different from the current one, see if there is |
| 900 |
//a server available. |
| 901 |
if (clientJ2EEVersion_!=versions[k]) |
| 902 |
{ |
| 903 |
String[] si = ServerSelectionUtils.getServerFromWebServceRuntimeAndJ2EE(clientIds_.getRuntimeId(), versions[k]); |
| 904 |
if (si!=null) |
| 905 |
{ |
| 906 |
if (si[0]!=null && si[0].length()>0) |
| 907 |
{ |
| 908 |
clientIds_.setServerId(si[0]); |
| 909 |
} |
| 910 |
if (si[1]!=null && si[1].length()>0) |
| 911 |
{ |
| 912 |
clientIds_.setServerInstanceId(si[1]); |
| 913 |
} |
| 914 |
clientJ2EEVersion_ = versions[k]; |
| 915 |
foundServer = true; |
| 916 |
break; |
| 917 |
} |
| 918 |
|
| 919 |
} |
| 920 |
} |
| 921 |
} |
| 922 |
} |
| 923 |
//No valid server runtimes appear to be configured, this is an error condition. |
| 924 |
if (!foundServer) |
| 925 |
{ |
| 926 |
String runtimeLabel = WebServiceRuntimeExtensionUtils.getRuntimeLabelById(clientIds_.getRuntimeId()); |
| 927 |
String serverLabels = getServerLabels(clientIds_.getRuntimeId()); |
| 928 |
status = new SimpleStatus("", msgUtils_.getMessage("MSG_ERROR_NO_SERVER_RUNTIME", new String[]{runtimeLabel, serverLabels}),Status.ERROR); |
| 929 |
} |
| 930 |
|
| 931 |
} |
| 876 |
} |
932 |
} |
| 877 |
|
933 |
|
| 878 |
} |
934 |
} |
|
|
935 |
|
| 936 |
return status; |
| 879 |
} |
937 |
} |
| 880 |
|
938 |
|
|
|
939 |
protected String getServerLabels(String runtimeId) |
| 940 |
{ |
| 941 |
WebServiceRuntimeInfo wsrt = WebServiceRuntimeExtensionUtils.getWebServiceRuntimeById(runtimeId); |
| 942 |
String[] validServerFactoryIds = wsrt.getServerFactoryIds(); |
| 943 |
//String[] validServerLabels = new String[validServerFactoryIds.length]; |
| 944 |
StringBuffer validServerLabels = new StringBuffer(); |
| 945 |
for (int i=0; i<validServerFactoryIds.length; i++) |
| 946 |
{ |
| 947 |
if (i>0) |
| 948 |
{ |
| 949 |
validServerLabels.append(", "); |
| 950 |
} |
| 951 |
validServerLabels.append(WebServiceRuntimeExtensionUtils.getServerLabelById(validServerFactoryIds[i])); |
| 952 |
|
| 953 |
} |
| 954 |
return validServerLabels.toString(); |
| 955 |
} |
| 881 |
|
956 |
|
| 882 |
protected void updateClientProject(String projectName, String componentName, String serviceTypeId) |
957 |
protected void updateClientProject(String projectName, String componentName, String serviceTypeId) |
| 883 |
{ |
958 |
{ |