Project

General

Profile

1 113 jones
<?xml version="1.0"?>
2 1311 berkley
<!--
3 670 jones
  *   '$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 113 jones
  *
9 670 jones
  *    '$Author$'
10 1292 tao
  *    '$Date$'
11
  *    '$Revision$'
12 666 jones
  *
13 670 jones
  * Build file for the Ant cross-platform build system for metacat
14
  * See http://jakarta.apache.org for details on Ant
15 113 jones
  *
16 303 jones
  * usage: ant [compile|jar|install|jdoc]
17 666 jones
  *
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 1311 berkley
-->
32 329 jones
<project name="metacat" default="jar" basedir=".">
33 2277 jones
  <property environment="env"/>
34 1929 brooke
  <property file="build.properties"/>  <!-- USER SPECIFIC PROPS -->
35
36 2599 jones
  <!-- 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 2957 tao
44
  <!-- Determine if installed ecogrid -->
45
  <condition property="enable.ecogrid">
46
    <equals arg1="${install.ecogrid}" arg2="true" />
47
  </condition>
48 3034 perry
49 1929 brooke
  <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 931 jones
     <!-- Customize these properties if you are using oracle -->
63 1929 brooke
     <echo message="Using oracle..."/>
64 925 berkley
     <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
65
     <property name="dbAdapter" value="edu.ucsb.nceas.dbadapter.OracleAdapter"/>
66 2617 tao
     <property name="jdbc-jar-name" value="classes111.zip" />
67
     <property name="jdbc" value="${jdbc_base}/${jdbc-jar-name}" />
68 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
69
     <property name="other" value="yes"/>
70 2175 tao
     <property name="install-sql"
71 2103 jones
               value="xmltables.sql" />
72 2175 tao
     <property name="upgrade-1.2-sql"
73 2103 jones
               value="upgrade-db-to-1.2.sql" />
74 2175 tao
     <property name="upgrade-1.3-sql"
75 2103 jones
               value="upgrade-db-to-1.3.sql" />
76 2175 tao
     <property name="upgrade-1.4-sql"
77 2103 jones
               value="upgrade-db-to-1.4.sql" />
78 2518 sgarg
     <property name="upgrade-1.5-sql"
79 2431 sgarg
               value="upgrade-db-to-1.5.sql" />
80 2518 sgarg
     <property name="upgrade-1.6-sql"
81
               value="upgrade-db-to-1.6.sql" />
82 3128 perry
     <property name="upgrade-1.7-sql"
83
               value="upgrade-db-to-1.7.sql" />
84 925 berkley
   </target>
85 1311 berkley
86 1929 brooke
   <target name="postgresql" if="use-postgresql">
87 931 jones
     <!-- Customize these properties if you are using postgres -->
88 1929 brooke
     <echo message="Using PostgreSQL..."/>
89 925 berkley
     <property name="dbDriver" value="org.postgresql.Driver"/>
90 1311 berkley
     <property name="dbAdapter"
91 931 jones
               value="edu.ucsb.nceas.dbadapter.PostgresqlAdapter"/>
92 2610 tao
     <property name="jdbc-jar-name" value="postgresql-8.0-312.jdbc3.jar" />
93
     <property name="jdbc" value="lib/${jdbc-jar-name}" />
94 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
95
     <property name="other" value="yes"/>
96 2175 tao
     <property name="install-sql"
97 2277 jones
               value="xmltables-postgres.sql" />
98 2175 tao
     <property name="upgrade-1.2-sql"
99 2277 jones
               value="upgrade-db-to-1.2-postgres.sql" />
100 2175 tao
     <property name="upgrade-1.3-sql"
101 2277 jones
               value="upgrade-db-to-1.3-postgres.sql" />
102 2175 tao
     <property name="upgrade-1.4-sql"
103 2277 jones
               value="upgrade-db-to-1.4-postgres.sql" />
104 2518 sgarg
     <property name="upgrade-1.5-sql"
105 2431 sgarg
               value="upgrade-db-to-1.5-postgres.sql" />
106 2518 sgarg
     <property name="upgrade-1.6-sql"
107
               value="upgrade-db-to-1.6-postgres.sql" />
108 3128 perry
     <property name="upgrade-1.7-sql"
109
               value="upgrade-db-to-1.7-postgres.sql" />
110 1744 tao
    </target>
111 2175 tao
112 1929 brooke
   <target name="sqlserver" if="use-sqlserver">
113 1739 tao
     <!-- Customize these properties if you are using SQL server -->
114 1929 brooke
     <echo message="Using SQL Server..."/>
115 1739 tao
     <property name="dbDriver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
116
     <property name="dbAdapter"
117
               value="edu.ucsb.nceas.dbadapter.SqlserverAdapter"/>
118 2296 sgarg
     <property name="jdbc" value="${jdbc_base}/msbase.jar" />
119
     <property name="jdbc-add1" value="${jdbc_base}/msutil.jar" />
120
     <property name="jdbc-add2" value="${jdbc_base}/mssqlserver.jar" />
121 1744 tao
     <!-- Property to indicate is a MSSQL installation-->
122
     <property name="MSSQL" value="yes"/>
123 2175 tao
     <property name="install-sql"
124 2118 costa
               value="xmltables-sqlserver.sql" />
125 1739 tao
   </target>
126 1311 berkley
127 1929 brooke
   <target name="config" depends="check-db,oracle,postgresql,sqlserver">
128 1814 tao
      <!-- usr for client testing, generally you don't need change-->
129 2991 berkley
      <property name="mcuser" value="uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org"/>
130
      <property name="mcpassword" value="kepler"/>
131 1801 tao
      <property name="mcanotheruser" value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
132
      <property name="mcanotherpassword" value=""/>
133
134 1827 jones
      <property name="debug" value="on" />
135 2053 sgarg
      <property name="debuglevel" value="55" />
136 1716 berkley
137 1522 berkley
      <property name="morphosourcedir" value="../morpho" />
138 1570 tao
      <property name="defaultcontenttype" value="application/octet-stream" />
139 1780 jones
      <property name="utilitiesdir" value="../utilities" />
140 2175 tao
141 1941 brooke
      <echo>*********** tomcatversion = ${tomcatversion}</echo>
142
      <echo>*********** set jsdk to ${jsdk}</echo>
143 1103 tao
  </target>
144
145 931 jones
   <target name="init" depends="config">
146 2631 tao
      <path id="compile.classpath">
147
        <pathelement location="${jsdk}"/>
148
        <pathelement location="lib" />
149
        <fileset dir="lib">
150
          <include name="*.jar"/>
151
        </fileset>
152 3059 berkley
	<fileset dir="lib">
153
           <include name="xalan.jar"/>
154 3030 sgarg
         </fileset>
155 2631 tao
       <fileset dir="lib/lsid_lib">
156
         <include name="*.jar"/>
157
       </fileset>
158
       <fileset dir="${jdbc_base}">
159
         <include name="${jdbc-jar-name}"/>
160
          <include name="msbase.jar"/>
161
          <include name="msutil.jar"/>
162
          <include name="mssqlserver.jar"/>
163 3034 perry
       </fileset>
164
165
        <!-- Include geoserver, geotools, et. al. -->
166
        <fileset dir="lib/spatial/geoserver/WEB-INF/lib">
167
          <include name="*.jar"/>
168 2631 tao
        </fileset>
169 3034 perry
        <pathelement location="lib/spatial/geoserver/WEB-INF/classes"/>
170
171 2631 tao
       </path>
172
173 931 jones
      <!-- It is less likely you'll need to make any changes from here down,
174
           but customization is possible -->
175 2737 jones
      <property name="installdir"          value="${deploy.dir}/${metacat.context}" />
176
      <property name="temp-dir"            value="/tmp/${metacat.context}" />
177 1929 brooke
      <property name="name"                value="metacat"/>
178
      <property name="Name"                value="MetaCat"/>
179
      <property name="debugprefix"         value="${Name}:"/>
180 3130 perry
      <property name="release"             value="1.7.0"/>
181 2737 jones
      <property name="replication-path"    value="/${metacat.context}/servlet/replication"/>
182
      <property name="harvester-registration-login-path" value="/${metacat.context}/harvesterRegistrationLogin"/>
183
      <property name="harvester-registration-path"       value="/${metacat.context}/harvesterRegistration"/>
184
      <property name="servlet-path"        value="/${metacat.context}/metacat"/>
185
      <property name="html-path"           value="/${metacat.context}"/>
186 2974 jones
      <property name="systemidserver"      value="${http.protocol}://${httpserver}"/>
187 3095 cjones
      <property name="style-common-relpath" value="/style/common"/>
188
      <property name="style-shared-relpath" value="/style/shared"/>
189
      <property name="style-common-cvsrelpath" value="lib${style-common-relpath}"/>
190
      <property name="style-common-fullpath" value="/${installdir}${style-common-relpath}"/>
191 2343 sgarg
      <property name="templates.dir"       value="${style-common-fullpath}/templates"/>
192 3095 cjones
      <property name="style-common-path"   value="/${metacat.context}${style-common-relpath}"/>
193
      <property name="style-shared-path"   value="/${metacat.context}${style-shared-relpath}"/>
194 1929 brooke
      <property name="style-skins-relpath" value="/style/skins"/>
195 2737 jones
      <property name="style-skins-path"    value="/${metacat.context}${style-skins-relpath}"/>
196 1929 brooke
      <property name="replication-log"     value="/tmp/metacatreplication.log"/>
197 1579 tao
      <property name="replicationerrorlog" value="/tmp/metacatreplication.err"/>
198 2737 jones
      <property name="config-dir"          value="${deploy.dir}/${style-skins-path}" />
199 2461 sgarg
      <property name="util-module"         value="utilities" />
200 1929 brooke
      <property name="eml-module"          value="eml" />
201
      <property name="eml-version"         value="2.0.0beta6" />
202
      <property name="eml-tag"             value="EML_2_0_0_BETA_6_FOR_METACAT" />
203 2232 sgarg
      <property name="eml2_0_0-tag"        value="RELEASE_EML_2_0_0_UPDATE_1" />
204 3012 sgarg
      <property name="eml2_0_1-tag"        value="RELEASE_EML_2_0_1_UPDATE_3" />
205 2228 sgarg
      <property name="eml2_0_0namespace"   value="eml://ecoinformatics.org/eml-2.0.0" />
