Package edu.isi.karma.rep

Examples of edu.isi.karma.rep.Row


     
     
      for (String key : hash.keySet()) {
        ArrayList<String> r = hash.get(key);
        Node node = parentRow.getNeighbor(newNode.getId());
        Row lastRow = CloneTableUtils.cloneDataTable(factory.getRow(r.get(0)), node.getNestedTable(), ht, newht, keyhnodes, factory, selection);
        for (String rowid : r) {
          Row cur = factory.getRow(rowid);
          Table dataTable = lastRow.getNeighborByColumnName("Values", factory).getNestedTable();
          CloneTableUtils.cloneDataTable(cur, dataTable, ht, newValueTable, valuehnodes, factory, selection);
        }
      }
    }
View Full Code Here


      }

      for (String hashKey : hash.keySet()) {
        ArrayList<String> r = hash.get(hashKey);
        Node node = parentRow.getNeighbor(newNode.getId());
        Row lastRow = CloneTableUtils.cloneDataTable(factory.getRow(r.get(0)), node.getNestedTable(),
            parentHT, newHT, hnodes, factory, selection);
        for (String rowid : r) {
          Row cur = factory.getRow(rowid);
          String newId = HNodeidMapping.get(cur.getNode(key.getId()).getValue().asString());
          Node newnode = lastRow.getNode(newId);
          Node oldnode = cur.getNode(value.getId());
          Row tmprow = newnode.getNestedTable().addRow(factory);
          tmprow.getNeighborByColumnName("Values", factory).setValue(oldnode.getValue().asString(), oldnode.getStatus(), factory);
          //newnode.setValue(oldnode.getValue().asString(), oldnode.getStatus(), factory);
        }
        resultRows.add(lastRow);
      }
    }
