Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *   '$RCSfile$'
4
  *     Authors: Matt Jones, Chad Berkley, Jivka Bojilova
5
  *   Copyright: 2000 Regents of the University of California and the
6
  *              National Center for Ecological Analysis and Synthesis
7
  * For Details: http://www.nceas.ucsb.edu/
8
  *
9
  *    '$Author: tao $'
10
  *    '$Date: 2008-05-01 16:51:04 -0700 (Thu, 01 May 2008) $'
11
  *    '$Revision: 3817 $'
12
  *
13
  * Build file for the Ant cross-platform build system for metacat
14
  * See http://jakarta.apache.org for details on Ant
15
  *
16
  * usage: ant [compile|jar|install|jdoc]
17
  *
18
  * This program is free software; you can redistribute it and/or modify
19
  * it under the terms of the GNU General Public License as published by
20
  * the Free Software Foundation; either version 2 of the License, or
21
  * (at your option) any later version.
22
  *
23
  * This program is distributed in the hope that it will be useful,
24
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
  * GNU General Public License for more details.
27
  *
28
  * You should have received a copy of the GNU General Public License
29
  * along with this program; if not, write to the Free Software
30
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
31
-->
32
<project name="metacat" default="jar" basedir=".">
33
  <property environment="env"/>
34
  <property file="build.properties"/>  <!-- USER SPECIFIC PROPS -->
35

    
36
  <!-- Determine which tomcat we are using and tomcat-specific settings -->
37
  <condition property="jsdk" value="${tomcat}/common/lib/servlet.jar">
38
    <equals arg1="${tomcatversion}" arg2="tomcat4" />
39
  </condition>
40
  <condition property="jsdk" value="${tomcat}/common/lib/servlet-api.jar">
41
    <equals arg1="${tomcatversion}" arg2="tomcat5" />
42
  </condition>
43
	
44
  <!-- Determine if installed ecogrid -->
45
  <condition property="enable.ecogrid">
46
    <equals arg1="${install.ecogrid}" arg2="true" />
47
  </condition>
48

    
49
  <target name="check-db">
50
    <condition property="use-oracle">
51
      <equals arg1="${database}" arg2="oracle" />
52
    </condition>
53
    <condition property="use-postgresql">
54
      <equals arg1="${database}" arg2="postgresql" />
55
    </condition>
56
    <condition property="use-sqlserver">
57
      <equals arg1="${database}" arg2="sqlserver" />
58
    </condition>
59
  </target>
60

    
61
  <target name="oracle" if="use-oracle">
62
     <!-- Customize these properties if you are using oracle -->
63
     <echo message="Using oracle..."/>
64
     <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
65
     <property name="dbAdapter" value="edu.ucsb.nceas.dbadapter.OracleAdapter"/>
66
     <property name="jdbc-jar-name" value="classes111.zip" />
67
     <property name="jdbc" value="${jdbc_base}/${jdbc-jar-name}" />
68
     <!-- Property to indicate is not MSSQL installation-->
69
     <property name="other" value="yes"/>
70
     <property name="install-sql"
71
               value="xmltables.sql" />
72
     <property name="upgrade-1.2-sql"
73
               value="upgrade-db-to-1.2.sql" />
74
     <property name="upgrade-1.3-sql"
75
               value="upgrade-db-to-1.3.sql" />
76
     <property name="upgrade-1.4-sql"
77
               value="upgrade-db-to-1.4.sql" />
78
     <property name="upgrade-1.5-sql"
79
               value="upgrade-db-to-1.5.sql" />
80
     <property name="upgrade-1.6-sql"
81
               value="upgrade-db-to-1.6.sql" />
82
     <property name="upgrade-1.7-sql"
83
               value="upgrade-db-to-1.7.sql" />
84
  	<property name="upgrade-1.8-sql"
85
  	   	               value="upgrade-db-to-1.8.sql" />
86
   </target>
87

    
88
   <target name="postgresql" if="use-postgresql">
89
     <!-- Customize these properties if you are using postgres -->
90
     <echo message="Using PostgreSQL..."/>
91
     <property name="dbDriver" value="org.postgresql.Driver"/>
92
     <property name="dbAdapter"
93
               value="edu.ucsb.nceas.dbadapter.PostgresqlAdapter"/>
94
     <property name="jdbc-jar-name" value="postgresql-8.0-312.jdbc3.jar" />
95
     <property name="jdbc" value="lib/${jdbc-jar-name}" />
96
     <!-- Property to indicate is not MSSQL installation-->
97
     <property name="other" value="yes"/>
98
     <property name="install-sql"
99
               value="xmltables-postgres.sql" />
100
     <property name="upgrade-1.2-sql"
101
               value="upgrade-db-to-1.2-postgres.sql" />
102
     <property name="upgrade-1.3-sql"
103
               value="upgrade-db-to-1.3-postgres.sql" />
104
     <property name="upgrade-1.4-sql"
105
               value="upgrade-db-to-1.4-postgres.sql" />
106
     <property name="upgrade-1.5-sql"
107
               value="upgrade-db-to-1.5-postgres.sql" />
108
     <property name="upgrade-1.6-sql"
109
               value="upgrade-db-to-1.6-postgres.sql" />
110
     <property name="upgrade-1.7-sql"
111
               value="upgrade-db-to-1.7-postgres.sql" />
112
   	<property name="upgrade-1.8-sql"
113
   	               value="upgrade-db-to-1.8-postgres.sql" />
114
    </target>
115

    
116
   <target name="sqlserver" if="use-sqlserver">
117
     <!-- Customize these properties if you are using SQL server -->
118
     <echo message="Using SQL Server..."/>
119
     <property name="dbDriver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
120
     <property name="dbAdapter"
121
               value="edu.ucsb.nceas.dbadapter.SqlserverAdapter"/>
122
     <property name="jdbc" value="${jdbc_base}/msbase.jar" />
123
     <property name="jdbc-add1" value="${jdbc_base}/msutil.jar" />
124
     <property name="jdbc-add2" value="${jdbc_base}/mssqlserver.jar" />
125
     <!-- Property to indicate is a MSSQL installation-->
126
     <property name="MSSQL" value="yes"/>
127
     <property name="install-sql"
128
               value="xmltables-sqlserver.sql" />
129
   </target>
130

    
131
   <target name="config" depends="check-db,oracle,postgresql,sqlserver">
132
      <!-- usr for client testing, generally you don't need change-->
133
      <property name="mcuser" value="uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org"/>
134
      <property name="mcpassword" value="kepler"/>
135
      <property name="mcanotheruser" value="uid=tao,o=NCEAS,dc=ecoinformatics,dc=org"/>
136
      <property name="mcanotherpassword" value="yourpass"/>
137
   	   <property name="piscouser" value="uid=tao,o=PISCO,dc=ecoinformatics,dc=org"/>
138
   	   <property name="piscopassword" value="yourpass"/>
139
   	   <property name="lteruser" value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
140
   	   <property name="lterpassword" value="yourpass"/>
141

    
142
      <property name="debug" value="on" />
143
      <property name="debuglevel" value="55" />
144

    
145
      <property name="morphosourcedir" value="../morpho" />
146
      <property name="defaultcontenttype" value="application/octet-stream" />
147
      <property name="utilitiesdir" value="../utilities" />
148

    
149
      <echo>*********** tomcatversion = ${tomcatversion}</echo>
150
      <echo>*********** set jsdk to ${jsdk}</echo>
151
  </target>
152

    
153
   <target name="init" depends="config">
154
      <path id="compile.classpath">
155
        <pathelement location="${jsdk}"/>
156
        <pathelement location="lib" />
157
        <fileset dir="lib">
158
          <include name="*.jar"/>
159
        </fileset>
160
	<fileset dir="lib">
161
           <include name="xalan.jar"/>
162
         </fileset>
163
       <fileset dir="lib/lsid_lib">
164
         <include name="*.jar"/>
165
       </fileset>
166
       <fileset dir="${jdbc_base}">
167
         <include name="${jdbc-jar-name}"/>
168
          <include name="msbase.jar"/>
169
          <include name="msutil.jar"/>
170
          <include name="mssqlserver.jar"/>
171
       </fileset>
172

    
173
        <!-- Include geoserver, geotools, et. al. -->
174
        <fileset dir="lib/spatial/geoserver/WEB-INF/lib">
175
          <include name="*.jar"/>
176
        </fileset>
177
        <pathelement location="lib/spatial/geoserver/WEB-INF/classes"/>
178

    
179
       </path>
180
      
181
      <!-- It is less likely you'll need to make any changes from here down,
182
           but customization is possible -->
183
      <property name="installdir"          value="${deploy.dir}/${metacat.context}" />
184
      <property name="temp-dir"            value="/tmp/${metacat.context}" />
185
      <property name="name"                value="metacat"/>
186
      <property name="Name"                value="MetaCat"/>
187
      <property name="debugprefix"         value="${Name}:"/>
188
      <property name="release"             value="1.8.0"/>
189
      <property name="replication-path"    value="/${metacat.context}/servlet/replication"/>
190
      <property name="harvester-registration-login-path" value="/${metacat.context}/harvesterRegistrationLogin"/>
