root/trunk/calendar3/bldfiles/buildwar.xml

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

A number of webclient changes

1. Move events related jsp into docs/event
2. Split out common/short/detailed/all event fields
3. Emit more xml, organizer and attendees
4. Add taglib component to webcommon and add tag to emit tagged xml

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 build.properties
8      and app.properties files of the individual applications.
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                        appsuite or uwcalapps probably
17     app.sou.dir        Location of the application skeleton, e.g.
18                        appsuite/admin
19     app.name           Name of the application. This wil be used to determine
20                        the name of the file containing the rest of the
21                        application properties, the directory we build in
22                        and the name of war and ear files.
23     cal.j2ee           Defined if this is a j2ee application
24     cal.j2ee.jboss     Defined if this is a jboss application
25     cal.strutsapp      Defined if this is a struts application
26      These should be defined in the build properties for the application.
27
28      It is possible to define any of the app.dest properties below to override
29      the location of destination files.
30
31      In the directory
32         ${apps.sou.dir}
33      we expect an application skeleton formatted like a web-application
34      For the purposes of this build it should contain a
35      structure like
36               war - docs    (contains jsp and html for this app)
37                     WEB-INF - struts-config.xml
38                               web.xml
39                               jboss-web.xml (for jboss only)
40
41      Authors: Mike Douglass   douglm@rpi.edu
42      =================================================================== -->
43
44 <project name="uwcal.buildwar" default="build" >
45   <target name="init" depends="init.common,init.j2ee,init.standalone" />
46
47   <target name="init.common">
48     <condition property="org.bedework.build.for.jetspeed2">
49       <equals arg1="jetspeed2" arg2="${propval.portal.platform}"/>
50     </condition>
51
52     <condition property="org.bedework.build.for.jboss">
53       <equals arg1="jboss" arg2="${org.bedework.global.j2ee.platform}"/>
54     </condition>
55
56     <!-- Destinations - where we build an unwrapped war -->
57     <property name="app.dest.war"
58               location="${org.bedework.temp.wars.home}/${propval.app.war.name}.war" />
59     <property name="app.dest.docs"
60               location="${app.dest.war}/docs" />
61     <property name="app.dest.webinf"
62               location="${app.dest.war}/WEB-INF" />
63     <property name="app.dest.classes"
64               location="${app.dest.webinf}/classes" />
65     <property name="app.dest.properties"
66               location="${app.dest.classes}/properties/calendar" />
67
68     <!--temp web.xml location  -->
69     <property name="app.dest.web.xml"
70               location="${app.dest.webinf}/web.xml" />
71
72     <property name="app.war.file"
73               location="${dist.home}/${propval.app.war.name}.war" />
74
75     <!-- These may have been set already -->
76     <property name="app.web.xml"
77               value="${app.sou.dir}/war/WEB-INF/web.xml" />
78     <property name="app.sou.properties"
79               location="${app.sou.dir}/war/WEB-INF/classes/servlet.properties" />
80   </target>
81
82   <target name="init.standalone" if="org.bedework.global.build.standalone.app">
83     <property name="app.dest.lib"
84               location="${app.dest.webinf}/lib" />
85   </target>
86
87   <target name="init.j2ee" if="org.bedework.global.j2ee.platform">
88     <property name="app.dest.lib"
89               location="${org.bedework.temp.home}/earlib" />
90   </target>
91
92   <target name="build" depends="init">
93     <delete dir="${app.dest.war}" />
94
95     <!-- Add modifed login pages -->
96     <copy todir="${app.dest.docs}/login" failonerror="false" >
97       <fileset dir="${app.root.dir}/resources/login" />
98       <filterset>
99         <filter token="DISPLAY-NAME" value="${propval.app.display.name}"/>
100       </filterset>
101     </copy>
102
103     <!-- ===============================================================
104          We copy 3 sets of properties.
105
106          First (for struts) are the servlet properties which ends up as
107               classes/servlet.properties
108          Next we copy in a set of generic property files and then with
109          overwrite we copy in a set of base specific files.
110
111          All are updated with new values.
112          =============================================================== -->
113
114     <filterset id="property.filters" >
115       <filter token="BW-APP-NAME"
116               value="${org.bedework.deploy.name}"/>
117
118       <filter token="HIBERNATE-DIALECT"
119               value="${org.bedework.global.hibernate.dialect}" />
120
121       <filter token="DIRECTORY-BROWSING-DISALLOWED"
122               value="${org.bedework.global.directory.browsing.disallowed}" />
123
124       <filter token="APP-DESCRIPTION"
125               value="${propval.app.description}" />
126
127       <filter token="SECURITY-DOMAIN"
128               value="${propval.app.security.domain}"/>
129       <filter token="SECURITY-PREFIX"
130               value="${propval.app.security.prefix}"/>
131       <filter token="TRANSPORT-GUARANTEE"
132               value="${propval.app.transport.guarantee}"/>
133
134       <filter token="DISPLAY-NAME"
135               value="${propval.app.display.name}"/>
136       <filter token="CONTEXT-ROOT"
137               value="${propval.app.context.root}" />
138       <filter token="APP-NAME"
139               value="${propval.app.name}"/>
140       <filter token="APP-VERSION"
141               value="${propval.app.version}"/>
142
143       <filter token="DEFAULT-CONTENTTYPE"
144               value="${propval.app.default.contenttype}" />
145       <filter token="NOXSLT"
146               value="${propval.app.noxslt}" />
147
148       <filter token="APP-GUESTMODE"
149               value="${propval.app.guestmode}" />
150
151       <!-- Change this to be an app par -->
152       <filter token="RUN-AS-USER"
153               value="${org.bedework.syspar.public.user}" />
154
155               <!-- ???????
156       <filter token="CALFILE-NAME"
157               value="${propval.app.calfile.name}" /> -->
158       <filter token="ADMIN-URI"
159               value="${org.bedework.global.public.admin.uri}" />
160       <filter token="PUBEVENTS-URI"
161               value="${org.bedework.global.public.calendar.uri}" />
162       <filter token="PERSONAL-URI"
163               value="${org.bedework.global.personal.calendar.uri}" />
164     </filterset>
165
166     <available file="${app.sou.dir}/properties" type="dir"
167                property="uwcal.properties.dir.exists" />
168
169     <available file="${app.sou.properties}" type="file"
170                property="uwcal.servlet.properties.exists" />
171
172     <available file="${app.sou.dir}/war/docs" type="dir"
173                property="uwcal.war.docs.exists" />
174
175     <antcall target="copy.properties" inheritRefs="true" />
176     <antcall target="copy.servlet.properties" inheritRefs="true" />
177     <antcall target="copy.war.docs" inheritRefs="true" />
178
179     <!-- Create the env.properties file -->
180     <mkdir dir="${app.dest.properties}" />
181
182     <copy tofile="${app.dest.properties}/env.properties"
183           file="${org.bedework.config.properties}" />
184
185     <!-- Make a modified copy of the web.xml file -->
186     <copy tofile="${app.dest.web.xml}"
187           file="${app.web.xml}"
188           overwrite="yes" >
189       <filterset>
190         <filter token="RPI-DEBUG" value="${app.debug.val}"/>
191       </filterset>
192       <filterset refid="property.filters" />
193     </copy>
194
195     <antcall target="struts-stuff" inheritRefs="true" />
196
197     <!-- ===============================================================
198          Add hibernate jars and property files.
199          =============================================================== -->
200
201     <copy todir="${app.dest.classes}">
202       <fileset dir="${org.bedework.core.base}/resources/properties" />
203       <filterset refid="property.filters" />
204     </copy>
205
206     <copy todir="${app.dest.classes}">
207       <fileset dir="${org.bedework.core.base}/resources/hbms" />
208       <filterset refid="property.filters" />
209     </copy>
210
211     <copy todir="${app.dest.lib}">
212       <fileset dir="${hibernate.jars.dir}">
213         <include name="*.jar"/>
214       </fileset>
215     </copy>
216
217     <antcall target="jboss-stuff" inheritRefs="true" />
218
219     <!-- ===============================================================
220          Any jar files required
221          =============================================================== -->
222
223     <!-- core files -->
224     <copy todir="${app.dest.lib}" file="${org.bedework.calcore.jar}" />
225     <copy todir="${app.dest.lib}" file="${org.bedework.calenv.jar}" />
226     <copy todir="${app.dest.lib}" file="${org.bedework.mail.jar}" />
227     <copy todir="${app.dest.lib}" file="${org.bedework.calfacadeshared.jar}" />
228
229       <!-- appcommon -->
230     <copy todir="${app.dest.lib}" file="${org.bedework.locale.jar}" />
231     <copy todir="${app.dest.lib}" file="${org.bedework.access.jar}" />
232     <copy todir="${app.dest.lib}" file="${org.bedework.calsvci.jar}" />
233     <copy todir="${app.dest.lib}" file="${org.bedework.calsvc.jar}" />
234     <copy todir="${app.dest.lib}" file="${org.bedework.ical.jar}" />
235     <copy todir="${app.dest.lib}" file="${org.bedework.common.jar}" />
236     <copy todir="${app.dest.lib}" file="${org.bedework.davdefs.jar}" />
237     <copy todir="${app.dest.lib}" file="${org.bedework.appcommon.jar}" />
238     <copy todir="${app.dest.lib}" file="${org.bedework.webcommon.jar}" />
239
240     <!-- Some more standard libs -->
241     <copy todir="${app.dest.lib}" file="${log4j.jar}"/>
242     <copy todir="${app.dest.lib}" file="${ical4j.jar}"/>
243
244     <!-- add the jdbcdriver if defined -->
245     <antcall target="add.jdbcdriver" inheritRefs="true" />
246
247      <!-- any extra -->
248     <copy todir="${app.dest.lib}" >
249       <fileset refid="app.lib.files" />
250       <fileset refid="app.temp.lib.files" />
251     </copy>
252
253     <!-- build the war file -->
254     <mkdir dir="${dist.home}" />
255     <delete file="${app.war.file}" />
256
257     <war warfile="${app.war.file}"
258          webxml="${app.dest.web.xml}"
259          basedir="${app.dest.war}"
260          excludes="${app.dest.web.xml}" />
261
262     <!-- build the ear file for a j2ee app
263     <antcall target="build.ear" inheritRefs="true" />
264     -->
265   </target>
266
267   <target name="add.jdbcdriver" if="app.jdbcdriver.jar">
268     <copy todir="${app.dest.lib}" file="${app.jdbcdriver.jar}"/>
269   </target>
270
271   <target name="copy.properties" if="uwcal.properties.dir.exists">
272     <!-- ===============================================================
273          Any property files we need for configuration, other than the
274          standard struts file, should be in the "${app.sou.dir}/properties
275          directory. They will be copied into the appropriate place for the
276          war and transformed by the above filter.
277          =============================================================== -->
278     <copy todir="${app.dest.properties}" overwrite="yes" >
279       <fileset dir="${app.sou.dir}/properties"
280                includes="*.properties"/>
281       <filterset refid="property.filters" />
282     </copy>
283   </target>
284
285   <target name="copy.servlet.properties" if="uwcal.servlet.properties.exists">
286     <copy tofile="${app.dest.classes}/servlet.properties" file="${app.sou.properties}">
287       <filterset refid="property.filters" />
288     </copy>
289   </target>
290
291   <target name="copy.war.docs" if="uwcal.war.docs.exists">
292     <copy todir="${app.dest.docs}">
293       <fileset dir="${app.sou.dir}/war/docs" />
294     </copy>
295   </target>
296
297   <!-- =================================================================
298        If this is a struts app the following gets executed.
299        We create an updated struts-config.xml file and add some jars.
300        ================================================================= -->
301
302   <target name="struts-stuff" if="org.bedework.strutsapp">
303     <!-- Copy a dummy startup file into the war. -->
304     <copy todir="${app.dest.war}">
305       <fileset dir="${app.sou.dir}/war/" includes="setup.do" />
306     </copy>
307
308     <copy todir="${app.dest.webinf}"
309           file="${app.sou.dir}/war/WEB-INF/struts-config.xml"/>
310
311     <mkdir  dir="${app.dest.webinf}/tlds"/>
312     <copy todir="${app.dest.webinf}/tlds" >
313       <fileset dir="${struts.tlds.dir}">
314         <include name="*"/>
315       </fileset>
316     </copy>
317     <copy todir="${app.dest.webinf}/tlds" >
318       <fileset dir="${org.bedework.default.lib}/tlds">
319         <include name="*"/>
320       </fileset>
321     </copy>
322
323     <antcall target="add.xalan" inheritRefs="true" />
324     <antcall target="add.jetspeed2" inheritRefs="true" />
325
326     <copy todir="${app.dest.lib}">
327       <fileset dir="${struts.dir}">
328         <include name="*.jar"/>
329       </fileset>
330     </copy>
331     <copy todir="${app.dest.lib}" file="${servlet.jsp.jar}"/>
332   </target>
333
334   <target name="add.jetspeed2" if="org.bedework.build.for.jetspeed2" >
335     <copy todir="${app.dest.webinf}"
336           file="${org.bedework.portal.resources.dir}/jetspeed2/${propval.app.war.name}/portlet.xml"
337           overwrite="yes"
338           failonerror="no" />
339     <copy todir="${app.dest.webinf}"
340           file="${org.bedework.portal.resources.dir}/jetspeed2/struts-portlet-config.xml"
341           overwrite="yes"
342           failonerror="no" />
343
344     <copy todir="${app.dest.lib}" >
345       <fileset dir="${org.bedework.default.lib}/${jetspeed2.jars.dir}/portals-bridges-struts">
346         <include name="*.jar"/>
347       </fileset>
348     </copy>
349
350     <copy todir="${app.dest.webinf}/tlds" >
351       <fileset dir="${org.bedework.default.lib}/${jetspeed2.jars.dir}/portals-bridges-struts">
352         <include name="*.tld"/>
353       </fileset>
354     </copy>
355
356     <!-- Overwrite the web.xml file -->
357     <copy tofile="${app.dest.web.xml}"
358           file="${org.bedework.portal.resources.dir}/jetspeed2/web.xml"
359           overwrite="yes" >
360       <filterset>
361         <filter token="RPI-DEBUG" value="${app.debug.val}"/>
362       </filterset>
363       <filterset refid="property.filters" />
364     </copy>
365
366     <!-- Add the portal bridge controller def -->
367     <replace file="${app.dest.webinf}/struts-config.xml">
368       <replacetoken><![CDATA[<!-- Jetspeed2 controller def here -->]]></replacetoken>
369       <replacevalue><![CDATA[<controller pagePattern="$M$P" inputForward="true"
370               processorClass="org.apache.portals.bridges.struts.PortletRequestProcessor"/>]]>
371       </replacevalue>
372     </replace>
373   </target>
374
375   <target name="add.xalan" unless="xalan.in.tomcat.common.endorsed" >
376     <copy todir="${app.dest.lib}" file="${xalan.jar}"/>
377   </target>
378
379   <!-- =================================================================
380        If this is a j2ee app the following gets executed.
381        We create an uodated jboss-web.xml file (for jboss) and a ear
382        ================================================================= -->
383
384   <target name="jboss-stuff" if="org.bedework.build.for.jboss">
385     <copy todir="${app.dest.webinf}"
386           file="${app.sou.dir}/war/WEB-INF/jboss-web.xml">
387       <filterset refid="property.filters" />
388     </copy>
389     <antcall target="jboss-virtual-host" inheritRefs="true" />
390   </target>
391
392   <target name="jboss-virtual-host" if="org.bedework.global.virtual.host">
393     <replace file="${app.dest.webinf}/jboss-web.xml">
394       <replacetoken><![CDATA[<!-- Virtual host -->]]></replacetoken>
395       <replacevalue><![CDATA[<virtual-host>@VIRTUAL-HOST@</virtual-host>
396       ]]>
397       </replacevalue>
398     </replace>
399     <replace file="${app.dest.webinf}/jboss-web.xml">
400       <replacefilter token="@VIRTUAL-HOST@" value="${org.bedework.global.virtual.host}"/>
401     </replace>
402   </target>
403
404   <target name="build.ear" if="cal.j2ee">
405     <ant antfile="${buildear}"
406          inheritRefs="true" target="build" />
407   </target>
408
409 </project>
Note: See TracBrowser for help on using the browser.