206
      <property name="eml2_0_1namespace"   value="eml://ecoinformatics.org/eml-2.0.1" />
207
      <property name="eml2_1_0namespace"   value="eml://ecoinformatics.org/eml-2.1.0" />
208 1929 brooke
      <property name="stmmlnamespace"      value="http://www.xml-cml.org/schema/stmml" />
209 1933 brooke
      <property name="eml-css"             value="eml_xsl.css"/>
210
      <property name="eml-module.default.css"
211
                                           value="default.css"/>
212 2965 tao
213 1929 brooke
      <!-- Config for registry variables -->
214 1933 brooke
      <property name="scope"               value="obfs"/>
215
      <property name="responseForm"        value="genericResponse.tmpl"/>
216
      <property name="entryForm"           value="entryForm.tmpl"/>
217
      <property name="guide"               value="genericGuide.tmpl"/>
218 2781 sgarg
      <property name="loginForm"           value="loginForm.tmpl"/>
219 2343 sgarg
      <property name="confirmData"         value="confirmData.tmpl"/>
220
      <property name="deleteData"          value="deleteData.tmpl"/>
221
      <property name="genericHeader"       value="genericHeader.tmpl"/>
222
      <property name="genericFooter"       value="genericFooter.tmpl"/>
223
      <property name="adminname"           value="KNB Support"/>
224
      <property name="recipient"           value="knb-software\@nceas.ucsb.edu"/>
225 1929 brooke
226 2343 sgarg
      <property name="defaultStage"        value="initregister"/>
227
      <property name="defaultHeader"       value="genericHeader.tmpl"/>
228
      <property name="defaultFooter"       value="genericFooter.tmpl"/>
229
      <property name="defaultChangePass"   value="ldapChangePass.tmpl"/>
230
      <property name="defaultResetPass"    value="ldapResetPass.tmpl"/>
231
      <property name="changePassSuccess"   value="ldapChangePassSuccess.tmpl"/>
232
      <property name="resetPassSuccess"    value="ldapResetPassSuccess.tmpl"/>
233
      <property name="registerFailed"      value="ldapRegisterFailed.tmpl"/>
234
      <property name="registerLter"        value="ldapRegisterLter.tmpl"/>
235
      <property name="registerMatch"       value="ldapRegisterMatch.tmpl"/>
236
      <property name="registerSuccess"     value="ldapRegisterSuccess.tmpl"/>
237
      <property name="register"            value="ldapRegister.tmpl"/>
238
      <property name="searchResults"       value="searchResults.tmpl"/>
239
240
      <filter token="scope"                value="${scope}"/>
241
      <filter token="responseForm"         value="${responseForm}"/>
242
      <filter token="entryForm"            value="${entryForm}"/>
243
      <filter token="guide"                value="${guide}"/>
244 2781 sgarg
      <filter token="loginForm"            value="${loginForm}"/>
245 2343 sgarg
      <filter token="confirmData"          value="${confirmData}"/>
246
      <filter token="deleteData"           value="${deleteData}"/>
247
      <filter token="genericHeader"        value="${genericHeader}"/>
248
      <filter token="genericFooter"        value="${genericFooter}"/>
249
      <filter token="adminname"            value="${adminname}"/>
250
      <filter token="recipient"            value="${recipient}"/>
251
252
      <filter token="ldapurl"              value="ldap.ecoinformatics.org"/>
253
      <filter token="ldapSearchBase"       value="dc=ecoinformatics,dc=org"/>
254
      <filter token="ldap_user"            value="cn=Manager,dc=ecoinformatics,dc=org"/>
255
      <filter token="ldap_password"        value="ldap_password"/>
256 2870 sgarg
      <filter token="mailhost"             value="localhost"/>
257 2343 sgarg
      <filter token="sender"               value="knb-software\@nceas.ucsb.edu"/>
258 2974 jones
      <filter token="cgiurl"               value="${cgi-prefix}/ldapweb.cgi"/>
259 2343 sgarg
260 882 jones
      <filter token="docrooturl" value="./" />
261 2356 sgarg
      <filter token="database" value="${database}" />
262 588 berkley
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
263 882 jones
      <filter token="dbDriver" value="${dbDriver}"/>
264 915 berkley
      <filter token="dbAdapter" value="${dbAdapter}"/>
265 614 bojilova
      <filter token="install-dir" value="${installdir}"/>
266 1929 brooke
      <filter token="temp-dir" value="${temp-dir}"/>
267 586 berkley
      <filter token="server" value="${server}"/>
268 977 tao
      <filter token="systemidserver" value="${systemidserver}"/>
269 1929 brooke
      <filter token="cgi-prefix" value="${cgi-prefix}"/>
270
      <filter token="ldapUrl" value="${ldapUrl}"/>
271 586 berkley
      <filter token="replication-log" value="${replication-log}"/>
272 1579 tao
      <filter token="replicationerrorlog" value="${replicationerrorlog}"/>
273 348 jones
      <filter token="servlet-path" value="${servlet-path}"/>
274 359 bojilova
      <filter token="html-path" value="${html-path}"/>
275 362 jones
      <filter token="user" value="${user}"/>
276
      <filter token="password" value="${password}"/>
277 1783 jones
      <filter token="mcuser" value="${mcuser}"/>
278
      <filter token="mcpassword" value="${mcpassword}"/>
279 1801 tao
      <filter token="mcanotheruser" value="${mcanotheruser}"/>
280
      <filter token="mcanotherpassword" value="${mcanotherpassword}"/>
281 1929 brooke
      <filter token="knb-site-url" value="${knb-site-url}"/>
282 1933 brooke
      <filter token="eml-css" value="${eml-css}"/>
283 1929 brooke
      <filter token="style-skins-relpath" value="${style-skins-relpath}"/>
284
      <filter token="style-skins-path" value="${style-skins-path}"/>
285
      <filter token="style-common-relpath" value="${style-common-relpath}"/>
286
      <filter token="style-common-fullpath" value="${style-common-fullpath}"/>
287
      <filter token="style-common-path" value="${style-common-path}"/>
288 3095 cjones
      <filter token="style-shared-path" value="${style-shared-path}"/>
289 2343 sgarg
      <filter token="templates.dir" value="${templates.dir}"/>
290
291 1929 brooke
      <!-- The "style-path" filter is used by the eml xsl stylesheets!!  -->
292
      <filter token="style-path" value="${style-skins-path}"/>
293 525 berkley
      <filter token="replication-path" value="${replication-path}"/>
294 2299 costa
      <filter token="harvester-registration-login-path" value="${harvester-registration-login-path}"/>
295
      <filter token="harvester-registration-path" value="${harvester-registration-path}"/>
296 832 jones
      <filter token="config-dir" value="${config-dir}"/>
297
      <filter token="default-style" value="${default-style}"/>
298 877 jones
      <filter token="eml-version" value="${eml-version}"/>
299 2175 tao
      <filter token="eml2_0_0namespace" value="${eml2_0_0namespace}"/>
300 2228 sgarg
      <filter token="eml2_0_1namespace" value="${eml2_0_1namespace}"/>
301 2175 tao
      <filter token="eml2_1_0namespace" value="${eml2_1_0namespace}"/>
302 1718 tao
      <filter token="stmmlnamespace" value="${stmmlnamespace}"/>
303 2737 jones
      <filter token="context" value="${metacat.context}"/>
304 2961 tao
   	  <filter token="httpserver" value="${httpserver}"/>
305 1292 tao
      <filter token="forcereplicationwaitingtime" value="${forcereplicationwaitingtime}" />
306 1051 tao
      <filter token="debuglevel" value="${debuglevel}" />
307 1079 tao
      <filter token="datafilepath" value="${datafilepath}" />
308 1455 tao
      <filter token="inlinedatafilepath" value="${inlinedatafilepath}" />
309 1522 berkley
      <filter token="defaultcontenttype" value="${defaultcontenttype}" />
310 1538 berkley
      <filter token="debugprefix" value="${debugprefix}"/>
311 2308 jones
      <filter token="administrators" value="${administrators}"/>
312 2577 sgarg
      <filter token="moderators" value="${moderators}"/>
313
      <filter token="allowedSubmitters" value="${allowedSubmitters}"/>
314
      <filter token="deniedSubmitters" value="${deniedSubmitters}"/>
315 2872 sgarg
      <filter token="indexPaths" value="${indexPaths}"/>
316 1487 tao
317 2343 sgarg
      <filter token="defaultStage" value="${defaultStage}"/>
318
      <filter token="defaultHeader" value="${defaultHeader}"/>
319
      <filter token="defaultFooter" value="${defaultFooter}"/>
320
      <filter token="defaultChangePass" value="${defaultChangePass}"/>
321
      <filter token="defaultResetPass" value="${defaultResetPass}"/>
322
      <filter token="changePassSuccess" value="${changePassSuccess}"/>
323
      <filter token="resetPassSuccess" value="${resetPassSuccess}"/>
324
      <filter token="registerFailed" value="${registerFailed}"/>
325
      <filter token="registerLter" value="${registerLter}"/>
326
      <filter token="registerMatch" value="${registerMatch}"/>
327
      <filter token="registerSuccess" value="${registerSuccess}"/>
328
      <filter token="register" value="${register}"/>
329
      <filter token="searchResults" value="${searchResults}"/>
330 2549 tao
331
   	  <filter token="timedreplication" value="${timedreplication}" />
332
   	  <filter token="firsttimedreplication" value="${firsttimedreplication}" />
333
   	  <filter token="timedreplicationinterval" value="${timedreplicationinterval}" />
334
335
   	  <property name="srcdir" value="./src" />
336 2599 jones
   	  <property name="lib.dir" value="./lib" />
337 1783 jones
      <property name="testdir" value="./test" />
338 2277 jones
      <property name="testtorun" value="BuildIndexTest" />
339 1116 tao
      <property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
340
      <property name="junitnettestsdir" value="./test/edu/ucsb/nceas/metacatnettest" />
341 348 jones
      <property name="build.dir" value="./build"/>
342
      <property name="build.src" value="${build.dir}/src"/>
343
      <property name="build.dest" value="${build.dir}/classes"/>
344 516 jones
      <property name="build.docs" value="${build.dir}/docs"/>
345 348 jones
      <property name="build.samples" value="${build.dir}/samples"/>
346
      <property name="build.tests" value="${build.dir}/tests"/>