191
      <property name="harvester-registration-path"       value="/${metacat.context}/harvesterRegistration"/>
192
      <property name="servlet-path"        value="/${metacat.context}/metacat"/>
193
      <property name="html-path"           value="/${metacat.context}"/>
194
      <property name="systemidserver"      value="${http.protocol}://${httpserver}"/>
195
      <property name="style-common-relpath" value="/style/common"/>
196
      <property name="style-shared-relpath" value="/style/shared"/>
197
      <property name="style-common-cvsrelpath" value="lib${style-common-relpath}"/>
198
      <property name="style-common-fullpath" value="/${installdir}${style-common-relpath}"/>
199
      <property name="templates.dir"       value="${style-common-fullpath}/templates"/>
200
      <property name="style-common-path"   value="/${metacat.context}${style-common-relpath}"/>
201
      <property name="style-shared-path"   value="/${metacat.context}${style-shared-relpath}"/>
202
      <property name="style-skins-relpath" value="/style/skins"/>
203
      <property name="style-skins-path"    value="/${metacat.context}${style-skins-relpath}"/>
204
      <property name="replication-log"     value="${log.dir}/metacatreplication.log"/>
205
      <property name="replicationerrorlog" value="${log.dir}/metacatreplication.err"/>
206
      <property name="config-dir"          value="${deploy.dir}/${style-skins-path}" />
207
      <property name="util-module"         value="utilities" />
208
      <property name="eml-module"          value="eml" />
209
      <property name="eml-version"         value="2.0.0beta6" />
210
      <property name="eml-tag"             value="EML_2_0_0_BETA_6_FOR_METACAT" />
211
      <property name="eml2_0_0-tag"        value="RELEASE_EML_2_0_0_UPDATE_1" />
212
      <property name="eml2_0_1-schema-tag" value="RELEASE_EML_2_0_1" />
213
      <property name="eml2_0_1-style-tag"  value="RELEASE_EML_2_0_1_UPDATE_6" />
214
      <property name="eml2_0_0namespace"   value="eml://ecoinformatics.org/eml-2.0.0" />
215
      <property name="eml2_0_1namespace"   value="eml://ecoinformatics.org/eml-2.0.1" />
216
      <property name="eml2_1_0namespace"   value="eml://ecoinformatics.org/eml-2.1.0" />
217
      <property name="stmmlnamespace"      value="http://www.xml-cml.org/schema/stmml" />
218
      <property name="eml-css"             value="eml_xsl.css"/>
219
      <property name="eml-module.default.css"
220
                                           value="default.css"/>
221
   	  
222
      <!-- Config for registry variables -->
223
      <property name="scope"               value="obfs"/>
224
      <property name="responseForm"        value="genericResponse.tmpl"/>
225
      <property name="entryForm"           value="entryForm.tmpl"/>
226
      <property name="guide"               value="genericGuide.tmpl"/>
227
      <property name="loginForm"           value="loginForm.tmpl"/>
228
      <property name="confirmData"         value="confirmData.tmpl"/>
229
      <property name="deleteData"          value="deleteData.tmpl"/>
230
      <property name="genericHeader"       value="genericHeader.tmpl"/>
231
      <property name="genericFooter"       value="genericFooter.tmpl"/>
232
      <property name="adminname"           value="KNB Support"/>
233
      <property name="recipient"           value="knb-software\@nceas.ucsb.edu"/>
234

    
235
      <property name="defaultStage"        value="initregister"/>
236
      <property name="defaultHeader"       value="genericHeader.tmpl"/>
237
      <property name="defaultFooter"       value="genericFooter.tmpl"/>
238
      <property name="defaultChangePass"   value="ldapChangePass.tmpl"/>
239
      <property name="defaultResetPass"    value="ldapResetPass.tmpl"/>
240
      <property name="changePassSuccess"   value="ldapChangePassSuccess.tmpl"/>
241
      <property name="resetPassSuccess"    value="ldapResetPassSuccess.tmpl"/>
242
      <property name="registerFailed"      value="ldapRegisterFailed.tmpl"/>
243
      <property name="registerLter"        value="ldapRegisterLter.tmpl"/>
244
      <property name="registerMatch"       value="ldapRegisterMatch.tmpl"/>
245
      <property name="registerSuccess"     value="ldapRegisterSuccess.tmpl"/>
246
      <property name="register"            value="ldapRegister.tmpl"/>
247
      <property name="searchResults"       value="searchResults.tmpl"/>
248
   	  <property name="ldapMainServerFailure" value="ldapMainServerFailure.tmpl"/>
249

    
250
      <filter token="scope"                value="${scope}"/>
251
      <filter token="responseForm"         value="${responseForm}"/>
252
      <filter token="entryForm"            value="${entryForm}"/>
253
      <filter token="guide"                value="${guide}"/>
254
      <filter token="loginForm"            value="${loginForm}"/>
255
      <filter token="confirmData"          value="${confirmData}"/>
256
      <filter token="deleteData"           value="${deleteData}"/>
257
      <filter token="genericHeader"        value="${genericHeader}"/>
258
      <filter token="genericFooter"        value="${genericFooter}"/>
259
      <filter token="adminname"            value="${adminname}"/>
260
      <filter token="recipient"            value="${recipient}"/>
261

    
262
      <filter token="ldapurl"              value="ldap.ecoinformatics.org"/>
263
      <filter token="ldapSearchBase"       value="dc=ecoinformatics,dc=org"/>
264
      <filter token="ldap_user"            value="cn=Manager,dc=ecoinformatics,dc=org"/>
265
      <filter token="ldap_password"        value="ldap_password"/>
266
      <filter token="mailhost"             value="localhost"/>
267
      <filter token="sender"               value="knb-software\@nceas.ucsb.edu"/>
268
      <filter token="cgiurl"               value="${cgi-prefix}/ldapweb.cgi"/>
269

    
270
      <filter token="docrooturl" value="./" />
271
      <filter token="database" value="${database}" />
272
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
273
      <filter token="dbDriver" value="${dbDriver}"/>
274
      <filter token="dbAdapter" value="${dbAdapter}"/>
275
      <filter token="install-dir" value="${installdir}"/>
276
      <filter token="temp-dir" value="${temp-dir}"/>
277
      <filter token="server" value="${server}"/>
278
      <filter token="systemidserver" value="${systemidserver}"/>
279
      <filter token="cgi-prefix" value="${cgi-prefix}"/>
280
      <filter token="ldapUrl" value="${ldapUrl}"/>
281
      <filter token="replication-log" value="${replication-log}"/>
282
      <filter token="replicationerrorlog" value="${replicationerrorlog}"/>
283
      <filter token="servlet-path" value="${servlet-path}"/>
284
      <filter token="html-path" value="${html-path}"/>
285
      <filter token="user" value="${user}"/>
286
      <filter token="password" value="${password}"/>
287
      <filter token="mcuser" value="${mcuser}"/>
288
      <filter token="mcpassword" value="${mcpassword}"/>
289
      <filter token="mcanotheruser" value="${mcanotheruser}"/>
290
      <filter token="mcanotherpassword" value="${mcanotherpassword}"/>
291
      <filter token="knb-site-url" value="${knb-site-url}"/>
292
      <filter token="eml-css" value="${eml-css}"/>
293
      <filter token="style-skins-relpath" value="${style-skins-relpath}"/>
294
      <filter token="style-skins-path" value="${style-skins-path}"/>
295
      <filter token="style-common-relpath" value="${style-common-relpath}"/>
296
      <filter token="style-common-fullpath" value="${style-common-fullpath}"/>
297
      <filter token="style-common-path" value="${style-common-path}"/>
298
      <filter token="style-shared-path" value="${style-shared-path}"/>
299
      <filter token="templates.dir" value="${templates.dir}"/>
300

    
301
      <!-- The "style-path" filter is used by the eml xsl stylesheets!!  -->
302
      <filter token="style-path" value="${style-skins-path}"/>
303
      <filter token="replication-path" value="${replication-path}"/>
304
      <filter token="harvester-registration-login-path" value="${harvester-registration-login-path}"/>
305
      <filter token="harvester-registration-path" value="${harvester-registration-path}"/>
306
      <filter token="config-dir" value="${config-dir}"/>
307
      <filter token="default-style" value="${default-style}"/>
308
      <filter token="eml-version" value="${eml-version}"/>
309
      <filter token="eml2_0_0namespace" value="${eml2_0_0namespace}"/>
310
      <filter token="eml2_0_1namespace" value="${eml2_0_1namespace}"/>
311
      <filter token="eml2_1_0namespace" value="${eml2_1_0namespace}"/>
312
      <filter token="stmmlnamespace" value="${stmmlnamespace}"/>
313
      <filter token="context" value="${metacat.context}"/>
314
   	  <filter token="httpserver" value="${httpserver}"/>
315
      <filter token="forcereplicationwaitingtime" value="${forcereplicationwaitingtime}" />
316
      <filter token="debuglevel" value="${debuglevel}" />
317
      <filter token="datafilepath" value="${datafilepath}" />
318
      <filter token="inlinedatafilepath" value="${inlinedatafilepath}" />
