root/trunk/build/buildwar.xml

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

Apply fix to restore from 3.0 code

Allow adding/removing event categories in admin and user client. Needs ui changes
Add system property to limit max date of recurring events.
Changed config to set it

Change events code to fix adding of recurring events with Date type dates (as against Date/Time).
Use limits to allow adding of infinite events.

Add code to bulk upload from ics file in admin and user client.

Many Java5 changes - all Collection stuff and nearly done. Down to 80+ eclipse warnings (from 460).

Schema change:
add int columns "bwmax_instances" , "bwmax_years" to Bedework_Settings

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-apiutil*.jar"/>
322         <include name="bw-calcore*.jar"/>
323         <include name="bw-calcorei*.jar"/>
324         <include name="bw-calenv*.jar"/>
325         <include name="bw-calfacade*.jar"/>
326         <include name="bw-calsvc*.jar"/>
327         <include name="bw-calsvci*.jar"/>
328         <include name="bw-icalendar*.jar"/>
329         <include name="bw-locale*.jar"/>
330         <include name="bw-logging*.jar"/>
331
332         <!-- Common jars for web apps -->
333         <include name="bw-appcommon*.jar"/>
334       </fileset>
335     </copy>
336
337      <!-- any extra bin files-->
338     <copy todir="${app.dest.lib}" >
339       <fileset refid="app.bin.files" />
340     </copy>
341
342     <!-- Some more standard libs -->
343     <copy todir="${app.dest.lib}" file="${log4j.jar}"/>
344     <copy todir="${app.dest.lib}" file="${ical4j.jar}"/>
345     <copy todir="${app.dest.lib}" file="${commons-codec.jar}"/>
346     <copy todir="${app.dest.lib}" file="${commons-collections.jar}"/>
347     <copy todir="${app.dest.lib}" file="${commons-httpclient.jar}"/>
348     <copy todir="${app.dest.lib}" file="${commons-ssl.jar}"/>
349
350
351     <!-- add the jdbcdriver if defined -->
352     <antcall target="add.jdbcdriver" inheritRefs="true" />
353
354     <!-- tomcat -->
355     <antcall target="add.tomcat" inheritRefs="true" />
356
357      <!-- any extra lib files-->
358     <copy todir="${app.dest.lib}" >
359       <fileset refid="app.lib.files" />
360       <!-- <fileset refid="app.temp.lib.files" /> -->
361     </copy>
362
363     <!-- build the war file -->
364     <mkdir dir="${dist.home}" />
365     <delete file="${app.war.file}" />
366
367     <war warfile="${app.war.file}"
368          webxml="${app.dest.web.xml}"
369          basedir="${app.dest.war}"
370          excludes="WEB-INF/web.xml" />
371
372     <!-- build the ear file for a j2ee app
373     <antcall target="build.ear" inheritRefs="true" />
374     -->
375   </target>
376
377   <target name="add.jdbcdriver" if="app.jdbcdriver.jar">
378     <copy todir="${app.dest.lib}" file="${app.jdbcdriver.jar}"/>
379   </target>
380
381   <target name="add.tomcat" if="org.bedework.global.deploy.on.tomcat">
382     <property name="propval.app.tomcat.context.xml"
383               location="${app.sou.dir}/war/META-INF/context.xml" />
384     <resolveFile name="app.tomcat.context.xml"
385                  file="${propval.app.tomcat.context.xml}"
386                  base="${app.sou.dir}"/>
387
388     <copy tofile="${app.dest.metainf}/context.xml"
389           file="${app.tomcat.context.xml}"
390           overwrite="yes" >
391       <filterset refid="property.filters" />
392     </copy>
393   </target>
394
395   <target name="copy.properties" if="org.bedework.properties.dir.exists">
396     <!-- ===============================================================
397          Any property files we need for configuration, other than the
398          standard struts file, should be in the "${app.sou.dir}/properties
399          directory. They will be copied into the appropriate place for the
400          war and transformed by the above filter.
401          =============================================================== -->
402     <copy todir="${app.dest.properties}" overwrite="yes" >
403       <fileset dir="${app.sou.dir}/properties"
404                includes="*.properties"/>
405       <filterset refid="property.filters" />
406     </copy>
407   </target>
408
409   <target name="copy.servlet.properties" if="org.bedework.servlet.properties.exists">
410     <copy tofile="${app.dest.classes}/servlet.properties" file="${app.sou.properties}">
411       <filterset refid="property.filters" />
412     </copy>
413   </target>
414
415   <target name="copy.war.docs" if="org.bedework.war.docs.exists">
416     <copy todir="${app.dest.docs}">
417       <fileset dir="${app.sou.dir}/war/docs" />
418     </copy>
419   </target>
420
421   <target name="bexchange-stuff" if="org.bedework.build.caldav.bexchange">
422     <copy tofile="${app.dest.properties}/timezones.xml"
423           file="${org.bedework.project.bedework}/docs/bwtimezones.xml" />
424   </target>
425
426   <target name="domino-stuff" if="org.bedework.build.caldav.domino">
427     <copy tofile="${app.dest.properties}/timezones.xml"
428           file="${org.bedework.project.bedework}/docs/bwtimezones.xml" />
429   </target>
430
431   <target name="google-stuff" if="org.bedework.build.caldav.google">
432     <copy todir="${app.dest.lib}">
433       <fileset dir="${google.dir}">
434         <include name="*.jar"/>
435       </fileset>
436     </copy>
437
438     <copy tofile="${app.dest.properties}/timezones.xml"
439           file="${org.bedework.project.bedework}/docs/bwtimezones.xml" />
440   </target>
441
442   <!-- =================================================================
443        If this is a struts app the following gets executed.
444        We create an updated struts-config.xml file and add some jars.
445        ================================================================= -->
446
447   <target name="struts-stuff" if="org.bedework.strutsapp">
448     <!-- Copy a dummy startup file into the war. -->
449     <copy todir="${app.dest.war}">
450       <fileset dir="${app.sou.dir}/war/" includes="setup.do" />
451     </copy>
452
453     <copy todir="${app.dest.webinf}"
454           file="${app.sou.dir}/war/WEB-INF/struts-config.xml"/>
455
456     <mkdir  dir="${app.dest.webinf}/tlds"/>
457     <copy todir="${app.dest.webinf}/tlds" >
458       <fileset dir="${struts.tlds.dir}">
459         <include name="*"/>
460       </fileset>
461     </copy>
462     <copy todir="${app.dest.webinf}/tlds" >
463       <fileset dir="${org.bedework.default.lib}/tlds">
464         <include name="*"/>
465       </fileset>
466     </copy>
467
468     <antcall target="add.xalan" inheritRefs="true" />
469     <antcall target="add.jetspeed2" inheritRefs="true" />
470     <antcall target="add.uportal2" inheritRefs="true" />
471
472     <copy todir="${app.dest.lib}">
473       <fileset dir="${struts.dir}">
474         <include name="*.jar"/>
475       </fileset>
476     </copy>
477
478     <copy todir="${app.dest.lib}" file="${antlr.jar}"/>
479     <copy todir="${app.dest.lib}" file="${commons-beanutils.jar}"/>
480     <copy todir="${app.dest.lib}" file="${digester.jar}"/>
481     <copy todir="${app.dest.lib}" file="${commons-fileupload.jar}"/>
482     <copy todir="${app.dest.lib}" file="${commons-logging.jar}"/>
483     <copy todir="${app.dest.lib}" file="${commons-validator.jar}"/>
484     <copy todir="${app.dest.lib}" file="${jakarta-oro.jar}"/>
485   </target>
486
487   <target name="add.jetspeed2" if="org.bedework.build.for.jetspeed2" >
488     <copy todir="${app.dest.webinf}"
489           file="${org.bedework.deploy.type.dir}/jetspeed2/${propval.app.war.name}/portlet.xml"
490           overwrite="yes"
491           failonerror="no" />
492     <copy todir="${app.dest.webinf}"
493           file="${org.bedework.deploy.type.dir}/jetspeed2/struts-portlet-config.xml"
494           overwrite="yes"
495           failonerror="no" />
496
497     <copy todir="${app.dest.lib}" >
498       <fileset dir="${org.bedework.default.lib}/${jetspeed2.jars.dir}/portals-bridges-struts">
499         <include name="*.jar"/>
500       </fileset>
501     </copy>
502
503     <copy todir="${app.dest.webinf}/tlds" >
504       <fileset dir="${org.bedework.default.lib}/${jetspeed2.jars.dir}/portals-bridges-struts">
505         <include name="*.tld"/>
506       </fileset>
507     </copy>
508
509     <!-- Add the portal bridge controller def -->
510     <replace file="${app.dest.webinf}/struts-config.xml">
511       <replacetoken><![CDATA[<!-- Jetspeed2 controller def here -->]]></replacetoken>
512       <replacevalue><![CDATA[<controller pagePattern="$M$P" inputForward="true"
513               processorClass="org.apache.portals.bridges.struts.PortletRequestProcessor"/>]]>
514       </replacevalue>
515     </replace>
516   </target>
517
518   <target name="add.uportal2" if="org.bedework.build.for.uportal2" >
519     <copy todir="${app.dest.webinf}"
520           file="${org.bedework.deploy.type.dir}/uportal2/portlet.xml"
521           overwrite="yes"
522           failonerror="no" >
523       <filterset refid="property.filters" />
524     </copy>
525
526     <copy todir="${app.dest.webinf}"
527           file="${org.bedework.deploy.type.dir}/uportal2/struts-portlet-config.xml"
528           overwrite="yes"
529           failonerror="no" />
530
531     <copy todir="${app.dest.lib}" >
532       <fileset dir="${portals-bridges.jars.dir}">
533         <include name="*.jar"/>
534       </fileset>
535       <fileset dir="${bin.home}">
536         <include name="bw-uportal*.jar"/>
537       </fileset>
538     </copy>
539
540     <copy todir="${app.dest.webinf}/tlds"
541           overwrite="yes"
542           failonerror="no" >
543       <fileset dir="${org.bedework.deploy.type.dir}/uportal2" >
544         <include name="*.tld"/>
545       </fileset>
546     </copy>
547
548     <copy todir="${app.dest.lib}" file="${org.bedework.uportal.jar}" />
549
550     <!-- Add the portlet servlet mapping -->
551     <replace file="${app.dest.webinf}/web.xml">
552       <replacetoken><![CDATA[<!-- uPortal2 portlet servlet mapping here -->]]></replacetoken>
553       <replacevalue><![CDATA[<servlet-mapping>
554     <servlet-name>@PORTLET-NAME@</servlet-name>
555     <url-pattern>/@PORTLET-NAME@/*</url-pattern>
556   </servlet-mapping>]]>
557       </replacevalue>
558     </replace>
559
560     <replace file="${app.dest.webinf}/web.xml">
561       <replacefilter token="@PORTLET-NAME@" value="${propval.app.portlet.name}"/>
562     </replace>
563
564     <!-- Add the portal bridge controller def -->
565     <replace file="${app.dest.webinf}/struts-config.xml">
566       <replacetoken><![CDATA[<!-- Jetspeed2 controller def here -->]]></replacetoken>
567       <replacevalue><![CDATA[<controller pagePattern="$M$P" inputForward="true"
568               processorClass="org.apache.portals.bridges.struts.PortletRequestProcessor"/>]]>
569       </replacevalue>
570     </replace>
571   </target>
572
573   <target name="add.xalan" unless="xalan.in.tomcat.common.endorsed" >
574     <copy todir="${app.dest.lib}" file="${xalan.jar}"/>
575   </target>
576
577   <!-- =================================================================
578        If this is a j2ee app the following gets executed.
579        We create an uodated jboss-web.xml file (for jboss) and a ear
580        ================================================================= -->
581
582   <target name="jboss-stuff" if="org.bedework.build.for.jboss">
583     <copy todir="${app.dest.webinf}"
584           file="${app.sou.dir}/war/WEB-INF/jboss-web.xml">
585       <filterset refid="property.filters" />
586     </copy>
587     <antcall target="jboss-virtual-host" inheritRefs="true" />
588   </target>
589
590   <target name="jboss-virtual-host" if="org.bedework.global.virtual.host">
591     <replace file="${app.dest.webinf}/jboss-web.xml">
592       <replacetoken><![CDATA[<!-- Virtual host -->]]></replacetoken>
593       <replacevalue><![CDATA[<virtual-host>@VIRTUAL-HOST@</virtual-host>
594       ]]>
595       </replacevalue>
596     </replace>
597     <replace file="${app.dest.webinf}/jboss-web.xml">
598       <replacefilter token="@VIRTUAL-HOST@" value="${org.bedework.global.virtual.host}"/>
599     </replace>
600   </target>
601
602   <target name="build.ear" if="cal.j2ee">
603     <ant antfile="${buildear}"
604          inheritRefs="true" target="build" />
605   </target>
606 </project>
Note: See TracBrowser for help on using the browser.