347 1778 tao
      <property name="build.tmp" value="${build.dir}/tmp"/>
348 1116 tao
      <property name="build.metacattest" value="${build.tests}/metacattest"/>
349
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
350 348 jones
      <property name="build.data" value="${build.dir}/data"/>
351 806 jones
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
352 1952 jones
      <property name="build.war" value="${build.dir}/war"/>
353 348 jones
354 882 jones
      <property name="dist.dir" value="dist"/>
355 806 jones
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
356
      <property name="ver.src" value="${ver.dir}/src"/>
357 2461 sgarg
      <property name="util.dir" value="${dist.dir}/${util-module}"/>
358 2401 costa
	  <!-- directories for creating a Harvest List Editor distribution -->
359
      <property name="dist.dir.hle" value="disthle"/>
360
      <property name="ver.dir.hle" value="${dist.dir.hle}/harvest-list-editor-${release}"/>
361 2965 tao
362
363
   	  <property name="ecogrid-target-name" value="metacatImpl"/>
364
   	  <property name="ecogrid-module-dest-dir" value =".."/>
365
   	  <property name="ecogrid-module" value="seek/projects/ecogrid"/>
366
   	  <property name="ecogrid-dist-dir" value="${dist.dir}/${ecogrid-module}"/>
367
   	  <property name="ecogrid-dir" value="${ecogrid-module-dest-dir}/${ecogrid-module}"/>
368 806 jones
369 254 jones
      <property name="package.home" value="edu/ucsb/nceas/metacat" />
370 2317 jones
      <condition property="utilities.required">
371
        <or>
372
          <not><available file="lib/httpclient.jar"/></not>
373
          <not><available file="lib/utilities.jar"/></not>
374
        </or>
375
      </condition>
376 2318 jones
      <condition property="eml.required">
377
        <or>
378
          <not><available file="lib/schema/eml-2.0.1/eml.xsd"/></not>
379
          <not><available file="lib/schema/eml-2.0.0/eml.xsd"/></not>
380
          <not><available file="lib/dtd/eml-dataset-2.0.0beta6.dtd"/></not>
381
        </or>
382
      </condition>
383 2965 tao
384
      <condition property="ecogrid.required">
385
      	   <or>
386
             <not><available file="${ecogrid-dir}/build.properties"/></not>
387
             <not><available file="${ecogrid-dir}/buildfiles/metacatImpl.xml"/></not>
388
           </or>
389
      </condition>
390 2599 jones
391 113 jones
   </target>
392 1311 berkley
393 348 jones
   <target name="prepare" depends="init">
394
      <mkdir dir="${build.dir}"/>
395
      <mkdir dir="${build.src}"/>
396
      <mkdir dir="${build.dest}"/>
397 516 jones
      <mkdir dir="${build.javadocs}"/>
398 1778 tao
      <mkdir dir="${build.tmp}"/>
399 348 jones
400 822 jones
      <copy todir="${build.src}" filtering="yes">
401
        <fileset dir="${srcdir}">
402
          <include name="edu/**"/>
403
          <include name="com/**"/>
404 877 jones
          <include name="**/*.sql"/>
405 822 jones
          <exclude name="**/CVS*"/>
406
          <exclude name="**/.#*"/>
407
        </fileset>
408
      </copy>
409 2344 sgarg
      <available file="lib/style/common/emlb6toeml2" type="dir"
410 1954 jones
                 property="styles.not.needed"/>
411 348 jones
   </target>
412
413 1939 brooke
   <target name="compile" depends="prepare,utilities"
414 1986 jones
    description="Compiles java code to build dir, and copies metacat props files there">
415 1939 brooke
416 1311 berkley
       <javac srcdir="${build.src}"
417
              destdir="${build.dest}"
418 1827 jones
              debug="${debug}"
419 2599 jones
              excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java">
420
        <classpath>
421
          <path refid="compile.classpath"/>
422
        </classpath>
423
      </javac>
424 1311 berkley
   </target>
425 113 jones
426 2322 jones
   <target name="jar" depends="compile,geteml"
427 1939 brooke
    description="Compiles and jars metacat java code to metacat.jar in build dir">
428
429 353 jones
       <delete file="${build.dir}/${name}.jar" />
430 635 jones
       <jar jarfile="${build.dir}/${name}.jar" basedir="${build.dest}"
431 2135 costa
            excludes="**/protocols/ **/harvesterClient/" />
432 1311 berkley
   </target>
433
434 1939 brooke
   <target name="protocol" depends="compile"
435
    description="Compiles and jars protocol java code to protocol.jar in build dir">
436 635 jones
       <delete file="${build.dir}/protocol.jar" />
437
       <jar jarfile="${build.dir}/protocol.jar" basedir="${build.dest}"
438
            includes="**/protocols/" />
439 1311 berkley
   </target>
440 113 jones
441 2317 jones
   <target name="utilities" depends="config" if="utilities.required">
442 1796 jones
     <ant dir="${utilitiesdir}" target="clean" inheritAll="false" />
443
     <ant dir="${utilitiesdir}" target="jar" inheritAll="false" />
444 1780 jones
     <copy file="${utilitiesdir}/lib/httpclient.jar" todir="lib" />
445
     <copy file="${utilitiesdir}/build/utilities.jar" todir="lib" />
446
   </target>
447
448 2461 sgarg
   <target name="getutilities" depends="prepare"
449
   description="Checks utility out of cvs and copies it to your metacat cvs sandbox">
450
     <echo>Enter CVS password: </echo>
451
     <cvs cvsRoot="${cvsroot}"
452 2468 sgarg
          package="${util-module}"
453 2461 sgarg
          dest="${build.tmp}" />
454
   </target>
455
456 1939 brooke
   <target name="client" depends="utilities, prepare"
457
    description="Compiles metacat-client java code to build dir">
458 1780 jones
       <javac srcdir="${build.src}"
459
              destdir="${build.dest}"
460 2599 jones
              includes="edu/ucsb/nceas/metacat/client/*">
461
          <classpath>
462
            <path refid="compile.classpath"/>
463
          </classpath>
464
        </javac>
465 1780 jones
   </target>
466
467 1939 brooke
   <target name="clientjar" depends="client"
468
    description="Compiles and jars metacat-client java code to metacat-client.jar in build dir">
469 1780 jones
       <delete file="${build.dir}/${name}-client.jar" />
470
       <jar jarfile="${build.dir}/${name}-client.jar" basedir="${build.dest}"
471
            includes="**/metacat/client/" />
472
   </target>
473
474 2748 costa
    <target name="advancedsearchjar" depends="compile"
475
            description="Compiles and jars advanced search Java code to advancedsearch.jar in build dir">
476
        <delete file="${build.dir}/advancedsearch.jar" />
477
        <jar jarfile="${build.dir}/advancedsearch.jar" basedir="${build.dest}"
478
             includes="**/metacat/advancedsearch/" />
479
    </target>
480
481 2059 costa
   <target name="harvester" depends="client"
482 1950 costa
           description="Compiles harvester java code to build dir">
483
       <javac srcdir="${build.src}"
484
              destdir="${build.dest}"
485 2599 jones
              includes="edu/ucsb/nceas/metacat/harvesterClient/*">
486
          <classpath>
487
            <path refid="compile.classpath"/>
488
          </classpath>
489
        </javac>
490 1950 costa
   </target>
491
492
   <target name="harvesterjar" depends="harvester"
493 2059 costa
           description="Compiles and jars harvester java code to harvester.jar in build dir">
494
       <delete file="${build.dir}/harvester.jar" />
495
       <jar jarfile="${build.dir}/harvester.jar" basedir="${build.dest}"
496 1950 costa
            includes="**/metacat/harvesterClient/" />
497
   </target>
498
499 2369 costa
   <target name="harvestListEditorDist" depends="harvesterjar"
500
           description="Prepares a distribution of the Harvest List Editor tool">
501 2401 costa
       <mkdir dir="${dist.dir.hle}"/>
502
       <delete dir="${ver.dir.hle}" />
503
       <mkdir dir="${ver.dir.hle}"/>
504
       <copy todir="${ver.dir.hle}" file="${build.dir}/harvester.jar"/>
505
       <copy todir="${ver.dir.hle}" file="lib/xercesImpl.jar"/>
506
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestList.xsd"/>
507
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.bat"/>
508
       <copy todir="${ver.dir.hle}" file="lib/harvester/harvestListEditor.sh"/>
509
       <delete file="./harvest-list-editor-${release}.zip"/>
510
       <zip zipfile="./harvest-list-editor-${release}.zip" basedir="${ver.dir.hle}" />
511
       <delete file="./harvest-list-editor-${release}.tar.gz" />
512
       <tar tarfile="./harvest-list-editor-${release}.tar" basedir="${ver.dir.hle}" />
513
       <gzip zipfile="./harvest-list-editor-${release}.tar.gz"
514
             src="./harvest-list-editor-${release}.tar"/>
515
       <delete file="./harvest-list-editor-${release}.tar" />
516 2369 costa
   </target>
517
518 2318 jones
   <target  name="geteml" depends="getemlpre2,geteml2+" if="eml.required"
519 1939 brooke
            description="Calls getemlpre2 and geteml2+ targets" />
520
521 2318 jones
   <target name="getemlpre2" depends="prepare" if="eml.required"
522 1939 brooke
   description="Checks EML-beta6 out of cvs and copies dtds and xsl to your metacat cvs sandbox">
523 1612 tao
     <echo>Enter CVS password: </echo>
524
     <cvs cvsRoot="${cvsroot}"
525
          package="${eml-module}"
526
          tag="${eml-tag}"
527 1939 brooke
          dest="${build.tmp}/eml_${eml-tag}" />
528 1612 tao
     <mkdir dir="lib/dtd" />
529
     <copy todir="lib/dtd" filtering="yes">
530 1939 brooke
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}">
531 1612 tao
         <include name="*.dtd"/>
532
       </fileset>
533
       <mapper type="glob" from="eml-*.dtd" to="eml-*-${eml-version}.dtd" />
534
     </copy>
535 2228 sgarg
536
     <copy todir="${style-common-cvsrelpath}" filtering="yes">
537
       <fileset dir="${build.tmp}/eml_${eml-tag}/${eml-module}/style">
538
       <include name="**/*.xsl"/>
539
     </fileset>
540
     </copy>
541 1939 brooke
   </target>