319
      <filter token="defaultcontenttype" value="${defaultcontenttype}" />
320
      <filter token="debugprefix" value="${debugprefix}"/>
321
      <filter token="administrators" value="${administrators}"/>
322
      <filter token="moderators" value="${moderators}"/>
323
      <filter token="allowedSubmitters" value="${allowedSubmitters}"/>
324
      <filter token="deniedSubmitters" value="${deniedSubmitters}"/>
325
      <filter token="indexPaths" value="${indexPaths}"/>
326

    
327
      <filter token="defaultStage" value="${defaultStage}"/>
328
      <filter token="defaultHeader" value="${defaultHeader}"/>
329
      <filter token="defaultFooter" value="${defaultFooter}"/>
330
      <filter token="defaultChangePass" value="${defaultChangePass}"/>
331
      <filter token="defaultResetPass" value="${defaultResetPass}"/>
332
      <filter token="changePassSuccess" value="${changePassSuccess}"/>
333
      <filter token="resetPassSuccess" value="${resetPassSuccess}"/>
334
      <filter token="registerFailed" value="${registerFailed}"/>
335
      <filter token="registerLter" value="${registerLter}"/>
336
      <filter token="registerMatch" value="${registerMatch}"/>
337
      <filter token="registerSuccess" value="${registerSuccess}"/>
338
      <filter token="register" value="${register}"/>
339
      <filter token="searchResults" value="${searchResults}"/>
340
   	  <filter token="ldapMainServerFailure" value="${ldapMainServerFailure}"/>
341
   	  <filter token="lter-user" value="${lteruser}"/>
342
   	  <filter token="lter-pass" value="${lterpassword}"/>
343
      <filter token="pisco-user" value="${piscouser}"/>
344
      <filter token="pisco-pass" value="${piscopassword}"/>
345
   	   
346
       
347
   	  <filter token="timedreplication" value="${timedreplication}" />
348
   	  <filter token="firsttimedreplication" value="${firsttimedreplication}" />
349
   	  <filter token="timedreplicationinterval" value="${timedreplicationinterval}" />
350
      
351
   	  <property name="srcdir" value="./src" />
352
   	  <property name="lib.dir" value="./lib" />
353
      <property name="testdir" value="./test" />
354
      <property name="testtorun" value="BuildIndexTest" />
355
      <property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
356
      <property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
357
      <property name="build.dir" value="./build"/>
358
      <property name="build.src" value="${build.dir}/src"/>
359
      <property name="build.dest" value="${build.dir}/classes"/>
360
      <property name="build.docs" value="${build.dir}/docs"/>
361
      <property name="build.samples" value="${build.dir}/samples"/>
362
      <property name="build.tests" value="${build.dir}/tests"/>
363
      <property name="build.tmp" value="${build.dir}/tmp"/>
364
      <property name="build.metacattest" value="${build.tests}/metacattest"/>
365
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
366
      <property name="build.data" value="${build.dir}/data"/>
367
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
368
      <property name="build.war" value="${build.dir}/war"/>
369

    
370
      <property name="dist.dir" value="dist"/>
371
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
372
      <property name="ver.src" value="${ver.dir}/src"/>
373
      <property name="util.dir" value="${dist.dir}/${util-module}"/>
374
	  <!-- directories for creating a Harvest List Editor distribution -->
375
      <property name="dist.dir.hle" value="disthle"/>
376
      <property name="ver.dir.hle" value="${dist.dir.hle}/harvest-list-editor-${release}"/>
377
   	  
378
   	  
379
   	  <property name="ecogrid-target-name" value="metacatImpl"/>
380
   	  <property name="ecogrid-module-dest-dir" value =".."/>
381
   	  <property name="ecogrid-module" value="seek/projects/ecogrid"/>
382
   	  <property name="ecogrid-dist-dir" value="${dist.dir}/${ecogrid-module}"/>
383
   	  <property name="ecogrid-dir" value="${ecogrid-module-dest-dir}/${ecogrid-module}"/>
384

    
385
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
386
      <condition property="utilities.required">
387
        <or>
388
          <not><available file="lib/httpclient.jar"/></not>
389
          <not><available file="lib/utilities.jar"/></not>
390
        </or>
391
      </condition>
392
      <condition property="eml.required">
393
        <or>
394
          <not><available file="lib/schema/eml-2.0.1/eml.xsd"/></not>
395
          <not><available file="lib/schema/eml-2.0.0/eml.xsd"/></not>
396
          <not><available file="lib/dtd/eml-dataset-2.0.0beta6.dtd"/></not>
397
        </or>
398
      </condition>
399
   	  
400
      <condition property="ecogrid.required">
401
      	   <or>
402
             <not><available file="${ecogrid-dir}/build.properties"/></not>
403
             <not><available file="${ecogrid-dir}/buildfiles/metacatImpl.xml"/></not>
404
           </or>
405
      </condition>
406

    
407
   </target>
408

    
409
   <target name="prepare" depends="init">
410
      <mkdir dir="${build.dir}"/>
411
      <mkdir dir="${build.src}"/>
412
      <mkdir dir="${build.dest}"/>
413
      <mkdir dir="${build.javadocs}"/>
414
      <mkdir dir="${build.tmp}"/>
415

    
416
      <copy todir="${build.src}" filtering="yes">
417
        <fileset dir="${srcdir}">
418
          <include name="edu/**"/>
419
          <include name="com/**"/>
420
          <include name="org/**"/>
421
          <include name="**/*.sql"/>
422
          <exclude name="**/CVS*"/>
423
          <exclude name="**/.#*"/>
424
        </fileset>
425
      </copy>
426
      <available file="lib/style/common/emlb6toeml2" type="dir"
427
                 property="styles.not.needed"/>
428
   </target>
429

    
430
   <target name="compile" depends="prepare,utilities"
431
    description="Compiles java code to build dir, and copies metacat props files there">
432

    
433
       <javac srcdir="${build.src}"
434
              destdir="${build.dest}"
435
              debug="${debug}"
436
              excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java">
437
        <classpath>
438
          <path refid="compile.classpath"/>
439
        </classpath>
440
      </javac>
441
   </target>
442

    
443
   <target name="jar" depends="compile,geteml"
444
    description="Compiles and jars metacat java code to metacat.jar in build dir">
445

    
446
       <delete file="${build.dir}/${name}.jar" />
447
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
448
            excludes="**/protocols/ **/harvesterClient/" />
449
   </target>
450

    
451
   <target name="protocol" depends="compile"
452
    description="Compiles and jars protocol java code to protocol.jar in build dir">
453
       <delete file="${build.dir}/protocol.jar" />
454
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
455
            includes="**/protocols/" />
456
   </target>
457

    
458
   <target name="utilities" depends="config" if="utilities.required">
459
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
460
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
461
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
462
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
463
   </target>
464

    
465
   <target name="getutilities" depends="prepare"
466
   description="Checks utility out of cvs and copies it to your metacat cvs sandbox">
467
     <echo>Enter CVS password: </echo>
468
     <cvs cvsRoot="${cvsroot}"
469
          package="${util-module}"
470
          dest="${build.tmp}" />
471
   </target>
472

    
473
   <target name="client" depends="utilities, prepare"
474
    description="Compiles metacat-client java code to build dir">
475
       <javac srcdir="${build.src}"
476
              destdir="${build.dest}"
477
              includes="edu/ucsb/nceas/metacat/client/*">
478
          <classpath>
479
            <path refid="compile.classpath"/>
480
          </classpath>
481
        </javac>
482
   </target>
483

    
484
   <target name="clientjar" depends="client"
485
    description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
486
       <delete file="${build.dir}/${name}-client.jar" />
487
       <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
488
            includes="**/metacat/client/" />
489
   </target>
490

    
491
    <target name="advancedsearchjar" depends="compile"
492
            description="Compiles and jars advanced search Java code to advancedsearch.jar in build dir">
493
        <delete file="${build.dir}/advancedsearch.jar" />
494
        <jar jarfile="${build.dir}/advancedsearch.jar" basedir="${build.dest}"
495
             includes="**/metacat/advancedsearch/" />
496
    </target>
497

    
498
   <target name="harvester" depends="client"
499
           description="Compiles harvester java code to build dir">
500
       <javac srcdir="${build.src}"
501
              destdir="${build.dest}"
502
              includes="edu/ucsb/nceas/metacat/harvesterClient/*">
503
          <classpath>
504
            <path refid="compile.classpath"/>
505
          </classpath>
506
        </javac>
507
   </target>
508

    
509
   <target name="harvesterjar" depends="harvester"
510
           description="Compiles and jars harvester java code to harvester.jar in build dir">
511
       <delete file="${build.dir}/harvester.jar" />
512
       <jar jarfile="${build.dir}/harvester.jar" basedir="${build.dest}"
513
            includes="**/metacat/harvesterClient/" />
514
   </target>
515

    
516
   <target name="harvestListEditorDist" depends="harvesterjar"
517
           description="Prepares a distribution of the Harvest List Editor tool">
518
       <mkdir dir="${dist.dir.hle}"/>
519
       <delete dir="${ver.dir.hle}" />
