Exemplo n.º 1
0
  public void loadProperty() {

    try {

      File file = new File(confFileName);

      log.debug("file=" + file.getAbsolutePath());

      confProperties = new Properties();
      confProperties.loadFromXML(new FileInputStream(file));

      bonitaApiHost = confProperties.getProperty("bonita.api.host");
      bonitaApiUsername = confProperties.getProperty("bonita.api.username");
      bonitaApiPassword = confProperties.getProperty("bonita.api.password");
      bonitaApiHttpUsername = confProperties.getProperty("bonita.api.http.username");
      bonitaApiHttpPassword = confProperties.getProperty("bonita.api.http.password");
      bonitaApiPath = confProperties.getProperty("bonita.api.path");

      rallyApiHost = confProperties.getProperty("rally.api.host");
      rallyApiHttpUsername = confProperties.getProperty("rally.api.http.username");
      rallyApiHttpPassword = confProperties.getProperty("rally.api.http.password");
      rallyProjectIds = confProperties.getProperty("rally.project.ids");

      // bonitaProcessId=properties.getProperty("bonita.process.xp_code.id");

      workflowServiceUrl = confProperties.getProperty("service.url");

    } catch (Exception e) {
      log.error("", e);
    }
  }
  protected void handleRequest(final HttpRequest request, final HttpResponse response)
      throws HttpException, IOException, JSONException, CalicoAPIErrorException, SuccessException {

    Properties params = getURLParams(request);

    final long uuid = Long.parseLong(params.getProperty("uuid", "0"));

    if (uuid == 0) {
      // ERROR
      throw new NotFoundException("The canvas you requested was not found.");
    }

    if (!CCanvasController.canvases.containsKey(uuid)) {
      throw new NotFoundException("The canvas you requested was not found.");
    }

    throw new SuccessException(CCanvasController.canvases.get(uuid).toProperties());
  }