542
543 2318 jones
   <target name="geteml2+" depends="prepare" if="eml.required"
544 1939 brooke
   description="Checks eml-2 out of cvs and copies schema and xsl to your metacat cvs sandbox">
545
     <echo>Enter CVS password: </echo>
546 1612 tao
     <cvs cvsRoot="${cvsroot}"
547
          package="${eml-module}"
548 2228 sgarg
          tag="${eml2_0_0-tag}"
549
          dest="${build.tmp}/eml_${eml2_0_0-tag}" />
550
     <mkdir dir="lib/schema/eml-2.0.0" />
551
     <copy todir="lib/schema/eml-2.0.0" filtering="yes">
552
       <fileset dir="${build.tmp}/eml_${eml2_0_0-tag}/${eml-module}">
553 1612 tao
         <include name="*.xsd"/>
554
       </fileset>
555 2175 tao
556 1939 brooke
       <!-- shouldn't we have a mapper here like this??
557
       <mapper type="glob" from="eml-*.xsd" to="eml-*-${eml-version}.xsd" />
558 2175 tao
559
       Jing's code didn't nave one - does it need to be added?
560 1939 brooke
       NOTE that eml-version is set to beta 6, so this would need changing -->
561 2175 tao
562 1612 tao
     </copy>
563 3018 sgarg
     <!-- <antcall target="copyxsl">
564 2228 sgarg
        <param name="cvs.tagname" value="${eml2_0_0-tag}" />
565
        <param name="dirname" value="eml-2.0.0" />
566 3018 sgarg
     </antcall> -->
567 2228 sgarg
568
     <echo>Enter CVS password: </echo>
569
     <cvs cvsRoot="${cvsroot}"
570
          package="${eml-module}"
571
          tag="${eml2_0_1-tag}"
572
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
573
     <mkdir dir="lib/schema/eml-2.0.1" />
574
     <copy todir="lib/schema/eml-2.0.1" filtering="yes">
575
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}">
576
         <include name="*.xsd"/>
577
       </fileset>
578
     </copy>
579
     <antcall target="copyxsl">
580
        <param name="cvs.tagname" value="${eml2_0_1-tag}" />
581
        <param name="dirname" value="eml-2.0.1" />
582
     </antcall>
583 1939 brooke
   </target>
584
585 2175 tao
   <target  name="copyxsl"
586 1939 brooke
   description="Copies xsl stylesheets from checkout in build/tmp to your metacat cvs sandbox">
587
588
     <delete file="${style-common-cvsrelpath}/${eml-css}"/>
589 2175 tao
590 2228 sgarg
     <copy todir="${style-common-cvsrelpath}/${dirname}" filtering="yes">
591
       <fileset dir="${build.tmp}/eml_${cvs.tagname}/${eml-module}/style/eml">
592 1929 brooke
       <include name="**/*.xsl"/>
593 1612 tao
     </fileset>
594
     </copy>
595 1939 brooke
596 2175 tao
597
     <!-- now copy default css from eml module and put it in style-common-path
598 1933 brooke
          dir with a new name, so other skin-specific css can import it if reqd -->
599 1939 brooke
     <copy file="${build.tmp}/eml_${cvs.tagname}/${eml-module}/${eml-module.default.css}"
600 1938 brooke
           tofile="${style-common-cvsrelpath}/${eml-css}" />
601 1612 tao
602 1463 tao
   </target>
603 2175 tao
604
605
606 2322 jones
   <target name="register-schemas" depends="prepare"
607
   description="Registers the Schemas with a new Metacat instance">
608 877 jones
     <echo/>
609 2322 jones
     <echo>Registering the Schemas with the new Metacat instance...</echo>
610 877 jones
     <sql driver="${dbDriver}"
611
          url="${jdbc-connect}"
612
          userid="${user}"
613
          password="${password}"
614 2599 jones
          src="${build.src}/loaddtdschema.sql">
615
       <classpath>
616
         <path refid="compile.classpath"/>
617
       </classpath>
618
     </sql>
619 877 jones
   </target>
620 1716 berkley
621 1939 brooke
   <target name="installdb" depends="prepare"
622
            description="Installs the database tables">
623 1827 jones
     <echo/>
624
     <echo>Installing the database tables...</echo>
625 2445 sgarg
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
626 2599 jones
     <echo/>
627 1827 jones
     <sql driver="${dbDriver}"
628
          url="${jdbc-connect}"
629
          userid="${user}"
630
          password="${password}"
631 2599 jones
          src="${build.src}/${install-sql}">
632
       <classpath>
633
         <path refid="compile.classpath"/>
634
       </classpath>
635
     </sql>
636 1827 jones
   </target>
637
638 2599 jones
   <target name="dropdb" depends="prepare"
639
            description="WARNING: Drops the database tables">
640
     <echo/>
641
     <echo>Dropping the database tables...</echo>
642
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
643
     <echo/>
644
     <sql driver="${dbDriver}"
645
          url="${jdbc-connect}"
646
          userid="${user}"
647
          password="${password}"
648
          src="${build.src}/drop-postgres.sql">
649
       <classpath>
650
         <path refid="compile.classpath"/>
651
       </classpath>
652
     </sql>
653
   </target>
654
655 1939 brooke
   <target name="upgrade12" depends="prepare"
656
            description="Updates the database tables to upgrade to version 1.2">
657 1827 jones
     <echo/>
658
     <echo>Updating the database tables to upgrade to version 1.2...</echo>
659
     <sql driver="${dbDriver}"
660
          url="${jdbc-connect}"
661
          userid="${user}"
662
          password="${password}"
663 2599 jones
          src="${build.src}/${upgrade-1.2-sql}">
664
       <classpath>
665
         <path refid="compile.classpath"/>
666
       </classpath>
667
     </sql>
668 1827 jones
   </target>
669
670 1939 brooke
   <target name="upgrade13" depends="prepare"
671
            description="Updates the database tables to upgrade to version 1.3">
672 1827 jones
     <echo/>
673
     <echo>Updating the database tables to upgrade to version 1.3...</echo>
674
     <sql driver="${dbDriver}"
675
          url="${jdbc-connect}"
676
          userid="${user}"
677
          password="${password}"
678 2599 jones
          src="${build.src}/${upgrade-1.3-sql}">
679
       <classpath>
680
         <path refid="compile.classpath"/>
681
       </classpath>
682
     </sql>
683 1827 jones
   </target>
684
685 2103 jones
   <target name="upgrade14" depends="prepare"
686
            description="Updates the database tables to upgrade to version 1.4">
687
     <echo/>
688
     <echo>Updating the database tables to upgrade to version 1.4...</echo>
689
     <sql driver="${dbDriver}"
690
          url="${jdbc-connect}"
691
          userid="${user}"
692
          password="${password}"
693 2599 jones
          src="${build.src}/${upgrade-1.4-sql}">
694
       <classpath>
695
         <path refid="compile.classpath"/>
696
       </classpath>
697
     </sql>
698 2103 jones
   </target>
699
700 2395 tao
   <target name="upgrade15" depends="sqlupgrade15"
701 2391 tao
           description="Updates the database tables to upgrade to version 1.5">
702 2353 sgarg
     <echo/>
703 2461 sgarg
     <echo>Updating the database tables to upgrade to version 1.5...</echo>
704 2353 sgarg
     <copy file="${srcdir}/upgrade_db_to_1_5.java"
705 2391 tao
           todir="${build.tmp}" filtering="yes"/>
706 2461 sgarg
707 2353 sgarg
     <javac srcdir="${build.tmp}"
708
            destdir="${build.tmp}"
709
            debug="${debug}"
710 2599 jones
            includes="upgrade_db_to_1_5.java">
711
       <classpath>
712
         <path refid="compile.classpath"/>
713
       </classpath>
714
     </javac>
715 2461 sgarg
716 2599 jones
     <java classname="upgrade_db_to_1_5">
717
       <classpath>
718
         <path refid="compile.classpath"/>
719
         <fileset dir="${build.tmp}"/>
720
       </classpath>
721
     </java>
722 2353 sgarg
723 2393 tao
   </target>
724 2461 sgarg
725 2518 sgarg
   <target name="upgrade16" depends="prepare"
726
            description="Updates the database tables from version 1.5 to version 1.6">
727
     <echo/>
728
     <echo>Updating the database tables to upgrade to version 1.6...</echo>
729
     <sql driver="${dbDriver}"
730
          url="${jdbc-connect}"
731
          userid="${user}"
732
          password="${password}"
733 2599 jones
          src="${build.src}/${upgrade-1.6-sql}">
734
       <classpath>
735
         <path refid="compile.classpath"/>
736
       </classpath>
737
     </sql>
738 2518 sgarg
   </target>
739
740 3128 perry
   <target name="upgrade17" depends="prepare"
741
            description="Updates the database tables from version 1.6 to version 1.7">
742
     <echo/>
743
     <echo>Updating the database tables to upgrade to version 1.7...</echo>
744
     <sql driver="${dbDriver}"
745
          url="${jdbc-connect}"
746
          userid="${user}"
747
          password="${password}"
748
          src="${build.src}/${upgrade-1.7-sql}">
749
       <classpath>
750
         <path refid="compile.classpath"/>
751
       </classpath>
752
     </sql>
753
   </target>
754 2518 sgarg
755 2395 tao
   <target name="sqlupgrade15" depends="prepare">
756
      <echo>Updating the database tables to upgrade to version 1.5 by sql command</echo>
757 2393 tao
      <sql driver="${dbDriver}"
758
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
759
          url="${jdbc-connect}"
760
          userid="${user}"
761
          password="${password}"
762
          src="${build.src}/${upgrade-1.5-sql}" />
763 2444 sgarg
      <sql driver="${dbDriver}"
764
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
765
          url="${jdbc-connect}"
766
          userid="${user}"
767
          password="${password}"
768
          rdbms="oracle"
769
          delimiter="/">
770
        <transaction>
771
           CREATE TRIGGER xml_returnfield_before_insert
772
           BEFORE INSERT ON xml_returnfield FOR EACH ROW
773
           BEGIN
774
              SELECT xml_returnfield_id_seq.nextval
775
                 INTO :new.returnfield_id
776
                 FROM dual;
777
           END;
778
           /
779
        </transaction>
780
        <transaction>
781
           CREATE TRIGGER xml_queryresult_before_insert
782
           BEFORE INSERT ON xml_queryresult FOR EACH ROW