520
       <mkdir dir="${ver.dir.hle}"/>
521
       <copy todir="${ver.dir.hle}" file="${build.dir}/harvester.jar"/>
522
       <copy todir="${ver.dir.hle}" file="lib/xercesImpl.jar"/>
523
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestList.xsd"/>
524
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.bat"/>
525
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.sh"/>
526
       <delete file="./harvest-list-editor-${release}.zip"/>
527
       <zip zipfile="./harvest-list-editor-${release}.zip" basedir="${ver.dir.hle}" />
528
       <delete file="./harvest-list-editor-${release}.tar.gz" />
529
       <tar tarfile="./harvest-list-editor-${release}.tar" basedir="${ver.dir.hle}" />
530
       <gzip zipfile="./harvest-list-editor-${release}.tar.gz"
531
             src="./harvest-list-editor-${release}.tar"/>
532
       <delete file="./harvest-list-editor-${release}.tar" />
533
   </target>
534

    
535
   <target  name="geteml" depends="getemlpre2,geteml2+" if="eml.required"
536
            description="Calls getemlpre2 and geteml2+ targets" />
537

    
538
   <target name="getemlpre2" depends="prepare" if="eml.required"
539
   description="Checks EML-beta6 out of cvs and copies dtds and xsl to your metacat cvs sandbox">
540
     <echo>Enter CVS password: </echo>
541
     <cvs cvsRoot="${cvsroot}"
542
          package="${eml-module}"
543
          tag="${eml-tag}"
544
          dest="${build.tmp}/eml_${eml-tag}" />
545
     <mkdir dir="lib/dtd" />
546
     <copy todir="lib/dtd" filtering="yes">
547
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}">
548
         <include name="*.dtd"/>
549
       </fileset>
550
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
551
     </copy>
552

    
553
     <copy todir="${style-common-cvsrelpath}" filtering="yes">
554
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}/style">
555
       <include name="**/*.xsl"/>
556
     </fileset>
557
     </copy>
558
   </target>
559

    
560
   <target name="geteml2+" depends="prepare" if="eml.required"
561
   description="Checks eml-2 out of cvs and copies schema and xsl to your metacat cvs sandbox">
562
     <echo>Enter CVS password: </echo>
563
     <cvs cvsRoot="${cvsroot}"
564
          package="${eml-module}"
565
          tag="${eml2_0_0-tag}"
566
          dest="${build.tmp}/eml_${eml2_0_0-tag}" />
567
     <mkdir dir="lib/schema/eml-2.0.0" />
568
     <copy todir="lib/schema/eml-2.0.0" filtering="yes">
569
       <fileset dir="${build.tmp}/eml_${eml2_0_0-tag}/${eml-module}">
570
         <include name="*.xsd"/>
571
       </fileset>
572

    
573
       <!-- shouldn't we have a mapper here like this??
574
       <mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
575

    
576
       Jing's code didn't nave one - does it need to be added?
577
       NOTE that eml-version is set to beta 6, so this would need changing -->
578

    
579
     </copy>
580
     <!-- <antcall target="copyxsl">
581
        <param name="cvs.tagname" value="${eml2_0_0-tag}" />
582
        <param name="dirname" value="eml-2.0.0" />
583
     </antcall> -->
584
   	
585
   	<!-- Checkout eml201 for given schema tag-->
586
     <echo>Enter CVS password: </echo>
587
     <cvs cvsRoot="${cvsroot}"
588
          package="${eml-module}"
589
          tag="${eml2_0_1-schema-tag}"
590
          dest="${build.tmp}/eml_${eml2_0_1-schema-tag}" />
591
     <mkdir dir="lib/schema/eml-2.0.1" />
592
     <copy todir="lib/schema/eml-2.0.1" filtering="yes">
593
       <fileset dir="${build.tmp}/eml_${eml2_0_1-schema-tag}/${eml-module}">
594
         <include name="*.xsd"/>
595
       </fileset>
596
     </copy>
597
   	
598
   	<!-- Checkout eml201 again for given style sheet tag-->
599
   	<echo>Enter CVS password: </echo>
600
   	     <cvs cvsRoot="${cvsroot}"
601
   	          package="${eml-module}"
602
   	          tag="${eml2_0_1-style-tag}"
603
   	          dest="${build.tmp}/eml_${eml2_0_1-style-tag}" />
604
     <antcall target="copyxsl">
605
        <param name="cvs.tagname" value="${eml2_0_1-style-tag}" />
606
        <param name="dirname" value="eml-2.0.1" />
607
     </antcall>
608
   </target>
609

    
610
   <target  name="copyxsl"
611
   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
612
     <delete file="${style-common-cvsrelpath}/${eml-css}"/>
613

    
614
     <copy todir="${style-common-cvsrelpath}/${dirname}" filtering="yes">
615
       <fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style/eml">
616
       <include name="**/*.xsl"/>
617
     </fileset>
618
     </copy>
619

    
620

    
621
     <!-- now copy default css from eml module and put it in style-common-path
622
          dir with a new name, so other skin-specific css can import it if reqd -->
623
     <copy file="${build.tmp}/eml_${cvs.tagname}/${eml-module}/${eml-module.default.css}"
624
           tofile="${style-common-cvsrelpath}/${eml-css}" />
625

    
626
   </target>
627

    
628

    
629

    
630
   <target name="register-schemas" depends="prepare"
631
   description="Registers the Schemas with a new Metacat instance">
632
     <echo/>
633
     <echo>Registering the Schemas with the new Metacat instance...</echo>
634
     <sql driver="${dbDriver}"
635
          url="${jdbc-connect}"
636
          userid="${user}"
637
          password="${password}"
638
          src="${build.src}/loaddtdschema.sql">
639
       <classpath>
640
         <path refid="compile.classpath"/>
641
       </classpath>
642
     </sql>
643
   </target>
644

    
645
   <target name="installdb" depends="prepare"
646
            description="Installs the database tables">
647
     <echo/>
648
     <echo>Installing the database tables...</echo>
649
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
650
     <echo/>
651
     <sql driver="${dbDriver}"
652
          url="${jdbc-connect}"
653
          userid="${user}"
654
          password="${password}"
655
          src="${build.src}/${install-sql}">
656
       <classpath>
657
         <path refid="compile.classpath"/>
658
       </classpath>
659
     </sql>
660
   </target>
661

    
662
   <target name="dropdb" depends="prepare"
663
            description="WARNING: Drops the database tables">
664
     <echo/>
665
     <echo>Dropping the database tables...</echo>
666
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
667
     <echo/>
668
     <sql driver="${dbDriver}"
669
          url="${jdbc-connect}"
670
          userid="${user}"
671
          password="${password}"
672
          src="${build.src}/drop-postgres.sql">
673
       <classpath>
674
         <path refid="compile.classpath"/>
675
       </classpath>
676
     </sql>
677
   </target>
678

    
679
   <target name="upgrade12" depends="prepare"
680
            description="Updates the database tables to upgrade to version 1.2">
681
     <echo/>
682
     <echo>Updating the database tables to upgrade to version 1.2...</echo>
683
     <sql driver="${dbDriver}"
684
          url="${jdbc-connect}"
685
          userid="${user}"
686
          password="${password}"
687
          src="${build.src}/${upgrade-1.2-sql}">
688
       <classpath>
689
         <path refid="compile.classpath"/>
690
       </classpath>
691
     </sql>
692
   </target>
693

    
694
   <target name="upgrade13" depends="prepare"
695
            description="Updates the database tables to upgrade to version 1.3">
696
     <echo/>
697
     <echo>Updating the database tables to upgrade to version 1.3...</echo>
698
     <sql driver="${dbDriver}"
699
          url="${jdbc-connect}"
700
          userid="${user}"
701
          password="${password}"
702
          src="${build.src}/${upgrade-1.3-sql}">
703
       <classpath>
704
         <path refid="compile.classpath"/>
705
       </classpath>
706
     </sql>
707
   </target>
708

    
709
   <target name="upgrade14" depends="prepare"
710
            description="Updates the database tables to upgrade to version 1.4">
711
     <echo/>
712
     <echo>Updating the database tables to upgrade to version 1.4...</echo>
713
     <sql driver="${dbDriver}"
714
          url="${jdbc-connect}"
715
          userid="${user}"
716
          password="${password}"
717
          src="${build.src}/${upgrade-1.4-sql}">
718
       <classpath>
719
         <path refid="compile.classpath"/>
720
       </classpath>
721
     </sql>
722
   </target>
723

    
724
   <target name="upgrade15" depends="sqlupgrade15"
725
           description="Updates the database tables to upgrade to version 1.5">
726
     <echo/>
727
     <echo>Updating the database tables to upgrade to version 1.5...</echo>
728
     <copy file="${srcdir}/upgrade_db_to_1_5.java"
729
           todir="${build.tmp}" filtering="yes"/>
730

    
731
     <javac srcdir="${build.tmp}"
732
            destdir="${build.tmp}"
733
            debug="${debug}"
734
            includes="upgrade_db_to_1_5.java">
735
       <classpath>
736
         <path refid="compile.classpath"/>
737
       </classpath>
738
     </javac>
