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