root/trunk/build/buildwar.xml

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

Fix to caldav freebusy query

Move a class from caldav server package into calfacade icalendar package

More fixes to get freeebusy aggregator working again.

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     <!-- Load the location of the libraries -->
47     <property file="${org.bedework.project.bedework}/build/libjars.properties" />
48
49     <!--
50     <condition property="org.bedework.build.for.jetspeed2">
51       <equals arg1="jetspeed2" arg2="${propval.app.portal.platform}"/>
52     </condition>
53
54     <condition property="org.bedework.build.for.uportal2">
55       <equals arg1="uportal2" arg2="${propval.app.portal.platform}"/>
56     </condition>
57
58     <condition property="org.bedework.build.for.jboss">
59       <equals arg1="jboss" arg2="${org.bedework.global.j2ee.platform}"/>
60     </condition>
61     -->
62
63     <!-- Destinations - where we build an unwrapped war -->
64     <property name="app.dest.war"
65               location="${org.bedework.temp.wars.home}/${propval.app.war.name}.war" />
66     <property name="app.dest.docs"
67               location="${app.dest.war}/docs" />
68     <property name="app.dest.webinf"
69               location="${app.dest.war}/WEB-INF" />
70     <property name="app.dest.metainf"
71               location="${app.dest.war}/META-INF" />
72     <property name="app.dest.classes"
73               location="${app.dest.webinf}/classes" />
74     <property name="app.dest.properties"
75               location="${app.dest.classes}/properties/calendar" />
76
77     <!--temp web.xml location  -->
78     <property name="app.dest.web.xml"
79               location="${app.dest.webinf}/web.xml" />
80
81     <property name="app.war.file"
82               location="${dist.home}/${propval.app.war.name}.war" />
83
84     <property name="app.sou.tomcat.context.xml"
85               location="${app.sou.dir}/war/META-INF/context.xml" />
86
87     <!-- default web.xml -->
88     <property name="propval.app.web.xml"
89               value="war/WEB-INF/web.xml" />
90
91               <!--
92     <property name="app.web.xml"
93               location="${propval.app.web.xml}" />
94               -->
95     <resolveFile name="app.web.xml"
96                  file="${propval.app.web.xml}"
97                  base="${app.sou.dir}"/>
98
99     <property name="app.sou.properties"
100               location="${app.sou.dir}/war/WEB-INF/classes/servlet.properties" />
101   </target>
102
103   <target name="init.uportal2" if="org.bedework.build.for.uportal2" >
104     <property name="propval.app.servlet.class"
105               value="org.apache.portals.bridges.struts.PortletServlet" />
106
107     <property name="propval.app.ignoreContentType"
108               value="true" />
109
110     <property name="propval.app.genurl.taglib.tld"
111               value="bedework-uportal2.tld" />
112   </target>
113
114   <target name="init.standalone" if="org.bedework.global.build.standalone.app">
115     <property name="propval.app.servlet.class"
116               value="org.apache.struts.action.ActionServlet" />
117
118     <property name="propval.app.ignoreContentType"
119               value="false" />
120
121     <property name="propval.app.portlet.mapping" value="" />
122
123     <property name="propval.app.genurl.taglib.tld"
124               value="struts-html.tld" />
125
126     <property name="app.dest.lib"
127               location="${app.dest.webinf}/lib" />
128   </target>
129
130   <target name="init.j2ee" if="org.bedework.global.j2ee.platform">
131     <property name="propval.app.servlet.class"
132               value="org.apache.struts.action.ActionServlet" />
133
134     <property name="propval.app.ignoreContentType"
135               value="false" />
136
137     <property name="propval.app.portlet.mapping" value="" />
138
139     <property name="propval.app.genurl.taglib.tld"
140               value="struts-html.tld" />
141
142     <property name="app.dest.lib"
143               location="${org.bedework.temp.dir}/earlib" />
144   </target>
145
146   <target name="build" depends="init">
147     <delete dir="${app.dest.war}" />
148
149     <!-- Add modifed login pages -->
150     <copy todir="${app.dest.docs}/login" failonerror="false" >
151       <fileset dir="${app.root.dir}/resources/login" />
152       <filterset>
153         <filter token="DISPLAY-NAME" value="${propval.app.display.name}"/>
154       </filterset>
155     </copy>
156
157     <!-- ===============================================================
158          We copy 3 sets of properties.
159
160          First (for struts) are the servlet properties which ends up as
161               classes/servlet.properties
162          Next we copy in a set of generic property files and then with
163          overwrite we copy in a set of base specific files.
164
165          All are updated with new values.
166          =============================================================== -->
167
168     <filterset id="property.filters" >
169       <filter token="BW-APP-NAME"
170               value="${org.bedework.deploy.name}"/>
171
172       <filter token="HIBERNATE-DIALECT"
173               value="${org.bedework.global.hibernate.dialect}" />
174
175       <filter token="DIRECTORY-BROWSING-DISALLOWED"
176               value="${org.bedework.global.directory.browsing.disallowed}" />
177
178       <filter token="IGNORE-CONTENT-TYPE"
179               value="${propval.app.ignoreContentType}" />
180
181       <filter token="APP-DESCRIPTION"
182               value="${propval.app.description}" />
183
184       <filter token="PORTAL-PLATFORM"
185               value="${propval.app.portal.platform}"/>
186
187       <filter token="PORTLET-NAME"
188               value="${propval.app.portlet.name}"/>
189
190       <filter token="CAL-SUITE"
191               value="${propval.app.cal.suite}"/>
192
193       <filter token="SERVLET-CLASS"
194               value="${propval.app.servlet.class}"/>
195
196       <filter token="GENURL-TAGLIB-TLD"
197               value="${propval.app.genurl.taglib.tld}"/>
198
199       <filter token="SECURITY-DOMAIN"
200               value="${propval.app.security.domain}"/>
201       <filter token="SECURITY-PREFIX"
202               value="${propval.app.security.prefix}"/>
203       <filter token="TRANSPORT-GUARANTEE"
204               value="${propval.app.transport.guarantee}"/>
205
206       <filter token="DISPLAY-NAME"
207               value="${propval.app.display.name}"/>
208       <filter token="CONTEXT-ROOT"
209               value="${propval.app.context.root}" />
210       <filter token="APP-NAME"
211               value="${propval.app.name}"/>
212       <filter token="APP-VERSION"
213               value="${propval.app.version}"/>
214       <filter token="WAR-NAME"
215               value="${propval.app.war.name}"/>
216       <filter token="TOMCAT-DOC-BASE"
217               value="${org.bedework.appserver.dir}${propval.app.deploy.dir}/${propval.app.war.name}"/>
218
219       <filter token="DEFAULT-CONTENTTYPE"
220               value="${propval.app.default.contenttype}" />
221       <filter token="NOXSLT"
222               value="${propval.app.noxslt}" />
223       <filter token="APPLICATION-ROOT"
224               value="${propval.app.root}" />
225
226       <filter token="APP-GUESTMODE"
227               value="${propval.app.guestmode}" />
228
229       <!-- Change this to be an app par -->
230       <filter token="RUN-AS-USER"
231               value="${org.bedework.syspar.public.user}" />
232
233               <!-- ???????
234       <filter token="CALFILE-NAME"
235               value="${propval.app.calfile.name}" /> -->
236       <filter token="ADMIN-URI"
237               value="${org.bedework.global.public.admin.uri}" />
238       <filter token="PUBEVENTS-URI"
239               value="${org.bedework.global.public.calendar.uri}" />
240       <filter token="PERSONAL-URI"
241               value="${org.bedework.global.personal.calendar.uri}" />
242     </filterset>
243
244     <available file="${app.sou.dir}/properties" type="dir"
245                property="org.bedework.properties.dir.exists" />
246
247     <available file="${app.sou.properties}" type="file"
248                property="org.bedework.servlet.properties.exists" />
249
250     <available file="${app.sou.dir}/war/docs" type="dir"
251                property="org.bedework.war.docs.exists" />
252
253     <antcall target="copy.properties" inheritRefs="true" />
254     <antcall target="copy.servlet.properties" inheritRefs="true" />
255     <antcall target="copy.war.docs" inheritRefs="true" />
256
257     <!-- Create the env.properties file -->
258     <mkdir dir="${app.dest.properties}" />
259
260     <copy tofile="${app.dest.properties}/env.properties"
261           file="${org.bedework.config.properties}" />
262
263     <copy tofile="${app.dest.properties}/options.xml"
264           file="${org.bedework.config.options}" >
265       <filterset>
266         <filter token="RPI-DEBUG" value="${app.debug.val}"/>
267       </filterset>
268       <filterset refid="property.filters" />
269     </copy>
270
271     <!-- Make a modified copy of the web.xml file -->
272     <copy tofile="${app.dest.web.xml}"
273           file="${app.web.xml}"
274           overwrite="yes" >
275       <filterset>
276         <filter token="RPI-DEBUG" value="${app.debug.val}"/>
277       </filterset>
278       <filterset refid="property.filters" />
279     </copy>
280
281     <antcall target="struts-stuff" inheritRefs="true" />
282
283     <!-- ===============================================================
284          Add hibernate jars and property files from calendar api.
285          =============================================================== -->
286
287     <copy todir="${app.dest.classes}">
288       <fileset dir="${org.bedework.project.calendarapi}/calCore/resources/properties" />
289       <filterset refid="property.filters" />
290     </copy>
291
292     <copy todir="${app.dest.classes}">
293       <fileset dir="${org.bedework.project.calendarapi}/calCore/resources/hbms" />
294       <filterset refid="property.filters" />
295     </copy>
296
297     <copy todir="${app.dest.lib}">
298       <fileset dir="${hibernate.jars.dir}">
299         <include name="*.jar"/>
300       </fileset>
301     </copy>
302
303     <antcall target="jboss-stuff" inheritRefs="true" />
304     <antcall target="bexchange-stuff" inheritRefs="true" />
305     <antcall target="domino-stuff" inheritRefs="true" />
306     <antcall target="google-stuff" inheritRefs="true" />
307
308     <!-- ===============================================================
309          Any jar files required
310          =============================================================== -->
311
312     <copy todir="${app.dest.lib}" overwrite="yes">
313       <fileset dir="${bin.home}">
314         <!-- jars from sub-projects needed by all -->
315         <include name="rpiaccess*.jar"/>
316         <include name="rpiutil*.jar"/>
317         <include name="bw-davdefs*.jar"/>
318         <include name="bw-davio*.jar"/>
319
320         <!-- Calendar api jars -->
321         <include name="bw-calcore*.jar"/>
322         <include name="bw-calcorei*.jar"/>
323         <include name="bw-calenv*.jar"/>
324         <include name="bw-calfacade*.jar"/>
325         <include name="bw-calsvc*.jar"/>
326         <include name="bw-calsvci*.jar"/>
327         <include name="bw-icalendar*.jar"/>
328         <include name="bw-locale*.jar"/>
329         <include name="bw-logging*.jar"/>
330
331         <!-- Common jars for web apps -->
332         <include name="bw-appcommon*.jar"/>
333       </fileset>
334     </copy>
335
336      <!-- any extra bin files-->
337     <copy todir="${app.dest.lib}" >
338       <fileset refid="app.bin.files" />
339     </copy>
340
341     <!-- Some more standard libs -->
342     <copy todir="${app.dest.lib}" file="${log4j.jar}"/>
343     <copy todir="${app.dest.lib}" file="${ical4j.jar}"/>
344     <copy todir="${app.dest.lib}" file="${commons-codec.jar}"/>
345     <copy todir="${app.dest.lib}" file="${commons-collections.jar}"/>
346     <copy todir="${app.dest.lib}" file="${commons-httpclient.jar}"/>
347     <copy todir="${app.dest.lib}" file="${commons-ssl.jar}"/>
348
349
350     <!-- add the jdbcdriver if defined -->
351     <antcall target="add.jdbcdriver" inheritRefs="true" />
352
353     <!-- tomcat -->
354     <antcall target="add.tomcat" inheritRefs="true" />
355
356      <!-- any extra lib files-->
357     <copy todir="${app.dest.lib}" >
358       <fileset refid="app.lib.files" />
359       <!-- <fileset refid="app.temp.lib.files" /> -->
360     </copy>
361
362     <!-- build the war file -->
363     <mkdir dir="${dist.home}" />
364     <delete file="${app.war.file}" />
365
366     <war warfile="${app.war.file}"
367          webxml="${app.dest.web.xml}"
368          basedir="${app.dest.war}"
369          excludes="WEB-INF/web.xml" />
370
371     <!-- build the ear file for a j2ee app
372     <antcall target="build.ear" inheritRefs="true" />
373     -->
374   </target>
375
376   <target name="add.jdbcdriver" if="app.jdbcdriver.jar">
377     <copy todir="${app.dest.lib}" file="${app.jdbcdriver.jar}"/>
378   </target>
379
380   <target name="add.tomcat" if="org.bedework.global.deploy.on.tomcat">
381     <property name="propval.app.tomcat.context.xml"
382               location="${app.sou.dir}/war/META-INF/context.xml" />
383     <resolveFile name="app.tomcat.context.xml"
384                  file="${propval.app.tomcat.context.xml}"
385                  base="${app.sou.dir}"/>
386
387     <copy tofile="${app.dest.metainf}/context.xml"
388           file="${app.tomcat.context.xml}"
389           overwrite="yes" >
390       <filterset refid="property.filters" />
391     </copy>
392   </target>
393
394   <target name="copy.properties" if="org.bedework.properties.dir.exists">
395     <!-- ===============================================================
396          Any property files we need for configuration, other than the
397          standard struts file, should be in the "${app.sou.dir}/properties
398          directory. They will be copied into the appropriate place for the
399          war and transformed by the above filter.
400          =============================================================== -->
401     <copy todir="${app.dest.properties}" overwrite="yes" >
402       <fileset dir="${app.sou.dir}/properties"
403                includes="*.properties"/>
404       <filterset refid="property.filters" />
405     </copy>
406   </target>
407
408   <target name="copy.servlet.properties" if="org.bedework.servlet.properties.exists">
409     <copy tofile="${app.dest.classes}/servlet.properties" file="${app.sou.properties}">
410       <filterset refid="property.filters" />
411     </copy>
412   </target>
413
414   <target name="copy.war.docs" if="org.bedework.war.docs.exists">
415     <copy todir="${app.dest.docs}">
416       <fileset dir="${app.sou.dir}/war/docs" />
417     </copy>
418   </target>
419
420   <target name="bexchange-stuff" if="org.bedework.build.caldav.bexchange">
421     <copy tofile="${app.dest.properties}/timezones.xml"
422           file="${org.bedework.project.bedework}/docs/bwtimezones.xml" />
423   </target>
424
425   <target name="domino-stuff" if="org.bedework.build.caldav.domino">
426     <copy tofile="${app.dest.properties}/timezones.xml"
427           file="${org.bedework.project.bedework}/docs/bwtimezones.xml" />
428   </target>
429
430   <target name="google-stuff" if="org.bedework.build.caldav.google">
431     <copy todir="${app.dest.lib}">
432       <fileset dir="${google.dir}">
433         <include name="*.jar"/>
434       </fileset>
435     </copy>
436
437     <copy tofile="${app.dest.properties}/timezones.xml"
438           file="${org.bedework.project.bedework}/docs/bwtimezones.xml" />
439   </target>
440
441   <!-- =================================================================
442        If this is a struts app the following gets executed.
443        We create an updated struts-config.xml file and add some jars.
444        ================================================================= -->
445
446   <target name="struts-stuff" if="org.bedework.strutsapp">
447     <!-- Copy a dummy startup file into the war. -->
448     <copy todir="${app.dest.war}">
449       <fileset dir="${app.sou.dir}/war/" includes="setup.do" />
450     </copy>
451
452     <copy todir="${app.dest.webinf}"
453           file="${app.sou.dir}/war/WEB-INF/struts-config.xml"/>
454
455     <mkdir  dir="${app.dest.webinf}/tlds"/>
456     <copy todir="${app.dest.webinf}/tlds" >
457       <fileset dir="${struts.tlds.dir}">
458         <include name="*"/>
459       </fileset>
460     </copy>
461     <copy todir="${app.dest.webinf}/tlds" >
462       <fileset dir="${org.bedework.default.lib}/tlds">
463         <include name="*"/>
464       </fileset>
465     </copy>
466
467     <antcall target="add.xalan" inheritRefs="true" />
468     <antcall target="add.jetspeed2" inheritRefs="true" />
469     <antcall target="add.uportal2" inheritRefs="true" />
470
471     <copy todir="${app.dest.lib}">
472       <fileset dir="${struts.dir}">
473         <include name="*.jar"/>
474       </fileset>
475     </copy>
476
477     <copy todir="${app.dest.lib}" file="${antlr.jar}"/>
478     <copy todir="${app.dest.lib}" file="${commons-beanutils.jar}"/>
479     <copy todir="${app.dest.lib}" file="${digester.jar}"/>
480     <copy todir="${app.dest.lib}" file="${commons-fileupload.jar}"/>
481     <copy todir="${app.dest.lib}" file="${commons-logging.jar}"/>
482     <copy todir="${app.dest.lib}" file="${commons-validator.jar}"/>
483     <copy todir="${app.dest.lib}" file="${jakarta-oro.jar}"/>
484   </target>
485
486   <target name="add.jetspeed2" if="org.bedework.build.for.jetspeed2" >
487     <copy todir="${app.dest.webinf}"
488           file="${org.bedework.deploy.type.dir}/jetspeed2/${propval.app.war.name}/portlet.xml"
489           overwrite="yes"
490           failonerror="no" />
491     <copy todir="${app.dest.webinf}"
492           file="${org.bedework.deploy.type.dir}/jetspeed2/struts-portlet-config.xml"
493           overwrite="yes"
494           failonerror="no" />
495
496     <copy todir="${app.dest.lib}" >
497       <fileset dir="${org.bedework.default.lib}/${jetspeed2.jars.dir}/portals-bridges-struts">
498         <include name="*.jar"/>
499       </fileset>
500     </copy>
501
502     <copy todir="${app.dest.webinf}/tlds" >
503       <fileset dir="${org.bedework.default.lib}/${jetspeed2.jars.dir}/portals-bridges-struts">
504         <include name="*.tld"/>
505       </fileset>
506     </copy>
507
508     <!-- Add the portal bridge controller def -->
509     <replace file="${app.dest.webinf}/struts-config.xml">
510       <replacetoken><![CDATA[<!-- Jetspeed2 controller def here -->]]></replacetoken>
511       <replacevalue><![CDATA[<controller pagePattern="$M$P" inputForward="true"
512               processorClass="org.apache.portals.bridges.struts.PortletRequestProcessor"/>]]>
513       </replacevalue>
514     </replace>
515   </target>
516
517   <target name="add.uportal2" if="org.bedework.build.for.uportal2" >
518     <copy todir="${app.dest.webinf}"
519           file="${org.bedework.deploy.type.dir}/uportal2/portlet.xml"
520           overwrite="yes"
521           failonerror="no" >
522       <filterset refid="property.filters" />
523     </copy>
524
525     <copy todir="${app.dest.webinf}"
526           file="${org.bedework.deploy.type.dir}/uportal2/struts-portlet-config.xml"
527           overwrite="yes"
528           failonerror="no" />
529
530     <copy todir="${app.dest.lib}" >
531       <fileset dir="${portals-bridges.jars.dir}">
532         <include name="*.jar"/>
533       </fileset>
534       <fileset dir="${bin.home}">
535         <include name="bw-uportal*.jar"/>
536       </fileset>
537     </copy>
538
539     <copy todir="${app.dest.webinf}/tlds"
540           overwrite="yes"
541           failonerror="no" >
542       <fileset dir="${org.bedework.deploy.type.dir}/uportal2" >
543         <include name="*.tld"/>
544       </fileset>
545     </copy>
546
547     <copy todir="${app.dest.lib}" file="${org.bedework.uportal.jar}" />
548
549     <!-- Add the portlet servlet mapping -->
550     <replace file="${app.dest.webinf}/web.xml">
551       <replacetoken><![CDATA[<!-- uPortal2 portlet servlet mapping here -->]]></replacetoken>
552       <replacevalue><![CDATA[<servlet-mapping>
553     <servlet-name>@PORTLET-NAME@</servlet-name>
554     <url-pattern>/@PORTLET-NAME@/*</url-pattern>
555   </servlet-mapping>]]>
556       </replacevalue>
557     </replace>
558
559     <replace file="${app.dest.webinf}/web.xml">
560       <replacefilter token="@PORTLET-NAME@" value="${propval.app.portlet.name}"/>
561     </replace>
562
563     <!-- Add the portal bridge controller def -->
564     <replace file="${app.dest.webinf}/struts-config.xml">
565       <replacetoken><![CDATA[<!-- Jetspeed2 controller def here -->]]></replacetoken>
566       <replacevalue><![CDATA[<controller pagePattern="$M$P" inputForward="true"
567               processorClass="org.apache.portals.bridges.struts.PortletRequestProcessor"/>]]>
568       </replacevalue>
569     </replace>
570   </target>
571
572   <target name="add.xalan" unless="xalan.in.tomcat.common.endorsed" >
573     <copy todir="${app.dest.lib}" file="${xalan.jar}"/>
574   </target>
575
576   <!-- =================================================================
577        If this is a j2ee app the following gets executed.
578        We create an uodated jboss-web.xml file (for jboss) and a ear
579        ================================================================= -->
580
581   <target name="jboss-stuff" if="org.bedework.build.for.jboss">
582     <copy todir="${app.dest.webinf}"
583           file="${app.sou.dir}/war/WEB-INF/jboss-web.xml">
584       <filterset refid="property.filters" />
585     </copy>
586     <antcall target="jboss-virtual-host" inheritRefs="true" />
587   </target>
588
589   <target name="jboss-virtual-host" if="org.bedework.global.virtual.host">
590     <replace file="${app.dest.webinf}/jboss-web.xml">
591       <replacetoken><![CDATA[<!-- Virtual host -->]]></replacetoken>
592       <replacevalue><![CDATA[<virtual-host>@VIRTUAL-HOST@</virtual-host>
593       ]]>
594       </replacevalue>
595     </replace>
596     <replace file="${app.dest.webinf}/jboss-web.xml">
597       <replacefilter token="@VIRTUAL-HOST@" value="${org.bedework.global.virtual.host}"/>
598     </replace>
599   </target>
600
601   <target name="build.ear" if="cal.j2ee">
602     <ant antfile="${buildear}"
603          inheritRefs="true" target="build" />
604   </target>
605 </project>
Note: See TracBrowser for help on using the browser.