Index: trunk/calendar3/bldfiles/application.xml =================================================================== --- trunk/calendar3/bldfiles/application.xml (revision 2) +++ (revision ) @@ -1,12 +1,0 @@ - - - - @DISPLAY-NAME@ - - - - @WAR-NAME@.war - /@CONTEXT-ROOT@ - - - Index: trunk/calendar3/bldfiles/buildApplication.xml =================================================================== --- trunk/calendar3/bldfiles/buildApplication.xml (revision 268) +++ (revision ) @@ -1,52 +1,0 @@ - - - - - - - - - - - - - - - - - - - - - - - ]]> - - -- java modules property goes here -- - ]]> - - - - - - - - PATHSEP - - - - - ]]> - - - - - Index: trunk/calendar3/bldfiles/buildwar.xml =================================================================== --- trunk/calendar3/bldfiles/buildwar.xml (revision 268) +++ trunk/calendar3/bldfiles/buildwar.xml (revision 269) @@ -55,8 +55,6 @@ - - @@ -89,9 +87,9 @@ + location="${org.bedework.temp.home}/earlib" /> - + Index: trunk/calendar3/bldfiles/defjars.properties =================================================================== --- trunk/calendar3/bldfiles/defjars.properties (revision 261) +++ trunk/calendar3/bldfiles/defjars.properties (revision 269) @@ -10,4 +10,6 @@ # supplied by your servlet container. servlet.jar=${org.bedework.default.lib}/servletapi-2.4.jar + +ant.jar=${org.bedework.default.lib}/ant-1.6.5.jar p6spy.jar=${org.bedework.default.lib}/p6spy-1.3.jar @@ -124,4 +126,7 @@ org.bedework.config.jar=${org.bedework.temp.jars}/${org.bedework.config.jar.name} +org.bedework.deployment.jar.name=bwdeployment-${product.version}.jar +org.bedework.deployment.jar=${org.bedework.temp.jars}/${org.bedework.deployment.jar.name} + org.bedework.dumprestore.jar.name=bwdumprestore-${product.version}.jar org.bedework.dumprestore.jar=${org.bedework.temp.jars}/${org.bedework.dumprestore.jar.name} Index: trunk/calendar3/deployment/build.xml =================================================================== --- trunk/calendar3/deployment/build.xml (revision 268) +++ trunk/calendar3/deployment/build.xml (revision 269) @@ -27,5 +27,11 @@ + + + + + + @@ -49,5 +55,32 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -90,5 +123,5 @@ ================================================================= --> - + Index: trunk/calendar3/deployment/src/org/bedework/deployment/ApplicationXmlTask.java =================================================================== --- (revision ) +++ trunk/calendar3/deployment/src/org/bedework/deployment/ApplicationXmlTask.java (revision 269) @@ -1,0 +1,223 @@ +/* + Copyright (c) 2000-2005 University of Washington. All rights reserved. + + Redistribution and use of this distribution in source and binary forms, + with or without modification, are permitted provided that: + + The above copyright notice and this permission notice appear in + all copies and supporting documentation; + + The name, identifiers, and trademarks of the University of Washington + are not used in advertising or publicity without the express prior + written permission of the University of Washington; + + Recipients acknowledge that this distribution is made available as a + research courtesy, "as is", potentially with defects, without + any obligation on the part of the University of Washington to + provide support, services, or repair; + + THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR + IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION + ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF + WASHINGTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING + NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH + THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +/* ********************************************************************** + Copyright 2005 Rensselaer Polytechnic Institute. All worldwide rights reserved. + + Redistribution and use of this distribution in source and binary forms, + with or without modification, are permitted provided that: + The above copyright notice and this permission notice appear in all + copies and supporting documentation; + + The name, identifiers, and trademarks of Rensselaer Polytechnic + Institute are not used in advertising or publicity without the + express prior written permission of Rensselaer Polytechnic Institute; + + DISCLAIMER: The software is distributed" AS IS" without any express or + implied warranty, including but not limited to, any implied warranties + of merchantability or fitness for a particular purpose or any warrant)' + of non-infringement of any current or pending patent rights. The authors + of the software make no representations about the suitability of this + software for any particular purpose. The entire risk as to the quality + and performance of the software is with the user. Should the software + prove defective, the user assumes the cost of all necessary servicing, + repair or correction. In particular, neither Rensselaer Polytechnic + Institute, nor the authors of the software are liable for any indirect, + special, consequential, or incidental damages related to the software, + to the maximum extent the law permits. + */ +package org.bedework.deployment; + +import java.io.File; +import java.io.FileWriter; +import java.io.FilenameFilter; +import java.io.Writer; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.DirectoryScanner; +import org.apache.tools.ant.taskdefs.MatchingTask; +import org.apache.tools.ant.types.FileSet; +import org.apache.tools.ant.util.FileUtils; + +/** Ant task to build the application.xml file for a ear. + * + * Task attributes are
    + *
  • outFile The application.xml file we are creating
  • + *
  • displayName Optional display name
  • + *
  • warDir Directory containing war files or expanded wars with names + * ending in ".war"
  • + *
+ * + *

