Examples of ExecutionController


Examples of edu.isi.karma.webserver.ExecutionController

  }

  private void createAndExecuteMultiCellCmd(Workspace workspace,
      HNodePath selectedPath, ValueCollection rvco) throws JSONException,
      KarmaException, CommandException {
    ExecutionController ctrl = WorkspaceRegistry.getInstance()
        .getExecutionController(workspace.getId());
    JSONArray inputParamArr = this.createMultiCellCmd(rvco, selectedPath
        .getLeaf().getId());
    CommandFactory cf = ctrl.getCommandFactoryMap().get(
        MultipleValueEditColumnCommand.class.getSimpleName());
    JSONInputCommandFactory scf = (JSONInputCommandFactory) cf;

    // TODO handle exceptions intelligently
    Command comm = scf.createCommand(inputParamArr, workspace);
View Full Code Here

Examples of edu.isi.karma.webserver.ExecutionController

  private void createAndExecuteNewAddColumnCommand(Workspace workspace,
      String colnameString) {
    // add a new column
    JSONArray inputParamArr0 = this.creatNewColumnCommand(worksheetId,
        hTableId, colnameString);
    ExecutionController ctrl = WorkspaceRegistry.getInstance()
        .getExecutionController(workspace.getId());
    CommandFactory cf0 = ctrl.getCommandFactoryMap().get(
        AddColumnCommand.class.getSimpleName());
    JSONInputCommandFactory scf1 = (JSONInputCommandFactory) cf0;
    Command comm1 = null;

    // TODO handle exceptions intelligently
View Full Code Here

Examples of edu.isi.karma.webserver.ExecutionController

  }
 
  @Before
  public void setUp() throws Exception {
    workspace = WorkspaceManager.getInstance().createWorkspace();
        WorkspaceRegistry.getInstance().register(new ExecutionController(workspace));
        ModelingConfiguration.load();
        ModelingConfiguration.setManualAlignment(true);
        File file = new File(getClass().getClassLoader().getResource("people.json").toURI());
        InputStream is = new FileInputStream(file);
        Reader reader = EncodingDetector.getInputStreamReader(is, EncodingDetector.detect(file));
View Full Code Here

Examples of edu.isi.karma.webserver.ExecutionController

  }

  public CommandHistoryUtil(List<Command> commands, Workspace workspace, String worksheetId) {
    this.worksheetId = worksheetId;
    this.workspace = workspace;
    ExecutionController ctrl = WorkspaceRegistry.getInstance().getExecutionController(workspace.getId());
    commandFactoryMap = ctrl.getCommandFactoryMap();
    this.commands.addAll(commands);
  }
View Full Code Here

Examples of edu.isi.karma.webserver.ExecutionController

    this.selectionName = selectionName;
  }
  protected Workspace initializeWorkspace() {
   
    Workspace workspace = WorkspaceManager.getInstance().createWorkspace();
        WorkspaceRegistry.getInstance().register(new ExecutionController(workspace));
        ModelingConfiguration.load();
        ModelingConfiguration.setManualAlignment(true);
        return workspace;
       
  }
View Full Code Here

Examples of edu.isi.karma.webserver.ExecutionController

    RepFactory f = workspace.getFactory();
    HNode hNode = f.getHNode(hNodeId);
    inputColumns.clear();
    outputColumns.clear();
    outputColumns.add(targetHNodeId);
    ExecutionController ctrl = WorkspaceRegistry.getInstance().getExecutionController(
        workspace.getId());
   
    //this.previousPythonTransformationCommand = ctrl.getWorkspace().getCommandHistory().getCommand(previousCommandId);
    this.saveOrResetColumnValues(workspace, ctrl);
   
View Full Code Here

Examples of edu.isi.karma.webserver.ExecutionController

    HNode hNode = f.getHNode(hNodeId);
    String hTableId = hNode.getHTableId();
    HTable hTable = hNode.getHTable(f);
    String nodeId = hTable.getHNodeIdFromColumnName(newColumnName);
    inputColumns.clear();
    ExecutionController ctrl = WorkspaceRegistry.getInstance().getExecutionController(
        workspace.getId());

    // Invoke the add column command
    logger.debug("SubmitPythonTranformation: " + hNodeId + ":" + nodeId);
    try
    {
      HNode newColumnNameHNode = hTable.getHNodeFromColumnName(newColumnName);
      if(null != newColumnNameHNode ) //Column name already exists
      {
        pythonNodeId = nodeId;

        saveOrResetColumnValues(workspace, ctrl);

        logger.debug("SubmitPythonTranformation: Tranform Existing Column" + hNodeId + ":" + nodeId);
        UpdateContainer c = applyPythonTransformation(workspace, worksheet, f,
            newColumnNameHNode, ctrl, nodeId);
        return c;
      } else {
        saveColumnValues(workspace);
      }

      if (null == addColCmd) {
        JSONArray addColumnInput = getAddColumnCommandInputJSON(hTableId);
        AddColumnCommandFactory addColumnFac = (AddColumnCommandFactory) ctrl
            .getCommandFactoryMap().get(
                AddColumnCommand.class.getSimpleName());
        addColCmd = (AddColumnCommand) addColumnFac.createCommand(
            addColumnInput, workspace);
        addColCmd.saveInHistory(false);
View Full Code Here

Examples of edu.isi.karma.webserver.ExecutionController

    return uc;
  }

  private UpdateContainer executeCommand(JSONObject commObject, boolean saveToHistory)
      throws JSONException, KarmaException, CommandException {
    ExecutionController ctrl = WorkspaceRegistry.getInstance().getExecutionController(workspace.getId());
    HashMap<String, CommandFactory> commandFactoryMap = ctrl.getCommandFactoryMap();

    JSONArray inputParamArr = (JSONArray) commObject.get(HistoryArguments.inputParameters.name());
    String commandName = (String)commObject.get(HistoryArguments.commandName.name());
    logger.info("Command in history: " + commandName);
View Full Code Here

Examples of edu.isi.karma.webserver.ExecutionController

    if(null == commands || commands.length() == 0)
    {
      return isR2RMLCompatible;
    }
   
    ExecutionController ctrl = WorkspaceRegistry.getInstance().getExecutionController(workspace.getId());
    HashMap<String, CommandFactory> commandFactoryMap = ctrl.getCommandFactoryMap();
   
    for(int i = 0; i < commands.length(); i++)
    {
      JSONObject commObject = commands.getJSONObject(i);
      JSONArray tags = commObject.getJSONArray(HistoryArguments.tags.name());
View Full Code Here

Examples of edu.isi.karma.webserver.ExecutionController

        redoStack.remove(rco);
        try {
          JSONArray array = new JSONArray(rco.command.getInputParameterJson());
          String worksheetId = HistoryJsonUtil.getStringValue(HistoryArguments.worksheetId.name(), array);
          WorksheetCommandHistoryExecutor executor = new WorksheetCommandHistoryExecutor(worksheetId, workspace);
          ExecutionController ctrl = WorkspaceRegistry.getInstance().getExecutionController(workspace.getId());
          HashMap<String, CommandFactory> commandFactoryMap = ctrl.getCommandFactoryMap();
          JSONArray inputParamArr = (JSONArray)rco.historyObject.get(HistoryArguments.inputParameters.name());
          String commandName = (String)rco.historyObject.get(HistoryArguments.commandName.name());
          executor.normalizeCommandHistoryJsonInput(workspace, worksheetId, inputParamArr, commandName, true);
          CommandFactory cf = commandFactoryMap.get(rco.historyObject.get(HistoryArguments.commandName.name()));
          Command comm = cf.createCommand(inputParamArr, workspace);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.