View Full Code Here

      hash.put(hashValue, ids);
    }
    List<Row> resultRows = new ArrayList<Row>();
    for (String hashKey : hash.keySet()) {
      ArrayList<String> r = hash.get(hashKey);
      Row lastRow = CloneTableUtils.cloneDataTable(factory.getRow(r.get(0)), newws.getDataTable(),
          oldws.getHeaders(), newws.getHeaders(), hnodes, factory, selection);
      for (String rowid : r) {
        Row cur = factory.getRow(rowid);
        String newId = HNodeidMapping.get(cur.getNode(key.getId()).getValue().asString());
        Node newnode = lastRow.getNode(newId);
        Node oldnode = cur.getNode(value.getId());
        Row tmprow = newnode.getNestedTable().addRow(factory);
        tmprow.getNeighborByColumnName("Values", factory).setValue(oldnode.getValue().asString(), oldnode.getStatus(), factory);
        //newnode.setValue(oldnode.getValue().asString(), oldnode.getStatus(), factory);
      }
      resultRows.add(lastRow);
    }
    for (Row tmpRow : resultRows) {
View Full Code Here

      Map<String, String> rowValueMap = new TreeMap<String, String>();
     
      UpdateContainer c = new UpdateContainer();
        for (Node node : mainNodes) {

          Row row = node.getBelongsToRow();
          rowValueMap.put(row.getId(), requestJsonArray.get(i).toString());
          //oldValueMap.put(row.getId(),node.getValue().asString());
          i = i+1;
         
        }
        edit = new MultipleValueEditColumnCommand(mainId, mainWorksheetId, mainHNodeId, rowValueMap);
View Full Code Here

    PyCode py = repo.getTransformCode();

    int numRowsWithErrors = 0;

    for (Node node : nodes) {
      Row row = node.getBelongsToRow();

      interpreter.set("nodeid", node.getId());

      try {
        PyObject output = interpreter.eval(py);
        String transformedValue = PythonTransformationHelper
            .getPyObjectValueAsString(output);
        addTransformedValue(transformedRows, row, transformedValue);
      } catch (PyException p) {
        logger.info("error in evaluation python, skipping one row");
        numRowsWithErrors++;
        // Error occured in the Python method execution
        addTransformedValue(transformedRows, row, errorDefaultValue);
        addError(errorValues, row, counter, p.value);
      } catch (Exception t) {
        // Error occured in the Python method execution
        logger.debug(
            "Error occured while transforming, using default value.",
            t);
        numRowsWithErrors++;
        rowToValueMap.put(row.getId(), errorDefaultValue);
      }
      if (limit != null && ++counter >= limit) {
        break;
      }
    }
View Full Code Here

    }
    return tmp;
  }

  public static Row cloneDataTable(Row oldRow, Table newDataTable, HTable oldHTable, HTable newHTable, List<HNode> hnodes, RepFactory factory, SuperSelection sel) {
    Row newrow = newDataTable.addRow(factory);
    for (HNode hnode : hnodes) {
      HNode newHNode = newHTable.getHNodeFromColumnName(hnode.getColumnName());
      if (newHNode == null)
        continue;
     
      Node oldNode = oldRow.getNode(hnode.getId());
      Node newNode = newrow.getNode(newHNode.getId());
      if (oldNode == null)
        continue;
      if (!oldNode.hasNestedTable()) {
        newNode.setValue(oldNode.getValue(), oldNode.getStatus(), factory);
      }
View Full Code Here

  }

  public static void cloneDataTable(Table oldDataTable, Table newDataTable, HTable oldHTable, HTable newHTable, List<HNode> hnodes, RepFactory factory, SuperSelection sel) {
    ArrayList<Row> rows = oldDataTable.getRows(0, oldDataTable.getNumRows(), sel);
    for (Row row : rows) {
      Row newrow = newDataTable.addRow(factory);
      for (HNode hnode : hnodes) {
        HNode newHNode = newHTable.getHNodeFromColumnName(hnode.getColumnName());
        Node oldNode = row.getNode(hnode.getId());
        Node newNode = newrow.getNode(newHNode.getId());
        if (!oldNode.hasNestedTable()) {
          newNode.setValue(oldNode.getValue(), oldNode.getStatus(), factory);
        }
        else {         
          cloneDataTable(oldNode.getNestedTable(), newNode.getNestedTable(), hnode.getNestedTable(), newHNode.getNestedTable(), hnode.getNestedTable().getSortedHNodes(), factory, sel);
View Full Code Here

    WorksheetDataUpdate upd = new WorksheetDataUpdate(vWorksheet.getId(), selection);
   
    try {
      JSONArray rowsJson = new JSONArray();
      if(additionalRows.size()  > 0) {
        Row row = additionalRows.get(0);
        ArrayList<VHNode> nodeList = getNestedNodeList(row, vWorksheet.getHeaderViewNodes());
        rowsJson = upd.getRowsJsonArray(additionalRows, vWorksheet,
              nodeList,
              vWorkspace.getPreferences().getIntViewPreferenceValue(
              ViewPreference.maxCharactersInCell));
View Full Code Here

    }
  }

  public void addEmptyRow(Table nestedTable, HNode hNode) {
    HTable headersNestedTable = hNode.getNestedTable();
    Row emptyRow = nestedTable.addRow(factory);
    numObjects++;
    if (maxNumLines > 0 && numObjects >= maxNumLines)
      return;

    for (HNode nestedHNode : headersNestedTable.getHNodes()) {
      if (nestedHNode.hasNestedTable()) {
        addEmptyRow(emptyRow.getNode(nestedHNode.getId())
            .getNestedTable(), nestedHNode);
      } else {
        emptyRow.setValue(nestedHNode.getId(), "", factory);
      }
    }
  }
View Full Code Here

  public void addKeysAndValues(JSONObject object, HTable nestedHTable,
      Table nestedTable) throws JSONException {
    if (maxNumLines > 0 && numObjects >= maxNumLines)
      return;

    Row nestedRow = nestedTable.addRow(factory);
    numObjects++;
    // if(maxNumLines > 0 && numObjects >= maxNumLines)
    // return;

View Full Code Here

TOP

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

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.