Changeset 1764

Show
Ignore:
Timestamp:
03/13/08 12:30:56
Author:
douglm
Message:

Fix jboss build so that virtual hosts and context roots are set from the properties.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • releases/bedework-3.4.1/build/buildwar.xml

    r1686 r1764  
    167167 
    168168    <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> 
    169174 
    170175    <!-- =============================================================== 
     
    571576      <filterset refid="property.filters" /> 
    572577    </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> 
    586593  </target> 
    587594 
  • releases/bedework-3.4.1/config/configs/democal.properties

    r1757 r1764  
    6060 
    6161org.bedework.global.directory.browsing.disallowed=false 
     62 
     63# Comment this out for j2ee deploy 
    6264org.bedework.global.build.standalone.app=true 
    6365 
  • releases/bedework-3.4.1/deployment/build.xml

    r1581 r1764  
    6565              location="${app.root.dir}/resources" /> 
    6666 
     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> 
    6777 
    6878    <!-- ==================== config properties ========================= 
  • releases/bedework-3.4.1/deployment/termination/jboss/build.xml

    r1186 r1764  
    7171    <applicationXml displayName="Bedework calendar suite" 
    7272                    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}"> 
    7475      <fileset dir="${ear.dir}"> 
    7576        <include name="*.jar"/> 
  • releases/bedework-3.4.1/deployutil/src/org/bedework/deployment/ApplicationXmlTask.java

    r1475 r1764  
    5555 
    5656import java.io.File; 
     57import java.io.FileInputStream; 
    5758import java.io.FileWriter; 
    5859import java.io.FilenameFilter; 
     
    6061import java.util.LinkedList; 
    6162import java.util.List; 
     63import java.util.Properties; 
    6264 
    6365import org.apache.tools.ant.BuildException; 
     
    7476 * <li>warDir    Directory containing war files or expanded wars with names 
    7577 *               ending in ".war"</li> 
     78 * <li>contexts  property file defining context roots</li> 
    7679 * </ul> 
    7780 * 
     
    9194  private String displayName; 
    9295 
     96  private String contexts; 
     97 
    9398  private File outFile; 
    9499  private Writer wtr; 
     100  private Properties contextProps; 
    95101 
    96102  /** Add a fileset 
     
    108114  public void setDisplayName(String val) { 
    109115    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; 
    110124  } 
    111125 
     
    135149 
    136150      wtr = new FileWriter(outFile); 
     151 
     152      if (contexts != null) { 
     153        FileInputStream propFile = new FileInputStream(contexts); 
     154        contextProps = new Properties(); 
     155        contextProps.load(propFile); 
     156      } 
    137157 
    138158      writeLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); 
     
    148168        writeLine("    <web>"); 
    149169        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>"); 
    153187        writeLine("    </web>"); 
    154188        writeLine("  </module>");