예제 #1
0
 private void emitGridTitle(JwCsvBuffer b) {
   String s = getState().getExportGridTitle();
   if (s != null) {
     b.addField(s);
     b.endRecord();
   }
 }
예제 #2
0
 private void emitCriteriaRow(JwCsvBuffer b, JwList<Object> v) {
   int len = b.getLength();
   for (Object e : v)
     if (e == null) b.addField("");
     else b.addField(e.toString());
   if (len != b.getLength()) b.endRecord();
 }
예제 #3
0
  public void emitCriteria(JwCsvBuffer b) {
    if (!hasExportCriteria()) return;

    int len = b.getLength();
    for (JwList<Object> v : getExportCriteria()) emitCriteriaRow(b, v);
    if (len != b.getLength()) b.endRecord();
  }
예제 #4
0
 public void emitGenerated(JwCsvBuffer b) {
   if (getState().getExportTimestamp()) {
     b.addField("Report Generated (UTC)");
     ScServletData data = ScServletData.getLocal();
     JwTimestampPolicy tp = data.getPreferredTimestampPolicy();
     b.addField(JwTimestamp.createNowUtc(), tp);
     b.endRecord();
     b.endRecord();
   }
 }
예제 #5
0
  private void emitHeaders(ScServletData data, JwCsvBuffer b) {
    int rowIndex = 0;
    int rowCount = getTitleRowCount();
    int lastRow = rowCount - 1;

    while (rowIndex < rowCount) {
      boolean isLastRow = rowIndex == lastRow;
      int len = b.getLength();
      emitPreHeaders(data, b);
      emitMainHeaders(b, rowIndex, isLastRow);
      emitPostHeaders(data, b);
      if (len != b.getLength()) b.endRecord();
      rowIndex++;
    }
  }
예제 #6
0
  public String getCsvExportFor(String airportCode, String roleOrRoleGroup) {
    JwSqlSelect st = getUserAirportAndRolesAndRoleGroupsSelect(airportCode, roleOrRoleGroup);

    JwCsvBuffer buffer = new JwCsvBuffer();
    buffer.addField("Login");
    buffer.addField("First Name");
    buffer.addField("Last Name");
    buffer.addField("Roles");
    buffer.addField("Role Groups");
    buffer.addField("Airports");
    buffer.endRecord();

    JwSqlResultSetProcessorIF p = getUserAirportAndRolesAndRoleGroupsResultSetProcessor(buffer);
    processResults(st, p);
    return buffer.toString();
  }
예제 #7
0
  protected void emitRow(
      ScServletData data, JwCsvBuffer buf, ScExportCsvState state, T e, int currentRow) {
    //        state.setCurrentRow(currentRow + 1);
    //        state.setCurrentRowIndex(currentRow);

    int maxChambers = getMaxChambersPerCell(e);

    for (int j = 0; j < maxChambers; j++) {
      int len = buf.getLength();

      emitPreColumns(data, buf, e, maxChambers, j);
      emitMainColumns(data, buf, e, maxChambers, j);
      emitPostColumns(data, buf, e, maxChambers, j);

      if (len != buf.getLength()) buf.endRecord();
    }
  }