Index: lams_build/build.xml
===================================================================
diff -u -rfd986626034d8cdc7f48a20bbae77c43447b3ede -r9d57b27409122d7e8b897697019f5d59b1a97d33
--- lams_build/build.xml (.../build.xml) (revision fd986626034d8cdc7f48a20bbae77c43447b3ede)
+++ lams_build/build.xml (.../build.xml) (revision 9d57b27409122d7e8b897697019f5d59b1a97d33)
@@ -230,46 +230,57 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -279,6 +290,7 @@
+
Index: lams_build/common.properties
===================================================================
diff -u -r768b07d2e4f1f3cacf48beddd310352d6543d0f0 -r9d57b27409122d7e8b897697019f5d59b1a97d33
--- lams_build/common.properties (.../common.properties) (revision 768b07d2e4f1f3cacf48beddd310352d6543d0f0)
+++ lams_build/common.properties (.../common.properties) (revision 9d57b27409122d7e8b897697019f5d59b1a97d33)
@@ -100,3 +100,6 @@
#web application properties
sessiontimeout=120
+
+# are we generating the tool deploy packages for an upgrader. Normally this is false
+generate.for.installers=false
\ No newline at end of file
Index: lams_build/deploy-tool/lib/lams-tool-deploy.jar
===================================================================
diff -u -rbe5dff2b0237bf6aeeefeb9449210da56869b55e -r9d57b27409122d7e8b897697019f5d59b1a97d33
Binary files differ
Index: lams_tool_chat/build.xml
===================================================================
diff -u -r27d3bbc5ceacea6e30fe6876b11e0800b4bff916 -r9d57b27409122d7e8b897697019f5d59b1a97d33
--- lams_tool_chat/build.xml (.../build.xml) (revision 27d3bbc5ceacea6e30fe6876b11e0800b4bff916)
+++ lams_tool_chat/build.xml (.../build.xml) (revision 9d57b27409122d7e8b897697019f5d59b1a97d33)
@@ -403,6 +403,7 @@
+ * (Optional) generateForInstallers: if true then the paths are prepended with @tool_build_dir@
+ * rather than a full path.
* (Optional) all other parameters go into the deploy.properties file.
*
*
@@ -88,7 +90,7 @@
// create the new configuration file, using the template
//deployConfig = new DeployToolConfig(getTemplateDeployName());
- deployConfig = new DeployToolConfig();
+ deployConfig = new DeployToolConfig(outputPath.toString());
// override with values from an optional config file
if ( configFile != null && configFile.length() > 0 ) {
log("Applying configuration file "+configFile.getAbsolutePath());
@@ -115,6 +117,7 @@
applyParameters();
applyFilesets(DeployToolConfig.LANGUAGE_FILES, filesets);
deployConfig.validateProperties();
+ deployConfig.convertForInstallers();
try
{
writeConfigFile();
Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/Deploy.java
===================================================================
diff -u -rbe5dff2b0237bf6aeeefeb9449210da56869b55e -r9d57b27409122d7e8b897697019f5d59b1a97d33
--- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/Deploy.java (.../Deploy.java) (revision be5dff2b0237bf6aeeefeb9449210da56869b55e)
+++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/Deploy.java (.../Deploy.java) (revision 9d57b27409122d7e8b897697019f5d59b1a97d33)
@@ -73,8 +73,8 @@
System.out.println("Starting Tool Deploy");
try
{
- System.out.println("Reading Configuration File"+args[0]);
- DeployToolConfig config = new DeployToolConfig(args[0]);
+ System.out.println("Reading Configuration File "+args[0]);
+ DeployToolConfig config = new DeployToolConfig(null, args[0]);
String toolSignature = config.getToolSignature();
String toolVersionStr = config.getToolVersion();
Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/DeployConfig.java
===================================================================
diff -u -r80b79caffb24c6e12d0c308ca492bb70751e3415 -r9d57b27409122d7e8b897697019f5d59b1a97d33
--- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/DeployConfig.java (.../DeployConfig.java) (revision 80b79caffb24c6e12d0c308ca492bb70751e3415)
+++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/DeployConfig.java (.../DeployConfig.java) (revision 9d57b27409122d7e8b897697019f5d59b1a97d33)
@@ -75,6 +75,10 @@
protected transient String validationError = "";
protected transient XStream xstream;
+ protected transient boolean generateForInstallers = false;
+ protected transient String outputPath = null;
+
+
/**
* Holds value of property toolVersion.
*/
@@ -112,10 +116,12 @@
*/
private String languageFilesPackage;
- public DeployConfig()
+ public DeployConfig(String outputPath)
{
this.validationError = "";
xstream = new XStream(new DomDriver());
+
+ this.outputPath = outputPath != null ? outputPath : "";
}
/**
@@ -383,6 +389,23 @@
this.setLamsEarPath(config.getLamsEarPath());
}
+ public boolean isGenerateForInstallers() {
+ return generateForInstallers;
+ }
+ public void setGenerateForInstallers(boolean generateForInstallers) {
+ this.generateForInstallers = generateForInstallers;
+ }
+
+ public String getOutputPath() {
+ return outputPath;
+ }
+
+ public void setOutputPath(String outputPath) {
+ this.outputPath = outputPath;
+ }
+
+ public abstract void convertForInstallers();
+
}
Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/DeployToolConfig.java
===================================================================
diff -u -r2fe3031016f4bc473032ce3f6f08d9ea4ab641e3 -r9d57b27409122d7e8b897697019f5d59b1a97d33
--- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/DeployToolConfig.java (.../DeployToolConfig.java) (revision 2fe3031016f4bc473032ce3f6f08d9ea4ab641e3)
+++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/DeployToolConfig.java (.../DeployToolConfig.java) (revision 9d57b27409122d7e8b897697019f5d59b1a97d33)
@@ -58,6 +58,7 @@
private static final String TOOL_JAR_FILE_NAME = "toolJarFileName";
private static final String DEPLOY_FILES= "deployFiles";
private static final String MIN_SERVER_VERSION_NUMBER= "minServerVersionNumber";
+ private static final String GENERATE_XML_FOR_INSTALLERS = "generateForInstallers";
protected static final String LANGUAGE_FILES= "languageFiles";
@@ -142,27 +143,26 @@
*/
private ArrayList languageFiles;
-
- /**
+ /**
* Creates an instance of DeployToolConfig object.
*/
- public DeployToolConfig()
+ public DeployToolConfig(String outputPath)
{
- super();
+ super(outputPath);
xstream.alias(ROOT_ELEMENT, DeployToolConfig.class);
}
/**
* Creates an instance of DeployToolConfig object, with the values
* of its properties, set to that specified by the Xml configuration file
- * @param configurationFilePath
+ * @param configurationFilePath - only needed when generating the initial deploy.xml
* @throws ParserConfigurationException
* @throws IOException
* @throws SAXException
*/
- public DeployToolConfig(String configurationFilePath) throws ParserConfigurationException, IOException, SAXException
+ public DeployToolConfig(String outputPath, String configurationFilePath) throws ParserConfigurationException, IOException, SAXException
{
- super();
+ super(outputPath);
xstream.alias(ROOT_ELEMENT, DeployToolConfig.class);
updateConfigurationProperties(configurationFilePath);
}
@@ -173,7 +173,7 @@
String xml = readFile(configFilePath);
DeployToolConfig config = (DeployToolConfig)deserialiseXML(xml);
copyProperties(config);
- //printObjectProperties(); //for testing purposes
+ printObjectProperties(); //for testing purposes
}
@@ -190,6 +190,11 @@
super.setProperty(key, value);
//System.out.println("ToolConfig " + key + " is: " + value);
+ if ( key.equalsIgnoreCase(GENERATE_XML_FOR_INSTALLERS) ) {
+ generateForInstallers = java.lang.Boolean.parseBoolean(value);
+ System.out.print("generateForInstallers"+generateForInstallers);
+ }
+
if ( key.equalsIgnoreCase(TOOL_SIGNATURE) ) {
toolSignature = value;
@@ -576,5 +581,43 @@
this.toolJarFileName = toolJarFileName;
}
-
+ public void convertForInstallers() {
+ if ( isGenerateForInstallers() ) {
+ System.out.println("Stripping paths output path "+outputPath);
+ int lengthOfPath = outputPath.length();
+ toolUpdateScriptPath = stripPath(toolUpdateScriptPath, outputPath, lengthOfPath);
+ toolInsertScriptPath = stripPath(toolInsertScriptPath, outputPath, lengthOfPath);
+ toolLibraryInsertScriptPath = stripPath(toolLibraryInsertScriptPath, outputPath, lengthOfPath);
+ toolActivityInsertScriptPath = stripPath(toolActivityInsertScriptPath, outputPath, lengthOfPath);
+ toolTablesScriptPath = stripPath(toolTablesScriptPath, outputPath, lengthOfPath);
+ toolTablesDeleteScriptPath = stripPath(toolTablesDeleteScriptPath, outputPath, lengthOfPath);
+
+ ArrayList newLanguageFiles = new ArrayList(languageFiles.size());
+ for ( String file : languageFiles ) {
+ newLanguageFiles.add(stripPath(file, outputPath, lengthOfPath));
+ }
+ languageFiles = newLanguageFiles;
+
+ ArrayList newDeployFiles = new ArrayList(deployFiles.size());
+ for ( String file : deployFiles ) {
+ newDeployFiles.add(stripPath(file, outputPath, lengthOfPath));
+ }
+ deployFiles = newDeployFiles;;
+
+ setDbDriverClass("@dbDriverClass@");
+ setDbDriverUrl("@dbDriverUrl@");
+ setDbUsername("@dbUsername@");
+ setDbPassword("@dbPassword@");
+ setLamsEarPath("@lamsear@");
+ }
+ }
+
+ private String stripPath(String path, String outputPath, int lengthOfPath) {
+ System.out.println("script path "+path+" index of "+path.indexOf(outputPath) );
+ if ( path.indexOf(outputPath) == 0 ) {
+ return "@toolDeployPackageDir@"+path.substring(lengthOfPath);
+ } else {
+ return path;
+ }
+ }
}
Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/libraryActivity/CreateLibraryPackageTask.java
===================================================================
diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r9d57b27409122d7e8b897697019f5d59b1a97d33
--- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/libraryActivity/CreateLibraryPackageTask.java (.../CreateLibraryPackageTask.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf)
+++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/libraryActivity/CreateLibraryPackageTask.java (.../CreateLibraryPackageTask.java) (revision 9d57b27409122d7e8b897697019f5d59b1a97d33)
@@ -75,7 +75,7 @@
// create the new configuration file, using the template
//deployConfig = new DeployToolConfig(getTemplateDeployName());
- deployConfig = new DeployLibraryConfig();
+ deployConfig = new DeployLibraryConfig(outputPath.toString());
// override with values from an optional config file
if ( configFile != null && configFile.length() > 0 ) {
log("Applying configuration file "+configFile.getAbsolutePath());
Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/libraryActivity/DeployLibraryConfig.java
===================================================================
diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r9d57b27409122d7e8b897697019f5d59b1a97d33
--- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/libraryActivity/DeployLibraryConfig.java (.../DeployLibraryConfig.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf)
+++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/libraryActivity/DeployLibraryConfig.java (.../DeployLibraryConfig.java) (revision 9d57b27409122d7e8b897697019f5d59b1a97d33)
@@ -54,8 +54,9 @@
private ArrayList learningLibraryList;
- public DeployLibraryConfig()
+ public DeployLibraryConfig(String outputPath)
{
+ super(outputPath);
xstream.alias(ROOT_ELEMENT, DeployLibraryConfig.class);
xstream.alias(LEARNING_LIBRARY, LearningLibrary.class);
xstream.alias(TOOL_ACTIVITY, ToolActivity.class);
@@ -65,8 +66,10 @@
String dbPassword,
String dbDriverClass,
String dbDriverUrl,
- ArrayList learningLibraries)
+ ArrayList learningLibraries,
+ String outputPath)
{
+ super(outputPath);
setDbUsername(dbUsername);
setDbPassword(dbPassword);
setDbDriverClass(dbDriverClass);
@@ -78,9 +81,9 @@
xstream.alias(TOOL_ACTIVITY, ToolActivity.class);
}
- public DeployLibraryConfig(String configurationFilePath) throws ParserConfigurationException, IOException, SAXException
+ public DeployLibraryConfig(String configurationFilePath, String outputPath) throws ParserConfigurationException, IOException, SAXException
{
- super();
+ super(outputPath);
xstream.alias(ROOT_ELEMENT, DeployLibraryConfig.class);
xstream.alias(LEARNING_LIBRARY, LearningLibrary.class);
xstream.alias(TOOL_ACTIVITY, ToolActivity.class);
@@ -223,4 +226,8 @@
public void setLearningLibraryList(ArrayList learningLibraryList) {
this.learningLibraryList = learningLibraryList;
}
+
+ public void convertForInstallers() {
+ // No conversion being done at this stage as the updater doesn't use them.
+ }
}
Index: lams_tool_forum/build.xml
===================================================================
diff -u -rf124bb5b1ed07b1d5dca8e235453d8d1035a6215 -r9d57b27409122d7e8b897697019f5d59b1a97d33
--- lams_tool_forum/build.xml (.../build.xml) (revision f124bb5b1ed07b1d5dca8e235453d8d1035a6215)
+++ lams_tool_forum/build.xml (.../build.xml) (revision 9d57b27409122d7e8b897697019f5d59b1a97d33)
@@ -374,6 +374,7 @@