Package org.apache.uima.taeconfigurator.editors.ui.dialogs

Examples of org.apache.uima.taeconfigurator.editors.ui.dialogs.AddRemoteServiceDialog


    + "  </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();
      }
View Full Code Here


          "  <timeout>{3}</timeout>" + "  {4}" + // <parameters> for VNS </parameters>
          "\n</uriSpecifier>";

  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("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) {
      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 }));
      printWriter.close();

      boolean bSuccess = addDelegate(dialog.genFilePath, sKey, sKey, dialog.isImportByName);
      if (bSuccess) {
        boolean bAutoAddToFlow = dialog.getAutoAddToFlow();
        if (bAutoAddToFlow) {
          addNodeToFlow(sKey);
        }
        refresh();
      }
View Full Code Here

    + "  </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();
      }
View Full Code Here

          "  <timeout>{3}</timeout>" + "  {4}" + // <parameters> for VNS </parameters>
          "\n</uriSpecifier>";

  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("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) {
      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 }));
      printWriter.close();

      boolean bSuccess = addDelegate(dialog.genFilePath, sKey, sKey, dialog.isImportByName);
      if (bSuccess) {
        boolean bAutoAddToFlow = dialog.getAutoAddToFlow();
        if (bAutoAddToFlow) {
          addNodeToFlow(sKey);
        }
        refresh();
      }
View Full Code Here

TOP

Related Classes of org.apache.uima.taeconfigurator.editors.ui.dialogs.AddRemoteServiceDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.