root/trunk/build/buildwar.xml

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

Add system property to set path to index root.
Changed config to set it

Implemented lcene indexing and searching. Admin client needs work to display results - user client will index and generate xml for query like
http://localhost:8080/ucal/search/search.rdo?query=eventSummary:meeting

Stylesheets need changes to display result.

Default quickstart creates indexes in the quickstart directory

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