root/trunk/calendar3/bldfiles/buildwar.xml

Revision 673 (checked in by douglm, 7 years ago)

Fix more freebusy aggregator bugs

Line 
1 <?xml version="1.0"?>
2
3 <!-- ===================================================================
4      This file is called by other build files to create web applications.
5
6      It is assumed that no changes will be made to this file. It should be
7      possible to make all changes needed by modifying the configuration
8      properties or a bedework.build.proeprties file
9
10      An unwrapped web application will be built in the temp directory
11      and a war and ear file will be left in the dist directory.
12
13      Properties which must be defined on entry, apart from those described
14      in the main build file are:
15     app.root.dir       Location of the root directory for the apps
16     app.sou.dir        Location of the application skeleton,
17     app.name           Name of the application. This wil be used to determine
18                        the name of the file containing the rest of the
19                        application properties, the directory we build in
20                        and the name of war and ear files.
21     cal.j2ee           Defined if this is a j2ee application
22     cal.j2ee.jboss     Defined if this is a jboss application
23     cal.strutsapp      Defined if this is a struts application
24      These should be defined in the build properties for the application.
25
26      It is possible to define any of the app.dest properties below to override
27      the location of destination files.
28
29      In the directory
30         ${apps.sou.dir}
31      we expect an application skeleton formatted like a web-application
32      For the purposes of this build it should contain a
33      structure like
34               war - docs    (contains jsp and html for this app)
35                     WEB-INF - struts-config.xml
36                               web.xml
37                               jboss-web.xml (for jboss only)
38
39      Authors: Mike Douglass   douglm@rpi.edu
40      =================================================================== -->
41
42 <project name="bedework.buildwar" default="build" >
43   <target name="init" depends="init.common,init.uportal2,init.j2ee,init.standalone" />
44
45   <target name="init.common">
46     <!--
47     <condition property="org.bedework.build.for.jetspeed2">
48       <equals arg1="jetspeed2" arg2="${propval.app.portal.platform}"/>
49     </condition>
50
51     <condition property="org.bedework.build.for.uportal2">
52       <equals arg1="uportal2" arg2="${propval.app.portal.platform}"/>
53     </condition>
54
55     <condition property="org.bedework.build.for.jboss">
56       <equals arg1="jboss" arg2="${org.bedework.global.j2ee.platform}"/>
57     </condition>
58     -->
59
60     <!-- Destinations - where we build an unwrapped war -->
61     <property name="app.dest.war"
62               location="${org.bedework.temp.wars.home}/${propval.app.war.name}.war" />
63     <property name="app.dest.docs"
64               location="${app.dest.war}/docs" />
65     <property name="app.dest.webinf"
66               location="${app.dest.war}/WEB-INF" />
67     <property name="app.dest.classes"
68               location="${app.dest.webinf}/classes" />
69     <property name="app.dest.properties"
70               location="${app.dest.classes}/properties/calendar" />
71
72     <!--temp web.xml location  -->
73     <property name="app.dest.web.xml"
74               location="${app.dest.webinf}/web.xml" />
75
76     <property name="app.war.file"
77               location="${dist.home}/${propval.app.war.name}.war" />
78
79     <!-- These may have been set already -->
80     <property name="app.web.xml"
81               value="${app.sou.dir}/war/WEB-INF/web.xml" />
82     <property name="app.sou.properties"
83               location="${app.sou.dir}/war/WEB-INF/classes/servlet.properties" />
84   </target>
85
86   <target name="init.uportal2" if="org.bedework.build.for.uportal2" >
87     <property name="propval.app.servlet.class"
88               value="org.apache.portals.bridges.struts.PortletServlet" />
89
90     <property name="propval.app.ignoreContentType"
91               value="true" />
92
93     <property name="propval.app.genurl.taglib.tld"
94               value="bedework-uportal2.tld" />
95   </target>
96
97   <target name="init.standalone" if="org.bedework.global.build.standalone.app">
98     <property name="propval.app.servlet.class"
99               value="org.apache.struts.action.ActionServlet" />
100
101     <property name="propval.app.ignoreContentType"
102               value="false" />
103
104     <property name="propval.app.portlet.mapping" value="" />
105
106     <property name="propval.app.genurl.taglib.tld"
107               value="struts-html.tld" />
108
109     <property name="app.dest.lib"
110               location="${app.dest.webinf}/lib" />
111   </target>
112
113   <target name="init.j2ee" if="org.bedework.global.j2ee.platform">
114     <property name="app.dest.lib"
115               location="${org.bedework.temp.home}/earlib" />
116   </target>
117
118   <target name="build" depends="init">
119     <delete dir="${app.dest.war}" />
120
121     <!-- Add modifed login pages -->
122     <copy todir="${app.dest.docs}/login" failonerror="false" >
123       <fileset dir="${app.root.dir}/resources/login" />
124       <filterset>
125         <filter token="DISPLAY-NAME" value="${propval.app.display.name}"/>
126       </filterset>
127     </copy>
128
129     <!-- ===============================================================
130          We copy 3 sets of properties.
131
132          First (for struts) are the servlet properties which ends up as
133               classes/servlet.properties
134          Next we copy in a set of generic property files and then with
135          overwrite we copy in a set of base specific files.
136
137          All are updated with new values.
138          =============================================================== -->
139
140     <filterset id="property.filters" >
141       <filter token="BW-APP-NAME"
142               value="${org.bedework.deploy.name}"/>
143
144       <filter token="HIBERNATE-DIALECT"
145               value="${org.bedework.global.hibernate.dialect}" />
146
147       <filter token="DIRECTORY-BROWSING-DISALLOWED"
148               value="${org.bedework.global.directory.browsing.disallowed}" />
149
150       <filter token="IGNORE-CONTENT-TYPE"
151               value="${propval.app.ignoreContentType}" />
152
153       <filter token="APP-DESCRIPTION"
154               value="${propval.app.description}" />
155
156       <filter token="PORTAL-PLATFORM"
157               value="${propval.app.portal.platform}"/>
158
159       <filter token="PORTLET-NAME"
160               value="${propval.app.portlet.name}"/>
161
162       <filter token="CAL-SUITE"
163               value="${propval.app.cal.suite}"/>
164
165       <filter token="SERVLET-CLASS"
166               value="${propval.app.servlet.class}"/>
167
168       <filter token="GENURL-TAGLIB-TLD"
169               value="${propval.app.genurl.taglib.tld}"/>
170
171       <filter token="SECURITY-DOMAIN"
172               value="${propval.app.security.domain}"/>
173       <filter token="SECURITY-PREFIX"
174               value="${propval.app.security.prefix}"/>
175       <filter token="TRANSPORT-GUARANTEE"
176               value="${propval.app.transport.guarantee}"/>
177
178       <filter token="DISPLAY-NAME"
179               value="${propval.app.display.name}"/>
180       <filter token="CONTEXT-ROOT"
181               value="${propval.app.context.root}" />
182       <filter token="APP-NAME"
183               value="${propval.app.name}"/>
184       <filter token="APP-VERSION"
185               value="${propval.app.version}"/>
186
187       <filter token="DEFAULT-CONTENTTYPE"
188               value="${propval.app.default.contenttype}" />
189       <filter token="NOXSLT"
190               value="${propval.app.noxslt}" />
191       <filter token="APPLICATION-ROOT"
192               value="${propval.app.root}" />
193
194       <filter token="APP-GUESTMODE"
195               value="${propval.app.guestmode}" />
196
197       <!-- Change this to be an app par -->
198       <filter token="RUN-AS-USER"
199               value="${org.bedework.syspar.public.user}" />
200
201               <!-- ???????
202       <filter token="CALFILE-NAME"
203               value="${propval.app.calfile.name}" /> -->
204       <filter token="ADMIN-URI"
205               value="${org.bedework.global.public.admin.uri}" />
206       <filter token="PUBEVENTS-URI"
207               value="${org.bedework.global.public.calendar.uri}" />
208       <filter token="PERSONAL-URI"
209               value="${org.bedework.global.personal.calendar.uri}" />
210     </filterset>
211
212     <available file="${app.sou.dir}/properties" type="dir"
213                property="org.bedework.properties.dir.exists" />
214
215     <available file="${app.sou.properties}" type="file"
216                property="org.bedework.servlet.properties.exists" />
217
218     <available file="${app.sou.dir}/war/docs" type="dir"
219                property="org.bedework.war.docs.exists" />
220
221     <antcall target="copy.properties" inheritRefs="true" />
222     <antcall target="copy.servlet.properties" inheritRefs="true" />
223     <antcall target="copy.war.docs" inheritRefs="true" />
224
225     <!-- Create the env.properties file -->
226     <mkdir dir="${app.dest.properties}" />
227
228     <copy tofile="${app.dest.properties}/env.properties"
229           file="${org.bedework.config.properties}" />
230
231     <copy tofile="${app.dest.properties}/options.xml"
232           file="${org.bedework.config.options}" >
233       <filterset>
234         <filter token="RPI-DEBUG" value="${app.debug.val}"/>
235       </filterset>
236       <filterset refid="property.filters" />
237     </copy>
238
239     <!-- Make a modified copy of the web.xml file -->
240     <copy tofile="${app.dest.web.xml}"
241           file="${app.web.xml}"
242           overwrite="yes" >
243       <filterset>
244         <filter token="RPI-DEBUG" value="${app.debug.val}"/>
245       </filterset>
246       <filterset refid="property.filters" />
247     </copy>
248
249     <antcall target="struts-stuff" inheritRefs="true" />
250
251     <!-- ===============================================================
252          Add hibernate jars and property files.
253          =============================================================== -->
254
255     <copy todir="${app.dest.classes}">
256       <fileset dir="${org.bedework.core.base}/resources/properties" />
257       <filterset refid="property.filters" />
258     </copy>
259
260     <copy todir="${app.dest.classes}">
261       <fileset dir="${org.bedework.core.base}/resources/hbms" />
262       <filterset refid="property.filters" />
263     </copy>
264
265     <copy todir="${app.dest.lib}">
266       <fileset dir="${hibernate.jars.dir}">
267         <include name="*.jar"/>
268       </fileset>
269     </copy>
270
271     <antcall target="jboss-stuff" inheritRefs="true" />
272
273     <!-- ===============================================================
274          Any jar files required
275          =============================================================== -->
276
277     <!-- core files -->
278     <copy todir="${app.dest.lib}" file="${org.bedework.calcore.jar}" />
279     <copy todir="${app.dest.lib}" file="${org.bedework.calenv.jar}" />
280     <copy todir="${app.dest.lib}" file="${org.bedework.mail.jar}" />
281     <copy todir="${app.dest.lib}" file="${org.bedework.calfacadeshared.jar}" />
282
283       <!-- appcommon -->
284     <copy todir="${app.dest.lib}" file="${org.bedework.locale.jar}" />
285     <copy todir="${app.dest.lib}" file="${org.bedework.access.jar}" />
286     <copy todir="${app.dest.lib}" file="${org.bedework.calsvci.jar}" />
287     <copy todir="${app.dest.lib}" file="${org.bedework.calsvc.jar}" />
288     <copy todir="${app.dest.lib}" file="${org.bedework.ical.jar}" />
289     <copy todir="${app.dest.lib}" file="${org.bedework.caldavClientApi.jar}" />
290     <copy todir="${app.dest.lib}" file="${org.bedework.common.jar}" />
291     <copy todir="${app.dest.lib}" file="${org.bedework.davdefs.jar}" />
292     <copy todir="${app.dest.lib}" file="${org.bedework.http.jar}" />
293     <copy todir="${app.dest.lib}" file="${org.bedework.appcommon.jar}" />
294     <copy todir="${app.dest.lib}" file="${org.bedework.webcommon.jar}" />
295
296     <!-- free busy -->
297     <copy todir="${app.dest.lib}" file="${org.bedework.fbclient.jar}" />
298     <copy todir="${app.dest.lib}" file="${org.bedework.fbaggregator.jar}" />
299
300     <!-- Some more standard libs -->
301     <copy todir="${app.dest.lib}" file="${log4j.jar}"/>
302     <copy todir="${app.dest.lib}" file="${ical4j.jar}"/>
303     <copy todir="${app.dest.lib}" file="${commons-codec.jar}"/>
304     <copy todir="${app.dest.lib}" file="${commons-collections.jar}"/>
305     <copy todir="${app.dest.lib}" file="${commons-httclient.jar}"/>
306
307     <!-- add the jdbcdriver if defined -->
308     <antcall target="add.jdbcdriver" inheritRefs="true" />
309
310      <!-- any extra -->
311     <copy todir="${app.dest.lib}" >
312       <fileset refid="app.lib.files" />
313       <fileset refid="app.temp.lib.files" />
314     </copy>
315
316     <!-- build the war file -->
317     <mkdir dir="${dist.home}" />
318     <delete file="${app.war.file}" />
319
320     <war warfile="${app.war.file}"
321          webxml="${app.dest.web.xml}"
322          basedir="${app.dest.war}"
323          excludes="${app.dest.web.xml}" />
324
325     <!-- build the ear file for a j2ee app
326     <antcall target="build.ear" inheritRefs="true" />
327     -->
328   </target>
329
330   <target name="add.jdbcdriver" if="app.jdbcdriver.jar">
331     <copy todir="${app.dest.lib}" file="${app.jdbcdriver.jar}"/>
332   </target>
333
334   <target name="copy.properties" if="org.bedework.properties.dir.exists">
335     <!-- ===============================================================
336          Any property files we need for configuration, other than the
337          standard struts file, should be in the "${app.sou.dir}/properties
338          directory. They will be copied into the appropriate place for the
339          war and transformed by the above filter.
340          =============================================================== -->
341     <copy todir="${app.dest.properties}" overwrite="yes" >
342       <fileset dir="${app.sou.dir}/properties"
343                includes="*.properties"/>
344       <filterset refid="property.filters" />
345     </copy>
346   </target>
347
348   <target name="copy.servlet.properties" if="org.bedework.servlet.properties.exists">
349     <copy tofile="${app.dest.classes}/servlet.properties" file="${app.sou.properties}">
350       <filterset refid="property.filters" />
351     </copy>
352   </target>
353
354   <target name="copy.war.docs" if="org.bedework.war.docs.exists">
355     <copy todir="${app.dest.docs}">
356       <fileset dir="${app.sou.dir}/war/docs" />
357     </copy>
358   </target>
359
360   <!-- =================================================================
361        If this is a struts app the following gets executed.
362        We create an updated struts-config.xml file and add some jars.
363        ================================================================= -->
364
365   <target name="struts-stuff" if="org.bedework.strutsapp">
366     <!-- Copy a dummy startup file into the war. -->
367     <copy todir="${app.dest.war}">
368       <fileset dir="${app.sou.dir}/war/" includes="setup.do" />
369     </copy>
370
371     <copy todir="${app.dest.webinf}"
372           file="${app.sou.dir}/war/WEB-INF/struts-config.xml"/>
373
374     <mkdir  dir="${app.dest.webinf}/tlds"/>
375     <copy todir="${app.dest.webinf}/tlds" >
376       <fileset dir="${struts.tlds.dir}">
377         <include name="*"/>
378       </fileset>
379     </copy>
380     <copy todir="${app.dest.webinf}/tlds" >
381       <fileset dir="${org.bedework.default.lib}/tlds">
382         <include name="*"/>
383       </fileset>
384     </copy>
385
386     <antcall target="add.xalan" inheritRefs="true" />
387     <antcall target="add.jetspeed2" inheritRefs="true" />
388     <antcall target="add.uportal2" inheritRefs="true" />
389
390     <copy todir="${app.dest.lib}">
391       <fileset dir="${struts.dir}">
392         <include name="*.jar"/>
393       </fileset>
394     </copy>
395
396     <copy todir="${app.dest.lib}" file="${antlr.jar}"/>
397     <copy todir="${app.dest.lib}" file="${commons-beanutils.jar}"/>
398     <copy todir="${app.dest.lib}" file="${digester.jar}"/>
399     <copy todir="${app.dest.lib}" file="${commons-fileupload.jar}"/>
400     <copy todir="${app.dest.lib}" file="${commons-logging.jar}"/>
401     <copy todir="${app.dest.lib}" file="${commons-validator.jar}"/>
402     <copy todir="${app.dest.lib}" file="${jakarta-oro.jar}"/>
403   </target>
404
405   <target name="add.jetspeed2" if="org.bedework.build.for.jetspeed2" >
406     <copy todir="${app.dest.webinf}"
407           file="${org.bedework.deploy.type.dir}/jetspeed2/${propval.app.war.name}/portlet.xml"
408           overwrite="yes"
409           failonerror="no" />
410     <copy todir="${app.dest.webinf}"
411           file="${org.bedework.deploy.type.dir}/jetspeed2/struts-portlet-config.xml"
412           overwrite="yes"
413           failonerror="no" />
414
415     <copy todir="${app.dest.lib}" >
416       <fileset dir="${org.bedework.default.lib}/${jetspeed2.jars.dir}/portals-bridges-struts">
417         <include name="*.jar"/>
418       </fileset>
419     </copy>
420
421     <copy todir="${app.dest.webinf}/tlds" >
422       <fileset dir="${org.bedework.default.lib}/${jetspeed2.jars.dir}/portals-bridges-struts">
423         <include name="*.tld"/>
424       </fileset>
425     </copy>
426
427     <!-- Add the portal bridge controller def -->
428     <replace file="${app.dest.webinf}/struts-config.xml">
429       <replacetoken><![CDATA[<!-- Jetspeed2 controller def here -->]]></replacetoken>
430       <replacevalue><![CDATA[<controller pagePattern="$M$P" inputForward="true"
431               processorClass="org.apache.portals.bridges.struts.PortletRequestProcessor"/>]]>
432       </replacevalue>
433     </replace>
434   </target>
435
436   <target name="add.uportal2" if="org.bedework.build.for.uportal2" >
437     <copy todir="${app.dest.webinf}"
438           file="${org.bedework.deploy.type.dir}/uportal2/portlet.xml"
439           overwrite="yes"
440           failonerror="no" >
441       <filterset refid="property.filters" />
442     </copy>
443
444     <copy todir="${app.dest.webinf}"
445           file="${org.bedework.deploy.type.dir}/uportal2/struts-portlet-config.xml"
446           overwrite="yes"
447           failonerror="no" />
448
449     <copy todir="${app.dest.lib}" >
450       <fileset dir="${portals-bridges.jars.dir}">
451         <include name="*.jar"/>
452       </fileset>
453     </copy>
454
455     <copy todir="${app.dest.webinf}/tlds"
456           overwrite="yes"
457           failonerror="no" >
458       <fileset dir="${org.bedework.deploy.type.dir}/uportal2" >
459         <include name="*.tld"/>
460       </fileset>
461     </copy>
462
463     <copy todir="${app.dest.lib}" file="${org.bedework.uportal.jar}" />
464
465     <!-- Add the portlet servelt mapping -->
466     <replace file="${app.dest.webinf}/web.xml">
467       <replacetoken><![CDATA[<!-- uPortal2 portlet servlet mapping here -->]]></replacetoken>
468       <replacevalue><![CDATA[<servlet-mapping>
469     <servlet-name>@PORTLET-NAME@</servlet-name>
470     <url-pattern>/@PORTLET-NAME@/*</url-pattern>
471   </servlet-mapping>]]>
472       </replacevalue>
473     </replace>
474
475     <replace file="${app.dest.webinf}/web.xml">
476       <replacefilter token="@PORTLET-NAME@" value="${propval.app.portlet.name}"/>
477     </replace>
478
479     <!-- Add the portal bridge controller def -->
480     <replace file="${app.dest.webinf}/struts-config.xml">
481       <replacetoken><![CDATA[<!-- Jetspeed2 controller def here -->]]></replacetoken>
482       <replacevalue><![CDATA[<controller pagePattern="$M$P" inputForward="true"
483               processorClass="org.apache.portals.bridges.struts.PortletRequestProcessor"/>]]>
484       </replacevalue>
485     </replace>
486   </target>
487
488   <target name="add.xalan" unless="xalan.in.tomcat.common.endorsed" >
489     <copy todir="${app.dest.lib}" file="${xalan.jar}"/>
490   </target>
491
492   <!-- =================================================================
493        If this is a j2ee app the following gets executed.
494        We create an uodated jboss-web.xml file (for jboss) and a ear
495        ================================================================= -->
496
497   <target name="jboss-stuff" if="org.bedework.build.for.jboss">
498     <copy todir="${app.dest.webinf}"
499           file="${app.sou.dir}/war/WEB-INF/jboss-web.xml">
500       <filterset refid="property.filters" />
501     </copy>
502     <antcall target="jboss-virtual-host" inheritRefs="true" />
503   </target>
504
505   <target name="jboss-virtual-host" if="org.bedework.global.virtual.host">
506     <replace file="${app.dest.webinf}/jboss-web.xml">
507       <replacetoken><![CDATA[<!-- Virtual host -->]]></replacetoken>
508       <replacevalue><![CDATA[<virtual-host>@VIRTUAL-HOST@</virtual-host>
509       ]]>
510       </replacevalue>
511     </replace>
512     <replace file="${app.dest.webinf}/jboss-web.xml">
513       <replacefilter token="@VIRTUAL-HOST@" value="${org.bedework.global.virtual.host}"/>
514     </replace>
515   </target>
516
517   <target name="build.ear" if="cal.j2ee">
518     <ant antfile="${buildear}"
519          inheritRefs="true" target="build" />
520   </target>
521
522 </project>
Note: See TracBrowser for help on using the browser.