739

    
740
     <java classname="upgrade_db_to_1_5">
741
       <classpath>
742
         <path refid="compile.classpath"/>
743
         <fileset dir="${build.tmp}"/>
744
       </classpath>
745
     </java>
746

    
747
   </target>
748

    
749
   <target name="upgrade16" depends="prepare"
750
            description="Updates the database tables from version 1.5 to version 1.6">
751
     <echo/>
752
     <echo>Updating the database tables to upgrade to version 1.6...</echo>
753
     <sql driver="${dbDriver}"
754
          url="${jdbc-connect}"
755
          userid="${user}"
756
          password="${password}"
757
          src="${build.src}/${upgrade-1.6-sql}">
758
       <classpath>
759
         <path refid="compile.classpath"/>
760
       </classpath>
761
     </sql>
762
   </target>
763

    
764
   <target name="upgrade17" depends="prepare"
765
            description="Updates the database tables from version 1.6 to version 1.7">
766
     <echo/>
767
     <echo>Updating the database tables to upgrade to version 1.7...</echo>
768
     <sql driver="${dbDriver}"
769
          url="${jdbc-connect}"
770
          userid="${user}"
771
          password="${password}"
772
          src="${build.src}/${upgrade-1.7-sql}">
773
       <classpath>
774
         <path refid="compile.classpath"/>
775
       </classpath>
776
     </sql>
777
   </target>
778
	
779
   <target name="upgrade18" depends="prepare"
780
	            description="Updates the database tables from version 1.7 to version 1.8">
781
	     <echo/>
782
	     <echo>Updating the database tables to upgrade to version 1.8...</echo>
783
	     <sql driver="${dbDriver}"
784
	          url="${jdbc-connect}"
785
	          userid="${user}"
786
	          password="${password}"
787
	          src="${build.src}/${upgrade-1.8-sql}">
788
	       <classpath>
789
	         <path refid="compile.classpath"/>
790
	       </classpath>
791
	     </sql>
792
   </target>
793

    
794
   <target name="sqlupgrade15" depends="prepare">
795
      <echo>Updating the database tables to upgrade to version 1.5 by sql command</echo>
796
      <sql driver="${dbDriver}"
797
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
798
          url="${jdbc-connect}"
799
          userid="${user}"
800
          password="${password}"
801
          src="${build.src}/${upgrade-1.5-sql}" />
802
      <sql driver="${dbDriver}"
803
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
804
          url="${jdbc-connect}"
805
          userid="${user}"
806
          password="${password}"
807
          rdbms="oracle"
808
          delimiter="/">
809
        <transaction>
810
           CREATE TRIGGER xml_returnfield_before_insert
811
           BEFORE INSERT ON xml_returnfield FOR EACH ROW
812
           BEGIN
813
              SELECT xml_returnfield_id_seq.nextval
814
                 INTO :new.returnfield_id
815
                 FROM dual;
816
           END;
817
           /
818
        </transaction>
819
        <transaction>
820
           CREATE TRIGGER xml_queryresult_before_insert
821
           BEFORE INSERT ON xml_queryresult FOR EACH ROW
822
           BEGIN
823
              SELECT xml_queryresult_id_seq.nextval
824
              INTO :new.queryresult_id
825
              FROM dual;
826
           END;
827
           /
828
        </transaction>
829
      </sql>
830
   </target>
831
	
832
   <target name="correctEML201Docs" depends="jar"
833
		            description="Uses the ant  task to run a JAVA patch class to correct invalide eml201 documents which were generated by wrong schema">
834
	   	<copy todir="${build.dir}" file="lib/metacat.properties" filtering="yes"/>    
835
	   	 <java classname="edu.ucsb.nceas.metacat.EML201DocumentCorrector" >
836
		         <classpath>
837
		          <path refid="compile.classpath"/>
838
		          <fileset dir="${build.dir}">
839
		            <include name="${name}.jar"/>
840
		          </fileset>
841
		        </classpath>
842
		      </java>
843
   </target>
844

    
845
   <target name="install-spatial" depends="jar,clientjar,harvesterjar"
846
           description="Installs spatial option for metacat">
847

    
848
      <property name="spatial.dir" value="./lib/spatial"/>
849
      <property name="spatial.geoserver.dir" value="${spatial.dir}/geoserver"/>
850
      <property name="spatial.webinf-mods" value="${spatial.dir}/WEB-INF"/>
851

    
852
      <!-- Copy geoserver libs into ${war.lib} -->
853
      <copy todir="${war.lib}" filtering="no">
854
        <fileset dir="${spatial.geoserver.dir}/WEB-INF/lib">
855
          <include name="**"/>
856
        </fileset>
857
      </copy>
858

    
859
      <!-- Copy everything in geoservers WEB-INF (except the libs) into ${war.webinf} -->
860
      <copy todir="${war.webinf}" filtering="no">
861
        <fileset dir="${spatial.geoserver.dir}/WEB-INF">
862
          <exclude name="lib/**"/>
863
          <exclude name="web.xml"/>
864
        </fileset>
865
      </copy>
866

    
867
      <!-- Copy the rest of the geoserver codebase into ${war.context} -->
868
      <copy todir="${war.context}" filtering="no">
869
        <fileset dir="${spatial.geoserver.dir}">
870
          <exclude name="WEB-INF/**"/>
871
          <exclude name="index.jsp"/>
872
        </fileset>
873
      </copy>
874

    
875
      <!-- Copy the geoserver index.jsp but rename it to avoid conflicting w/metcat   -->
876
     <copy file="${spatial.geoserver.dir}/WEB-INF/pages/index.jsp"
877
          tofile="${war.context}/geoserver.jsp"
878
          overwrite="true"
879
          filtering="no"/>
880

    
881
      <!-- Copy the rest of the modified geoserver web-inf files
882
      <copy todir="${war.webinf}" filtering="no">
883
        <fileset dir="${spatial.webinf-mods}">
884
          <exclude name="web.xml.combined"/>
885
        </fileset>
886
      </copy> -->
887

    
888
    </target>
889

    
890

    
891
   <target name="install" depends="install-ecogrid" description="* Full Install *">
892
       <mkdir dir="${datafilepath}" />
893
       <mkdir dir="${inlinedatafilepath}" />
894
       <chmod dir="${datafilepath}" perm="ug+w" />
895
       <mkdir dir="${temp-dir}"/>
896
       <chmod dir="${temp-dir}" perm="ug+w" />
897
       <copy file="${dist.dir}/${metacat.context}.war" todir="${deploy.dir}"/>
898
   	   <echo>If you enable ecogrid installation, please run "ant deploy-ecogrid" when installation or upgrade is done</echo> 
899
   </target>
900
	
901
   <target name="install-ecogrid" depends="war, get-ecogrid" if="enable.ecogrid"
902
			    description="Install Ecogrid Compentent">
903
   	  <copyfile src="lib/metacat.url" dest="${ecogrid-dir}/conf/MetacatImpl/classes/metacat.properties" forceoverwrite="true" filtering="yes"/>
904
   	  <ant antfile="build.xml" dir="${ecogrid-dir}" target ="clean" inheritall="false">
905
   	         <property name="context" value="${metacat.context}"/>
906
   	   	     <property name="target" value="${ecogrid-target-name}"/>
907
   	   	     <property name="metacat.dir" value="${metacat.dir}"/>
908
   	  </ant>
909
   	  <ant antfile="build.xml" dir="${ecogrid-dir}" target ="war" inheritall="false">
910
   	     <property name="context" value="${metacat.context}"/>
911
   	     <property name="target" value="${ecogrid-target-name}"/>
912
   	     <property name="metacat.dir" value="${metacat.dir}"/>
913
   	  </ant>
914
   	  <war destfile="${ecogrid-dir}/build/${metacat.context}.war" update="true">
915
  	      <webinf dir="${ecogrid-dir}/lib">
916
   	        <include name="server-config.wsdd"/>
917
   	      </webinf>
918
   	  </war>
919
   	  <copy file="${ecogrid-dir}/build/${metacat.context}.war" todir="${dist.dir}" overwrite="true"/>
920
   	  
921
   
922
   </target>
923
   
924
   <target name="get-ecogrid" depends="init" if="ecogrid.required" description="Check out ecogrid module">
925
	<echo>Enter CVS password: </echo>
926
	     <cvs cvsRoot="${cvsroot}"
927
	          package="${ecogrid-module}" dest="${ecogrid-module-dest-dir}"/>
928
   </target>
929
	
930
   	
931
   <target name="upgrade" depends="install"
932
          description="* Upgrade an existing metacat installation with a new version *">
933
       <unwar src="${deploy.dir}/${metacat.context}.war" dest="${deploy.dir}/${metacat.context}" />
934
   </target>
935
	
936
   <target name="deploy-ecogrid" depends="clean-ecogrid-server-config-wsdd" if="enable.ecogrid" description="Automately generate wsdd for ecogrid service">
937
   	 <ant antfile="build.xml" dir="${ecogrid-dir}" target ="deploy" inheritall="false">
938
   	   	 <property name="context" value="${metacat.context}"/>
939
   	   	 <property name="target" value="${ecogrid-target-name}"/>
