From 89f05aa0337f25a691fb4f7b06084e404d0b7424 Mon Sep 17 00:00:00 2001 From: Kaushalkumar Shah Date: Thu, 27 Apr 2017 14:14:26 -0700 Subject: [PATCH 01/27] first commit --- .../webapp/js/ServerResponseObjectParsing.js | 8 ++++- .../src/main/webapp/js/tableColumnOptions.js | 35 +------------------ .../src/main/webapp/js/worksheetOptions.js | 35 +------------------ 3 files changed, 9 insertions(+), 69 deletions(-) diff --git a/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js b/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js index e45b0f09e..0735cef98 100755 --- a/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js +++ b/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js @@ -45,7 +45,7 @@ function parse(data) { } } }); - + console.log("Kaushal shaha response method called"); if (isError) return false; @@ -130,6 +130,7 @@ function parse(data) { }) .on('shown', function(e, editable) { console.log(editable); + console.log("Kaushal1"); editable.input.$input.val(graphLabel.html()); }); @@ -168,6 +169,7 @@ function parse(data) { }) .on('shown', function(e, editable) { console.log(editable); + console.log("Kaushal2"); editable.input.$input.val(prefixLabel.html()); }); headerDiv.append(sep); @@ -205,6 +207,7 @@ function parse(data) { }) .on('shown', function(e, editable) { console.log(editable); + console.log("Kaushal3"); editable.input.$input.val(baseURILabel.html()); }); @@ -270,6 +273,7 @@ function parse(data) { }) .on('shown', function(e, editable) { console.log(editable); + console.log("Kaushal4"); var oldValue = githubUrlLabel.html(); if(oldValue == "disabled" || oldValue == "Empty") oldValue = ""; @@ -557,6 +561,7 @@ function parse(data) { } else if (element["updateType"] == "SetWorksheetProperties") { // Remove existing link if any console.log(element); + console.log("Kaushal5"); if (element["prefix"]) { $("#txtPrefix_" + element["worksheetId"]).text(element["prefix"]); } @@ -1133,6 +1138,7 @@ function submitSelectedModelNameToBeLoaded() { function setGithubURLProperties(githubLabel, worksheetId, newValue) { console.log("Set new value:" + newValue); console.log(newValue); + console.log("Kaushal6"); githubLabel.text(newValue); var worksheetProps = new Object(); worksheetProps["hasPrefix"] = false; diff --git a/karma-web/src/main/webapp/js/tableColumnOptions.js b/karma-web/src/main/webapp/js/tableColumnOptions.js index 1840c691b..d722494cb 100755 --- a/karma-web/src/main/webapp/js/tableColumnOptions.js +++ b/karma-web/src/main/webapp/js/tableColumnOptions.js @@ -96,7 +96,7 @@ function TableColumnOptions(wsId, wsColumnId, wsColumnTitle, isLeafNode, isOutof leafOnly: false, leafExcluded: true }, { - name: "Selection", + name: "Filters", func: undefined, addLevel: true, leafOnly: false, @@ -104,15 +104,6 @@ function TableColumnOptions(wsId, wsColumnId, wsColumnTitle, isLeafNode, isOutof levels: [{ name: "Add Rows", func: addRows - }, { - name: "Intersect Rows", - func: intersectRows - }, { - name: "Subtract Rows", - func: subtractRows - }, { - name: "Invert", - func: invertRows }, { name: "Clear", func: undefined, @@ -139,35 +130,11 @@ function TableColumnOptions(wsId, wsColumnId, wsColumnTitle, isLeafNode, isOutof PyTransformSelectionDialog.getInstance(wsId, wsColumnId).show(); } - function intersectRows() { - hideDropdown(); - $("#pyTransformSelectionDialog").data("operation", "Intersect"); - PyTransformSelectionDialog.getInstance(wsId, wsColumnId).show(); - } - - function subtractRows() { - hideDropdown(); - $("#pyTransformSelectionDialog").data("operation", "Subtract"); - PyTransformSelectionDialog.getInstance(wsId, wsColumnId).show(); - } - function aggregation() { hideDropdown(); AggregationDialog.getInstance().show(wsId, wsColumnId, wsColumnTitle); } - function invertRows() { - hideDropdown(); - var headers = getColumnHeadingsForColumn(wsId, wsColumnId, "GroupBy"); - var info = generateInfoObject(wsId, headers[0]['HNodeId'], "OperateSelectionCommand"); - var newInfo = info['newInfo']; - newInfo.push(getParamObject("pythonCode", "", "other")); - newInfo.push(getParamObject("operation", "Invert", "other")); - info["newInfo"] = JSON.stringify(newInfo); - showLoading(worksheetId); - sendRequest(info, worksheetId); - } - function refreshRows() { var headers = getColumnHeadingsForColumn(wsId, wsColumnId, "GroupBy"); var info = generateInfoObject(wsId, headers[0]['HNodeId'], "RefreshSelectionCommand"); diff --git a/karma-web/src/main/webapp/js/worksheetOptions.js b/karma-web/src/main/webapp/js/worksheetOptions.js index ae57bb9f0..f40ffb8db 100755 --- a/karma-web/src/main/webapp/js/worksheetOptions.js +++ b/karma-web/src/main/webapp/js/worksheetOptions.js @@ -106,21 +106,12 @@ function WorksheetOptions(wsId, wsTitle) { }, { name: "divider" }, { - name: "Selection", + name: "Filters", func: undefined, addLevel: true, levels: [{ name: "Add Rows", func: addRows - }, { - name: "Intersect Rows", - func: intersectRows - }, { - name: "Subtract Rows", - func: subtractRows - }, { - name: "Invert", - func: invertRows }, { name: "Clear", func: undefined, @@ -165,30 +156,6 @@ function WorksheetOptions(wsId, wsTitle) { PyTransformSelectionDialog.getInstance(wsId, "").show(); } - function intersectRows() { - hideDropdown(); - $("#pyTransformSelectionDialog").data("operation", "Intersect"); - PyTransformSelectionDialog.getInstance(wsId, "").show(); - } - - function subtractRows() { - hideDropdown(); - $("#pyTransformSelectionDialog").data("operation", "Subtract"); - PyTransformSelectionDialog.getInstance(wsId, "").show(); - } - - function invertRows() { - hideDropdown(); - var headers = getColumnHeadingsForColumn(wsId, "", "GroupBy"); - var info = generateInfoObject(wsId, headers[0]['HNodeId'], "OperateSelectionCommand"); - var newInfo = info['newInfo']; - newInfo.push(getParamObject("pythonCode", "", "other")); - newInfo.push(getParamObject("operation", "Invert", "other")); - info["newInfo"] = JSON.stringify(newInfo); - showLoading(worksheetId); - sendRequest(info, worksheetId); - } - function clearAll() { hideDropdown(); var headers = getColumnHeadingsForColumn(wsId, "", "GroupBy"); From e602c7086e8772fabbb9787b98ab135d925b1892 Mon Sep 17 00:00:00 2001 From: Kaushalkumar Shah Date: Thu, 4 May 2017 12:34:39 -0700 Subject: [PATCH 02/27] Change log message --- .../src/main/java/edu/isi/karma/util/KarmaStats.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/karma-util/src/main/java/edu/isi/karma/util/KarmaStats.java b/karma-util/src/main/java/edu/isi/karma/util/KarmaStats.java index d38f6cc74..8c3fd319d 100644 --- a/karma-util/src/main/java/edu/isi/karma/util/KarmaStats.java +++ b/karma-util/src/main/java/edu/isi/karma/util/KarmaStats.java @@ -43,7 +43,7 @@ public static void main(String[] args) { KarmaStats stats = new KarmaStats(cl); if(!stats.parseCommandLineOptions(cl)) { - System.out.println("Parse ERROR. Please use \"java -cp JAR_NAME --inputfile INPUT_FILE --outputfile OUTPUT_FILE --pretty(optional)\" "); + System.out.println("Parse ERROR. Please use \"java -cp JAR_NAME edu.isi.karma.util.KarmaStats --inputfile INPUT_FILE --outputfile OUTPUT_FILE --pretty(optional)\" "); return; } karmaStats(stats.inputFile, stats.outputFile,stats.isPretty); @@ -67,14 +67,12 @@ public static void karmaStats(String inputFile, String outputFile,boolean isPret /* * If model name has "." in the name. * */ - if(fname.length>2) - { + for(int j=0;j Date: Tue, 9 May 2017 12:13:29 -0700 Subject: [PATCH 03/27] Added Glue & Unfold commands to stats --- .../main/java/edu/isi/karma/util/KarmaStats.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/karma-util/src/main/java/edu/isi/karma/util/KarmaStats.java b/karma-util/src/main/java/edu/isi/karma/util/KarmaStats.java index 8c3fd319d..ac9be2473 100644 --- a/karma-util/src/main/java/edu/isi/karma/util/KarmaStats.java +++ b/karma-util/src/main/java/edu/isi/karma/util/KarmaStats.java @@ -83,10 +83,11 @@ public static void karmaStats(String inputFile, String outputFile,boolean isPret final String setSemanticCommandName = "SetSemanticTypeCommand"; final String setPropertyCommandName = "SetMetaPropertyCommand"; final String addLinkCommandName = "AddLinkCommand"; - final String deleteLinkCommandName = "DeleteLinkCommand"; final String changeLinkCommandName = "ChangeInternalNodeLinksCommand"; final String unassignSemeticCommandName = "UnassignSemanticTypeCommand"; final String selectionCommandName = "OperateSelectionCommand"; + final String glueCommandName = "GlueCommand"; + final String unfoldCommandName = "UnfoldCommand"; boolean isJSON = false; int pyTransformCount = 0; @@ -94,6 +95,8 @@ public static void karmaStats(String inputFile, String outputFile,boolean isPret int classCount = 0; int linkCount = 0; // Except sementic type links int filterCount = 0; + int glueCount = 0; + int unFoldCount = 0; while ((tmpString = bufferedReader.readLine()) != null) { if (isJSON) { @@ -137,14 +140,16 @@ public static void karmaStats(String inputFile, String outputFile,boolean isPret SemanticTypeCount++; } else if (commandName.equals(addLinkCommandName)) { linkCount++; - } else if (commandName.equals(deleteLinkCommandName)) { - + } else if (commandName.equals(glueCommandName)) { + glueCount++; } else if (commandName.equals(selectionCommandName)) { filterCount++; } else if (commandName.equals(unassignSemeticCommandName)) { SemanticTypeCount--; } else if(commandName.equals(changeLinkCommandName)) { linkCount++; + } else if(commandName.equals(unfoldCommandName)) { + unFoldCount++; } } } @@ -160,6 +165,8 @@ public static void karmaStats(String inputFile, String outputFile,boolean isPret output.put("class", classCount); output.put("links", linkCount); output.put("filters", filterCount); + output.put("Unfold", unFoldCount); + output.put("Glue", glueCount); modelStat.put("modelStatistics", output); if(isPretty) { writeBuffer.append(modelStat.toString(4)); From 3081a97f0763affbd22beee05c465c4792b8eff6 Mon Sep 17 00:00:00 2001 From: Dipsy Kapoor Date: Thu, 11 May 2017 10:27:19 -0700 Subject: [PATCH 04/27] change karma-spark shaded naming to include env so can distinguish between versions --- karma-spark/pom.xml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/karma-spark/pom.xml b/karma-spark/pom.xml index 65bd5e5d6..720dfc067 100644 --- a/karma-spark/pom.xml +++ b/karma-spark/pom.xml @@ -154,12 +154,12 @@ - cloudera + 1.5.0-cdh5.5.0 true env - cloudera + 1.5.0-cdh5.5.0 @@ -176,11 +176,11 @@ - vanilla + 1.5.0 env - vanilla + 1.5.0 @@ -197,11 +197,11 @@ - withhive + 1.5.0-hive env - hive + 1.5.0-hive @@ -218,11 +218,11 @@ - withcdhhive + 1.6.0-cdh5.10.1-hive env - cdhhive + 1.6.0-cdh5.10.1-hive @@ -251,10 +251,13 @@ mvn package -P shaded To generate jar for vanilla spark 1.5, run - mvn package -P shaded -Denv=vanilla + mvn package -P shaded -Denv=1.5.0 To generate jar for spark 1.5 with hive, run - mvn package -P shaded -Denv=hive + mvn package -P shaded -Denv=1.5.0-hive + + To generate jar for cloudera spark 1.6.0 with hive, run + mvn package -P shaded -Denv=1.6.0-cdh5.10.1-hive --> org.apache.maven.plugins @@ -263,7 +266,7 @@ true true - shaded + ${env} From b289268a382496f0484da540779114b9a0eb3d05 Mon Sep 17 00:00:00 2001 From: Kaushalkumar Shah Date: Thu, 11 May 2017 14:01:54 -0700 Subject: [PATCH 05/27] Change Column color for selections --- karma-web/src/main/webapp/index.jsp | 6 +++++- karma-web/src/main/webapp/js/ServerResponseObjectParsing.js | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/karma-web/src/main/webapp/index.jsp b/karma-web/src/main/webapp/index.jsp index 3e8bcdfdb..310cd2220 100755 --- a/karma-web/src/main/webapp/index.jsp +++ b/karma-web/src/main/webapp/index.jsp @@ -138,7 +138,11 @@ and related projects, please see: http://www.isi.edu/integration .wk-row-selected { background-color: #EEEEEE; } - + + .htable-selected { + background-color: #FFA600; + } + .table-no-border td { border-top: 0 none; } diff --git a/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js b/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js index 0735cef98..cbddd5b69 100755 --- a/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js +++ b/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js @@ -948,7 +948,9 @@ function addColumnHeadersRecurse(worksheetId, columns, headersTable, isOdd) { if (column["columnDerivedFrom"]) { td.data("columnDerivedFrom", column["columnDerivedFrom"]); } - + if(column["status"]) { + td.addClass("htable-selected"); + } if (column["hasNestedTable"]) { var pElem = $("
") .addClass("wk-header") From f8595c8659428b61e0d74824e6be566145a4cac1 Mon Sep 17 00:00:00 2001 From: Kaushalkumar Shah Date: Thu, 11 May 2017 14:03:11 -0700 Subject: [PATCH 06/27] Code clean up --- .../src/main/webapp/js/ServerResponseObjectParsing.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js b/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js index cbddd5b69..ebca34e11 100755 --- a/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js +++ b/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js @@ -45,7 +45,6 @@ function parse(data) { } } }); - console.log("Kaushal shaha response method called"); if (isError) return false; @@ -130,7 +129,6 @@ function parse(data) { }) .on('shown', function(e, editable) { console.log(editable); - console.log("Kaushal1"); editable.input.$input.val(graphLabel.html()); }); @@ -169,7 +167,6 @@ function parse(data) { }) .on('shown', function(e, editable) { console.log(editable); - console.log("Kaushal2"); editable.input.$input.val(prefixLabel.html()); }); headerDiv.append(sep); @@ -207,7 +204,6 @@ function parse(data) { }) .on('shown', function(e, editable) { console.log(editable); - console.log("Kaushal3"); editable.input.$input.val(baseURILabel.html()); }); @@ -273,7 +269,6 @@ function parse(data) { }) .on('shown', function(e, editable) { console.log(editable); - console.log("Kaushal4"); var oldValue = githubUrlLabel.html(); if(oldValue == "disabled" || oldValue == "Empty") oldValue = ""; @@ -561,7 +556,6 @@ function parse(data) { } else if (element["updateType"] == "SetWorksheetProperties") { // Remove existing link if any console.log(element); - console.log("Kaushal5"); if (element["prefix"]) { $("#txtPrefix_" + element["worksheetId"]).text(element["prefix"]); } @@ -1140,7 +1134,6 @@ function submitSelectedModelNameToBeLoaded() { function setGithubURLProperties(githubLabel, worksheetId, newValue) { console.log("Set new value:" + newValue); console.log(newValue); - console.log("Kaushal6"); githubLabel.text(newValue); var worksheetProps = new Object(); worksheetProps["hasPrefix"] = false; From 21049ade02504c924b120baa036984533aef9e34 Mon Sep 17 00:00:00 2001 From: Kaushalkumar Shah Date: Thu, 11 May 2017 15:41:29 -0700 Subject: [PATCH 07/27] Changes to update colors for nested tables --- .../main/webapp/js/ServerResponseObjectParsing.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js b/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js index ebca34e11..875801729 100755 --- a/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js +++ b/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js @@ -390,7 +390,7 @@ function parse(data) { $("tbody", headersTable).empty(); } - var colWidths = addColumnHeadersRecurse(element["worksheetId"], element["columns"], headersTable, true); + var colWidths = addColumnHeadersRecurse(element["worksheetId"], element["columns"], headersTable, true,false); var stylesheet = document.styleSheets[0]; // Remove the previous rows if any @@ -903,8 +903,9 @@ function processHistoryCommand(command) { } } -function addColumnHeadersRecurse(worksheetId, columns, headersTable, isOdd) { +function addColumnHeadersRecurse(worksheetId, columns, headersTable, isOdd,isAncestorSelected) { var row = $(""); + var ancestorSelection = isAncestorSelected; if (isOdd) { row.addClass("wk-row-odd"); } else { @@ -942,8 +943,11 @@ function addColumnHeadersRecurse(worksheetId, columns, headersTable, isOdd) { if (column["columnDerivedFrom"]) { td.data("columnDerivedFrom", column["columnDerivedFrom"]); } - if(column["status"]) { - td.addClass("htable-selected"); + if(!ancestorSelection) { + if(column["status"]) { + td.addClass("htable-selected"); + ancestorSelection = true; + } } if (column["hasNestedTable"]) { var pElem = $("
") @@ -961,7 +965,7 @@ function addColumnHeadersRecurse(worksheetId, columns, headersTable, isOdd) { } else { nestedTable.addClass("htable-odd"); } - var nestedColumnWidths = addColumnHeadersRecurse(worksheetId, column["columns"], nestedTable, !isOdd); + var nestedColumnWidths = addColumnHeadersRecurse(worksheetId, column["columns"], nestedTable, !isOdd,ancestorSelection); var colAdded = 0; $.each(nestedColumnWidths, function(index2, colWidth) { From 64d07638e753f36f11a11cf3da89a22d6296447e Mon Sep 17 00:00:00 2001 From: Dipsy Kapoor Date: Tue, 18 Jul 2017 12:00:02 -0700 Subject: [PATCH 08/27] Log the JSON file that had problems when reading JSON --- .../java/edu/isi/karma/util/JSONUtil.java | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/karma-common/src/main/java/edu/isi/karma/util/JSONUtil.java b/karma-common/src/main/java/edu/isi/karma/util/JSONUtil.java index af104c14f..54bc90343 100644 --- a/karma-common/src/main/java/edu/isi/karma/util/JSONUtil.java +++ b/karma-common/src/main/java/edu/isi/karma/util/JSONUtil.java @@ -256,24 +256,28 @@ public static void writeJsonFile(Object o, String name) { } public static Object convertJSONLinesToJSONArray(InputStream is,String encoding) throws Exception{ - if(encoding == null){ + if (encoding == null) { encoding = "UTF-8"; } JSONArray jArray = new JSONArray(); - try{ - - BufferedReader br = new BufferedReader(new InputStreamReader(is,encoding)); - String line=null; - - while((line = br.readLine()) != null){ - jArray.put(new JSONObject(line.trim())); - } - - br.close(); - return jArray; - }catch(Exception e){ - throw new Exception("Error while reading json lines."+ e.getMessage()); + + String line = null; + try { + BufferedReader br = new BufferedReader(new InputStreamReader(is, + encoding)); + + while ((line = br.readLine()) != null) { + jArray.put(new JSONObject(line.trim())); + } + + br.close(); + return jArray; + } catch (Exception e) { + String message = "Error while reading json lines:" + e.getMessage(); + if (line != null) + message = message + "\n" + line; + throw new Exception(message); } - + } } From 638c1d9ed174bee6fc28e957924c7a1f5d9b721a Mon Sep 17 00:00:00 2001 From: Dipsy Kapoor Date: Thu, 20 Jul 2017 11:02:38 -0700 Subject: [PATCH 09/27] add pyTranform methods to get worksheet metadata --- .../isi/karma/er/helper/PythonRepository.java | 8 ++- .../er/helper/PythonTransformationHelper.java | 52 +++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/karma-common/src/main/java/edu/isi/karma/er/helper/PythonRepository.java b/karma-common/src/main/java/edu/isi/karma/er/helper/PythonRepository.java index 11bcedf00..4f02ff37d 100644 --- a/karma-common/src/main/java/edu/isi/karma/er/helper/PythonRepository.java +++ b/karma-common/src/main/java/edu/isi/karma/er/helper/PythonRepository.java @@ -4,7 +4,6 @@ import java.io.FilenameFilter; import java.io.IOException; import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.concurrent.ConcurrentHashMap; @@ -51,6 +50,9 @@ private void initialize() compileAndAddToRepository(interpreter, PythonTransformationHelper.getVDefStatement()); compileAndAddToRepository(interpreter, PythonTransformationHelper.getTransformStatement()); compileAndAddToRepository(interpreter, PythonTransformationHelper.getSelectionStatement()); + compileAndAddToRepository(interpreter, PythonTransformationHelper.getModelName()); + compileAndAddToRepository(interpreter, PythonTransformationHelper.getModelPrefix()); + compileAndAddToRepository(interpreter, PythonTransformationHelper.getModelBaseUri()); initializeInterpreter(interpreter); } @@ -96,6 +98,10 @@ public void initializeInterpreter(PythonInterpreter interpreter) interpreter.exec(scripts.get(PythonTransformationHelper.getGetValueFromNestedColumnByIndexDefStatement())); interpreter.exec(scripts.get(PythonTransformationHelper.getRowIndexDefStatement())); interpreter.exec(scripts.get(PythonTransformationHelper.getVDefStatement())); + interpreter.exec(scripts.get(PythonTransformationHelper.getModelName())); + interpreter.exec(scripts.get(PythonTransformationHelper.getModelPrefix())); + interpreter.exec(scripts.get(PythonTransformationHelper.getModelBaseUri())); + } if(localsUninitialized ||(!libraryHasBeenLoaded || reloadLibrary)) { diff --git a/karma-common/src/main/java/edu/isi/karma/er/helper/PythonTransformationHelper.java b/karma-common/src/main/java/edu/isi/karma/er/helper/PythonTransformationHelper.java index 269fcf69c..6deff01fe 100644 --- a/karma-common/src/main/java/edu/isi/karma/er/helper/PythonTransformationHelper.java +++ b/karma-common/src/main/java/edu/isi/karma/er/helper/PythonTransformationHelper.java @@ -39,6 +39,10 @@ public class PythonTransformationHelper { private static String importStatement = null; private static String valueFromNestedColumnByIndexDefStatement = null; private static String getRowIndexDefStatement = null; + private static String modelNameStatement = null; + private static String modelPrefixStatement = null; + private static String modelBaseUriStatement = null; + public static String getPyObjectValueAsString(PyObject obj) { if (obj == null) return ""; @@ -99,6 +103,7 @@ public static String getImportStatements() { importStmt.append("import json\n"); importStmt.append("import edu.isi.karma.rep.WorkspaceManager\n"); importStmt.append("import edu.isi.karma.rep.Workspace\n"); + importStmt.append("import edu.isi.karma.rep.Worksheet\n"); importStmt.append("import edu.isi.karma.rep.Node\n"); importStmt.append("import edu.isi.karma.rep.Table\n"); importStmt.append("import edu.isi.karma.rep.HTable\n"); @@ -106,6 +111,9 @@ public static String getImportStatements() { importStmt.append("import edu.isi.karma.rep.RepFactory\n"); importStmt.append("import edu.isi.karma.er.helper.PythonTransformationHelper\n"); importStmt.append("import edu.isi.karma.controller.command.transformation.PythonTransformationCommand\n"); + importStmt.append("import edu.isi.karma.rep.metadata.WorksheetProperties\n"); + importStmt.append("import edu.isi.karma.rep.metadata.WorksheetProperties.Property\n"); + importStatement = importStmt.toString(); } return importStatement; @@ -197,6 +205,50 @@ public static String getGetValueFromNestedColumnByIndexDefStatement() { } + public static String getModelName() { + if(modelNameStatement == null) { + StringBuilder methodStmt = new StringBuilder(); + methodStmt.append("def getModelName():\n"); + methodStmt.append(" worksheet = edu.isi.karma.rep.WorkspaceManager.getInstance().getWorkspace(workspaceid).getWorksheet(worksheetId)\n"); + methodStmt.append(" props = worksheet.getMetadataContainer().getWorksheetProperties()\n"); + methodStmt.append(" modelName = props.getPropertyValue(edu.isi.karma.rep.metadata.WorksheetProperties.Property.graphLabel)\n"); + methodStmt.append(" if modelName is not None:\n"); + methodStmt.append(" return modelName\n"); + methodStmt.append(" return ''\n"); + modelNameStatement = methodStmt.toString(); + } + return modelNameStatement; + } + + public static String getModelPrefix() { + if(modelPrefixStatement == null) { + StringBuilder methodStmt = new StringBuilder(); + methodStmt.append("def getModelPrefix():\n"); + methodStmt.append(" worksheet = edu.isi.karma.rep.WorkspaceManager.getInstance().getWorkspace(workspaceid).getWorksheet(worksheetId)\n"); + methodStmt.append(" props = worksheet.getMetadataContainer().getWorksheetProperties()\n"); + methodStmt.append(" prefix = props.getPropertyValue(edu.isi.karma.rep.metadata.WorksheetProperties.Property.prefix)\n"); + methodStmt.append(" if prefix is not None:\n"); + methodStmt.append(" return prefix\n"); + methodStmt.append(" return ''\n"); + modelPrefixStatement = methodStmt.toString(); + } + return modelPrefixStatement; + } + + public static String getModelBaseUri() { + if(modelBaseUriStatement == null) { + StringBuilder methodStmt = new StringBuilder(); + methodStmt.append("def getModelBaseUri():\n"); + methodStmt.append(" worksheet = edu.isi.karma.rep.WorkspaceManager.getInstance().getWorkspace(workspaceid).getWorksheet(worksheetId)\n"); + methodStmt.append(" props = worksheet.getMetadataContainer().getWorksheetProperties()\n"); + methodStmt.append(" uri = props.getPropertyValue(edu.isi.karma.rep.metadata.WorksheetProperties.Property.baseURI)\n"); + methodStmt.append(" if uri is not None:\n"); + methodStmt.append(" return uri\n"); + methodStmt.append(" return ''\n"); + modelBaseUriStatement = methodStmt.toString(); + } + return modelBaseUriStatement; + } public static String getIsEmptyDefStatement() { From 17dc56eebad861ec715b22ad52735d4a20eab681 Mon Sep 17 00:00:00 2001 From: Dipsy Kapoor Date: Fri, 28 Jul 2017 10:26:49 -0700 Subject: [PATCH 10/27] increment version --- karma-web/src/main/webapp/version.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/karma-web/src/main/webapp/version.jsp b/karma-web/src/main/webapp/version.jsp index 4e7f05929..1efcfa543 100644 --- a/karma-web/src/main/webapp/version.jsp +++ b/karma-web/src/main/webapp/version.jsp @@ -1 +1 @@ -v2.053 +v2.053.1 From c4003519372516d6639b469ee15e0d85b984b5bc Mon Sep 17 00:00:00 2001 From: Dipsy Kapoor Date: Mon, 31 Jul 2017 11:35:15 -0700 Subject: [PATCH 11/27] fix labels in HIstory --- .../karma/controller/command/alignment/DeleteLinkCommand.java | 2 ++ .../transformation/SubmitPythonTransformationCommand.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/karma-commands/commands-alignment/src/main/java/edu/isi/karma/controller/command/alignment/DeleteLinkCommand.java b/karma-commands/commands-alignment/src/main/java/edu/isi/karma/controller/command/alignment/DeleteLinkCommand.java index bfba43168..aa56a1df2 100644 --- a/karma-commands/commands-alignment/src/main/java/edu/isi/karma/controller/command/alignment/DeleteLinkCommand.java +++ b/karma-commands/commands-alignment/src/main/java/edu/isi/karma/controller/command/alignment/DeleteLinkCommand.java @@ -101,6 +101,8 @@ private UpdateContainer deleteLink(Alignment alignment, OntologyManager ontMgr, LabeledLink delLink = alignment.getLinkById(linkId); if(delLink != null) { this.displayLabel = delLink.getLabel().getDisplayName(); + } else { + this.displayLabel = edgeUri; } alignment.removeLink(linkId); diff --git a/karma-commands/commands-python/src/main/java/edu/isi/karma/controller/command/transformation/SubmitPythonTransformationCommand.java b/karma-commands/commands-python/src/main/java/edu/isi/karma/controller/command/transformation/SubmitPythonTransformationCommand.java index 4c71f5b91..6845d8d89 100644 --- a/karma-commands/commands-python/src/main/java/edu/isi/karma/controller/command/transformation/SubmitPythonTransformationCommand.java +++ b/karma-commands/commands-python/src/main/java/edu/isi/karma/controller/command/transformation/SubmitPythonTransformationCommand.java @@ -70,7 +70,7 @@ public SubmitPythonTransformationCommand(String id, String model, String newColu //logger.info("SubmitPythonTranformationCommand:" + id + " newColumnName:" + newColumnName + ", code=" + transformationCode); this.pythonNodeId = hNodeId; } - + @Override public String getCommandName() { return this.getClass().getSimpleName(); @@ -124,6 +124,7 @@ public UpdateContainer doIt(Workspace workspace) throws CommandException { Map mapping = gatherTransformedResults(workspace, nodeId); handleJSONOutput(workspace, mapping, newColumnNameHNode); } + newColumnAbsoluteName = newColumnNameHNode.getAbsoluteColumnName(f); WorksheetUpdateFactory.detectSelectionStatusChange(worksheetId, workspace, this); return c; } else { From 9c4b9675c74508587b2dd10172e327ca4e94b874 Mon Sep 17 00:00:00 2001 From: Dipsy Kapoor Date: Thu, 3 Aug 2017 14:31:54 -0700 Subject: [PATCH 12/27] fix bug with editing PyTransforms - Move PyTransform based on its input and detect loops --- .../transformation/AddColumnConsolidator.java | 47 +++++++ .../PyTransformConsolidator.java | 17 ++- .../command/worksheet/AddColumnCommand.java | 4 - .../controller/history/CommandHistory.java | 118 +++++++++++++++++- .../controller/history/HistoryJsonUtil.java | 6 +- .../history/WorksheetCommandHistory.java | 46 ++++++- .../WorksheetCommandHistoryExecutor.java | 8 +- karma-web/src/main/webapp/version.jsp | 2 +- 8 files changed, 222 insertions(+), 26 deletions(-) create mode 100644 karma-commands/commands-python/src/main/java/edu/isi/karma/controller/command/transformation/AddColumnConsolidator.java diff --git a/karma-commands/commands-python/src/main/java/edu/isi/karma/controller/command/transformation/AddColumnConsolidator.java b/karma-commands/commands-python/src/main/java/edu/isi/karma/controller/command/transformation/AddColumnConsolidator.java new file mode 100644 index 000000000..8f8ae5ff7 --- /dev/null +++ b/karma-commands/commands-python/src/main/java/edu/isi/karma/controller/command/transformation/AddColumnConsolidator.java @@ -0,0 +1,47 @@ +package edu.isi.karma.controller.command.transformation; + +import java.util.Iterator; +import java.util.List; + +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; +import org.json.JSONArray; + +import edu.isi.karma.controller.command.Command; +import edu.isi.karma.controller.command.ICommand; +import edu.isi.karma.controller.command.worksheet.AddColumnCommand; +import edu.isi.karma.controller.history.CommandConsolidator; +import edu.isi.karma.controller.history.HistoryJsonUtil; +import edu.isi.karma.rep.Workspace; + +public class AddColumnConsolidator extends CommandConsolidator { + + @Override + public Pair consolidateCommand(List commands, + ICommand newCommand, Workspace workspace) { + if (newCommand instanceof SubmitPythonTransformationCommand) { + String model = newCommand.getModel(); + + Iterator itr = commands.iterator(); + while(itr.hasNext()) { + ICommand tmp = itr.next(); + if (((Command)tmp).getOutputColumns().equals(((Command)newCommand).getOutputColumns()) + && tmp.getModel().equals(model) + && (tmp instanceof AddColumnCommand)) { + SubmitPythonTransformationCommand py = ((SubmitPythonTransformationCommand)newCommand); + JSONArray inputJSON = new JSONArray(py.getInputParameterJson()); + + JSONArray tmpInputJSON = new JSONArray(tmp.getInputParameterJson()); + String hNodeId = HistoryJsonUtil.getStringValue("hNodeId", tmpInputJSON); + + HistoryJsonUtil.setArgumentValue("hNodeId", hNodeId, inputJSON); + py.setInputParameterJson(inputJSON.toString()); + + return new ImmutablePair<>(tmp, (Object)py); + } + } + } + return null; + } + +} diff --git a/karma-commands/commands-python/src/main/java/edu/isi/karma/controller/command/transformation/PyTransformConsolidator.java b/karma-commands/commands-python/src/main/java/edu/isi/karma/controller/command/transformation/PyTransformConsolidator.java index 13c95e5d5..d2eee86c6 100644 --- a/karma-commands/commands-python/src/main/java/edu/isi/karma/controller/command/transformation/PyTransformConsolidator.java +++ b/karma-commands/commands-python/src/main/java/edu/isi/karma/controller/command/transformation/PyTransformConsolidator.java @@ -1,20 +1,17 @@ package edu.isi.karma.controller.command.transformation; +import java.util.Iterator; +import java.util.List; + +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; +import org.json.JSONArray; + import edu.isi.karma.controller.command.Command; -import edu.isi.karma.controller.command.CommandException; import edu.isi.karma.controller.command.ICommand; import edu.isi.karma.controller.history.CommandConsolidator; import edu.isi.karma.controller.history.HistoryJsonUtil; -import edu.isi.karma.controller.history.WorksheetCommandHistoryExecutor; import edu.isi.karma.rep.Workspace; -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.commons.lang3.tuple.Pair; -import org.json.JSONArray; -import org.json.JSONObject; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; public class PyTransformConsolidator extends CommandConsolidator { diff --git a/karma-commands/commands-worksheet/src/main/java/edu/isi/karma/controller/command/worksheet/AddColumnCommand.java b/karma-commands/commands-worksheet/src/main/java/edu/isi/karma/controller/command/worksheet/AddColumnCommand.java index 09f814184..0372dd458 100644 --- a/karma-commands/commands-worksheet/src/main/java/edu/isi/karma/controller/command/worksheet/AddColumnCommand.java +++ b/karma-commands/commands-worksheet/src/main/java/edu/isi/karma/controller/command/worksheet/AddColumnCommand.java @@ -156,7 +156,6 @@ public UpdateContainer doIt(Workspace workspace) throws CommandException { c.append(WorksheetUpdateFactory.createRegenerateWorksheetUpdates(worksheetId, getSuperSelection(worksheet), workspace.getContextId())); c.append(computeAlignmentAndSemanticTypesAndCreateUpdates(workspace)); - inputColumns.add(hNodeId); outputColumns.add(newHNodeId); newColumnAbsoluteName = ndid.getAbsoluteColumnName(workspace.getFactory()); return c; @@ -194,10 +193,7 @@ public UpdateContainer undoIt(Workspace workspace) { return WorksheetUpdateFactory.createRegenerateWorksheetUpdates(worksheetId, getSuperSelection(worksheet), workspace.getContextId()); } - public String getNewHNodeId() { return newHNodeId; } - - } diff --git a/karma-common/src/main/java/edu/isi/karma/controller/history/CommandHistory.java b/karma-common/src/main/java/edu/isi/karma/controller/history/CommandHistory.java index b4a4efaa1..5dd347477 100644 --- a/karma-common/src/main/java/edu/isi/karma/controller/history/CommandHistory.java +++ b/karma-common/src/main/java/edu/isi/karma/controller/history/CommandHistory.java @@ -30,14 +30,25 @@ import edu.isi.karma.controller.command.ICommand.CommandTag; import edu.isi.karma.controller.history.HistoryJsonUtil.ClientJsonKeys; import edu.isi.karma.controller.history.HistoryJsonUtil.ParameterType; +import edu.isi.karma.controller.update.AbstractUpdate; import edu.isi.karma.controller.update.HistoryUpdate; +import edu.isi.karma.controller.update.TrivialErrorUpdate; import edu.isi.karma.controller.update.UpdateContainer; +import edu.isi.karma.modeling.steiner.topk.Graph; import edu.isi.karma.rep.HNode; +import edu.isi.karma.rep.Node; +import edu.isi.karma.rep.RepFactory; import edu.isi.karma.rep.Workspace; import edu.isi.karma.util.JSONUtil; import edu.isi.karma.view.VWorkspace; +import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; +import org.jgrapht.DirectedGraph; +import org.jgrapht.alg.CycleDetector; +import org.jgrapht.graph.DefaultDirectedGraph; +import org.jgrapht.graph.DefaultEdge; +import org.jgrapht.graph.DirectedMultigraph; import org.json.JSONArray; import org.json.JSONObject; import org.reflections.Reflections; @@ -137,6 +148,7 @@ public UpdateContainer doCommand(Command command, Workspace workspace, boolean s Pair consolidatedCommand = null; String consolidatorName = null; String worksheetId = worksheetCommandHistory.getWorksheetId(command); + RepFactory factory = workspace.getFactory(); List potentialConsolidateCommands = worksheetCommandHistory.getCommandsFromWorksheetIdAndCommandTag(worksheetId, command.getTagFromPriority()); for (CommandConsolidator consolidator : consolidators) { consolidatedCommand = consolidator.consolidateCommand(potentialConsolidateCommands, command, workspace); @@ -149,7 +161,37 @@ public UpdateContainer doCommand(Command command, Workspace workspace, boolean s if (consolidatedCommand != null) { worksheetCommandHistory.setStale(worksheetId, true); if (consolidatorName.equals("PyTransformConsolidator")) { - effects.append(consolidatedCommand.getLeft().doIt(workspace)); + Command runCommand = (Command)consolidatedCommand.getLeft(); + effects.append(runCommand.doIt(workspace)); + + if(runCommand.getInputColumns().size() > 0 && + !runCommand.getInputColumns().equals(command.getInputColumns())) { + Pair> cycleDetect = detectTransformCycle(worksheetId); + if(cycleDetect.getLeft() == false) { + + placeTransformCommandByInput(runCommand); + } else { + StringBuilder columns = new StringBuilder(); + String sep = ""; + System.out.println(cycleDetect.getRight()); + for(String nodeId : cycleDetect.getRight()) { + HNode node = factory.getHNode(nodeId); + columns.append(sep); + if(node != null) + columns.append(node.getAbsoluteColumnName(factory)); + else { + Node repNode = factory.getNode(nodeId); + if(repNode != null) + columns.append(repNode.prettyPrint(factory)); + else + columns.append(nodeId); + } + sep = ", "; + } + AbstractUpdate update = new TrivialErrorUpdate("A cycle occurs in the Column Transforms for Columns: " + columns.toString() + ". Please fix the cycle"); + effects.add(update); + } + } } if (consolidatorName.equals("UnassignSemanticTypesConsolidator")) { worksheetCommandHistory.removeCommandFromHistory(Arrays.asList(consolidatedCommand.getLeft())); @@ -179,6 +221,12 @@ public UpdateContainer doCommand(Command command, Workspace workspace, boolean s worksheetCommandHistory.replaceCommandFromHistory(consolidatedCommand.getKey(), (ICommand)consolidatedCommand.getRight()); effects.append(((ICommand) consolidatedCommand.getRight()).doIt(workspace)); } + if (consolidatorName.equals("AddColumnConsolidator")) { + worksheetCommandHistory.removeCommandFromHistory(Arrays.asList(consolidatedCommand.getLeft())); + ICommand runCommand = ((ICommand) consolidatedCommand.getRight()); + worksheetCommandHistory.insertCommandToHistory(runCommand); + effects.append(runCommand.doIt(workspace)); + } } else { effects.append(command.doIt(workspace)); @@ -219,6 +267,74 @@ public UpdateContainer doCommand(Command command, Workspace workspace, boolean s return effects; } + private void placeTransformCommandByInput(Command command) { + ICommand placeAfterCmd = null; + Set cmdInputs = command.getInputColumns(); + Set cmdOutputs = command.getOutputColumns(); + List commandsToMove = new ArrayList<>(); + for (ICommand afterCmd : worksheetCommandHistory.getCommandsAfterCommand(command, CommandTag.Transformation)) { + Set afterCmdOutputs = ((Command)afterCmd).getOutputColumns(); + Set afterCmdInputs = ((Command)afterCmd).getInputColumns(); + for(String input : cmdInputs) { + if(afterCmdOutputs.contains(input)) { + placeAfterCmd = afterCmd; + break; + } + } + for(String output : cmdOutputs) { + if(afterCmdInputs.contains(output)) { + commandsToMove.add((Command)afterCmd); + break; + } + } + } + + if (placeAfterCmd != null) { + worksheetCommandHistory.removeCommandFromHistory(Arrays.asList((ICommand)command)); + JSONArray inputJSON = new JSONArray(command.getInputParameterJson()); + JSONArray placeAfterCmdInputJSON = new JSONArray(command.getInputParameterJson()); + String placeHNodeId = HistoryJsonUtil.getStringValue("hNodeId", placeAfterCmdInputJSON); + HistoryJsonUtil.setArgumentValue("hNodeId", placeHNodeId, inputJSON); + command.setInputParameterJson(inputJSON.toString()); + worksheetCommandHistory.insertCommandToHistoryAfterCommand(command, placeAfterCmd); + } + + for(Command cmd : commandsToMove) + placeTransformCommandByInput(cmd); + } + + private Pair> detectTransformCycle(String worksheetId) { + DirectedGraph historyInputOutputGraph = new DefaultDirectedGraph<>(DefaultEdge.class); + for (ICommand cmd : worksheetCommandHistory.getCommandsFromWorksheetIdAndCommandTag(worksheetId, CommandTag.Transformation)) { + Set outputs = ((Command)cmd).getOutputColumns(); + Set inputs = ((Command)cmd).getInputColumns(); + String commandId = "Command-" + cmd.getId(); + historyInputOutputGraph.addVertex(commandId); + for(String input : inputs) { + historyInputOutputGraph.addVertex(input); + historyInputOutputGraph.addEdge(input, commandId); + } + for(String output : outputs) { + historyInputOutputGraph.addVertex(output); + historyInputOutputGraph.addEdge(commandId, output); + } + } + CycleDetector cycleDetector = new CycleDetector<>(historyInputOutputGraph); + if(cycleDetector.detectCycles()) { + Set cycleVertices = cycleDetector.findCycles(); + Set nodeVertices = new HashSet<>(); + Iterator iterator = cycleVertices.iterator(); + while(iterator.hasNext()) { + String node = iterator.next(); + if(!node.startsWith("Command-")) + nodeVertices.add(node); + } + + return new ImmutablePair<>(true, nodeVertices); + } + return new ImmutablePair>(false, null); + } + private void writeHistoryPerWorksheet(Workspace workspace, IHistorySaver historySaver) throws Exception { String workspaceId = workspace.getId(); Map comMap = new HashMap<>(); diff --git a/karma-common/src/main/java/edu/isi/karma/controller/history/HistoryJsonUtil.java b/karma-common/src/main/java/edu/isi/karma/controller/history/HistoryJsonUtil.java index 2897132f2..9ce23fd62 100644 --- a/karma-common/src/main/java/edu/isi/karma/controller/history/HistoryJsonUtil.java +++ b/karma-common/src/main/java/edu/isi/karma/controller/history/HistoryJsonUtil.java @@ -35,7 +35,11 @@ public static JSONObject getJSONObjectWithName(String arg, JSONArray json) throw } public static JSONArray getJSONArrayValue(String arg, JSONArray json) throws JSONException { - return getJSONObjectWithName(arg, json).getJSONArray(ClientJsonKeys.value.name()); + JSONObject obj = getJSONObjectWithName(arg, json); + if(obj.has(ClientJsonKeys.value.name())) + return obj.getJSONArray(ClientJsonKeys.value.name()); + else + return new JSONArray(); } public static ParameterType getParameterType(JSONObject json) throws JSONException { diff --git a/karma-common/src/main/java/edu/isi/karma/controller/history/WorksheetCommandHistory.java b/karma-common/src/main/java/edu/isi/karma/controller/history/WorksheetCommandHistory.java index 03dc5cc98..1426c32fe 100644 --- a/karma-common/src/main/java/edu/isi/karma/controller/history/WorksheetCommandHistory.java +++ b/karma-common/src/main/java/edu/isi/karma/controller/history/WorksheetCommandHistory.java @@ -1,11 +1,15 @@ package edu.isi.karma.controller.history; import edu.isi.karma.controller.command.ICommand; + import org.apache.commons.lang3.tuple.Pair; +import org.jgrapht.graph.DefaultEdge; +import org.jgrapht.graph.DirectedMultigraph; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.*; +import edu.isi.karma.controller.command.Command; /** * Created by Frank on 9/14/15. @@ -53,8 +57,7 @@ public void removeCommandFromHistory(List commands) { private final Map historyWorksheetMap = new TreeMap<>(); private static final String IMPORT_COMMANDS = "ImportCommands"; - - + public WorksheetCommandHistory() { historyWorksheetMap.put(IMPORT_COMMANDS, new CommandTagListMap()); } @@ -94,6 +97,22 @@ public void insertCommandToHistory(ICommand command) { commandTagListMap.addCommandToHistory(command); } + public void insertCommandToHistoryAfterCommand(ICommand newCommand, ICommand afterCommand) { + String worksheetId = getWorksheetId(afterCommand); + if (worksheetId == null) { + worksheetId = IMPORT_COMMANDS; + } + CommandTagListMap commandTagListMap = historyWorksheetMap.get(worksheetId); + if (commandTagListMap != null) { + for (Map.Entry> entry : commandTagListMap.commandTagListHashMap.entrySet()) { + int index = entry.getValue().indexOf(afterCommand); + if (index != -1) { + entry.getValue().add(index+1, newCommand); + } + } + } + } + public void setLastRedoCommandObject(RedoCommandObject command) { String worksheetId = getWorksheetId(command.getCommand()); @@ -200,6 +219,29 @@ public List getCommandsFromWorksheetIdAndCommandTag(String worksheetId return commands; } + public List getCommandsAfterCommand(ICommand command, ICommand.CommandTag commandTag) { + List commands = new ArrayList<>(); + String worksheetId = getWorksheetId(command); + if (worksheetId == null) { + worksheetId = IMPORT_COMMANDS; + } + CommandTagListMap map = historyWorksheetMap.get(worksheetId); + if (map != null) { + List tagCommands = map.getCommands(commandTag); + boolean start = false; + for(ICommand cmd : tagCommands) { + if(cmd.equals(command)) { + start = true; + continue; + } + if(start) + commands.add(cmd); + } + commands.addAll(map.getCommands(commandTag)); + } + return commands; + } + public RedoCommandObject getLastRedoCommandObject(String worksheetId) { if (worksheetId == null) { worksheetId = IMPORT_COMMANDS; diff --git a/karma-common/src/main/java/edu/isi/karma/controller/history/WorksheetCommandHistoryExecutor.java b/karma-common/src/main/java/edu/isi/karma/controller/history/WorksheetCommandHistoryExecutor.java index 811f01583..b4720ed0a 100644 --- a/karma-common/src/main/java/edu/isi/karma/controller/history/WorksheetCommandHistoryExecutor.java +++ b/karma-common/src/main/java/edu/isi/karma/controller/history/WorksheetCommandHistoryExecutor.java @@ -45,7 +45,6 @@ import edu.isi.karma.rep.HNode.HNodeType; import edu.isi.karma.rep.HTable; import edu.isi.karma.rep.Workspace; -import edu.isi.karma.util.Util; import edu.isi.karma.webserver.ExecutionController; import edu.isi.karma.webserver.KarmaException; import edu.isi.karma.webserver.WorkspaceRegistry; @@ -181,13 +180,8 @@ public UpdateContainer normalizeCommandHistoryJsonInput(Workspace workspace, Str logger.debug("Column being normalized: "+ nameObjColumnName); HNode node = hTable.getHNodeFromColumnName(nameObjColumnName); if(node == null) { //Because add column can happen even if the column after which it is to be added is not present - AbstractUpdate update = new TrivialErrorUpdate(nameObjColumnName + " does not exist, using empty values"); - if (uc == null) - uc = new UpdateContainer(update); - else - uc.add(update); if (addIfNonExist) { - node = hTable.addHNode(nameObjColumnName, HNodeType.Regular, workspace.getWorksheet(worksheetId), workspace.getFactory()); + node = hTable.addHNode(nameObjColumnName, HNodeType.Transformation, workspace.getWorksheet(worksheetId), workspace.getFactory()); } else { continue; diff --git a/karma-web/src/main/webapp/version.jsp b/karma-web/src/main/webapp/version.jsp index 1efcfa543..d067b8c0f 100644 --- a/karma-web/src/main/webapp/version.jsp +++ b/karma-web/src/main/webapp/version.jsp @@ -1 +1 @@ -v2.053.1 +v2.053.2 From c1628aabd036ea5018cf7f46586861b876abfa83 Mon Sep 17 00:00:00 2001 From: Dipsy Kapoor Date: Thu, 10 Aug 2017 12:21:59 -0700 Subject: [PATCH 13/27] remove handling of github url using cookies --- .../src/main/webapp/js/ServerResponseObjectParsing.js | 3 --- karma-web/src/main/webapp/js/worksheetOptions.js | 9 +++------ karma-web/src/main/webapp/version.jsp | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js b/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js index e45b0f09e..2ca026653 100755 --- a/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js +++ b/karma-web/src/main/webapp/js/ServerResponseObjectParsing.js @@ -214,7 +214,6 @@ function parse(data) { var sep = $("").html(" | "); var label1 = $("