public Component buildOverviewPanel(RestRequest request) {
    JPropertiesTable<RestRequest> table = new JPropertiesTable<RestRequest>("Request Properties");
    table.addProperty("Name", "name");
    table.addProperty("Description", "description", true);
    // table.addProperty( "Method", "method", new Object[]{RequestMethod.GET,
    // RequestMethod.POST,
    // RequestMethod.PUT, RequestMethod.DELETE, RequestMethod.HEAD} );
    table.addProperty("Encoding", "encoding", new String[] {null, "UTF-8", "iso-8859-1"});
    table.addProperty("Endpoint", "endpoint", request.getOperation().getInterface().getEndpoints());
    table.addProperty("Timeout", "timeout", true);
    table.addProperty("Bind Address", "bindAddress", true);
    table.addProperty("Follow Redirects", "followRedirects", JPropertiesTable.BOOLEAN_OPTIONS);

    // security / authentication
    table.addProperty("Username", "username", true);
    table.addPropertyShadow("Password", "password", true);
    table.addProperty("Domain", "domain", true);
    table.addProperty(
        "Authentication Type",
        "authType",
        new String[] {
          AuthType.GLOBAL_HTTP_SETTINGS.toString(),
          AuthType.PREEMPTIVE.toString(),
          AuthType.NTLM_KERBEROS.toString()
        });

    StringList keystores =
        new StringList(
            request.getOperation().getInterface().getProject().getWssContainer().getCryptoNames());
    keystores.add("");
    table.addProperty("SSL Keystore", "sslKeystore", keystores.toStringArray());

    table.addProperty("Strip whitespaces", "stripWhitespaces", JPropertiesTable.BOOLEAN_OPTIONS);
    table.addProperty(
        "Remove Empty Content", "removeEmptyContent", JPropertiesTable.BOOLEAN_OPTIONS);
    table.addProperty(
        "Entitize Properties", "entitizeProperties", JPropertiesTable.BOOLEAN_OPTIONS);
    table.addProperty("Multi-Value Delimiter", "multiValueDelimiter", true);

    // post-processing
    table.addProperty("Pretty Print", "prettyPrint", JPropertiesTable.BOOLEAN_OPTIONS);
    table
        .addProperty("Dump File", "dumpFile")
        .setDescription("Dumps response message to specified file");
    table
        .addProperty("Max Size", "maxSize", true)
        .setDescription("The maximum number of bytes to receive");

    table.setPropertyObject(request);

    return table;
  }
示例#2
0
  public JComponent getComponent() {
    if (mainPanel == null) {
      mainPanel = new JPanel(new BorderLayout());

      form = new SimpleBindingForm(new PresentationModel<AbstractHttpRequest<?>>(request));
      form.addSpace(5);
      form.appendComboBox(
          "authType",
          "Authorisation Type",
          new String[] {
            AuthType.GLOBAL_HTTP_SETTINGS.toString(),
            AuthType.PREEMPTIVE.toString(),
            AuthType.NTLM_KERBEROS.toString()
          },
          "");
      form.appendTextField("username", "Username", "The username to use for HTTP Authentication");
      form.appendPasswordField(
          "password", "Password", "The password to use for HTTP Authentication");
      form.appendTextField(
          "domain", "Domain", "The domain to use for Authentication(NTLM/Kerberos)");

      if (request instanceof WsdlRequest) {
        StringList outgoingNames =
            new StringList(
                request
                    .getOperation()
                    .getInterface()
                    .getProject()
                    .getWssContainer()
                    .getOutgoingWssNames());
        outgoingNames.add("");
        StringList incomingNames =
            new StringList(
                request
                    .getOperation()
                    .getInterface()
                    .getProject()
                    .getWssContainer()
                    .getIncomingWssNames());
        incomingNames.add("");

        form.addSpace(5);
        form.appendComboBox(
            "outgoingWss",
            "Outgoing WSS",
            outgoingNames.toStringArray(),
            "The outgoing WS-Security configuration to use");
        form.appendComboBox(
            "incomingWss",
            "Incoming WSS",
            incomingNames.toStringArray(),
            "The incoming WS-Security configuration to use");
      }

      form.addSpace(5);

      mainPanel.add(new JScrollPane(form.getPanel()), BorderLayout.CENTER);
    }

    return mainPanel;
  }