940
   	     <property name="metacat.dir" value="${metacat.dir}"/>
941
   	     <property name="hostname" value="localhost"/>
942
   	     <property name="port" value="${config.port}"/>
943
   	 </ant>
944
   </target>
945
	
946
   <target name="clean-ecogrid-server-config-wsdd" depends="init" description="Automately generate wsdd for ecogrid service">
947
      <delete file="${deploy.dir}/${metacat.context}/WEB-INF/server-config.wsdd"/>
948
   </target>
949

    
950
   <target name="install-registry" depends="init,getConversionXSL"
951
            description="Install Registry">
952

    
953
      <copy file="${srcdir}/perl/register-dataset.cgi"
954
            todir="${inst.cgi.dir}" filtering="yes"/>
955
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
956

    
957
      <mkdir dir="${temp-dir}" />
958
      <copy todir="${temp-dir}" filtering="yes">
959
       <fileset dir="lib/style/common/emlb6toeml2">
960
         <include name="*.xsl"/>
961
         <include name="*.xml"/>
962
       </fileset>
963
      </copy>
964

    
965
      <echo message="Install Registry completed." />
966
   </target>
967

    
968
   <target name="install-ldap" depends="init">
969
      <copy file="${srcdir}/perl/ldapweb.cgi"
970
            todir="${inst.cgi.dir}" filtering="yes"/>
971
      <chmod file="${inst.cgi.dir}/ldapweb.cgi" perm="ugo+x" />
972
      <copy file="lib/ldapweb.cfg"
973
            todir="${inst.cgi.dir}" filtering="yes"/>
974
      <chmod file="${inst.cgi.dir}/ldapweb.cfg" perm="ugo+x" />
975
      <mkdir dir="${templates.dir}" />
976
      <copy todir="${templates.dir}" filtering="yes">
977
        <fileset dir="lib/style/common/templates">
978
            <include name="${defaultChangePass}"/>
979
            <include name="${defaultResetPass}"/>
980
            <include name="${changePassSuccess}"/>
981
            <include name="${resetPassSuccess}"/>
982
            <include name="${registerFailed}"/>
983
            <include name="${registerLter}"/>
984
            <include name="${registerMatch}"/>
985
            <include name="${registerSuccess}"/>
986
            <include name="${register}"/>
987
            <include name="${searchResults}"/>
988
            <include name="${defaultHeader}"/>
989
            <include name="${defaultFooter}"/>
990
            <include name="${responseForm}"/>
991
        	<include name="${ldapMainServerFailure}"/>       	
992
        </fileset>
993
      </copy>
994
      <echo message="ldapweb install complete." />
995
   </target>
996

    
997

    
998
   <target name="install-skin" depends="init"
999
            description="Install a Skin">
1000

    
1001
      <input message="Please enter name of the skin"
1002
             addproperty="skin-name"/>
1003

    
1004
      <mkdir dir="${installdir}/style/skins/${skin-name}" />
1005
      <copy todir="${installdir}/style/skins/${skin-name}" filtering="yes">
1006
       <fileset dir="lib/style/skins/${skin-name}">
1007
           <exclude name="**/*.png"/>
1008
           <exclude name="**/*.gif"/>
1009
           <exclude name="**/*.jpg"/>
1010
           <exclude name="**/CVS*"/>
1011
           <exclude name="**/.#*"/>
1012
       </fileset>
1013
      </copy>
1014
     <copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
1015
       <fileset dir="lib/style/skins/${skin-name}">
1016
           <include name="**/*.png"/>
1017
           <include name="**/*.gif"/>
1018
           <include name="**/*.jpg"/>
1019
           <exclude name="**/CVS*"/>
1020
           <exclude name="**/.#*"/>
1021
       </fileset>
1022
      </copy>
1023
      <copy todir="${installdir}/style/common" filtering="yes">
1024
       <fileset dir="lib/style/common">
1025
           <include name="*.js"/>
1026
           <include name="*.jsp"/>
1027
           <include name="*.css"/>
1028
           <exclude name="*.png"/>
1029
           <exclude name="*.gif"/>
1030
           <exclude name="*.jpg"/>
1031
           <exclude name="**/CVS*"/>
1032
           <exclude name="**/.#*"/>
1033
       </fileset>
1034
      </copy>
1035
      <!--
1036
      <mkdir dir="${installdir}/style/skins/${skin-name}/images" />
1037
     <copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
1038
       <fileset dir="lib/style/skins/${skin-name}/images">
1039
           <include name="*.png"/>
1040
           <include name="*.gif"/>
1041
           <include name="*.jpg"/>
1042
       </fileset>
1043
      </copy>
1044
      -->
1045

    
1046
      <echo message="Install Skin completed." />
1047
   </target>
1048

    
1049
   <target name="war" depends="warPrepare,warMSSQL,install-spatial"
1050
            description="Create a web archive (WAR) for servlet deployment">
1051
       <mkdir dir="${dist.dir}" />
1052
       <war destfile="${dist.dir}/${metacat.context}.war"
1053
            webxml="${build.war}/web.xml">
1054
         <fileset dir="${war.context}"/>
1055
         <lib dir="${war.lib}"/>
1056
         <webinf dir="${war.webinf}"/>
1057
       </war>
1058
   </target>
1059
	
1060
	
1061

    
1062
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
1063
            description="Prepare files for creating a web archive (WAR)">
1064

    
1065
       <property name="war.lib" value="${build.war}/lib" />
1066
       <property name="war.webinf" value="${build.war}/WEB-INF" />
1067
       <property name="war.context" value="${build.war}/${metacat.context}" />
1068
       <mkdir dir="${war.lib}" />
1069
       <mkdir dir="${war.webinf}" />
1070
       <mkdir dir="${war.context}" />
1071
       
1072
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
1073
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
1074
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
1075
       <copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
1076
       <copy todir="${war.lib}" filtering="no">
1077
         <fileset dir="lib">
1078
            <not>
1079
               <filename name="${jdbc-jar-name}"/>
1080
            </not>
1081
            <include name="*.jar"/>
1082
         </fileset>
1083
         <fileset dir="lib">
1084
           <include name="xalan.jar"/>
1085
           <include name="gwt*.jar"/>
1086
         </fileset>
1087
       </copy>
1088
       <copy file="lib/web.xml.${tomcatversion}"
1089
             tofile="${build.war}/web.xml" />
1090
       <copy file="lib/metacat.properties" todir="${war.webinf}"
1091
             filtering="yes" />
1092
   	   <copy file="lib/metacat.properties.metadata" todir="${war.webinf}"
1093
   	             filtering="no" />
1094
       <copy todir="${war.webinf}" filtering="yes">
1095
	   	  <fileset dir="lib">
1096
           <include name="skin.configs/**"/>
1097
		  </fileset>
1098
	   </copy>
1099
       <copy file="lib/log4j.properties" todir="${war.webinf}"
1100
             filtering="yes" />
1101
       <copy todir="${war.context}" filtering="no">
1102
         <fileset dir="lib">
1103
           <include name="**/*.jpg"/>
1104
           <include name="**/*.png"/>
1105
           <include name="**/*.gif"/>
1106
           <include name="LiveMap_30/**"/>
1107
         </fileset>
1108
       </copy>
1109
       <copy todir="${war.context}" filtering="yes">
1110
         <fileset dir="lib">
1111
           <exclude name="*.jar"/>
1112
           <exclude name="*.properties"/>
1113
         	<exclude name="*.metadata"/>
1114
           <exclude name="web.xml"/>
1115
           <exclude name="**/*.jpg"/>
1116
           <exclude name="**/*.png"/>
1117
           <exclude name="**/*.gif"/>
1118
           <exclude name="lsid_lib/**"/>
1119
           <exclude name="lsid_conf/**"/>
1120
           <exclude name="LiveMap_30/**"/>
1121
           <exclude name="skin.configs/**"/>
1122
           <exclude name="spatial/geoserver/**"/>
1123
           <exclude name="spatial/WEB-INF/**"/>
1124
         </fileset>
1125
       </copy>
1126
   </target>
1127

    
1128
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
1129
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
1130
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
1131
   </target>
1132

    
1133
   <target name="getConversionXSL" depends="prepare"
1134
            unless="styles.not.needed"
1135
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1136

    
1137
     <echo>Enter CVS password: </echo>
1138
     <cvs cvsRoot="${cvsroot}"
1139
          package="${eml-module}"
1140
          tag="${eml2_0_1-tag}"
1141
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
1142

    
1143
     <mkdir dir="lib/style/common/emlb6toeml2" />
1144
      <copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1145
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}/lib/beta6toeml2/xsl">
1146
         <include name="*.xsl"/>
1147
         <include name="*.xml"/>
1148
       </fileset>
1149
      </copy>
1150
   </target>
1151

    
1152
   <target name="testprep" depends="jar,clientjar,harvesterjar">
1153
      <mkdir dir="${build.tests}"/>
1154
      <copy todir="${build.tests}" filtering="yes">
1155
        <fileset dir="${testdir}">
1156
          <include name="edu/**"/>
1157
        </fileset>
1158
      </copy>
