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

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


  @Override
  public UpdateContainer undoIt(Workspace workspace) {
   
    Worksheet wk = workspace.getFactory().getWorksheet(worksheetId);
    SuperSelection selection = getSuperSelection(wk);
    List<HNodePath> columnPaths = wk.getHeaders().getAllPaths();

    // Get the path which has the split value hNodeId
    HNodePath selectedPath = null;
    for (HNodePath path : columnPaths) {
View Full Code Here


  }

  @Override
  public UpdateContainer doIt(Workspace workspace) throws CommandException {
    Node node = workspace.getFactory().getNode(nodeIdArg);
    SuperSelection sel = getSuperSelection(workspace);
    inputColumns.clear();
    outputColumns.clear();
    inputColumns.add(node.getHNodeId());
    outputColumns.add(node.getHNodeId());
    previousValue = node.getValue();
View Full Code Here

  }

  @Override
  public UpdateContainer undoIt(Workspace workspace) {
    Node node = workspace.getFactory().getNode(nodeIdArg);
    SuperSelection sel = getSuperSelection(workspace);
    node.setValue(previousValue, previousStatus, workspace.getFactory());
    UpdateContainer uc = WorksheetUpdateFactory.createWorksheetHierarchicalAndCleaningResultsUpdates(worksheetId, sel);
    uc.add(new NodeChangedUpdate(worksheetId,
        nodeIdArg, previousValue, previousStatus));
    return uc;
View Full Code Here

  }

  @Override
  public UpdateContainer doIt(Workspace workspace) throws CommandException {
    Worksheet worksheet = workspace.getWorksheet(worksheetId);
    SuperSelection currentSel = getSuperSelection(worksheet);
    List<SelectionWithPriority> selections = new ArrayList<SelectionWithPriority>();
    for (Selection sel : currentSel.getAllSelection()) {
      HTable ht = workspace.getFactory().getHTable(sel.getHTableId());
      selections.add(new SelectionWithPriority(sel, hTableDepth(ht, workspace.getFactory())));
    }
    Collections.sort(selections);
    for (SelectionWithPriority s : selections) {
      Selection sel = s.sel;
      JSONArray inputJSON = new JSONArray();
      HTable ht = workspace.getFactory().getHTable(sel.getHTableId());
      Iterator<String> itr = ht.getHNodeIds().iterator();
      inputJSON.put(CommandInputJSONUtil.createJsonObject("worksheetId", worksheetId, ParameterType.worksheetId));
      inputJSON.put(CommandInputJSONUtil.createJsonObject("hNodeId", itr.next(), ParameterType.hNodeId));
      inputJSON.put(CommandInputJSONUtil.createJsonObject("selectionName", currentSel.getName(), ParameterType.other));
      try {
        Command c = new RefreshSelectionCommandFactory().createCommand(inputJSON, workspace);
        c.doIt(workspace);
      } catch (Exception e) {
       
View Full Code Here

  public UpdateContainer doIt(Workspace workspace) throws CommandException {
    inputColumns.clear();
    outputColumns.clear();
    Worksheet worksheet = workspace.getWorksheet(worksheetId);
    RepFactory factory = workspace.getFactory();
    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);
      worksheet.getSelectionManager().addSelection(t);
      outputColumns.addAll(t.getInputColumns());
      previousSelection = superSel.getSelection(t.getHTableId());
      if (previousSelection != null)
        superSel.removeSelection(previousSelection);
      superSel.addSelection(t);
     
    }catch (Exception e) {
      return getErrorUpdate("The operation is undefined");
    }
    WorksheetUpdateFactory.detectSelectionStatusChange(worksheetId, workspace, this);
View Full Code Here

  @Override
  public UpdateContainer undoIt(Workspace workspace) {
    inputColumns.clear();
    outputColumns.clear();
    Worksheet worksheet = workspace.getWorksheet(worksheetId);
    SuperSelection superSel = getSuperSelection(worksheet);
    HNode hNode = workspace.getFactory().getHNode(hNodeId);
    Selection currentSel = superSel.getSelection(hNode.getHTableId());
    if (previousSelection != null) {
      superSel.addSelection(previousSelection);
      outputColumns.addAll(previousSelection.getInputColumns());
    }
    if (currentSel != null) {
      worksheet.getSelectionManager().removeSelection(currentSel);
      superSel.removeSelection(currentSel);
    }
    WorksheetUpdateFactory.detectSelectionStatusChange(worksheetId, workspace, this);
    UpdateContainer uc = WorksheetUpdateFactory.createWorksheetHierarchicalAndCleaningResultsUpdates(worksheetId, superSel)
    uc.add(new WorksheetSuperSelectionListUpdate(worksheetId));
    return uc;
View Full Code Here

  }

  @Override
  public UpdateContainer doIt(Workspace workspace) throws CommandException {
    Worksheet worksheet = workspace.getWorksheet(worksheetId);
    SuperSelection selection = getSuperSelection(worksheet);
//    if (worksheet.getSemanticTypes().getListOfTypes().size() == 0) {
//      SemanticTypeUtil.populateSemanticTypesUsingCRF(worksheet, workspace
//          .getTagsContainer().getTag(TagName.Outlier), workspace
//          .getSemanticTypeModelHandler(), workspace.getOntologyManager());
//    }
View Full Code Here

  }

  @Override
  public UpdateContainer doIt(Workspace workspace) throws CommandException {
    Worksheet worksheet = workspace.getWorksheet(worksheetId);
    SuperSelection selection = getSuperSelection(worksheet);

    OntologyManager om= workspace.getOntologyManager();
    WorksheetToFeatureCollection geo = new WorksheetToFeatureCollection(worksheet, om, selection);//ying
   
    // Send an error update if no geospatial data found!
View Full Code Here

        selectedPath = path;

      }
    }
    Collection<Node> nodes = new ArrayList<Node>();
    SuperSelection selection = getSuperSelection(workspace);
    workspace.getFactory().getWorksheet(worksheetId).getDataTable()
        .collectNodes(selectedPath, nodes, selection);
    for (Node node : nodes) {
      String id = node.getBelongsToRow().getId();
      String originalVal = node.getValue().asString();
View Full Code Here

  }

  @Override
  public UpdateContainer doIt(Workspace workspace) throws CommandException {
    Worksheet worksheet = workspace.getWorksheet(worksheetId);
    SuperSelection selection = getSuperSelection(worksheet);
    HNodePath selectedPath = null;
    List<HNodePath> columnPaths = worksheet.getHeaders().getAllPaths();
    for (HNodePath path : columnPaths) {
      if (path.getLeaf().getId().equals(hNodeId)) {
        selectedPath = path;
View Full Code Here

TOP

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

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.