protected FoldCommand(String id, String model, String worksheetId, String hTableId, String hNodeId, String selectionId) { super(id, model, worksheetId, selectionId); this.hNodeId = hNodeId; this.hTableId = hTableId; addTag(CommandTag.Transformation); }
Worksheet worksheet = workspace.getWorksheet( worksheetId); SuperSelection selection = getSuperSelection(worksheet); inputColumns.clear(); outputColumns.clear(); Object para = JSONUtil.createJson(this.getInputParameterJson()); HTable htable; if (hNodeId.compareTo("") != 0) WorksheetUpdateFactory.detectSelectionStatusChange(worksheetId, workspace, this); UpdateContainer c = new UpdateContainer(); c.append(WorksheetUpdateFactory.createRegenerateWorksheetUpdates(worksheetId, getSuperSelection(worksheet), workspace.getContextId())); c.append(computeAlignmentAndSemanticTypesAndCreateUpdates(workspace)); return c; } catch (Exception e) {
@Override public UpdateContainer undoIt(Workspace workspace) { cmd.undoIt(workspace); //remove the new column //currentTable.removeHNode(newHNodeId, worksheet); UpdateContainer c = new UpdateContainer(); c.append(WorksheetUpdateFactory.createRegenerateWorksheetUpdates(worksheetId, getSuperSelection(workspace), workspace.getContextId())); c.append(computeAlignmentAndSemanticTypesAndCreateUpdates(workspace)); return c; }
@Override public Command createCommand(JSONArray inputJson, String model, Workspace workspace) throws JSONException, KarmaException { /** Parse the input arguments and create proper data structures to be passed to the command **/ String hNodeID = CommandInputJSONUtil.getStringValue(Arguments.hNodeId.name(), inputJson); String worksheetId = CommandInputJSONUtil.getStringValue(Arguments.worksheetId.name(), inputJson); this.normalizeSelectionId(worksheetId, inputJson, workspace); String selectionName = CommandInputJSONUtil.getStringValue(Arguments.selectionName.name(), inputJson); FoldCommand foldCmd = new FoldCommand(getNewId(workspace), model, worksheetId, "", hNodeID, selectionName); foldCmd.setInputParameterJson(inputJson.toString()); return foldCmd; }
@Override public Command createCommand(HttpServletRequest request, Workspace workspace) { String hNodeId = request.getParameter(Arguments.hNodeId.name()); String worksheetId = request.getParameter(Arguments.worksheetId.name()); String selectionName = request.getParameter(Arguments.selectionName.name()); return new FoldCommand(getNewId(workspace), Command.NEW_MODEL, worksheetId, "", hNodeId, selectionName); }