예제 #1
0
  /**
   * Forwards new information for the jobs to the jobstatus instances, which are afterwards saved
   * via Memento within the monitor.core plug-in. This function stores all additional information
   * provided by lml_da in each jobStatusData instance.
   */
  public void forwardRowToJobData() {
    final JobStatusData[] userJobs = lguiItem.getUserJobs();
    final Set<String> userNames = new HashSet<String>();
    for (final JobStatusData jobStatus : userJobs) {
      userNames.add(jobStatus.getString(JobStatusData.OWNER_ATTR));
    }

    // Traverse all tables
    for (final TableType table : getTables()) {
      // Get extended rows with attached jobStatusData
      final Row[] rows =
          getTableDataWithColor(
              table.getId(), false); // Contains extended rows with additional data
      for (int i = 0; i < rows.length; i++) {
        if (rows[i].status == null) { // If there is no jobstatusdata, do not add additional data
          continue;
        }
        if (!userNames.contains(rows[i].status.getString(JobStatusData.OWNER_ATTR))) {
          continue;
        }

        final RowType rawRow = table.getRow().get(i); // The actual row from LML data
        // Iterate over all columns and save their key value pairs
        // into the jobstatus instances
        for (final ColumnType column : table.getColumn()) {
          final String columnName = column.getName();
          final String value = getCellValue(table, rawRow, columnName);
          if (value != null) {
            rows[i].status.putString(columnName, value);
          }
        }
      }
    }
  }
예제 #2
0
 /**
  * Getting an element(Table Type) which has an equal title to the argument tableType.
  *
  * @param gid ID of the desired table
  * @return Corresponding table to the desired table title
  */
 public TableType getTable(String gid) {
   for (final TableType tag : getTables()) {
     if (tag.getId().equals(gid)) {
       return tag;
     }
   }
   return null;
 }