root/trunk/build/buildwar.xml

Revision 1933 (checked in by douglm, 5 years ago)

Two distinct sets of updates here.

1. Add some support (not fully working yet) for liferay5. Some old unused stylesheets were deleted to tidy up and while working on this decided the second set of updates were needed asa first step to simplification

2. Ensure that only the option xml file is used at run time.

Some properties were moved into the xml file and code was adjusted to refer to the xml config objects.

CalEnv?, CalEnvI, CalEnvFactory? were removed.

Following properties were moved into options.xml

org.bedework.app.X.nogroupallowed

org.bedework.app.X.publicadmin

org.bedework.app.X.guestmode

sysintfimpl (caldav)

org.bedework.global.system.name --> globals.systemName

org.bedework.app.X.run.as.user --> runAsUser

org.bedework.app.CalAdmin?.admingroupsidprefix=agrp_

Removed remaining run-time references to
org.bedework.app.X.name
org.bedework.app.X.root

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
40      =================================================================== -->
41
42 <project name="bedework.buildwar" default="build" >
43   <import file="${build.dir}/buildfilters.xml" />
44
45   <target name="init" depends="init.common,init.j2ee,init.standalone" />
46
47   <target name="init.common">
48     <!-- Load the location of the libraries -->
49     <property file="${org.bedework.project.bedework}/build/libjars.properties" />
50
51     <!-- Destinations - where we build an unwrapped war -->
52     <property name="app.dest.war"
53               location="${org.bedework.temp.wars.home}/${propval.app.war.name}.war" />
54     <property name="app.dest.docs"
55               location="${app.dest.war}/docs" />
56     <property name="app.dest.webinf"
57               location="${app.dest.war}/WEB-INF" />
58     <property name="app.dest.metainf"
59               location="${app.dest.war}/META-INF" />
60     <property name="app.dest.classes"
61               location="${app.dest.webinf}/classes" />
62     <property name="app.dest.properties"
63               location="${app.dest.classes}/properties/calendar" />
64
65     <!--temp web.xml location  -->
66     <property name="app.temp.web.xml"
67               location="${app.dest.webinf}/tempweb.xml" />
68
69     <!--final web.xml location  -->
70     <property name="app.dest.web.xml"
71               location="${app.dest.webinf}/web.xml" />
72
73     <property name="app.war.file"
74               location="${dist.home}/${propval.app.war.name}.war" />
75
76     <!-- default web.xml -->
77     <property name="propval.app.web.xml"
78               value="war/WEB-INF/web.xml" />
79
80               <!--
81     <property name="app.web.xml"
82               location="${propval.app.web.xml}" />
83               -->
84     <resolveFile name="app.web.xml"
85                  file="${propval.app.web.xml}"
86                  base="${app.sou.dir}"/>
87
88     <property name="app.sou.properties"
89               location="${app.sou.dir}/war/WEB-INF/classes/servlet.properties" />
90   </target>
91
92   <target name="init.standalone" if="org.bedework.global.build.standalone.app">
93
94     <property name="app.dest.lib"
95               location="${app.dest.webinf}/lib" />
96   </target>
97
98   <target name="init.j2ee" if="org.bedework.global.j2ee.platform">
99     <property name="app.dest.lib"
100               location="${org.bedework.temp.dir}/earlib" />
101   </target>
102
103   <target name="build" depends="init">
104     <echo message="**************************************************" />
105     <echo message=" * Building war ${propval.app.war.name}"/>
106     <echo message="**************************************************" />
107
108     <delete dir="${app.dest.war}" />
109
110     <!-- Add modifed login pages -->
111     <copy todir="${app.dest.docs}/login" failonerror="false" >
112       <fileset dir="${org.bedework.common.resources}/login" />
113       <filterset>
114         <filter token="DISPLAY-NAME" value="${propval.app.display.name}"/>
115       </filterset>
116     </copy>
117
118     <!-- ===============================================================
119          We copy 3 sets of properties.
120
121          First (for struts) are the servlet properties which ends up as
122               classes/servlet.properties
123          Next we copy in a set of generic property files and then with
124          overwrite we copy in a set of base specific files.
125
126          All are updated with new values.
127          =============================================================== -->
128
129     <available file="${app.sou.dir}/properties" type="dir"
130                property="org.bedework.properties.dir.exists" />
131
132     <available file="${app.sou.properties}" type="file"
133                property="org.bedework.servlet.properties.exists" />
134
135     <available file="${app.sou.dir}/war/docs" type="dir"
136                property="org.bedework.war.docs.exists" />
137
138     <antcall target="copy.properties" inheritRefs="true" />
139     <antcall target="copy.servlet.properties" inheritRefs="true" />
140     <antcall target="copy.war.docs" inheritRefs="true" />
141
142     <!-- Create the runtime options file -->
143     <mkdir dir="${app.dest.properties}" />
144
145     <copy tofile="${app.dest.properties}/options.xml"
146           file="${org.bedework.config.options}" >
147       <filterset>
148         <filter token="RPI-DEBUG" value="${app.debug.val}"/>
149       </filterset>
150       <filterset refid="property.filters" />
151     </copy>
152
153     <!-- Make a temp copy of the web.xml file -->
154     <copy tofile="${app.temp.web.xml}" file="${app.web.xml}"
155           overwrite="yes" />
156
157     <antcall target="struts-stuff" inheritRefs="true" />
158
159     <!-- Filter the temp copy of the web.xml file -->
160     <copy tofile="${app.dest.web.xml}"
161           file="${app.temp.web.xml}"
162           overwrite="yes" >
163       <filterset>
164         <filter token="RPI-DEBUG" value="${app.debug.val}"/>
165       </filterset>
166       <filterset refid="property.filters" />
167     </copy>
168
169     <delete file="${app.temp.web.xml}" />
170
171     <!-- Add the contex root to the file. Note that newline is required -->
172     <echo file="${org.bedework.global.context.roots}" append="yes">
173 ${propval.app.war.name}.context=${propval.app.context.root}
174     </echo>
175
176     <!-- ===============================================================
177          Add hibernate jars and property files from calendar api.
178          =============================================================== -->
179
180     <copy todir="${app.dest.classes}">
181       <fileset dir="${org.bedework.project.calendarapi}/calCore/resources/properties" />
182       <filterset refid="property.filters" />
183     </copy>
184
185     <copy todir="${app.dest.classes}">
186       <fileset dir="${org.bedework.project.calendarapi}/calCore/resources/hbms" />
187       <filterset refid="property.filters" />
188     </copy>
189
190     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.antlr}" />
191     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.asm-attrs}" />
192     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.asm}" />
193     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.cglib}" />
194     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.dom4j}" />
195     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.ehcache}" />
196     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.hibernate}" />
197     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jgroups}" />
198     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jta}" />
199
200     <antcall target="jboss-stuff" inheritRefs="true" />
201     <antcall target="bexchange-stuff" inheritRefs="true" />
202     <antcall target="domino-stuff" inheritRefs="true" />
203     <antcall target="google-stuff" inheritRefs="true" />
204
205     <!-- ===============================================================
206          Any jar files required
207          =============================================================== -->
208
209     <echo message="+++++++++++  bw-logging at ${org.bedework.appjar.bw-logging}" />
210     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-annotations}" />
211     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.rpiaccess}" />
212     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.rpiutil}" />
213     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-davio}" />
214     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-apiutil}" />
215     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calcore}" />
216     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calcorei}" />
217     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calenv}" />
218     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calfacade}" />
219     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calsvc}" />
220     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-calsvci}" />
221     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-client}" />
222     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-icalendar}" />
223     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-logging}" />
224     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-mail}" />
225     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.bw-appcommon}" />
226
227      <!-- any extra files-->
228     <copy todir="${app.dest.lib}" >
229       <fileset dir="${org.bedework.temp.extrajars.dir}" />
230     </copy>
231
232     <!-- Some more standard libs -->
233     <if>
234       <not>
235         <isset property="org.bedework.build.for.jboss"/>
236       </not>
237       <then>
238         <copy todir="${app.dest.lib}" file="${org.bedework.appjar.log4j}"/>
239       </then>
240     </if>
241     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.lucene-core}"/>
242     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.lucene-misc}"/>
243     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.ical4j}"/>
244     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-codec}"/>
245     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-collections}"/>
246     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-httpclient}"/>
247     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-lang}"/>
248     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-ssl}"/>
249
250     <!-- Mail related stuff -->
251     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.activation}" />
252     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.dsn}" />
253     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.imap}" />
254     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.mailapi}" />
255     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.pop3}" />
256     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.smtp}" />
257
258     <!-- add the jdbcdriver if defined
259          Disable this - shouldn't be adding jdbc drivers to the war file
260     <if>
261       <isset property="app.jdbcdriver.jar"/>
262       <then>
263         <copy todir="${app.dest.lib}" file="${app.jdbcdriver.jar}"/>
264       </then>
265     </if>
266      -->
267
268     <!-- tomcat -->
269     <antcall target="add.tomcat" inheritRefs="true" />
270
271     <!-- build the war file -->
272     <mkdir dir="${dist.home}" />
273     <delete file="${app.war.file}" />
274
275     <war warfile="${app.war.file}"
276          webxml="${app.dest.web.xml}"
277          basedir="${app.dest.war}"
278          excludes="WEB-INF/web.xml" />
279   </target>
280
281   <target name="add.tomcat" if="org.bedework.global.deploy.on.tomcat">
282     <property name="propval.app.tomcat.context.xml"
283               location="${app.sou.dir}/war/META-INF/context.xml" />
284     <resolveFile name="app.tomcat.context.xml"
285                  file="${propval.app.tomcat.context.xml}"
286                  base="${app.sou.dir}"/>
287
288     <copy tofile="${app.dest.metainf}/context.xml"
289           file="${app.tomcat.context.xml}"
290           overwrite="yes" >
291       <filterset refid="property.filters" />
292     </copy>
293   </target>
294
295   <target name="copy.properties" if="org.bedework.properties.dir.exists">
296     <!-- ===============================================================
297          Any property files we need for configuration, other than the
298          standard struts file, should be in the "${app.sou.dir}/properties
299          directory. They will be copied into the appropriate place for the
300          war and transformed by the above filter.
301          =============================================================== -->
302     <copy todir="${app.dest.properties}" overwrite="yes" >
303       <fileset dir="${app.sou.dir}/properties"
304                includes="*.properties"/>
305       <filterset refid="property.filters" />
306     </copy>
307   </target>
308
309   <target name="copy.servlet.properties">
310     <copy todir="${app.dest.classes}">
311       <fileset dir="${app.sou.dir}/war/WEB-INF/classes"
312                includes="*"/>
313       <filterset refid="property.filters" />
314     </copy>
315   </target>
316
317   <target name="copy.war.docs" if="org.bedework.war.docs.exists">
318     <copy todir="${app.dest.docs}">
319       <fileset dir="${app.sou.dir}/war/docs" />
320     </copy>
321   </target>
322
323   <target name="bexchange-stuff" if="org.bedework.build.caldav.bexchange">
324     <copy tofile="${app.dest.properties}/timezones.xml"
325           file="${org.bedework.project.bedework}/docs/bwtimezones.xml" />
326   </target>
327
328   <target name="domino-stuff" if="org.bedework.build.caldav.domino">
329     <copy tofile="${app.dest.properties}/timezones.xml"
330           file="${org.bedework.project.bedework}/docs/bwtimezones.xml" />
331   </target>
332
333   <target name="google-stuff" if="org.bedework.build.caldav.google">
334     <copy todir="${app.dest.lib}">
335       <fileset dir="${google.dir}">
336         <include name="*.jar"/>
337       </fileset>
338     </copy>
339
340     <copy tofile="${app.dest.properties}/timezones.xml"
341           file="${org.bedework.project.bedework}/docs/bwtimezones.xml" />
342   </target>
343
344   <!-- =================================================================
345        If this is a struts app the following gets executed.
346        We create an updated struts-config.xml file and add some jars.
347        ================================================================= -->
348
349   <target name="struts-stuff" if="org.bedework.strutsapp">
350     <!-- Copy a dummy startup file into the war. -->
351     <copy todir="${app.dest.war}">
352       <fileset dir="${app.sou.dir}/war/" includes="setup.do" />
353     </copy>
354
355     <copy todir="${app.dest.webinf}"
356           file="${app.sou.dir}/war/WEB-INF/struts-config.xml"/>
357
358     <mkdir  dir="${app.dest.webinf}/tlds"/>
359     <copy todir="${app.dest.webinf}/tlds" >
360       <fileset dir="${org.bedework.struts.tlds}">
361         <include name="*"/>
362       </fileset>
363     </copy>
364
365     <if>
366       <not>
367         <isset property="xalan.in.tomcat.common.endorsed" />
368       </not>
369       <then>
370         <copy todir="${app.dest.lib}" file="${xalan.jar}"/>
371       </then>
372     </if>
373
374     <if>
375       <isset property="org.bedework.global.portal.platform" />
376       <then>
377         <!-- Add common portlet files -->
378
379         <copy todir="${app.dest.lib}"
380               file="${org.bedework.appjar.portals-bridges-common}"/>
381         <copy todir="${app.dest.lib}"
382               file="${org.bedework.appjar.portals-bridges-struts-1.2.7}"/>
383
384         <!-- Use generic bedework portlet tld -->
385         <copy todir="${app.dest.webinf}/tlds"
386               overwrite="yes"
387               failonerror="no" >
388           <fileset dir="${app.root.dir}/resources/portlet" >
389             <include name="*.tld"/>
390           </fileset>
391         </copy>
392
393         <copy todir="${app.dest.webinf}"
394               file="${org.bedework.deploy.type.dir}/portlet/struts-portlet-config.xml"
395               overwrite="yes"
396               failonerror="no" />
397
398         <copy todir="${app.dest.webinf}"
399               file="${org.bedework.deploy.type.dir}/portlet/portlet.xml"
400               overwrite="yes"
401               failonerror="no" >
402           <filterset refid="property.filters" />
403         </copy>
404
405         <!-- Add the portal bridge controller def -->
406         <replace file="${app.dest.webinf}/struts-config.xml">
407           <replacetoken><![CDATA[<!-- portlet controller def here -->]]></replacetoken>
408           <replacevalue><![CDATA[<controller pagePattern="$M$P" inputForward="true"
409                   processorClass="org.apache.portals.bridges.struts.PortletRequestProcessor"/>]]>
410           </replacevalue>
411         </replace>
412
413         <antcall target="add.jetspeed2" inheritRefs="true" />
414         <antcall target="add.uportal2" inheritRefs="true" />
415         <antcall target="add.liferay4" inheritRefs="true" />
416         <antcall target="add.liferay5" inheritRefs="true" />
417       </then>
418     </if>
419
420     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.struts}"/>
421
422     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.antlr}"/>
423     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-beanutils}"/>
424     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-digester}"/>
425     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-fileupload}"/>
426     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-logging}"/>
427     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.commons-validator}"/>
428     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jakarta-oro}"/>
429     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jstl}"/>
430     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.jstl-standard}"/>
431   </target>
432
433   <!-- =================================================================
434        Jetspeed 2 modifications
435        ================================================================= -->
436
437   <target name="add.jetspeed2" if="org.bedework.build.for.jetspeed2" >
438     <copy todir="${app.dest.webinf}/tlds" >
439       <fileset dir="${org.bedework.default.lib}/${jetspeed2.jars.dir}/portals-bridges-struts">
440         <include name="*.tld"/>
441       </fileset>
442     </copy>
443   </target>
444
445   <!-- =================================================================
446        Uportal 2 modifications
447        ================================================================= -->
448
449   <target name="add.uportal2" if="org.bedework.build.for.uportal2" >
450     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.uportal}"/>
451
452     <!-- Add the portlet servlet mapping -->
453     <replace file="${app.temp.web.xml}">
454       <replacetoken><![CDATA[<!-- portlet servlet mapping here -->]]></replacetoken>
455       <replacevalue><![CDATA[<servlet-mapping>
456     <servlet-name>@PORTLET-NAME@</servlet-name>
457     <url-pattern>/@PORTLET-NAME@/*</url-pattern>
458   </servlet-mapping>]]>
459       </replacevalue>
460     </replace>
461
462   </target>
463
464   <!-- =================================================================
465        Liferay 4 modifications
466        ================================================================= -->
467
468   <target name="add.liferay4" if="org.bedework.build.for.liferay4" >
469    <!-- Add liferay config files -->
470     <copy todir="${app.dest.webinf}" >
471       <fileset dir="${app.sou.dir}/war/WEB-INF" >
472         <include name="liferay*"/>
473       </fileset>
474       <filterset refid="property.filters" />
475     </copy>
476
477     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.liferay}"/>
478     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.liferay.util-bridges}"/>
479     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.liferay.util-java}"/>
480
481     <!-- Add the context params -->
482     <replace file="${app.temp.web.xml}">
483       <replacetoken><![CDATA[<!-- add context params here -->]]></replacetoken>
484       <replacevalue><![CDATA[<!-- add context params here -->
485
486   <context-param>
487     <param-name>company_id</param-name>
488     <param-value>@LIFERAY-COMPANY-ID@</param-value>
489   </context-param>]]>
490       </replacevalue>
491     </replace>
492
493     <!-- Add the portal listener -->
494     <replace file="${app.temp.web.xml}">
495       <replacetoken><![CDATA[<!-- add listeners here -->]]></replacetoken>
496       <replacevalue><![CDATA[<!-- add listeners here -->
497
498   <listener>
499     <listener-class>
500       @PORTAL-SERVLET-CONTEXT-LISTENER@
501     </listener-class>
502   </listener>]]>
503       </replacevalue>
504     </replace>
505
506     <!-- Add the portlet servlet definition -->
507     <replace file="${app.temp.web.xml}">
508       <replacetoken><![CDATA[<!-- add servlet definitions here -->]]></replacetoken>
509       <replacevalue><![CDATA[<!-- add servlet definitions here -->
510
511   <!-- Servlet definition for portlet use. -->
512   <servlet>
513     <servlet-name>@PORTLET-NAME@</servlet-name>
514     <display-name>@PORTLET-NAME@ Wrapper</display-name>
515     <servlet-class>@PORTLET-SERVLET-CLASS@</servlet-class>
516     <init-param>
517       <param-name>portlet-class</param-name>
518       <param-value>@PORTLET-CLASS@</param-value>
519     </init-param>
520     <init-param>
521       <param-name>portlet-guid</param-name>
522       <param-value>@CONTEXT-ROOT@.@PORTLET-NAME@</param-value>
523     </init-param>
524   </servlet>]]>
525       </replacevalue>
526     </replace>
527
528     <!-- Add the portlet servlet mapping -->
529     <replace file="${app.temp.web.xml}">
530       <replacetoken><![CDATA[<!-- add servlet mappings here -->]]></replacetoken>
531       <replacevalue><![CDATA[<!-- add servlet mappings here -->
532
533   <servlet-mapping>
534     <servlet-name>@PORTLET-NAME@</servlet-name>
535     <url-pattern>/@PORTLET-NAME@/*</url-pattern>
536   </servlet-mapping>]]>
537       </replacevalue>
538     </replace>
539   </target>
540
541   <!-- =================================================================
542        Liferay 5 modifications
543        ================================================================= -->
544
545   <target name="add.liferay5" if="org.bedework.build.for.liferay5" >
546    <!-- Add liferay config files -->
547     <copy todir="${app.dest.webinf}" >
548       <fileset dir="${app.sou.dir}/war/WEB-INF" >
549         <include name="liferay*"/>
550       </fileset>
551       <filterset refid="property.filters" />
552     </copy>
553
554     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.liferay.util-taglib}"/>
555     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.liferay.util-bridges}"/>
556     <copy todir="${app.dest.lib}" file="${org.bedework.appjar.liferay.util-java}"/>
557
558     <!-- Add the context params -->
559     <replace file="${app.temp.web.xml}">
560       <replacetoken><![CDATA[<!-- add context params here -->]]></replacetoken>
561       <replacevalue><![CDATA[<!-- add context params here -->
562
563   <context-param>
564     <param-name>company_id</param-name>
565     <param-value>@LIFERAY-COMPANY-ID@</param-value>
566   </context-param>]]>
567       </replacevalue>
568     </replace>
569
570     <!-- Add the portal listener -->
571     <replace file="${app.temp.web.xml}">
572       <replacetoken><![CDATA[<!-- add listeners here -->]]></replacetoken>
573       <replacevalue><![CDATA[<!-- add listeners here -->
574
575   <listener>
576     <listener-class>
577       @PORTAL-SERVLET-CONTEXT-LISTENER@
578     </listener-class>
579   </listener>]]>
580       </replacevalue>
581     </replace>
582
583     <!-- Add the portlet servlet definition -->
584     <replace file="${app.temp.web.xml}">
585       <replacetoken><![CDATA[<!-- add servlet definitions here -->]]></replacetoken>
586       <replacevalue><![CDATA[<!-- add servlet definitions here -->
587
588   <!-- Servlet definition for portlet use. -->
589   <servlet>
590     <servlet-name>@PORTLET-NAME@</servlet-name>
591     <display-name>@PORTLET-NAME@ Wrapper</display-name>
592     <servlet-class>@PORTLET-SERVLET-CLASS@</servlet-class>
593     <init-param>
594       <param-name>portlet-class</param-name>
595       <param-value>@PORTLET-CLASS@</param-value>
596     </init-param>
597     <init-param>
598       <param-name>portlet-guid</param-name>
599       <param-value>@CONTEXT-ROOT@.@PORTLET-NAME@</param-value>
600     </init-param>
601   </servlet>]]>
602       </replacevalue>
603     </replace>
604
605     <!-- Add the portlet servlet mapping -->
606     <replace file="${app.temp.web.xml}">
607       <replacetoken><![CDATA[<!-- add servlet mappings here -->]]></replacetoken>
608       <replacevalue><![CDATA[<!-- add servlet mappings here -->
609
610   <servlet-mapping>
611     <servlet-name>@PORTLET-NAME@</servlet-name>
612     <url-pattern>/@PORTLET-NAME@/*</url-pattern>
613   </servlet-mapping>]]>
614       </replacevalue>
615     </replace>
616   </target>
617
618   <!-- =================================================================
619        If this is a j2ee app the following gets executed.
620        We create an uodated jboss-web.xml file (for jboss) and a ear
621        ================================================================= -->
622
623   <target name="jboss-stuff" if="org.bedework.build.for.jboss">
624     <copy todir="${app.dest.webinf}"
625           file="${app.sou.dir}/war/WEB-INF/jboss-web.xml">
626       <filterset refid="property.filters" />
627     </copy>
628
629     <if>
630       <isset property="propval.app.virtual.host" />
631       <then>
632         <replace file="${app.dest.webinf}/jboss-web.xml">
633           <replacetoken><![CDATA[<!-- Virtual host -->]]></replacetoken>
634           <replacevalue><![CDATA[<virtual-host>@VIRTUAL-HOST@</virtual-host>
635           ]]>
636           </replacevalue>
637         </replace>
638         <replace file="${app.dest.webinf}/jboss-web.xml">
639           <replacefilter token="@VIRTUAL-HOST@" value="${propval.app.virtual.host}"/>
640         </replace>
641       </then>
642     </if>
643   </target>
644
645   <target name="build.ear" if="cal.j2ee">
646     <ant antfile="${buildear}"
647          inheritRefs="true" target="build" />
648   </target>
649 </project>
Note: See TracBrowser for help on using the browser.