Body is a fileset giving jar files to add. + * + * @author douglm @ rpi.edu + */ +public class ApplicationXmlTask extends MatchingTask { + private List filesets = new LinkedList(); + + private List wars = new LinkedList(); + + private List jars = new LinkedList(); + + private File warDir; + + private String displayName; + + private File outFile; + private Writer wtr; + + public void addFileset(FileSet set) { + filesets.add(set); + } + + /** Set the display name + * + * @param val String + */ + public void setDisplayName(String val) { + displayName = val; + } + + /** Set the application.xml output file + * + * @param val File + */ + public void setOutFile(File val) { + outFile = val; + } + + /** Set the directory containing wars + * + * @param val File + */ + public void setWarDir(File val) { + warDir = val; + } + + /** Executes the task + */ + public void execute() throws BuildException { + try { + getModules(); + + FileUtils.newFileUtils().createNewFile(outFile, true); + + wtr = new FileWriter(outFile); + + writeLine(""); + writeLine(""); + writeLine(""); + if (displayName != null) { + writeLine(" " + displayName + ""); + } + + Iterator it = wars.iterator(); + while (it.hasNext()) { + String nm = (String)it.next(); + + writeLine(""); + writeLine(" "); + writeLine(" "); + writeLine(" " + nm + ""); + writeLine(" /" + + nm.substring(0, nm.lastIndexOf(".war")) + + ""); + writeLine(" "); + writeLine(" "); + } + + it = jars.iterator(); + while (it.hasNext()) { + String nm = (String)it.next(); + + writeLine(""); + writeLine(" "); + writeLine(" " + nm + ""); + writeLine(" "); + } + + writeLine(""); + + wtr.close(); + } catch (BuildException be) { + throw be; + } catch (Throwable t) { + throw new BuildException(t); + } + } + + /* Scan the filesets and extract files that end with ".jar" and directories + * or files that end with ".war" + * + */ + private void getModules() throws BuildException { + FilenameFilter fltr = new FilenameFilter() { + public boolean accept(File dir, String name) { + return name.endsWith(".war"); + } + }; + + if (warDir == null) { + throw new BuildException("No wardir supplied"); + } + + String[] warnames = warDir.list(fltr); + for (int wi = 0; wi < warnames.length; wi++) { + wars.add(warnames[wi]); + } + + Iterator it = filesets.iterator(); + + while (it.hasNext()) { + FileSet fs = (FileSet)it.next(); + + DirectoryScanner ds = fs.getDirectoryScanner(getProject()); + + String[] dsFiles = ds.getIncludedFiles(); + + for (int dsi = 0; dsi < dsFiles.length; dsi++) { + String fname = dsFiles[dsi]; + + if (fname.endsWith(".jar")) { + jars.add(fname); + } else if (fname.endsWith(".war")) { + wars.add(fname); + } + } + } + } + + private void writeLine(String ln) throws Throwable { + wtr.write(ln); + wtr.write("\n"); + } + +} Index: trunk/calendar3/deployment/termination/jboss/build.xml =================================================================== --- trunk/calendar3/deployment/termination/jboss/build.xml (revision 268) +++ trunk/calendar3/deployment/termination/jboss/build.xml (revision 269) @@ -11,4 +11,6 @@ + @@ -20,12 +22,44 @@ - - - + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + Index: trunk/calendar3/deployment/webadmin/jboss/build.xml =================================================================== --- trunk/calendar3/deployment/webadmin/jboss/build.xml (revision 268) +++ trunk/calendar3/deployment/webadmin/jboss/build.xml (revision 269) @@ -25,9 +25,4 @@ - - - - - Index: trunk/calendar3/deployment/webpublic/jboss/build.xml =================================================================== --- trunk/calendar3/deployment/webpublic/jboss/build.xml (revision 268) +++ trunk/calendar3/deployment/webpublic/jboss/build.xml (revision 269) @@ -25,9 +25,4 @@ - - - - - Index: trunk/calendar3/deployment/webuser/jboss/build.xml =================================================================== --- trunk/calendar3/deployment/webuser/jboss/build.xml (revision 268) +++ trunk/calendar3/deployment/webuser/jboss/build.xml (revision 269) @@ -25,9 +25,4 @@ - - - - - Index: trunk/calendar3/webclient/war/WEB-INF/jboss-web.xml =================================================================== --- trunk/calendar3/webclient/war/WEB-INF/jboss-web.xml (revision 2) +++ trunk/calendar3/webclient/war/WEB-INF/jboss-web.xml (revision 269) @@ -8,8 +8,3 @@ java:/CalendarDS - - - rpi/misc/creds - @CREDSEJB-JNDI-NAME@ - Index: trunk/calendar3/webcommon/src/org/bedework/webcommon/BwActionFormBase.java =================================================================== --- trunk/calendar3/webcommon/src/org/bedework/webcommon/BwActionFormBase.java (revision 251) +++ trunk/calendar3/webcommon/src/org/bedework/webcommon/BwActionFormBase.java (revision 269) @@ -111,5 +111,5 @@ // XXX locale - needs to be changed when locale changes - private Collator listCollator = Collator.getInstance(); + private transient Collator listCollator; /* This should be a cloned copy only */ @@ -1440,5 +1440,5 @@ public Collection getAddContentCalendarCollections() { try { - TreeMap tm = new TreeMap(listCollator); + TreeMap tm = new TreeMap(getListCollator()); Iterator it = fetchSvci().getAddContentCalendarCollections().iterator(); @@ -2140,4 +2140,13 @@ } } + + // XXX locale - needs to be changed when locale changes + private Collator getListCollator() { + if (listCollator == null) { + listCollator = Collator.getInstance(); + } + + return listCollator; + } }