+ " </parameters>\n"
+ "</customResourceSpecifier>";
private void handleAddRemote() {
String sDescriptorPath = editor.getFile().getParent().getLocation().toString() + '/';
AddRemoteServiceDialog dialog = new AddRemoteServiceDialog(this, sDescriptorPath);
dialog.open();
if (dialog.getReturnCode() == InputDialog.CANCEL)
return;
String sServiceType = dialog.getSelectedServiceTypeName();
if (sServiceType != null &&
!sServiceType.equals("UIMA-AS JMS") &&
!sServiceType.equals("SOAP") &&
!sServiceType.equals("Vinci")) {
return;
}
String sURI = dialog.getSelectedUri();
String sKey = dialog.getSelectedKey();
if (!isNewKey(sKey)) {
Utility.popMessage("Duplicate Key", "You have specified a duplicate key. Please try again.",
MessageDialog.ERROR);
return;
}
PrintWriter printWriter = setupToPrintFile(dialog.genFilePath);
if (null != printWriter) {
if (!sServiceType.equals("UIMA-AS JMS")) {
String vnsHostPort = "";
if (dialog.vnsHost.length() > 0) {
vnsHostPort = MessageFormat.format(" <parameter name=\"VNS_HOST\" value=\"{0}\"/>\n",
new Object[] { dialog.vnsHost });
}
if (dialog.vnsPort.length() > 0) {
vnsHostPort += MessageFormat.format(" <parameter name=\"VNS_PORT\" value=\"{0}\"/>\n",
new Object[] { dialog.vnsPort });
}
if (vnsHostPort.length() > 0)
vnsHostPort = "\n <parameters>" + vnsHostPort + " </parameters>";
printWriter.println(MessageFormat.format(REMOTE_TEMPLATE, new Object[] { dialog.aeOrCc, sURI,
sServiceType, dialog.timeout, vnsHostPort }));
} else {
// is UIMA-AS JMS
StringBuilder sb = new StringBuilder();
addParam(sb, "timeout", dialog.timeout);
addParam(sb, "getmetatimeout", dialog.getmetaTimeout);
addParam(sb, "cpctimeout", dialog.cpcTimeout);
addParam(sb, "binary_serialization", dialog.binary_serialization);
addParam(sb, "ignore_process_errors", dialog.ignore_process_errors);
printWriter.println(MessageFormat.format(REMOTE_JMS_TEMPLATE, new Object[] {
sURI, // brokerUrl
dialog.endpoint, // endpoint
sb.toString()
}));
}
printWriter.close();
boolean bSuccess = addDelegate(dialog.genFilePath, sKey, sKey, dialog.isImportByName);
if (bSuccess) {
boolean bAutoAddToFlow = dialog.getAutoAddToFlow();
if (bAutoAddToFlow) {
addNodeToFlow(sKey);
}
refresh();
}