783
           BEGIN
784
              SELECT xml_queryresult_id_seq.nextval
785
              INTO :new.queryresult_id
786
              FROM dual;
787
           END;
788
           /
789
        </transaction>
790
      </sql>
791 2393 tao
   </target>
792 2353 sgarg
793 3072 perry
   <target name="install-spatial" depends="jar,clientjar,harvesterjar"
794 3034 perry
           description="Installs spatial option for metacat">
795
796
      <property name="spatial.dir" value="./lib/spatial"/>
797
      <property name="spatial.geoserver.dir" value="${spatial.dir}/geoserver"/>
798
      <property name="spatial.webinf-mods" value="${spatial.dir}/WEB-INF"/>
799
800
      <!-- Copy geoserver libs into ${war.lib} -->
801
      <copy todir="${war.lib}" filtering="no">
802
        <fileset dir="${spatial.geoserver.dir}/WEB-INF/lib">
803
          <include name="**"/>
804
        </fileset>
805
      </copy>
806
807
      <!-- Copy everything in geoservers WEB-INF (except the libs) into ${war.webinf} -->
808
      <copy todir="${war.webinf}" filtering="no">
809
        <fileset dir="${spatial.geoserver.dir}/WEB-INF">
810
          <exclude name="lib/**"/>
811
          <exclude name="web.xml"/>
812
        </fileset>
813
      </copy>
814
815
      <!-- Copy the rest of the geoserver codebase into ${war.context} -->
816
      <copy todir="${war.context}" filtering="no">
817
        <fileset dir="${spatial.geoserver.dir}">
818
          <exclude name="WEB-INF/**"/>
819
          <exclude name="index.jsp"/>
820
        </fileset>
821
      </copy>
822
823
      <!-- Copy the geoserver index.jsp but rename it to avoid conflicting w/metcat   -->
824
     <copy file="${spatial.geoserver.dir}/WEB-INF/pages/index.jsp"
825
          tofile="${war.context}/geoserver.jsp"
826
          overwrite="true"
827
          filtering="no"/>
828
829
      <!-- Copy the rest of the modified geoserver web-inf files
830
      <copy todir="${war.webinf}" filtering="no">
831
        <fileset dir="${spatial.webinf-mods}">
832
          <exclude name="web.xml.combined"/>
833
        </fileset>
834
      </copy> -->
835
836
    </target>
837
838
839 2957 tao
   <target name="install" depends="install-ecogrid" description="* Full Install *">
840 1079 tao
       <mkdir dir="${datafilepath}" />
841 1455 tao
       <mkdir dir="${inlinedatafilepath}" />
842 1079 tao
       <chmod dir="${datafilepath}" perm="ug+w" />
843 1929 brooke
       <mkdir dir="${temp-dir}"/>
844
       <chmod dir="${temp-dir}" perm="ug+w" />
845 2737 jones
       <copy file="${dist.dir}/${metacat.context}.war" todir="${deploy.dir}"/>
846 2993 tao
   	   <echo>If you enable ecogrid installation, please run "ant deploy-ecogrid" when installation or upgrade is done</echo>
847 1952 jones
   </target>
848 2957 tao
849 2965 tao
   <target name="install-ecogrid" depends="war, get-ecogrid" if="enable.ecogrid"
850 2957 tao
			    description="Install Ecogrid Compentent">
851 2965 tao
   	  <copyfile src="lib/metacat.url" dest="${ecogrid-dir}/conf/MetacatImpl/classes/metacat.properties" forceoverwrite="true" filtering="yes"/>
852 2991 berkley
   	  <ant antfile="build.xml" dir="${ecogrid-dir}" target ="clean" inheritall="false">
853 2977 tao
   	         <property name="context" value="${metacat.context}"/>
854
   	   	     <property name="target" value="${ecogrid-target-name}"/>
855
   	   	     <property name="metacat.dir" value="${metacat.dir}"/>
856
   	  </ant>
857 2991 berkley
   	  <ant antfile="build.xml" dir="${ecogrid-dir}" target ="war" inheritall="false">
858 2957 tao
   	     <property name="context" value="${metacat.context}"/>
859
   	     <property name="target" value="${ecogrid-target-name}"/>
860 2965 tao
   	     <property name="metacat.dir" value="${metacat.dir}"/>
861 2957 tao
   	  </ant>
862 2978 tao
   	  <war destfile="${ecogrid-dir}/build/${metacat.context}.war" update="true">
863
  	      <webinf dir="${ecogrid-dir}/lib">
864
   	        <include name="server-config.wsdd"/>
865
   	      </webinf>
866
   	  </war>
867 2965 tao
   	  <copy file="${ecogrid-dir}/build/${metacat.context}.war" todir="${dist.dir}" overwrite="true"/>
868 2978 tao
869
870 2957 tao
   </target>
871 2965 tao
872
   <target name="get-ecogrid" depends="init" if="ecogrid.required" description="Check out ecogrid module">
873
	<echo>Enter CVS password: </echo>
874
	     <cvs cvsRoot="${cvsroot}"
875
	          package="${ecogrid-module}" dest="${ecogrid-module-dest-dir}"/>
876
   </target>
877
878
879 2175 tao
   <target name="upgrade" depends="install"
880 1952 jones
          description="* Upgrade an existing metacat installation with a new version *">
881 2737 jones
       <unwar src="${deploy.dir}/${metacat.context}.war" dest="${deploy.dir}/${metacat.context}" />
882 1952 jones
   </target>
883 2957 tao
884 2978 tao
   <target name="deploy-ecogrid" depends="clean-ecogrid-server-config-wsdd" if="enable.ecogrid" description="Automately generate wsdd for ecogrid service">
885 2991 berkley
   	 <ant antfile="build.xml" dir="${ecogrid-dir}" target ="deploy" inheritall="false">
886 2957 tao
   	   	 <property name="context" value="${metacat.context}"/>
887
   	   	 <property name="target" value="${ecogrid-target-name}"/>
888 2965 tao
   	     <property name="metacat.dir" value="${metacat.dir}"/>
889 2977 tao
   	     <property name="hostname" value="${config.hostname}"/>
890
   	     <property name="port" value="${config.port}"/>
891 2957 tao
   	 </ant>
892
   </target>
893 2978 tao
894
   <target name="clean-ecogrid-server-config-wsdd" depends="init" description="Automately generate wsdd for ecogrid service">
895
      <delete file="${deploy.dir}/${metacat.context}/WEB-INF/server-config.wsdd"/>
896
   </target>
897 1952 jones
898 2175 tao
   <target name="install-registry" depends="init,getConversionXSL"
899 1952 jones
            description="Install Registry">
900 2175 tao
901 1952 jones
      <copy file="${srcdir}/perl/register-dataset.cgi"
902
            todir="${inst.cgi.dir}" filtering="yes"/>
903
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
904 2175 tao
905 1952 jones
      <mkdir dir="${temp-dir}" />
906 2343 sgarg
      <copy todir="${temp-dir}" filtering="yes">
907
       <fileset dir="lib/style/common/emlb6toeml2">
908 1952 jones
         <include name="*.xsl"/>
909
         <include name="*.xml"/>
910
       </fileset>
911 2343 sgarg
      </copy>
912 1952 jones
913
      <echo message="Install Registry completed." />
914
   </target>
915
916 2343 sgarg
   <target name="install-ldap" depends="init">
917
      <copy file="${srcdir}/perl/ldapweb.cgi"
918
            todir="${inst.cgi.dir}" filtering="yes"/>
919
      <chmod file="${inst.cgi.dir}/ldapweb.cgi" perm="ugo+x" />
920
      <copy file="lib/ldapweb.cfg"
921
            todir="${inst.cgi.dir}" filtering="yes"/>
922
      <chmod file="${inst.cgi.dir}/ldapweb.cfg" perm="ugo+x" />
923
      <mkdir dir="${templates.dir}" />
924
      <copy todir="${templates.dir}" filtering="yes">
925
        <fileset dir="lib/style/common/templates">
926
            <include name="${defaultChangePass}"/>
927
            <include name="${defaultResetPass}"/>
928
            <include name="${changePassSuccess}"/>
929
            <include name="${resetPassSuccess}"/>
930
            <include name="${registerFailed}"/>
931
            <include name="${registerLter}"/>
932
            <include name="${registerMatch}"/>
933
            <include name="${registerSuccess}"/>
934
            <include name="${register}"/>
935
            <include name="${searchResults}"/>
936 2974 jones
            <include name="${defaultHeader}"/>
937
            <include name="${defaultFooter}"/>
938
            <include name="${responseForm}"/>
939 2343 sgarg
        </fileset>
940
      </copy>
941
      <echo message="ldapweb install complete." />
942
   </target>
943
944
945 2175 tao
   <target name="install-skin" depends="init"
946 2052 sgarg
            description="Install a Skin">
947
948 2175 tao
      <input message="Please enter name of the skin"
949 2052 sgarg
             addproperty="skin-name"/>
950
951
      <mkdir dir="${installdir}/style/skins/${skin-name}" />
952
      <copy todir="${installdir}/style/skins/${skin-name}" filtering="yes">
953
       <fileset dir="lib/style/skins/${skin-name}">
954 3014 costa
           <exclude name="**/*.png"/>
955
           <exclude name="**/*.gif"/>
956
           <exclude name="**/*.jpg"/>
957 2277 jones
           <exclude name="**/CVS*"/>
958
           <exclude name="**/.#*"/>
959 2052 sgarg
       </fileset>
960
      </copy>
961 2054 sgarg
     <copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
962
       <fileset dir="lib/style/skins/${skin-name}">
963 3014 costa
           <include name="**/*.png"/>
964
           <include name="**/*.gif"/>
965
           <include name="**/*.jpg"/>
966 2277 jones
           <exclude name="**/CVS*"/>
967
           <exclude name="**/.#*"/>
968 2054 sgarg
       </fileset>
969
      </copy>
970 2974 jones
      <copy todir="${installdir}/style/common" filtering="yes">
971
       <fileset dir="lib/style/common">
972
           <include name="*.js"/>
973
           <include name="*.jsp"/>
974
           <include name="*.css"/>
975
           <exclude name="*.png"/>
976
           <exclude name="*.gif"/>
977
           <exclude name="*.jpg"/>
978
           <exclude name="**/CVS*"/>
979
           <exclude name="**/.#*"/>
