@Override
public UpdateContainer doIt(Workspace workspace) throws CommandException {
// TODO Auto-generated method stub
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;
}
}
Collection<Node> nodes = new ArrayList<Node>();
workspace.getFactory().getWorksheet(worksheetId).getDataTable()
.collectNodes(selectedPath, nodes, selection);
try {
JSONArray requestJsonArray = new JSONArray();
for (Node node : nodes) {
String originalVal = node.getValue().asString();
originalVal = originalVal == null ? "" : originalVal;
requestJsonArray.put(originalVal);
}
JSONObject json = new JSONObject(worksheet.getJsonAnnotation().toString());
String mainId = json.getString("id");
String mainWorksheetId = json.getString("worksheetId");
String mainHNodeId = json.getString("hNodeId");
Worksheet mainWorksheet = workspace.getWorksheet(mainWorksheetId);
HNodePath mainSelectedPath = null;
List<HNodePath> mainColumnPaths = mainWorksheet.getHeaders().getAllPaths();
for (HNodePath path : mainColumnPaths) {
if (path.getLeaf().getId().equals(mainHNodeId)) {
mainSelectedPath = path;
}