Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/Deploy.java =================================================================== diff -u -r60f8ad90ac03834ede1c4a45585f7f117d5844de -r36af70a291e83151c95c28003ae26cd8da398171 --- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/Deploy.java (.../Deploy.java) (revision 60f8ad90ac03834ede1c4a45585f7f117d5844de) +++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/Deploy.java (.../Deploy.java) (revision 36af70a291e83151c95c28003ae26cd8da398171) @@ -50,7 +50,9 @@ if ((args.length < 1) || (args[0] == null)) { - throw new IllegalArgumentException("Usage: Deployer "); + throw new IllegalArgumentException("Usage: Deployer . n" + + "\nforceDB deletes the old database entries before creating the new entries." + + "\nSo it should be set to false for production and true for development"); } System.out.println("Starting Tool Deploy"); Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/ToolDBRemoveToolEntriesTask.java =================================================================== diff -u -r60f8ad90ac03834ede1c4a45585f7f117d5844de -r36af70a291e83151c95c28003ae26cd8da398171 --- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/ToolDBRemoveToolEntriesTask.java (.../ToolDBRemoveToolEntriesTask.java) (revision 60f8ad90ac03834ede1c4a45585f7f117d5844de) +++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/ToolDBRemoveToolEntriesTask.java (.../ToolDBRemoveToolEntriesTask.java) (revision 36af70a291e83151c95c28003ae26cd8da398171) @@ -93,17 +93,19 @@ { conn.setAutoCommit(false); toolId = getToolId(conn); - learningLibraryId = getLearningLibraryId(toolId, conn); - - System.out.println("Deleting rows where toolId = "+toolId+" and learningLibraryId = "+learningLibraryId); - cleanupToolTables(toolId, learningLibraryId, conn); - - //run the tool table delete script - if ( toolTablesDeleteScriptPath == null || toolTablesDeleteScriptPath.length() == 0 ) { - System.err.println("Unable to run tool delete script as not specified. Later calls may fail."); - } else { - ScriptRunner runner = new ScriptRunner(readFile(toolTablesDeleteScript), conn); - runner.run(); + if ( toolId != 0 ) { + learningLibraryId = getLearningLibraryId(toolId, conn); + + System.out.println("Deleting rows where toolId = "+toolId+" and learningLibraryId = "+learningLibraryId); + cleanupToolTables(toolId, learningLibraryId, conn); + + //run the tool table delete script + if ( toolTablesDeleteScriptPath == null || toolTablesDeleteScriptPath.length() == 0 ) { + System.err.println("Unable to run tool delete script as not specified. Later calls may fail."); + } else { + ScriptRunner runner = new ScriptRunner(readFile(toolTablesDeleteScript), conn); + runner.run(); + } } //commit transaction @@ -186,10 +188,6 @@ { return results.getLong("tool_id"); } - else - { - System.err.println("Tool entry cannot be found. Tool signature "+toolSignature); - } } catch (SQLException sqlex) { @@ -216,10 +214,6 @@ { return results.getLong("learning_library_id"); } - else - { - System.err.println("Learning library id cannot be found. Tool id "+toolId); - } } catch (SQLException sqlex) {