Package edu.isi.karma.controller.history

Examples of edu.isi.karma.controller.history.CommandHistory


    HTable hTable = factory.getHTable(factory.getHNode(hNodeId).getHTableId());
    Selection currentSel = superSel.getSelection(hTable.getId());
    if (currentSel != null) {
      currentSel.updateSelection();
    }
    CommandHistory history = workspace.getCommandHistory();
    List<Command> tmp = gatherAllOperateSelectionCommands(history.getCommandsFromWorksheetId(worksheetId), workspace);
    if (tmp.size() > 0) {
      JSONArray inputJSON = new JSONArray();
      inputJSON.put(CommandInputJSONUtil.createJsonObject("worksheetId", worksheetId, ParameterType.worksheetId));
      inputJSON.put(CommandInputJSONUtil.createJsonObject("hNodeId", hNodeId, ParameterType.hNodeId));
      inputJSON.put(CommandInputJSONUtil.createJsonObject("operation", Operation.Intersect.name(), ParameterType.other));
      inputJSON.put(CommandInputJSONUtil.createJsonObject("pythonCode", SelectionManager.defaultCode, ParameterType.other));
      inputJSON.put(CommandInputJSONUtil.createJsonObject("onError", "false", ParameterType.other));
      inputJSON.put(CommandInputJSONUtil.createJsonObject("selectionName", superSel.getName(), ParameterType.other));
      Command t = null;
      try {
        t = new OperateSelectionCommandFactory().createCommand(inputJSON, workspace);
      }catch(Exception e) {
       
      }
      if (t != null)
        history._getHistory().add(t);
      history._getHistory().addAll(tmp);
    }
    UpdateContainer uc = WorksheetUpdateFactory.createWorksheetHierarchicalAndCleaningResultsUpdates(worksheetId, superSel);
    uc.add(new HistoryUpdate(history));
    return uc;
  }
View Full Code Here


    oldColumnName = columnNode.getColumnName();
   
    // Change the column name
    columnNode.setColumnName(newColumnName);
   
    CommandHistory history = workspace.getCommandHistory();
    List<ICommand>  allCommands = history._getHistory();
    for(ICommand command : allCommands) {
      String json = command.getInputParameterJson();
      if(json != null && json.length() > 0) {
        JSONArray inputs = new JSONArray(json);
        for(int i=0; i<inputs.length(); i++) {
View Full Code Here

    savePreferences(workspace);
    boolean storeOldHistory = ModelingConfiguration.isStoreOldHistoryEnabled();
    System.out.println("storeOldHistory: " + storeOldHistory);
    Worksheet worksheet = workspace.getWorksheet(worksheetId);
    SuperSelection selection = getSuperSelection(worksheet);
    CommandHistory history = workspace.getCommandHistory();
    List<Command> oldCommands = history.getCommandsFromWorksheetId(worksheetId);
    if (storeOldHistory) {     
      JSONArray oldCommandsArray = new JSONArray();
      for (Command refined : oldCommands)
        oldCommandsArray.put(workspace.getCommandHistory().getCommandJSON(workspace, refined));
      worksheet.getMetadataContainer().getWorksheetProperties().setPropertyValue(
          Property.oldCommandHistory, oldCommandsArray.toString());
    }
    CommandHistoryUtil historyUtil = new CommandHistoryUtil(history.getCommandsFromWorksheetId(worksheetId), workspace, worksheetId);
    historyUtil.consolidateHistory()
    if (!oldCommands.equals(historyUtil.getCommands())) {
      uc.append(historyUtil.replayHistory());
      uc.removeUpdateByClass(HistoryAddCommandUpdate.class);
      uc.removeUpdateByClass(InfoUpdate.class);
View Full Code Here

    return this.originalColumnValues;
  }

  protected ICommand extractPreviousCommand(ExecutionController ctrl) {

    CommandHistory commandHistory = ctrl.getWorkspace().getCommandHistory();
    List<ICommand> commands = commandHistory._getHistory();
    for(int i = commands.size() -1 ; i>=0; i--) {
      ICommand command = commands.get(i);
      if(command instanceof SubmitPythonTransformationCommand) {
        SubmitPythonTransformationCommand pyCommand = (SubmitPythonTransformationCommand)command;
        if(pyCommand.worksheetId.equals(this.worksheetId)) {
View Full Code Here

  }

  public CommandHistory getCommandHistory() {
    if(commandHistory == null)
    {
      commandHistory = new CommandHistory();
    }
    return commandHistory;
  }
View Full Code Here

TOP

Related Classes of edu.isi.karma.controller.history.CommandHistory

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.