Changeset 1765
- Timestamp:
- 03/13/08 12:31:27
- Files:
-
- trunk/build/buildwar.xml (modified) (2 diffs)
- trunk/config/configs/democal.properties (modified) (1 diff)
- trunk/deployment/build.xml (modified) (1 diff)
- trunk/deployment/termination/jboss/build.xml (modified) (1 diff)
- trunk/deployutil/src/org/bedework/deployment/ApplicationXmlTask.java (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/build/buildwar.xml
r1686 r1765 167 167 168 168 <delete file="${app.temp.web.xml}" /> 169 170 <!-- Add the contex root to the file. Note that newline is required --> 171 <echo file="${org.bedework.global.context.roots}" append="yes"> 172 ${propval.app.war.name}.context=${propval.app.context.root} 173 </echo> 169 174 170 175 <!-- =============================================================== … … 571 576 <filterset refid="property.filters" /> 572 577 </copy> 573 <antcall target="jboss-virtual-host" inheritRefs="true" /> 574 </target> 575 576 <target name="jboss-virtual-host" if="org.bedework.global.virtual.host"> 577 <replace file="${app.dest.webinf}/jboss-web.xml"> 578 <replacetoken><![CDATA[<!-- Virtual host -->]]></replacetoken> 579 <replacevalue><![CDATA[<virtual-host>@VIRTUAL-HOST@</virtual-host> 580 ]]> 581 </replacevalue> 582 </replace> 583 <replace file="${app.dest.webinf}/jboss-web.xml"> 584 <replacefilter token="@VIRTUAL-HOST@" value="${propval.app.virtual.host}"/> 585 </replace> 578 579 <if> 580 <isset property="propval.app.virtual.host" /> 581 <then> 582 <replace file="${app.dest.webinf}/jboss-web.xml"> 583 <replacetoken><![CDATA[<!-- Virtual host -->]]></replacetoken> 584 <replacevalue><![CDATA[<virtual-host>@VIRTUAL-HOST@</virtual-host> 585 ]]> 586 </replacevalue> 587 </replace> 588 <replace file="${app.dest.webinf}/jboss-web.xml"> 589 <replacefilter token="@VIRTUAL-HOST@" value="${propval.app.virtual.host}"/> 590 </replace> 591 </then> 592 </if> 586 593 </target> 587 594 trunk/config/configs/democal.properties
r1698 r1765 61 61 62 62 org.bedework.global.directory.browsing.disallowed=false 63 64 # Comment this out for j2ee deploy 63 65 org.bedework.global.build.standalone.app=true 64 66 trunk/deployment/build.xml
r1581 r1765 65 65 location="${app.root.dir}/resources" /> 66 66 67 <if> 68 <not> 69 <isset property="org.bedework.global.context.roots" /> 70 </not> 71 <then> 72 <tempfile property="org.bedework.global.context.roots" 73 destdir="${org.bedework.temp.dir}" 74 prefix="context-roots" suffix=".properties" /> 75 </then> 76 </if> 67 77 68 78 <!-- ==================== config properties ========================= trunk/deployment/termination/jboss/build.xml
r1186 r1765 71 71 <applicationXml displayName="Bedework calendar suite" 72 72 outFile="${ear.dir}/META-INF/application.xml" 73 warDir="${org.bedework.temp.dir}/wars"> 73 warDir="${org.bedework.temp.dir}/wars" 74 contexts="${org.bedework.global.context.roots}"> 74 75 <fileset dir="${ear.dir}"> 75 76 <include name="*.jar"/> trunk/deployutil/src/org/bedework/deployment/ApplicationXmlTask.java
r1475 r1765 55 55 56 56 import java.io.File; 57 import java.io.FileInputStream; 57 58 import java.io.FileWriter; 58 59 import java.io.FilenameFilter; … … 60 61 import java.util.LinkedList; 61 62 import java.util.List; 63 import java.util.Properties; 62 64 63 65 import org.apache.tools.ant.BuildException; … … 74 76 * <li>warDir Directory containing war files or expanded wars with names 75 77 * ending in ".war"</li> 78 * <li>contexts property file defining context roots</li> 76 79 * </ul> 77 80 * … … 91 94 private String displayName; 92 95 96 private String contexts; 97 93 98 private File outFile; 94 99 private Writer wtr; 100 private Properties contextProps; 95 101 96 102 /** Add a fileset … … 108 114 public void setDisplayName(String val) { 109 115 displayName = val; 116 } 117 118 /** Set the contexts file name 119 * 120 * @param val String 121 */ 122 public void setContexts(String val) { 123 contexts = val; 110 124 } 111 125 … … 135 149 136 150 wtr = new FileWriter(outFile); 151 152 if (contexts != null) { 153 FileInputStream propFile = new FileInputStream(contexts); 154 contextProps = new Properties(); 155 contextProps.load(propFile); 156 } 137 157 138 158 writeLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); … … 148 168 writeLine(" <web>"); 149 169 writeLine(" <web-uri>" + nm + "</web-uri>"); 150 writeLine(" <context-root>/" + 151 nm.substring(0, nm.lastIndexOf(".war")) + 152 "</context-root>"); 170 171 String warName = nm.substring(0, nm.lastIndexOf(".war")); 172 String contextRoot = null; 173 174 if (contextProps != null) { 175 contextRoot = contextProps.getProperty(warName + ".context"); 176 177 if (contextRoot.length() == 0) { 178 contextRoot = "/"; 179 } 180 } 181 182 if (contextRoot == null) { 183 contextRoot = "/" + warName; 184 } 185 186 writeLine(" <context-root>" + contextRoot + "</context-root>"); 153 187 writeLine(" </web>"); 154 188 writeLine(" </module>");