980
       </fileset>
981
      </copy>
982 2277 jones
      <!--
983 2210 jones
      <mkdir dir="${installdir}/style/skins/${skin-name}/images" />
984
     <copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
985
       <fileset dir="lib/style/skins/${skin-name}/images">
986
           <include name="*.png"/>
987
           <include name="*.gif"/>
988
           <include name="*.jpg"/>
989
       </fileset>
990
      </copy>
991 2277 jones
      -->
992 2052 sgarg
993
      <echo message="Install Skin completed." />
994
   </target>
995
996 3034 perry
   <target name="war" depends="warPrepare,warMSSQL,install-spatial"
997 1952 jones
            description="Create a web archive (WAR) for servlet deployment">
998 2737 jones
       <mkdir dir="${dist.dir}" />
999
       <war destfile="${dist.dir}/${metacat.context}.war"
1000 1952 jones
            webxml="${build.war}/web.xml">
1001
         <fileset dir="${war.context}"/>
1002
         <lib dir="${war.lib}"/>
1003
         <webinf dir="${war.webinf}"/>
1004
       </war>
1005
   </target>
1006 2957 tao
1007
1008 1952 jones
1009 2059 costa
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
1010 1952 jones
            description="Prepare files for creating a web archive (WAR)">
1011
1012
       <property name="war.lib" value="${build.war}/lib" />
1013
       <property name="war.webinf" value="${build.war}/WEB-INF" />
1014 2737 jones
       <property name="war.context" value="${build.war}/${metacat.context}" />
1015 1952 jones
       <mkdir dir="${war.lib}" />
1016
       <mkdir dir="${war.webinf}" />
1017
       <mkdir dir="${war.context}" />
1018 2610 tao
1019
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
1020 1952 jones
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
1021
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
1022 2059 costa
       <copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
1023 1952 jones
       <copy todir="${war.lib}" filtering="no">
1024 1823 jones
         <fileset dir="lib">
1025 2610 tao
            <not>
1026
               <filename name="${jdbc-jar-name}"/>
1027
            </not>
1028
            <include name="*.jar"/>
1029 1823 jones
         </fileset>
1030 3059 berkley
         <fileset dir="lib">
1031
           <include name="xalan.jar"/>
1032 1823 jones
         </fileset>
1033
       </copy>
1034 1729 tao
       <copy file="lib/web.xml.${tomcatversion}"
1035 1952 jones
             tofile="${build.war}/web.xml" />
1036
       <copy file="lib/metacat.properties" todir="${war.webinf}"
1037 1951 jones
             filtering="yes" />
1038 3099 jones
   	   <copy file="lib/metacat.properties.metadata" todir="${war.webinf}"
1039
   	             filtering="no" />
1040 2900 sgarg
       <copy todir="${war.webinf}" filtering="yes">
1041
	   	  <fileset dir="lib">
1042
           <include name="skin.configs/**"/>
1043
		  </fileset>
1044
	   </copy>
1045 2583 sgarg
       <copy file="lib/log4j.properties" todir="${war.webinf}"
1046
             filtering="yes" />
1047 1952 jones
       <copy todir="${war.context}" filtering="no">
1048 822 jones
         <fileset dir="lib">
1049
           <include name="**/*.jpg"/>
1050
           <include name="**/*.png"/>
1051
           <include name="**/*.gif"/>
1052 2844 costa
           <include name="LiveMap_30/**"/>
1053 822 jones
         </fileset>
1054
       </copy>
1055 1952 jones
       <copy todir="${war.context}" filtering="yes">
1056 822 jones
         <fileset dir="lib">
1057
           <exclude name="*.jar"/>
1058
           <exclude name="*.properties"/>
1059 3099 jones
         	<exclude name="*.metadata"/>
1060 822 jones
           <exclude name="web.xml"/>
1061 1437 berkley
           <exclude name="**/*.jpg"/>
1062
           <exclude name="**/*.png"/>
1063
           <exclude name="**/*.gif"/>
1064 2778 jones
           <exclude name="lsid_lib/**"/>
1065
           <exclude name="lsid_conf/**"/>
1066 2844 costa
           <exclude name="LiveMap_30/**"/>
1067 2900 sgarg
           <exclude name="skin.configs/**"/>
1068 3034 perry
           <exclude name="spatial/geoserver/**"/>
1069
           <exclude name="spatial/WEB-INF/**"/>
1070 822 jones
         </fileset>
1071
       </copy>
1072 1311 berkley
   </target>
1073 1929 brooke
1074 1952 jones
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
1075
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
1076
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
1077 1929 brooke
   </target>
1078
1079 2175 tao
   <target name="getConversionXSL" depends="prepare"
1080 1954 jones
            unless="styles.not.needed"
1081 1939 brooke
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1082 2497 sgarg
1083 1929 brooke
     <echo>Enter CVS password: </echo>
1084 2497 sgarg
     <cvs cvsRoot="${cvsroot}"
1085
          package="${eml-module}"
1086
          tag="${eml2_0_1-tag}"
1087
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
1088 2343 sgarg
1089
     <mkdir dir="lib/style/common/emlb6toeml2" />
1090
      <copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1091 2497 sgarg
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}/lib/beta6toeml2/xsl">
1092 2343 sgarg
         <include name="*.xsl"/>
1093
         <include name="*.xml"/>
1094
       </fileset>
1095
      </copy>
1096 1929 brooke
   </target>
1097
1098 2135 costa
   <target name="testprep" depends="jar,clientjar,harvesterjar">
1099 1783 jones
      <mkdir dir="${build.tests}"/>
1100
      <copy todir="${build.tests}" filtering="yes">
1101
        <fileset dir="${testdir}">
1102
          <include name="edu/**"/>
1103
        </fileset>
1104
      </copy>
1105 971 tao
      <!-- copy and compile the tests into a jar file -->
1106 1783 jones
      <javac srcdir="${build.tests}"
1107
             destdir="${build.tests}"
1108 1612 tao
             debug="on"
1109 2982 jones
             includes="**/*.java">
1110 2599 jones
        <classpath>
1111
          <path refid="compile.classpath"/>
1112
          <fileset dir="${build.dir}">
1113 2982 jones
            <include name="${name}.jar"/>
1114
            <include name="${name}-client.jar"/>
1115
            <include name="harvester.jar"/>
1116 2599 jones
          </fileset>
1117
        </classpath>
1118
      </javac>
1119 204 jones
1120 1311 berkley
      <jar jarfile="${build.dir}/${name}-junittests.jar"
1121 1783 jones
        basedir="${build.tests}"
1122 1311 berkley
                includes="**/*.class" />
1123 1822 jones
   </target>
1124 971 tao
1125 1939 brooke
   <target name="test" depends="testprep"
1126
            description="Uses the ant junit task to run all JUnit tests">
1127 1822 jones
1128 971 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
1129 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1130 971 tao
             haltonerror="no">
1131 1783 jones
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
1132 971 tao
        <classpath>
1133 2599 jones
          <path refid="compile.classpath"/>
1134
          <fileset dir="${build.dir}">
1135 2982 jones
            <include name="${name}.jar"/>
1136
            <include name="${name}-client.jar"/>
1137
            <include name="harvester.jar"/>
1138
            <include name="${name}-junittests.jar"/>
1139 2599 jones
          </fileset>
1140 971 tao
        </classpath>
1141
1142
        <formatter type="plain" />
1143
1144
        <batchtest fork="yes" todir="${build.dir}">
1145 1783 jones
          <fileset dir="${build.tests}">
1146 1116 tao
            <include name="**/*.class" />
1147 971 tao
          </fileset>
1148
        </batchtest>
1149
     </junit>
1150
   </target>
1151 1103 tao
1152 1939 brooke
    <target name="runonetest" depends="testprep"
1153
            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1154 1500 tao
1155 1939 brooke
              <echo>testtorun: ${testtorun}</echo>
1156
1157 1500 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
1158 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1159 1500 tao
             haltonerror="no">
1160 2044 tao
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
1161 1500 tao
        <classpath>
1162 2599 jones
          <path refid="compile.classpath"/>
1163
          <fileset dir="${build.dir}">
1164 2982 jones
            <include name="${name}.jar"/>
1165
            <include name="${name}-client.jar"/>
1166
            <include name="harvester.jar"/>
1167
            <include name="${name}-junittests.jar"/>
1168 2599 jones
          </fileset>
1169 1500 tao
        </classpath>
1170
1171
        <formatter type="plain" />
1172
1173
        <batchtest fork="yes" todir="${build.dir}">
1174 1783 jones
          <fileset dir="${build.tests}">
1175 1500 tao
            <include name="**/${testtorun}.class" />
1176
          </fileset>
1177
        </batchtest>
1178
     </junit>
1179
   </target>
1180
1181 2175 tao
   <target name="testharvester"
1182 2135 costa
           depends="testprep"
1183
           description="Uses the ant junit task to test only the Harvester code">
1184 2175 tao
     <junit printsummary="yes"
1185
            haltonfailure="off"
1186 2135 costa
            fork="yes"
1187
            haltonerror="off">
1188 2599 jones
        <classpath>
1189
          <path refid="compile.classpath"/>
1190
          <fileset dir="${build.dir}">
1191 2982 jones
            <include name="${name}.jar"/>
1192
            <include name="${name}-client.jar"/>
1193
            <include name="harvester.jar"/>
1194
            <include name="${name}-junittests.jar"/>
1195 2599 jones
          </fileset>
1196
        </classpath>
1197 2135 costa
       <formatter type="plain" />
1198
       <batchtest fork="yes" todir="${build.dir}">
1199
         <fileset dir="${build.tests}">
1200
           <include name="**/harvesterClient/*.class" />
1201
         </fileset>
1202
       </batchtest>
1203
     </junit>
1204
   </target>
1205
1206 1939 brooke
  <target name="gethttpclient" depends="prepare"
1207
            description="checks out and compiles morpho httpclient code">
1208 1311 berkley
  <!--mkdir dir="${morphosourcedir}" -->
1209 1487 tao
        <cvs cvsRoot="${cvsroot}"
1210 1103 tao
             package="morpho"
1211
             dest="." />
1212 1107 tao
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
1213 1103 tao
   </target>
1214
1215
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
1216 1939 brooke
   <target name="nettest" depends="install"
1217
            description="compiles and runs the metacatnettest code">
