Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/Deploy.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/Deploy.java,v diff -u -r1.6 -r1.7 --- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/Deploy.java 15 Jun 2005 03:55:07 -0000 1.6 +++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/Deploy.java 21 Jun 2005 05:56:03 -0000 1.7 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/ToolDBRemoveToolEntriesTask.java,v diff -u -r1.1 -r1.2 --- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/ToolDBRemoveToolEntriesTask.java 15 Jun 2005 03:55:07 -0000 1.1 +++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/ToolDBRemoveToolEntriesTask.java 21 Jun 2005 05:56:03 -0000 1.2 @@ -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) {