Package org.apache.uima.simpleserver.config

Examples of org.apache.uima.simpleserver.config.ServerSpec


  // maps woth parameters, values and their descriptions,
  // as well as the current URL,
  // and the additional descritpion specified in the previous method.

  public String constructHtmlDescription(String servletURL) {
    ServerSpec rspec = this.server.getServiceSpec();
    String html = "<html>" + "<head>" + "<title>"
            + rspec.getShortDescription()
            + "</title>"
            + "</head>"
            + "<body>"
            + "<h2>"
            + rspec.getShortDescription()
            + "</h2>"
            + rspec.getLongDescription()
            + "<h3>Usage</h3>"
            + "In order to use this service, a POST- or GET-request should be sent to the server with the following URL:"
            + "<pre>"
            + servletURL
            + "</pre>"
View Full Code Here


   * valid instance of ResultSpecification in order to be able to deliver a valid XML service
   * description
   */
  @Override
  public boolean initServer() {
    ServerSpec res = new ServerSpecImpl("Result Merger",
        "Result Merger - merge results of other UIMA services");
    // res.setTypeSpecs(new ArrayList<TypeMap>());
    // TODO: fix this
    // this.server.setResultSpec(res);
    return true;
View Full Code Here

    // Also create ant build script for this.
    // TEMPORARY:
    final boolean doOutputAll = false;

    // Create new server spec from XML beans.
    ServerSpec spec = ConfigFactory.newServerSpec(specBean.getShortDescription(), specBean
        .getLongDescription(), doOutputAll);
    TypeElementType[] typeMaps = specBean.getTypeArray();
    for (int i = 0; i < typeMaps.length; i++) {
      spec.addTypeMap(readTypeMap(typeMaps[i]));
    }
    return spec;
  }
View Full Code Here

  // maps woth parameters, values and their descriptions,
  // as well as the current URL,
  // and the additional descritpion specified in the previous method.

  public String constructHtmlDescription(String servletURL) {
    ServerSpec rspec = this.server.getServiceSpec();
    String html = "<html>" + "<head>" + "<title>"
        + rspec.getShortDescription()
        + "</title>"
        + "</head>"
        + "<body>"
        + "<h2>"
        + rspec.getShortDescription()
        + "</h2>"
        + rspec.getLongDescription()
        + "<h3>Usage</h3>"
        + "In order to use this service, a POST- or GET-request should be sent to the server with the following URL:"
        + "<pre>"
        + servletURL
        + "</pre>"
View Full Code Here

   * valid instance of ResultSpecification in order to be able to deliver a valid XML service
   * description
   */
  @Override
  public boolean initServer() {
    ServerSpec res = new ServerSpecImpl("Result Merger",
        "Result Merger - merge results of other UIMA services");
    // res.setTypeSpecs(new ArrayList<TypeMap>());
    // TODO: fix this
    // this.server.setResultSpec(res);
    return true;
View Full Code Here

  @Test
  public void readSampleConfig() {
    try {
      InputStream is = this.getClass().getClassLoader().getResourceAsStream(CONFIG_TEST_FILE);
      ServerSpec spec = XmlConfigReader.readServerSpec(is);
      List<TypeMap> types = spec.getTypeSpecs();
      for (int i = 0; i < types.size(); i++) {
        assertNotNull(types.get(i));
      }
    } catch (XmlException e) {
      e.printStackTrace();
View Full Code Here

    test("serverspec/spec6.xml", 10);
  }

  private static final void test(String configFile, int expectedResultNumber) {
    JCas cas = createTestCas();
    ServerSpec serverSpec = null;
    try {
      serverSpec = XmlConfigReader.readServerSpec(JUnitExtension.getFile(configFile));
    } catch (SimpleServerException e) {
      e.printStackTrace();
      assertTrue(false);
    } catch (IOException e) {
      e.printStackTrace();
      assertTrue(false);
    } catch (XmlException e) {
      e.printStackTrace();
      assertTrue(false);
    }
    List<SimpleServerException> exc = serverSpec.validate(cas.getTypeSystem());
    if (exc.size() > 0) {
      exc.get(0).printStackTrace();
      assertTrue(false);
    }
    ResultExtractor ex = new ResultExtractor();
View Full Code Here

  // maps woth parameters, values and their descriptions,
  // as well as the current URL,
  // and the additional descritpion specified in the previous method.

  public String constructHtmlDescription(String servletURL) {
    ServerSpec rspec = this.server.getServiceSpec();
    String html = "<html>" + "<head>" + "<title>"
            + rspec.getShortDescription()
            + "</title>"
            + "</head>"
            + "<body>"
            + "<h2>"
            + rspec.getShortDescription()
            + "</h2>"
            + rspec.getLongDescription()
            + "<h3>Usage</h3>"
            + "In order to use this service, a POST- or GET-request should be sent to the server with the following URL:"
            + "<pre>"
            + servletURL
            + "</pre>"
View Full Code Here

  @Test
  public void readSampleConfig() {
    try {
      InputStream is = this.getClass().getClassLoader().getResourceAsStream(CONFIG_TEST_FILE);
      ServerSpec spec = XmlConfigReader.readServerSpec(is);
      List<TypeMap> types = spec.getTypeSpecs();
      for (int i = 0; i < types.size(); i++) {
        assertNotNull(types.get(i));
      }
    } catch (XmlException e) {
      e.printStackTrace();
View Full Code Here

  }

  private static final void test(String testNumber, int expectedResultNumber) {
    final String configFile = getConfigFileName(testNumber);
    JCas cas = createTestCas();
    ServerSpec serverSpec = null;
    try {
      serverSpec = XmlConfigReader.readServerSpec(JUnitExtension.getFile(configFile));
    } catch (SimpleServerException e) {
      e.printStackTrace();
      assertTrue(false);
    } catch (IOException e) {
      e.printStackTrace();
      assertTrue(false);
    } catch (XmlException e) {
      e.printStackTrace();
      assertTrue(false);
    }
    List<SimpleServerException> exc = serverSpec.validate(cas.getTypeSystem());
    if (exc.size() > 0) {
      exc.get(0).printStackTrace();
      assertTrue(false);
    }
    ResultExtractor ex = new ResultExtractor();
View Full Code Here

TOP

Related Classes of org.apache.uima.simpleserver.config.ServerSpec

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.