1159
   	<copy todir="${build.tests}" file="lib/metacat.properties" filtering="yes">
1160
   	        
1161
   	 </copy>
1162
      <!-- copy and compile the tests into a jar file -->
1163
      <javac srcdir="${build.tests}"
1164
             destdir="${build.tests}"
1165
             debug="on"
1166
             includes="**/*.java">
1167
        <classpath>
1168
          <path refid="compile.classpath"/>
1169
          <fileset dir="${build.dir}">
1170
            <include name="${name}.jar"/>
1171
            <include name="${name}-client.jar"/>
1172
            <include name="harvester.jar"/>
1173
          </fileset>
1174
        </classpath>
1175
      </javac>
1176

    
1177
      <jar jarfile="${build.dir}/${name}-junittests.jar"
1178
        basedir="${build.tests}"
1179
                includes="**/*.class" />
1180
   </target>
1181

    
1182
   <target name="test" depends="testprep"
1183
            description="Uses the ant junit task to run all JUnit tests">
1184

    
1185
      <!-- use the ant "junit" task to run JUnit tests. -->
1186
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1187
             haltonerror="no">
1188
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
1189
        <classpath>
1190
          <path refid="compile.classpath"/>
1191
          <fileset dir="${build.dir}">
1192
            <include name="${name}.jar"/>
1193
            <include name="${name}-client.jar"/>
1194
            <include name="harvester.jar"/>
1195
            <include name="${name}-junittests.jar"/>
1196
          </fileset>
1197
        </classpath>
1198

    
1199
        <formatter type="plain" />
1200

    
1201
        <batchtest fork="yes" todir="${build.dir}">
1202
          <fileset dir="${build.tests}">
1203
            <include name="**/*.class" />
1204
          </fileset>
1205
        </batchtest>
1206
     </junit>
1207
   </target>
1208

    
1209
    <target name="runonetest" depends="testprep"
1210
            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1211

    
1212
              <echo>testtorun: ${testtorun}</echo>
1213

    
1214
      <!-- use the ant "junit" task to run JUnit tests. -->
1215
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1216
             haltonerror="no" showoutput="yes">
1217
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
1218
        <classpath>
1219
          <path refid="compile.classpath"/>
1220
          <fileset dir="${build.dir}">
1221
            <include name="${name}.jar"/>
1222
            <include name="${name}-client.jar"/>
1223
            <include name="harvester.jar"/>
1224
            <include name="${name}-junittests.jar"/>
1225
          </fileset>
1226
        </classpath>
1227

    
1228
        <formatter type="plain" />
1229

    
1230
        <batchtest fork="yes" todir="${build.dir}">
1231
          <fileset dir="${build.tests}">
1232
            <include name="**/${testtorun}.class" />
1233
          </fileset>
1234
        </batchtest>
1235
     </junit>
1236
   </target>
1237

    
1238
   <target name="testharvester"
1239
           depends="testprep"
1240
           description="Uses the ant junit task to test only the Harvester code">
1241
     <junit printsummary="yes"
1242
            haltonfailure="off"
1243
            fork="yes"
1244
            haltonerror="off">
1245
        <classpath>
1246
          <path refid="compile.classpath"/>
1247
          <fileset dir="${build.dir}">
1248
            <include name="${name}.jar"/>
1249
            <include name="${name}-client.jar"/>
1250
            <include name="harvester.jar"/>
1251
            <include name="${name}-junittests.jar"/>
1252
          </fileset>
1253
        </classpath>
1254
       <formatter type="plain" />
1255
       <batchtest fork="yes" todir="${build.dir}">
1256
         <fileset dir="${build.tests}">
1257
           <include name="**/harvesterClient/*.class" />
1258
         </fileset>
1259
       </batchtest>
1260
     </junit>
1261
   </target>
1262

    
1263
  <target name="gethttpclient" depends="prepare"
1264
            description="checks out and compiles morpho httpclient code">
1265
  <!--mkdir dir="${morphosourcedir}" -->
1266
        <cvs cvsRoot="${cvsroot}"
1267
             package="morpho"
1268
             dest="." />
1269
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
1270
   </target>
1271

    
1272
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
1273
   <target name="nettest" depends="install"
1274
            description="compiles and runs the metacatnettest code">
1275

    
1276
      <echo>***********************************
1277
      Please run ant gethttpclient first!
1278
      ***********************************
1279
      </echo>
1280
      <!-- copy and compile the tests into a jar file -->
1281
      <mkdir dir="${build.metacatnettest}"/>
1282
      <javac srcdir="${junitnettestsdir}"
1283
             destdir="${build.metacatnettest}"
1284
             includes="**/*.java">
1285
        <classpath>
1286
          <path refid="compile.classpath"/>
1287
          <fileset dir="${build.dir}">
1288
            <include name="${name}.jar"/>
1289
          </fileset>
1290
        </classpath>
1291
      </javac>
1292

    
1293
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
1294
                    basedir="${build.metacatnettest}"
1295
                    includes="**/*.class" />
1296

    
1297
      <!-- use the ant "junit" task to run JUnit tests. -->
1298
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1299
             haltonerror="no">
1300
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1301
        <classpath>
1302
          <path refid="compile.classpath"/>
1303
          <fileset dir="${build.dir}">
1304
            <include name="${name}.jar"/>
1305
            <include name="${name}-junitnettests.jar"/>
1306
          </fileset>
1307
        </classpath>
1308

    
1309
        <formatter type="plain" />
1310

    
1311
        <batchtest fork="yes" todir="${build.dir}">
1312
          <fileset dir="${build.metacatnettest}">
1313
            <include name="**/*.class" />
1314
          </fileset>
1315
        </batchtest>
1316
     </junit>
1317
   </target>
1318

    
1319
   <target name="cleanweb" depends="clean"
1320
            description="deletes tomcat web context dir and all its contents">
1321
     <delete dir="${installdir}" />
1322
   </target>
1323

    
1324

    
1325
   <target name="clean" depends="init"
1326
            description="deletes build dir and files that can be regenerated form the release">
1327
       <delete dir="${build.dir}" />
1328
       <delete dir="${dist.dir}" />
1329
   </target>
1330

    
1331
   <target name="fullclean" depends="clean"
1332
            description="deletes even jars that depend on external sources such as stylesheets and jars">
1333
       <delete file="lib/httpclient.jar" />
1334
       <delete file="lib/utilities.jar" />
1335
       <delete includeEmptyDirs="true" failonerror="false">
1336
         <fileset dir="${style-common-cvsrelpath}">
1337
           <include name="${eml-css}" />
1338
           <include name="eml-*/*.xsl" />
1339
           <include name="eml-*" />
1340
         </fileset>
1341
       </delete>
1342
   </target>
1343

    
1344
   <target name="jdoc" depends="prepare"
1345
            description="generates javadoc documentation">
1346
       <javadoc packagenames="edu.ucsb.nceas.*"
1347
           sourcepath="${build.src}"
1348
           destdir="${build.javadocs}"
1349
           author="true"
1350
           version="true"
1351
           use="true"
1352
           windowtitle="${Name} API"
1353
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1354
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1355
         <classpath>
1356
           <path refid="compile.classpath"/>
1357
         </classpath>
1358
       </javadoc>
1359
   </target>
1360

    
1361
   <target name="dist"
1362
       depends="geteml,get-ecogrid,jar,protocol,jdoc,getConversionXSL,getutilities"
1363
            description="prepares a full release distribution">
1364
      <mkdir dir="${dist.dir}"/>
1365
      <delete dir="${ver.dir}" />
1366
      <mkdir dir="${ver.dir}"/>
1367
      <copy todir="${ver.dir}">
1368
        <fileset dir="."
