Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.ConfigureResponse


  }

  @Override
  public ConfigureResponse getConfigForm(Locale locale) {
    try {
      ConfigureResponse result = new ConfigureResponse("",
          makeConfigForm(null, getResources(locale), false));
      LOGGER.config("getConfigForm form:\n" + result.getFormSnippet());
      return result;
    } catch (Throwable t) {
      return getErrorResponse(getExceptionMessages(null, t));
    }
  }
View Full Code Here


        // all is ok
        return null;
      }
      ResourceBundle messages = getResources(locale);
      ConfigureResponse result = new ConfigureResponse(
          getResource(messages, "missingRequiredInformation"),
          makeConfigForm(configData, messages, true));
      LOGGER.config("validateConfig new form:\n" + result.getFormSnippet());
      return result;
    } catch (Throwable t) {
      return getErrorResponse(getExceptionMessages(null, t));
    }
  }
View Full Code Here

  @Override
  public ConfigureResponse getPopulatedConfigForm(
      Map<String, String> configMap, Locale locale) {
    try {
      return new ConfigureResponse("",
          makeConfigForm(configMap, getResources(locale), false));
    } catch (Throwable t) {
      return getErrorResponse(getExceptionMessages(null, t));
    }
  }
View Full Code Here

  private ConfigureResponse getErrorResponse(String error) {
    StringBuilder buffer = new StringBuilder(
        "<tr><td colspan=\"2\"><font color=\"red\">");
    buffer.append(error); // FIXME: HTML escaping?
    buffer.append("</font></td></tr>");
    return new ConfigureResponse(null, buffer.toString());
  }
View Full Code Here

    this.service = service;
  }
 
  /** {@inheritDoc} */
  public ConfigureResponse getConfigForm(Locale locale) {
    return new ConfigureResponse("", makeForm(null, locale));   
  }
View Full Code Here

  }
 
  /** {@inheritDoc} */
  public ConfigureResponse getPopulatedConfigForm(Map configMap,
      Locale locale) {
    return new ConfigureResponse("", makeForm(configMap, locale));
  }
View Full Code Here

  public ConfigureResponse validateConfig(Map configMap, Locale locale) {
    String problemMessage = getFirstProblemMessage(configMap, service);
    if (problemMessage == null) {
      return null;
    } else {
      return new ConfigureResponse(getString(problemMessage, locale),
                                   makeForm(configMap, locale));
    }
  }
View Full Code Here

    String email = "EMAIL-" + nonce;
    String password = "PASSWORD-" + nonce;
    configMap.put(AfydConnectorType.DOMAIN_KEY, domain);
    configMap.put(AfydConnectorType.EMAIL_KEY, email);
    configMap.put(AfydConnectorType.PASSWORD_KEY, password);
    ConfigureResponse response = type.getPopulatedConfigForm(configMap, locale);
    String snippet = response.getFormSnippet();
   
    assertTrue(snippet.contains(domain));
    assertTrue(snippet.contains(email));
    assertTrue(snippet.contains(password));
  }
View Full Code Here

    DctmConnectorType test = new DctmConnectorType();
    String[] fiels = { "login", "Password", "docbase", "clientX",
        "authentication_type", "webtop_display_url", "where_clause",
        "is_public" };
    test.setConfigKeys(fiels);
    ConfigureResponse resp = test.validateConfig(map, Locale.US, null);
    assertNull(resp);
  }
View Full Code Here

    DctmConnectorType test = new DctmConnectorType();
    String[] fiels = { "login", "Password", "docbase", "clientX",
        "authentication_type", "webtop_display_url", "where_clause",
        "is_public" };
    test.setConfigKeys(fiels);
    ConfigureResponse resp = test.validateConfig(map, Locale.US, null);
    assertTrue(resp
        .getMessage()
        .startsWith(
            "<p><font color=\"#FF0000\">Some required configuration is missing: Please check the Superuser credentials."));
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.spi.ConfigureResponse

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.