1218 2175 tao
1219 1103 tao
      <echo>***********************************
1220 1311 berkley
      Please run ant gethttpclient first!
1221
      ***********************************
1222 1103 tao
      </echo>
1223
      <!-- copy and compile the tests into a jar file -->
1224 1116 tao
      <mkdir dir="${build.metacatnettest}"/>
1225 1103 tao
      <javac srcdir="${junitnettestsdir}"
1226 1116 tao
             destdir="${build.metacatnettest}"
1227 2599 jones
             includes="**/*.java">
1228
        <classpath>
1229
          <path refid="compile.classpath"/>
1230
          <fileset dir="${build.dir}">
1231 2982 jones
            <include name="${name}.jar"/>
1232 2599 jones
          </fileset>
1233
        </classpath>
1234
      </javac>
1235 1103 tao
1236
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
1237 1116 tao
                    basedir="${build.metacatnettest}"
1238 1103 tao
                    includes="**/*.class" />
1239
1240
      <!-- use the ant "junit" task to run JUnit tests. -->
1241 1107 tao
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1242 1103 tao
             haltonerror="no">
1243 1107 tao
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1244 1103 tao
        <classpath>
1245 2599 jones
          <path refid="compile.classpath"/>
1246
          <fileset dir="${build.dir}">
1247 2982 jones
            <include name="${name}.jar"/>
1248
            <include name="${name}-junitnettests.jar"/>
1249 2599 jones
          </fileset>
1250 1103 tao
        </classpath>
1251
1252
        <formatter type="plain" />
1253
1254
        <batchtest fork="yes" todir="${build.dir}">
1255 1116 tao
          <fileset dir="${build.metacatnettest}">
1256
            <include name="**/*.class" />
1257 1103 tao
          </fileset>
1258
        </batchtest>
1259
     </junit>
1260 1311 berkley
   </target>
1261 1103 tao
1262 1939 brooke
   <target name="cleanweb" depends="clean"
1263
            description="deletes tomcat web context dir and all its contents">
1264 1522 berkley
     <delete dir="${installdir}" />
1265
   </target>
1266
1267
1268 1939 brooke
   <target name="clean" depends="init"
1269 2320 jones
            description="deletes build dir and files that can be regenerated form the release">
1270 822 jones
       <delete dir="${build.dir}" />
1271 2737 jones
       <delete dir="${dist.dir}" />
1272 2320 jones
   </target>
1273
1274
   <target name="fullclean" depends="clean"
1275
            description="deletes even jars that depend on external sources such as stylesheets and jars">
1276
       <delete file="lib/httpclient.jar" />
1277
       <delete file="lib/utilities.jar" />
1278 1939 brooke
       <delete includeEmptyDirs="true" failonerror="false">
1279
         <fileset dir="${style-common-cvsrelpath}">
1280
           <include name="${eml-css}" />
1281
           <include name="eml-*/*.xsl" />
1282
           <include name="eml-*" />
1283
         </fileset>
1284 2320 jones
       </delete>
1285 113 jones
   </target>
1286
1287 1939 brooke
   <target name="jdoc" depends="prepare"
1288
            description="generates javadoc documentation">
1289 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
1290 516 jones
           sourcepath="${build.src}"
1291
           destdir="${build.javadocs}"
1292 113 jones
           author="true"
1293
           version="true"
1294
           use="true"
1295 348 jones
           windowtitle="${Name} API"
1296
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1297 2599 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1298
         <classpath>
1299
           <path refid="compile.classpath"/>
1300
         </classpath>
1301
       </javadoc>
1302 113 jones
   </target>
1303
1304 2461 sgarg
   <target name="dist"
1305 2965 tao
       depends="geteml,get-ecogrid,jar,protocol,jdoc,getConversionXSL,getutilities"
1306 1939 brooke
            description="prepares a full release distribution">
1307 806 jones
      <mkdir dir="${dist.dir}"/>
1308
      <delete dir="${ver.dir}" />
1309
      <mkdir dir="${ver.dir}"/>
1310
      <copy todir="${ver.dir}">
1311 1311 berkley
        <fileset dir="."
