Exemple #1
0
  String getProgressBar(IBatch batch) {

    String color = "success";
    if (batch.getRejectedItemsId() != null && batch.getRejectedItemsId().size() > 0) {
      color = "warning";
    }

    if (IBatch.STATUS_ZOMBIE.equals(batch.getStatus())) {
      color = "warning";
    }

    if (IBatch.STATUS_FAILURE.equals(batch.getStatus())) {
      color = "danger";
    }

    int percent = round(batch.getProgressStatus());

    String status = "progress-" + color;
    String active = "active";
    String striped = "progress-striped";
    // progress is animated if job is running (not complete and still
    // updated)
    if (IBatch.STATUS_ZOMBIE.equals(batch.getStatus())
        || IBatch.STATUS_FAILURE.equals(batch.getStatus()) //
        || IBatch.STATUS_SUCCESS.equals(batch.getStatus())) {
      active = "";
    }

    if (IBatch.STATUS_FAILURE.equals(batch.getStatus())
        || IBatch.STATUS_SUCCESS.equals(batch.getStatus())) {
      striped = "";
    }

    if (percent == -1) {
      percent = 100;
    }

    return "<div class=\"progress "
        + striped
        + " "
        + active
        + " "
        + status
        + "\">" //
        + "<div class=\"bar\" style=\"width: "
        + percent
        + "%;\"></div>"
        + "</div>";
  }
Exemple #2
0
  private String getIcon(IBatch b) {

    if (IBatch.STATUS_FAILURE.equals(b.getStatus())) {
      return Resources.STATUS_JOB_ERROR;
    }

    if (IBatch.STATUS_SUCCESS.equals(b.getStatus())
        && b.getRejectedItemsId() != null //
        && b.getRejectedItemsId().size() > 0) {
      return Resources.STATUS_JOB_WARNING;
    }

    return Resources.STATUS_JOB;
  }