1369
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/**"/>
1370
      </copy>
1371
      <copy todir="${ver.dir}" file="build.xml"/>
1372
      <copy todir="${ver.dir}" file="build.properties"/>
1373

    
1374
      <copy todir="${ver.dir}/docs" filtering="yes">
1375
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1376
      </copy>
1377
      <copy todir="${ver.dir}/docs" filtering="no">
1378
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1379
      </copy>
1380
      <copy todir="${ver.dir}/docs/dev">
1381
        <fileset dir="${build.dir}/docs"/>
1382
      </copy>
1383
      <copy todir="${ver.dir}/src">
1384
        <fileset dir="${build.dir}/src"/>
1385
      </copy>
1386
      <!-- copy loaddtdschemal.sql form src dir(which has the server token to ver.dir/src-->
1387
      <copy todir="${ver.dir}/src" file="${srcdir}/loaddtdschema.sql" overwrite="yes" filtering="no"/>
1388
      <copy todir="${ver.dir}/src" file="${srcdir}/upgrade-db-to-1.5.sql" overwrite="yes" filtering="no"/>
1389
      <!--
1390
      <delete dir="./${ver.dir}/${build.dir}"/>
1391
      <delete dir="./${ver.dir}/dist"/>
1392
      -->
1393
      <delete file="./${name}-${release}.zip"/>
1394
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1395
      <delete file="./${name}-${release}.tar.gz" />
1396
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1397
      <gzip zipfile="./${name}-${release}.tar.gz"
1398
                src="./${name}-${release}.tar"/>
1399
      <delete file="./${name}-${release}.tar" />
1400
  </target>
1401

    
1402
  <target name="distsrc" depends="dist"
1403
            description="prepares a source distribution">
1404
      <mkdir dir="${ver.src}"/>
1405
      <copy todir="${ver.src}">
1406
        <fileset dir="./src"/>
1407
      </copy>
1408
      <mkdir dir="${util.dir}"/>
1409
      <copy todir="${util.dir}">
1410
        <fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1411
      </copy>
1412
  	  
1413
  	  <mkdir dir="${ecogrid-dist-dir}"/>
1414
  	  <copy todir="${ecogrid-dist-dir}">
1415
  	        <fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1416
  	  </copy>
1417

    
1418
      <delete file="${ver.dir}/lib/utilities.jar"/>
1419

    
1420
      <delete file="./${name}-src-${release}.zip"/>
1421
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
1422
      <delete file="./${name}-src-${release}.tar.gz" />
1423
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
1424
      <gzip zipfile="./${name}-src-${release}.tar.gz"
1425
                src="./${name}-src-${release}.tar"/>
1426
      <delete file="./${name}-src-${release}.tar" />
1427
      <delete dir="${dist.dir}"/> 
1428
  </target>
1429

    
1430
   <target name="stylesheettest">
1431
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1432
      <param name="displaymodule" expression="${displaymodule}"/>
1433
      <param name="docid" expression="${input}"/>
1434
      <param name="entitytype" expression="${entitytype}"/>
1435
      <param name="entityindex" expression="${entityindex}"/>
1436
      <outputproperty name="method" value="html"/>
1437
      <outputproperty name="standalone" value="yes"/>
1438
      <outputproperty name="encoding" value="iso8859_1"/>
1439
      <outputproperty name="indent" value="yes"/>
1440
    </xslt>
1441
  </target>
1442

    
1443
 
1444
  <target name="compilewebclient" depends="prepare">
1445
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1446
  </target>
1447

    
1448
  <target name="runwebclient" depends="compilewebclient">
1449
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1450
           dir="${build.dest}" fork="yes"
1451
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1452
         <arg value="${serviceUrl}"/>
1453
         <arg value="${docid}"/>
1454
     </java>
1455
  </target>
1456
  
1457
  <target name="spatial_option" depends="prepare" description=" -- compiles code for the spatial option">
1458

    
1459
    <echo message="Compiling the metatcat shapefile creator"/>
1460
    <echo message="using the shapelib at: ${shapelib.dir}"/>
1461
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1462
     <arg line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1463
    </exec>
1464
  
1465
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1466
     <arg line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1467
    </exec>
1468
  </target>
1469

    
1470
    <!-- LSID Authority support -->
1471
    <patternset id="lsid.jars">
1472
        <include name="axis.jar" />
1473
        <include name="commons-discovery-0.2.jar" />
1474
        <include name="jaxrpc.jar" />
1475
        <include name="lsid-client-1.1.1.jar" />
1476
        <include name="lsid-server-1.1.1.jar" />
1477
        <include name="saaj.jar" />
1478
        <include name="wsdl4j-1.5.1.jar" />
1479
        <include name="activation.jar" />
1480
        <include name="castor-0.9.5.jar" />
1481
        <include name="dnsjava-1.3.2.jar" />
1482
        <include name="mail.jar" />
1483
        <include name="commons-logging-1.0.4.jar" />
1484
        <!-- These jars may be needed but seem to not actually be,
1485
             so leaving them out for now
1486
        <include name="axis-ant.jar" />
1487
        -->
1488
        <!--<include name="GenCastor.class" />-->
1489
    </patternset>
1490
    <patternset id="lib.jars">
1491
        <include name="httpclient.jar" />
1492
        <include name="log4j-1.2.12.jar" />
1493
        <include name="utilities.jar" />
1494
        <include name="xercesImpl.jar" />
1495
        <include name="xalan.jar" />
1496
        <include name="xml-apis.jar" />
1497
    </patternset>
1498

    
1499
    <path id="lsid.classpath">
1500
        <fileset dir="${lsid.lib.dir}">
1501
            <patternset refid="lsid.jars"/>
1502
        </fileset>
1503
        <fileset dir="${lib.dir}">
1504
            <patternset refid="lsid.jars"/>
1505
        </fileset>
1506
        <fileset dir="${lib.dir}">
1507
            <include name="xalan.jar" />
1508
            <include name="xml-apis.jar" />
1509
        </fileset>
1510
        <fileset dir="${build.dir}">
1511
            <include name="metacat-client.jar" />
1512
        </fileset>
1513
    </path>
1514

    
1515
    <filterset id="configFilters">
1516
        <filter token="LSID_AUTHORITY_HOSTNAME"
1517
                value="${config.hostname}" />
1518
        <filter token="LSID_AUTHORITY_PORT"
1519
                value="${config.port}" />
1520
        <filter token="METADATA_LABELS"
1521
                value="${config.metadataLabelLsid}" />
1522
        <filter token="METACAT_SERVER"
1523
                value="${config.metacatserver}" />
1524
        <filter token="LSID_AUTHORITY_STRING"
1525
                value="${config.lsidauthority}" />
1526
    </filterset>
1527
    
1528
    <target name="prepare-lsid"
1529
            depends="prepare,utilities,clientjar"
1530
            description="Configure files prior to compilation">
1531
        <mkdir dir="${lsid.build.dir}" />
1532
        <!-- Copy the properties file into the build -->
1533
        <copy file="${conf.dir}/metacat-lsid.properties"
1534
              tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1535
              overwrite="true">
1536
            <filterset refid="configFilters" />
1537
        </copy>
1538
        <copy file="${conf.dir}/log4j.properties"
1539
              tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1540
              overwrite="true">
1541
            <filterset refid="configFilters" />
1542
        </copy>
1543
        <!-- Copy config files into the build -->
1544
        <copy todir="${lsid.build.dir}/WEB-INF">
1545
            <fileset dir="${webinf.dir}"
1546
                     includes="**/*.wsdd" />
1547
        </copy>
1548
        <!-- Copy the metadata configuration files into the build -->
1549
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1550
        <copy todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1551
            <fileset dir="${conf.dir}"
1552
                     includes="**/*.xml" />
1553
            <fileset dir="${conf.dir}"
1554
                     includes="**/*.xslt" />
1555
            <filterset refid="configFilters" />
1556
        </copy>
1557
        <!-- Copy services files into the build -->
1558
        <mkdir dir="${lsid.build.dir}/services" />
1559
        <copy todir="${lsid.build.dir}/services">
1560
            <fileset dir="${services.dir}" />
1561
            <filterset refid="configFilters" />
1562
        </copy>
1563
        <!-- Copy axis files into the build -->
1564
        <mkdir dir="${lsid.build.dir}" />
1565
        <copy todir="${lsid.build.dir}">
1566
            <fileset dir="${conf.dir}/axis"
1567
                     excludes="*.properties"/>
1568
        </copy>
1569
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1570
        <copy todir="${lsid.build.dir}/WEB-INF/classes">
1571
            <fileset dir="${conf.dir}/axis"
1572
                     includes="*.properties"/>
1573
        </copy>
1574
    </target>
1575
    
1576
    <target name="compile-lsid"
1577
            depends="prepare-lsid"
1578
            description="Compile Java sources">
1579
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1580
        <javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1581
               destdir="${lsid.build.dir}/WEB-INF/classes"
1582
               debug="${compile.debug}"
1583
               deprecation="${compile.deprecation}"
1584
               optimize="${compile.optimize}">
1585
            <classpath refid="lsid.classpath" />
1586
        </javac>
1587
    </target>
1588
    
1589
    <target name="war-lsid"
1590
            depends="compile-lsid"
1591
            description="Create a war file for the application">
1592
        <mkdir dir="${dist.dir}" />
1593
        <war destfile="${dist.dir}/${authority.context}.war"
1594
             webxml="${webinf.dir}/web.xml">
1595
            <fileset dir="${lsid.build.dir}" />
1596
            <lib dir="${lsid.lib.dir}">
1597
                <patternset refid="lsid.jars"/>
1598
            </lib>
1599
            <lib dir="${lib.dir}">
1600
                <patternset refid="lib.jars"/>
1601
            </lib>
1602
            <lib dir="${lib.dir}">
1603
                <include name="xalan.jar" />
1604
                <include name="xml-apis.jar" />
1605
            </lib>
1606
            <lib dir="${build.dir}">
1607
                <include name="metacat-client.jar" />
1608
            </lib>
1609
        </war>
1610
    </target>
1611
    
1612
    <target name="deploy-lsid"
1613
            depends="war-lsid"
1614
            description="Deploy LSID war to servlet container">
1615
        <delete dir="${deploy.dir}/${authority.context}" />
1616
        <delete file="${deploy.dir}/${authority.context}.war" />
1617
        <mkdir dir="${deploy.dir}" />
1618
        <copy todir="${deploy.dir}">
1619
            <fileset dir="${dist.dir}" />
1620
        </copy>
1621
    </target>
1622
</project>
(5-5/5)