Package edu.isi.karma.controller.command.selection

Examples of edu.isi.karma.controller.command.selection.MiniSelection


    SuperSelection superSel = this.getSuperSelection(worksheet);
    HTable hTable = factory.getHTable(factory.getHNode(hNodeId).getHTableId());
    Selection currentSel = superSel.getSelection(hTable.getId());
    Selection anotherSel = null;
    if (!operation.equalsIgnoreCase(Operation.Invert.name())) {
      anotherSel = new MiniSelection(workspace, worksheetId, hTable.getId(), factory.getNewId("SEL"), superSel.getName(), pythonCode, onError);
      worksheet.getSelectionManager().addSelection(anotherSel);
    }
    if (currentSel == null && operation.equalsIgnoreCase(Operation.Invert.name()) ) {
      return getErrorUpdate("No defined Selection");
    }
    if (currentSel == null) {
      currentSel = new MiniSelection(workspace, worksheetId, hTable.getId(), factory.getNewId("SEL"), superSel.getName(), SelectionManager.defaultCode, onError);
      worksheet.getSelectionManager().addSelection(currentSel);
    }
    try {
      Operation operation = Operation.valueOf(Operation.class, this.operation);
      Selection t = new LargeSelection(workspace, worksheetId, hTable.getId(), factory.getNewId("SEL"), superSel.getName(), currentSel, anotherSel, operation);
View Full Code Here


  public void testSelection1() throws IOException {
   
    StringBuilder pythonCode = new StringBuilder();
    pythonCode.append("if getValue(\"title\") == \"Prof\": \n");
    pythonCode.append("   return True \n");
    Selection sel = new MiniSelection(workspace, worksheet.getId(),
        worksheet.getHeaders().getId(), workspace.getFactory().getNewId("SEL"), null,
        pythonCode.toString(), true);
    assertEquals(sel != null, true);
    Table t = worksheet.getDataTable();
    for (Row r : t.getRows(0, t.getNumRows(), SuperSelectionManager.DEFAULT_SELECTION)) {
      boolean t1 = sel.isSelected(r);
      if (r.getNeighborByColumnName("title", workspace.getFactory()).getValue().asString().equals("Prof"))
        assertTrue(t1);
      else
        assertFalse(t1);
    }
View Full Code Here

  @Test
  public void testSelection2() throws IOException, KarmaException {
    StringBuilder pythonCode = new StringBuilder();
    pythonCode.append("if getValue(\"title\") == \"Prof\": \n");
    pythonCode.append("   return True \n");
    Selection sel = new MiniSelection(workspace, worksheet.getId(),
        worksheet.getHeaders().getId(), workspace.getFactory().getNewId("SEL"), "test",
        pythonCode.toString(), true);
    R2RMLMappingIdentifier modelIdentifier = new R2RMLMappingIdentifier(
        "people-model", getTestResource(
             "people-model.ttl"));
View Full Code Here

TOP

Related Classes of edu.isi.karma.controller.command.selection.MiniSelection

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.