Package edu.isi.karma.rep

Examples of edu.isi.karma.rep.Table


    } else if (value instanceof Boolean) {
      row.setValue(hNodeId, value.toString(), factory);
    } else if (value instanceof JSONObject) {
      if (maxNumLines <= 0 || numObjects < maxNumLines) {
        HTable nestedHTable = addNestedHTable(hNode, key, row);
        Table nestedTable = row.getNode(hNodeId).getNestedTable();
        addKeysAndValues((JSONObject) value, nestedHTable, nestedTable);
      }
    } else if (value instanceof JSONArray) {
      if (maxNumLines <= 0 || numObjects < maxNumLines) {
        HTable nestedHTable = addNestedHTable(hNode, key, row);
        Table nestedTable = row.getNode(hNodeId).getNestedTable();
        JSONArray a = (JSONArray) value;
        for (int i = 0; i < a.length(); i++) {
          addListElement(a.get(i), nestedHTable, nestedTable);
        }
      }
View Full Code Here


    }
    else if (c == '{') {
      if (maxNumLines <= 0 || numObjects < maxNumLines) {
        if (hNode != null) {
          HTable nestedHTable = addNestedHTable(hNode, key, row);
          Table nestedTable = row.getNode(hNodeId).getNestedTable();
          addKeysAndValues(token, nestedHTable, nestedTable);
        }
        else
          addKeysAndValues(token, null, null);
      }
    } else if (c == '[') {
      if (maxNumLines <= 0 || numObjects < maxNumLines) {
        if (hNode != null) {
          HTable nestedHTable = addNestedHTable(hNode, key, row);
          Table nestedTable = row.getNode(hNodeId).getNestedTable();
          addListElement(token, nestedHTable, nestedTable);
        }
        else
          addListElement(token, null, null);
      }
View Full Code Here

        numObjects++;
        if (maxNumLines > 0 && numObjects >= maxNumLines)
          return;
        HTable nestedHTable = addNestedHTable(hNode,
            "nested array values", row);
        Table nestedTable = row.getNode(hNodeId).getNestedTable();
        JSONArray a = (JSONArray) listValue;
        for (int i = 0; i < a.length(); i++) {
          addListElement(a.get(i), nestedHTable, nestedTable);
        }
      }
View Full Code Here

            numObjects++;
            if (maxNumLines > 0 && numObjects >= maxNumLines)
              return;
            HTable nestedHTable = addNestedHTable(hNode,
                "nested array values", row);
            Table nestedTable = row.getNode(hNodeId).getNestedTable();
            addListElement(token, nestedHTable, nestedTable);
          }
          else
            addListElement(token, null, null);
        }
View Full Code Here

      response.put(JsonKeys.worksheetId.name(), worksheetId);
      response.put(AbstractUpdate.GenericJsonKeys.updateType.name(),
          this.getClass().getSimpleName());

      Worksheet wk = vWorksheet.getWorksheet();
      Table dataTable = wk.getDataTable();
      TablePager pager = vWorksheet.getTopTablePager();

      JSONArray rows = getRowsUsingPager(
          pager, vWorksheet,
          vWorksheet.getHeaderViewNodes(), vWorkspace.getPreferences().getIntViewPreferenceValue(
              ViewPreference.maxCharactersInCell));
      int rowsLeft = dataTable.getNumRows() - rows.length();
      rowsLeft = rowsLeft < 0 ? 0 : rowsLeft;
      response.put(JsonKeys.additionalRowsCount.name(), rowsLeft);
      response.put(JsonKeys.tableId.name(), dataTable.getId());
      response.put(JsonKeys.rows.name(), rows);

      pw.println(response.toString());
    } catch (JSONException e) {
      logger.error("JSONException", e);
View Full Code Here

              WorksheetHeadersUpdate.getColumnClass(vNode.getId()));
          nodeObj.put(JsonKeys.nodeId.name(), rowNode.getId());

          if (vNode.hasNestedTable()) {
            nodeObj.put(JsonKeys.hasNestedTable.name(), true);
            Table nestedTable = rowNode.getNestedTable();
            JSONArray nestedTableRows = getRowsUsingPager(
                vWorksheet.getNestedTablePager(nestedTable),
                vWorksheet,
                vNode.getNestedNodes(),
                maxDataDisplayLength);
            nodeObj.put(JsonKeys.nestedRows.name(), nestedTableRows);
            nodeObj.put(JsonKeys.tableId.name(), rowNode.getNestedTable().getId());

            int rowsLeft = nestedTable.getNumRows() - nestedTableRows.length();
            rowsLeft = rowsLeft < 0 ? 0 : rowsLeft;
            nodeObj.put(JsonKeys.additionalRowsCount.name(), rowsLeft);

          } else {
            String nodeVal = rowNode.getValue().asString();
View Full Code Here

    Map<String, String> mapping = CloneTableUtils.cloneHTable(ht, newht, oldws, factory, childHNodes, selection);
    for (Entry<String, String> entry : mapping.entrySet()) {
      outputColumns.add(entry.getValue());
    }
    for (Row parentRow : parentRows) {
      Table t = null;
      for (Node node : parentRow.getNodes()) {
        if (node.hasNestedTable() && node.getNestedTable().getHTableId().compareTo(ht.getId()) == 0) {
          t = node.getNestedTable();
          break;
       
      }
      ArrayList<Row> rows = t.getRows(0, t.getNumRows(), selection);
      for (Row row : rows) {
        Table nestedTable = row.getNeighbor(newNode.getId()).getNestedTable();
        generateRows(hnodes, selection, row, nestedTable, factory, mapping, childHNodes, newht);
      }

    }
  }
View Full Code Here

    for (Entry<String, String> entry : mapping.entrySet()) {
      outputColumns.add(entry.getValue());
    }
    ArrayList<Row> rows = oldws.getDataTable().getRows(0, oldws.getDataTable().getNumRows(), selection);
    for (Row row : rows) {
      Table nestedTable = row.getNeighbor(newNode.getId()).getNestedTable();
      generateRows(hnodes, selection, row, nestedTable, factory, mapping, childHNodes, newht);
    }

  }
View Full Code Here

        headersList = addHeaders(wk, columnNames, factory);
       
      }
     
      /** Add the data **/
          Table dataTable = wk.getDataTable();
          Row row = dataTable.addRow(factory);
          for(int i=0; i<rowValues.size(); i++) {
            row.setValue(headersList.get(i), rowValues.get(i), factory);
          }
     
      counter++;
View Full Code Here

            nodeObj.put(columnName, "");
            String str = nodeObj.toString();
            pw.print(rowSep);
            pw.print(str.substring(1, str.length()-3));

            Table nestedTable = rowNode.getNestedTable();
            generateRowsUsingPager(
                vWorksheet.getNestedTablePager(nestedTable),
                vWorksheet,
                vNode.getNestedNodes(),
                pw, space + "  ");
View Full Code Here

TOP

Related Classes of edu.isi.karma.rep.Table

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.