1312 2401 costa
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/**"/>
1313 806 jones
      </copy>
1314
      <copy todir="${ver.dir}" file="build.xml"/>
1315 2317 jones
      <copy todir="${ver.dir}" file="build.properties"/>
1316 882 jones
1317
      <copy todir="${ver.dir}/docs" filtering="yes">
1318
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1319
      </copy>
1320
      <copy todir="${ver.dir}/docs" filtering="no">
1321
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1322
      </copy>
1323 806 jones
      <copy todir="${ver.dir}/docs/dev">
1324
        <fileset dir="${build.dir}/docs"/>
1325
      </copy>
1326 917 berkley
      <copy todir="${ver.dir}/src">
1327
        <fileset dir="${build.dir}/src"/>
1328
      </copy>
1329 2391 tao
      <!-- copy loaddtdschemal.sql form src dir(which has the server token to ver.dir/src-->
1330
      <copy todir="${ver.dir}/src" file="${srcdir}/loaddtdschema.sql" overwrite="yes" filtering="no"/>
1331 2395 tao
      <copy todir="${ver.dir}/src" file="${srcdir}/upgrade-db-to-1.5.sql" overwrite="yes" filtering="no"/>
1332 2323 jones
      <!--
1333 992 berkley
      <delete dir="./${ver.dir}/${build.dir}"/>
1334
      <delete dir="./${ver.dir}/dist"/>
1335 2323 jones
      -->
1336 882 jones
      <delete file="./${name}-${release}.zip"/>
1337 1312 tao
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1338 882 jones
      <delete file="./${name}-${release}.tar.gz" />
1339 1312 tao
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1340 1311 berkley
      <gzip zipfile="./${name}-${release}.tar.gz"
1341 882 jones
                src="./${name}-${release}.tar"/>
1342
      <delete file="./${name}-${release}.tar" />
1343 1311 berkley
  </target>
1344 806 jones
1345 1939 brooke
  <target name="distsrc" depends="dist"
1346
            description="prepares a source distribution">
1347 806 jones
      <mkdir dir="${ver.src}"/>
1348
      <copy todir="${ver.src}">
1349
        <fileset dir="./src"/>
1350
      </copy>
1351 2461 sgarg
      <mkdir dir="${util.dir}"/>
1352
      <copy todir="${util.dir}">
1353
        <fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1354
      </copy>
1355 2965 tao
1356
  	  <mkdir dir="${ecogrid-dist-dir}"/>
1357
  	  <copy todir="${ecogrid-dist-dir}">
1358
  	        <fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1359
  	  </copy>
1360 806 jones
1361 3131 perry
      <delete file="${ver.dir}/lib/utilities.jar"/>
1362
1363 882 jones
      <delete file="./${name}-src-${release}.zip"/>
1364
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
1365
      <delete file="./${name}-src-${release}.tar.gz" />
1366
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
1367 1311 berkley
      <gzip zipfile="./${name}-src-${release}.tar.gz"
1368 882 jones
                src="./${name}-src-${release}.tar"/>
1369
      <delete file="./${name}-src-${release}.tar" />
1370 3131 perry
      <delete dir="${dist.dir}"/>
1371 1311 berkley
  </target>
1372 806 jones
1373 1702 tao
   <target name="stylesheettest">
1374 1939 brooke
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1375 1702 tao
      <param name="displaymodule" expression="${displaymodule}"/>
1376
      <param name="docid" expression="${input}"/>
1377
      <param name="entitytype" expression="${entitytype}"/>
1378
      <param name="entityindex" expression="${entityindex}"/>
1379
      <outputproperty name="method" value="html"/>
1380
      <outputproperty name="standalone" value="yes"/>
1381
      <outputproperty name="encoding" value="iso8859_1"/>
1382
      <outputproperty name="indent" value="yes"/>
1383
    </xslt>
1384
  </target>
1385 2175 tao
1386 1819 tao
 <target name="gridinit" depends="init">
1387
   <property name="java2wsdl.tool" value="org.apache.axis.wsdl.Java2WSDL" />
1388
   <property name="wsdldecorator.tool" value="org.globus.ogsa.tools.wsdl.DecorateWSDL" />
1389
   <property name="wsdl.tool" value="org.globus.ogsa.tools.wsdl.GSDL2Java"/>
1390
   <property environment="env"/>
1391
   <property name="binding.file" value="${env.GLOBUS_LOCATION}/schema/ogsi/ogsi_bindings.wsdl"/>
1392 1820 tao
    <path id="webservicepath">
1393
        <pathelement location="."/>
1394
        <pathelement location="${env.JAVA_HOME}/../lib/tools.jar"/>
1395
        <pathelement location="${build.dest}"/>
1396
        <fileset dir="${env.GLOBUS_LOCATION}/lib">
1397
           <include name="*.jar"/>
1398
        </fileset>
1399
      </path>
1400 1819 tao
</target>
1401
1402 1821 tao
 <target name="gridprepare" depends="gridinit, prepare">
1403 2175 tao
 </target>
1404
1405 1821 tao
  <target name="compileinterface" depends="clean, gridprepare">
1406 1817 tao
    <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/${interface.name}.java" />
1407 1811 tao
  </target>
1408 2175 tao
1409 1811 tao
  <target name="generateWSDL" depends="compileinterface">
1410
    <echo message="Generating wsdl from ${interface.name} interface"/>
1411
    <java classname="${java2wsdl.tool}"
1412 1814 tao
          dir="${build.src}" fork="yes"
1413 1811 tao
          classpathref="webservicepath"  failonerror="true" >
1414
      <arg value="-P"/>
1415
      <arg value="${interface.name}PortType"/>
1416
      <arg value="-S"/>
1417
      <arg value="${interface.name}Service"/>
1418
      <arg value="-y"/>
1419
      <arg value="WRAPPED"/>
1420
      <arg value="-u"/>
1421
      <arg value="LITERAL"/>
1422
      <arg value="-l"/>
1423
      <arg value="http://localhost/ogsa/services/${interface.name}Service"/>
1424
      <arg value="-n"/>
1425
      <arg value="http://${services.namespace}/${interface.name}"/>
1426
      <arg value="${interface.package}.${interface.name}"/>
1427
    </java>
1428
  </target>
1429 2175 tao
1430 1811 tao
   <target name="decorateWSDL" depends="generateWSDL">
1431
      <property name="wsdl.file" value="${interface.name}Service.wsdl"/>
1432 1814 tao
      <java classname="${wsdldecorator.tool}" dir="${build.src}"
1433 1811 tao
            fork="yes"
1434
            classpathref="webservicepath" failonerror="true" >
1435
        <arg value="${binding.file}"/>
1436
        <arg value="${wsdl.file}"/>
1437
      </java>
1438
   </target>
1439 2175 tao
1440 1811 tao
   <target name="generatestubs" depends="decorateWSDL">
1441
      <echo message=" Generating stubs " />
1442 1814 tao
      <echo message="wsdl file is ${wsdl.file}"/>
1443
      <echo message="build.src is ${build.src}"/>
1444 1811 tao
      <java classname="${wsdl.tool}" dir="${build.src}" fork="yes"
1445
            classpathref="webservicepath" failonerror="true" >
1446 1814 tao
         <arg value="${wsdl.file}"/>
1447 1811 tao
    </java>
1448
  </target>
1449 2175 tao
1450 1811 tao
  <target name="compileStubsAndImpl" depends="generatestubs, utilities">
1451
     <echo message=" Compiling stubs " />
1452
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" includes="**/${interface.name}/*.java" />
1453
     <echo message=" Compiling impl " />
1454
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" classpath="./lib/utilities.jar" includes="**/impl/*.java" />
1455
  </target>
1456 2175 tao
1457 1811 tao
  <target name="jarStubsAndImpl" depends="compileStubsAndImpl">
1458
     <echo message=" jar stubs classes " />
1459
     <jar destfile="${build.dir}/${interface.name}-stubs.jar" basedir="${build.dest}" includes="**/${interface.name}/*.class" />
1460
     <echo message=" jar impl classes " />
1461
     <jar destfile="${build.dir}/${interface.name}.jar" basedir="${build.dest}" includes="**/impl/*.class" />
1462
  </target>
1463 2175 tao
1464 1811 tao
  <target name="gar" depends="jarStubsAndImpl">
1465
     <echo message=" jar the gar file"/>
1466
     <mkdir dir="${build.dir}/gar"/>
1467
     <mkdir dir="${build.dir}/gar/schema/edu"/>
1468
     <copy file="${build.dir}/${interface.name}.jar" todir="${build.dir}/gar" />
1469
     <copy file="${build.dir}/${interface.name}-stubs.jar" todir="${build.dir}/gar" />
1470 1814 tao
     <copy file="lib/utilities.jar" todir="${build.dir}/gar" />
1471
     <copy file="lib/server-deploy.wsdd" todir="${build.dir}/gar" />
1472
     <copy file="${build.src}/${interface.name}Service.wsdl" todir="${build.dir}/gar/schema/edu" />
1473
     <jar destfile="lib/${interface.name}.gar" basedir="${build.dir}/gar"/>
1474 1811 tao
  </target>
1475 2175 tao
1476 1814 tao
  <target name="compilewebclient" depends="prepare">
1477
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1478
  </target>
1479 2175 tao
1480 1814 tao
  <target name="runwebclient" depends="compilewebclient">
1481 2175 tao
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1482 1814 tao
           dir="${build.dest}" fork="yes"
1483
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1484
         <arg value="${serviceUrl}"/>
1485
         <arg value="${docid}"/>
1486
     </java>
1487
  </target>
1488 2598 harris
1489 2639 harris
  <target name="spatial_option" depends="prepare" description=" -- compiles code for the spatial option">
1490 2598 harris
1491
    <echo message="Compiling the metatcat shapefile creator"/>
1492
    <echo message="using the shapelib at: ${shapelib.dir}"/>
1493
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1494
     <arg line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1495
    </exec>
1496
1497
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1498 2639 harris
     <arg line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1499 2598 harris
    </exec>
1500
  </target>
1501
1502 2737 jones
    <!-- LSID Authority support -->
1503
    <patternset id="lsid.jars">
1504
        <include name="axis.jar" />
1505 2772 jones
        <include name="commons-discovery-0.2.jar" />
1506 2737 jones
        <include name="jaxrpc.jar" />
1507
        <include name="lsid-client-1.1.1.jar" />
1508
        <include name="lsid-server-1.1.1.jar" />
1509
        <include name="saaj.jar" />
1510 2772 jones
        <include name="wsdl4j-1.5.1.jar" />
1511 2737 jones
        <include name="activation.jar" />
1512
        <include name="castor-0.9.5.jar" />
1513
        <include name="dnsjava-1.3.2.jar" />
1514
        <include name="mail.jar" />
1515 2778 jones
        <include name="commons-logging-1.0.4.jar" />
1516
        <!-- These jars may be needed but seem to not actually be,
1517
             so leaving them out for now
1518
        <include name="axis-ant.jar" />
1519 2737 jones
        -->
1520
        <!--<include name="GenCastor.class" />-->
1521
    </patternset>
1522
    <patternset id="lib.jars">
1523
        <include name="httpclient.jar" />
1524
        <include name="log4j-1.2.12.jar" />
1525
        <include name="utilities.jar" />
1526
        <include name="xercesImpl.jar" />
1527
        <include name="xalan.jar" />
1528
        <include name="xml-apis.jar" />
1529
    </patternset>
1530
1531
    <path id="lsid.classpath">
1532
        <fileset dir="${lsid.lib.dir}">
1533
            <patternset refid="lsid.jars"/>
1534
        </fileset>
1535
        <fileset dir="${lib.dir}">
1536
            <patternset refid="lsid.jars"/>
1537
        </fileset>
1538 3059 berkley
        <fileset dir="${lib.dir}">
1539 2737 jones
            <include name="xalan.jar" />
1540
            <include name="xml-apis.jar" />
1541
        </fileset>
1542
        <fileset dir="${build.dir}">
1543
            <include name="metacat-client.jar" />
1544
        </fileset>
1545
    </path>
1546
1547
    <filterset id="configFilters">
1548
        <filter token="LSID_AUTHORITY_HOSTNAME"
1549
                value="${config.hostname}" />
1550
        <filter token="LSID_AUTHORITY_PORT"
1551
                value="${config.port}" />
1552
        <filter token="METADATA_LABELS"
1553
                value="${config.metadataLabelLsid}" />
1554
        <filter token="METACAT_SERVER"
1555
                value="${config.metacatserver}" />
1556
        <filter token="LSID_AUTHORITY_STRING"
1557
                value="${config.lsidauthority}" />
1558
    </filterset>
1559
1560
    <target name="prepare-lsid"
1561
            depends="prepare,utilities,clientjar"
1562
            description="Configure files prior to compilation">
1563
        <mkdir dir="${lsid.build.dir}" />
1564
        <!-- Copy the properties file into the build -->
1565
        <copy file="${conf.dir}/metacat-lsid.properties"
1566
              tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1567
              overwrite="true">
1568
            <filterset refid="configFilters" />
1569
        </copy>
1570 2817 jones
        <copy file="${conf.dir}/log4j.properties"
1571
              tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1572
              overwrite="true">
1573
            <filterset refid="configFilters" />
1574
        </copy>
1575 2737 jones
        <!-- Copy config files into the build -->
1576
        <copy todir="${lsid.build.dir}/WEB-INF">
1577
            <fileset dir="${webinf.dir}"
1578
                     includes="**/*.wsdd" />
1579
        </copy>
1580
        <!-- Copy the metadata configuration files into the build -->
1581
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1582
        <copy todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1583
            <fileset dir="${conf.dir}"
1584
                     includes="**/*.xml" />
1585
            <fileset dir="${conf.dir}"
1586
                     includes="**/*.xslt" />
1587
            <filterset refid="configFilters" />
1588
        </copy>
1589
        <!-- Copy services files into the build -->
1590
        <mkdir dir="${lsid.build.dir}/services" />
1591
        <copy todir="${lsid.build.dir}/services">
1592
            <fileset dir="${services.dir}" />
1593
            <filterset refid="configFilters" />
1594
        </copy>
1595 2778 jones
        <!-- Copy axis files into the build -->
1596
        <mkdir dir="${lsid.build.dir}" />
1597
        <copy todir="${lsid.build.dir}">
1598
            <fileset dir="${conf.dir}/axis"
1599
                     excludes="*.properties"/>
1600
        </copy>
1601
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1602
        <copy todir="${lsid.build.dir}/WEB-INF/classes">
1603
            <fileset dir="${conf.dir}/axis"
1604
                     includes="*.properties"/>
1605
        </copy>
1606 2737 jones
    </target>
1607
1608
    <target name="compile-lsid"
1609
            depends="prepare-lsid"
1610
            description="Compile Java sources">
1611
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1612
        <javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1613
               destdir="${lsid.build.dir}/WEB-INF/classes"
1614
               debug="${compile.debug}"
1615
               deprecation="${compile.deprecation}"
1616
               optimize="${compile.optimize}">
1617
            <classpath refid="lsid.classpath" />
1618
        </javac>
1619
    </target>
1620
1621
    <target name="war-lsid"
1622
            depends="compile-lsid"
1623
            description="Create a war file for the application">
1624
        <mkdir dir="${dist.dir}" />
1625
        <war destfile="${dist.dir}/${authority.context}.war"
1626
             webxml="${webinf.dir}/web.xml">
1627
            <fileset dir="${lsid.build.dir}" />
1628
            <lib dir="${lsid.lib.dir}">
1629
                <patternset refid="lsid.jars"/>
1630
            </lib>
1631
            <lib dir="${lib.dir}">
1632
                <patternset refid="lib.jars"/>
1633
            </lib>
1634 3059 berkley
            <lib dir="${lib.dir}">
1635 2737 jones
                <include name="xalan.jar" />
1636
                <include name="xml-apis.jar" />
1637
            </lib>
1638
            <lib dir="${build.dir}">
1639
                <include name="metacat-client.jar" />
1640
            </lib>
1641
        </war>
1642
    </target>
1643
1644
    <target name="deploy-lsid"
1645
            depends="war-lsid"
1646
            description="Deploy LSID war to servlet container">
1647
        <delete dir="${deploy.dir}/${authority.context}" />
1648
        <delete file="${deploy.dir}/${authority.context}.war" />
1649
        <mkdir dir="${deploy.dir}" />
1650
        <copy todir="${deploy.dir}">
1651
            <fileset dir="${dist.dir}" />
1652
        </copy>
1653
    </target>
1654 113 jones
</project>