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}/lib/common/servlet.jar">
38
    <equals arg1="${tomcatversion}" arg2="tomcat3" />
39
  </condition>
40
  <condition property="jsdk" value="${tomcat}/common/lib/servlet.jar">
41
    <equals arg1="${tomcatversion}" arg2="tomcat4" />
42
  </condition>
43
  <condition property="jsdk" value="${tomcat}/common/lib/servlet-api.jar">
44
    <equals arg1="${tomcatversion}" arg2="tomcat5" />
45
  </condition>
46 2957 tao
47
  <!-- Determine if installed ecogrid -->
48
  <condition property="enable.ecogrid">
49
    <equals arg1="${install.ecogrid}" arg2="true" />
50
  </condition>
51 3034 perry
52 1929 brooke
  <target name="check-db">
53
    <condition property="use-oracle">
54
      <equals arg1="${database}" arg2="oracle" />
55
    </condition>
56
    <condition property="use-postgresql">
57
      <equals arg1="${database}" arg2="postgresql" />
58
    </condition>
59
    <condition property="use-sqlserver">
60
      <equals arg1="${database}" arg2="sqlserver" />
61
    </condition>
62
  </target>
63
64
  <target name="oracle" if="use-oracle">
65 931 jones
     <!-- Customize these properties if you are using oracle -->
66 1929 brooke
     <echo message="Using oracle..."/>
67 925 berkley
     <property name="dbDriver" value="oracle.jdbc.driver.OracleDriver"/>
68
     <property name="dbAdapter" value="edu.ucsb.nceas.dbadapter.OracleAdapter"/>
69 2617 tao
     <property name="jdbc-jar-name" value="classes111.zip" />
70
     <property name="jdbc" value="${jdbc_base}/${jdbc-jar-name}" />
71 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
72
     <property name="other" value="yes"/>
73 2175 tao
     <property name="install-sql"
74 2103 jones
               value="xmltables.sql" />
75 2175 tao
     <property name="upgrade-1.2-sql"
76 2103 jones
               value="upgrade-db-to-1.2.sql" />
77 2175 tao
     <property name="upgrade-1.3-sql"
78 2103 jones
               value="upgrade-db-to-1.3.sql" />
79 2175 tao
     <property name="upgrade-1.4-sql"
80 2103 jones
               value="upgrade-db-to-1.4.sql" />
81 2518 sgarg
     <property name="upgrade-1.5-sql"
82 2431 sgarg
               value="upgrade-db-to-1.5.sql" />
83 2518 sgarg
     <property name="upgrade-1.6-sql"
84
               value="upgrade-db-to-1.6.sql" />
85 925 berkley
   </target>
86 1311 berkley
87 1929 brooke
   <target name="postgresql" if="use-postgresql">
88 931 jones
     <!-- Customize these properties if you are using postgres -->
89 1929 brooke
     <echo message="Using PostgreSQL..."/>
90 925 berkley
     <property name="dbDriver" value="org.postgresql.Driver"/>
91 1311 berkley
     <property name="dbAdapter"
92 931 jones
               value="edu.ucsb.nceas.dbadapter.PostgresqlAdapter"/>
93 2610 tao
     <property name="jdbc-jar-name" value="postgresql-8.0-312.jdbc3.jar" />
94
     <property name="jdbc" value="lib/${jdbc-jar-name}" />
95 1744 tao
     <!-- Property to indicate is not MSSQL installation-->
96
     <property name="other" value="yes"/>
97 2175 tao
     <property name="install-sql"
98 2277 jones
               value="xmltables-postgres.sql" />
99 2175 tao
     <property name="upgrade-1.2-sql"
100 2277 jones
               value="upgrade-db-to-1.2-postgres.sql" />
101 2175 tao
     <property name="upgrade-1.3-sql"
102 2277 jones
               value="upgrade-db-to-1.3-postgres.sql" />
103 2175 tao
     <property name="upgrade-1.4-sql"
104 2277 jones
               value="upgrade-db-to-1.4-postgres.sql" />
105 2518 sgarg
     <property name="upgrade-1.5-sql"
106 2431 sgarg
               value="upgrade-db-to-1.5-postgres.sql" />
107 2518 sgarg
     <property name="upgrade-1.6-sql"
108
               value="upgrade-db-to-1.6-postgres.sql" />
109 1744 tao
    </target>
110 2175 tao
111 1929 brooke
   <target name="sqlserver" if="use-sqlserver">
112 1739 tao
     <!-- Customize these properties if you are using SQL server -->
113 1929 brooke
     <echo message="Using SQL Server..."/>
114 1739 tao
     <property name="dbDriver" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
115
     <property name="dbAdapter"
116
               value="edu.ucsb.nceas.dbadapter.SqlserverAdapter"/>
117 2296 sgarg
     <property name="jdbc" value="${jdbc_base}/msbase.jar" />
118
     <property name="jdbc-add1" value="${jdbc_base}/msutil.jar" />
119
     <property name="jdbc-add2" value="${jdbc_base}/mssqlserver.jar" />
120 1744 tao
     <!-- Property to indicate is a MSSQL installation-->
121
     <property name="MSSQL" value="yes"/>
122 2175 tao
     <property name="install-sql"
123 2118 costa
               value="xmltables-sqlserver.sql" />
124 1739 tao
   </target>
125 1311 berkley
126 1929 brooke
   <target name="config" depends="check-db,oracle,postgresql,sqlserver">
127 1814 tao
      <!-- usr for client testing, generally you don't need change-->
128 2991 berkley
      <property name="mcuser" value="uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org"/>
129
      <property name="mcpassword" value="kepler"/>
130 1801 tao
      <property name="mcanotheruser" value="uid=jtao,o=LTER,dc=ecoinformatics,dc=org"/>
131
      <property name="mcanotherpassword" value=""/>
132
133 1827 jones
      <property name="debug" value="on" />
134 2053 sgarg
      <property name="debuglevel" value="55" />
135 1716 berkley
136 1522 berkley
      <property name="morphosourcedir" value="../morpho" />
137 1570 tao
      <property name="defaultcontenttype" value="application/octet-stream" />
138 1780 jones
      <property name="utilitiesdir" value="../utilities" />
139 2175 tao
140 1941 brooke
      <echo>*********** tomcatversion = ${tomcatversion}</echo>
141
      <echo>*********** set jsdk to ${jsdk}</echo>
142 1103 tao
  </target>
143
144 931 jones
   <target name="init" depends="config">
145 2631 tao
      <path id="compile.classpath">
146
        <pathelement location="${jsdk}"/>
147
        <pathelement location="lib" />
148
        <fileset dir="lib">
149
          <include name="*.jar"/>
150
        </fileset>
151 3059 berkley
	<fileset dir="lib">
152
           <include name="xalan.jar"/>
153 3030 sgarg
         </fileset>
154 2631 tao
       <fileset dir="lib/lsid_lib">
155
         <include name="*.jar"/>
156
       </fileset>
157
       <fileset dir="${jdbc_base}">
158
         <include name="${jdbc-jar-name}"/>
159
          <include name="msbase.jar"/>
160
          <include name="msutil.jar"/>
161
          <include name="mssqlserver.jar"/>
162 3034 perry
       </fileset>
163
164
        <!-- Include geoserver, geotools, et. al. -->
165
        <fileset dir="lib/spatial/geoserver/WEB-INF/lib">
166
          <include name="*.jar"/>
167 2631 tao
        </fileset>
168 3034 perry
        <pathelement location="lib/spatial/geoserver/WEB-INF/classes"/>
169
170 2631 tao
       </path>
171
172 931 jones
      <!-- It is less likely you'll need to make any changes from here down,
173
           but customization is possible -->
174 2737 jones
      <property name="installdir"          value="${deploy.dir}/${metacat.context}" />
175
      <property name="temp-dir"            value="/tmp/${metacat.context}" />
176 1929 brooke
      <property name="name"                value="metacat"/>
177
      <property name="Name"                value="MetaCat"/>
178
      <property name="debugprefix"         value="${Name}:"/>
179 2577 sgarg
      <property name="release"             value="1.6.0"/>
180 2737 jones
      <property name="replication-path"    value="/${metacat.context}/servlet/replication"/>
181
      <property name="harvester-registration-login-path" value="/${metacat.context}/harvesterRegistrationLogin"/>
182
      <property name="harvester-registration-path"       value="/${metacat.context}/harvesterRegistration"/>
183
      <property name="servlet-path"        value="/${metacat.context}/metacat"/>
184
      <property name="html-path"           value="/${metacat.context}"/>
185 2974 jones
      <property name="systemidserver"      value="${http.protocol}://${httpserver}"/>
186 2175 tao
      <property name="style-common-relpath"
187 1933 brooke
                                           value="/style/common"/>
188 2175 tao
      <property name="style-common-cvsrelpath"
189 1938 brooke
                                           value="lib${style-common-relpath}"/>
190 2175 tao
      <property name="style-common-fullpath"
191 1933 brooke
                                           value="/${installdir}${style-common-relpath}"/>
192 2343 sgarg
      <property name="templates.dir"       value="${style-common-fullpath}/templates"/>
193 2175 tao
      <property name="style-common-path"
194 2737 jones
                                           value="/${metacat.context}${style-common-relpath}"/>
195 1929 brooke
      <property name="style-skins-relpath" value="/style/skins"/>
196 2737 jones
      <property name="style-skins-path"    value="/${metacat.context}${style-skins-relpath}"/>
197 1929 brooke
      <property name="replication-log"     value="/tmp/metacatreplication.log"/>
198 1579 tao
      <property name="replicationerrorlog" value="/tmp/metacatreplication.err"/>
199 2737 jones
      <property name="config-dir"          value="${deploy.dir}/${style-skins-path}" />
200 2461 sgarg
      <property name="util-module"         value="utilities" />
201 1929 brooke
      <property name="eml-module"          value="eml" />
202
      <property name="eml-version"         value="2.0.0beta6" />
203
      <property name="eml-tag"             value="EML_2_0_0_BETA_6_FOR_METACAT" />
204 2232 sgarg
      <property name="eml2_0_0-tag"        value="RELEASE_EML_2_0_0_UPDATE_1" />
205 3012 sgarg
      <property name="eml2_0_1-tag"        value="RELEASE_EML_2_0_1_UPDATE_3" />
206 2228 sgarg
      <property name="eml2_0_0namespace"   value="eml://ecoinformatics.org/eml-2.0.0" />
207
      <property name="eml2_0_1namespace"   value="eml://ecoinformatics.org/eml-2.0.1" />
208
      <property name="eml2_1_0namespace"   value="eml://ecoinformatics.org/eml-2.1.0" />
209 1929 brooke
      <property name="stmmlnamespace"      value="http://www.xml-cml.org/schema/stmml" />
210 1933 brooke
      <property name="eml-css"             value="eml_xsl.css"/>
211
      <property name="eml-module.default.css"
212
                                           value="default.css"/>
213 2965 tao
214 1929 brooke
      <!-- Config for registry variables -->
215 1933 brooke
      <property name="scope"               value="obfs"/>
216
      <property name="responseForm"        value="genericResponse.tmpl"/>
217
      <property name="entryForm"           value="entryForm.tmpl"/>
218
      <property name="guide"               value="genericGuide.tmpl"/>
219 2781 sgarg
      <property name="loginForm"           value="loginForm.tmpl"/>
220 2343 sgarg
      <property name="confirmData"         value="confirmData.tmpl"/>
221
      <property name="deleteData"          value="deleteData.tmpl"/>
222
      <property name="genericHeader"       value="genericHeader.tmpl"/>
223
      <property name="genericFooter"       value="genericFooter.tmpl"/>
224
      <property name="adminname"           value="KNB Support"/>
225
      <property name="recipient"           value="knb-software\@nceas.ucsb.edu"/>
226 1929 brooke
227 2343 sgarg
      <property name="defaultStage"        value="initregister"/>
228
      <property name="defaultHeader"       value="genericHeader.tmpl"/>
229
      <property name="defaultFooter"       value="genericFooter.tmpl"/>
230
      <property name="defaultChangePass"   value="ldapChangePass.tmpl"/>
231
      <property name="defaultResetPass"    value="ldapResetPass.tmpl"/>
232
      <property name="changePassSuccess"   value="ldapChangePassSuccess.tmpl"/>
233
      <property name="resetPassSuccess"    value="ldapResetPassSuccess.tmpl"/>
234
      <property name="registerFailed"      value="ldapRegisterFailed.tmpl"/>
235
      <property name="registerLter"        value="ldapRegisterLter.tmpl"/>
236
      <property name="registerMatch"       value="ldapRegisterMatch.tmpl"/>
237
      <property name="registerSuccess"     value="ldapRegisterSuccess.tmpl"/>
238
      <property name="register"            value="ldapRegister.tmpl"/>
239
      <property name="searchResults"       value="searchResults.tmpl"/>
240
241
      <filter token="scope"                value="${scope}"/>
242
      <filter token="responseForm"         value="${responseForm}"/>
243
      <filter token="entryForm"            value="${entryForm}"/>
244
      <filter token="guide"                value="${guide}"/>
245 2781 sgarg
      <filter token="loginForm"            value="${loginForm}"/>
246 2343 sgarg
      <filter token="confirmData"          value="${confirmData}"/>
247
      <filter token="deleteData"           value="${deleteData}"/>
248
      <filter token="genericHeader"        value="${genericHeader}"/>
249
      <filter token="genericFooter"        value="${genericFooter}"/>
250
      <filter token="adminname"            value="${adminname}"/>
251
      <filter token="recipient"            value="${recipient}"/>
252
253
      <filter token="ldapurl"              value="ldap.ecoinformatics.org"/>
254
      <filter token="ldapSearchBase"       value="dc=ecoinformatics,dc=org"/>
255
      <filter token="ldap_user"            value="cn=Manager,dc=ecoinformatics,dc=org"/>
256
      <filter token="ldap_password"        value="ldap_password"/>
257 2870 sgarg
      <filter token="mailhost"             value="localhost"/>
258 2343 sgarg
      <filter token="sender"               value="knb-software\@nceas.ucsb.edu"/>
259 2974 jones
      <filter token="cgiurl"               value="${cgi-prefix}/ldapweb.cgi"/>
260 2343 sgarg
261 882 jones
      <filter token="docrooturl" value="./" />
262 2356 sgarg
      <filter token="database" value="${database}" />
263 588 berkley
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
264 882 jones
      <filter token="dbDriver" value="${dbDriver}"/>
265 915 berkley
      <filter token="dbAdapter" value="${dbAdapter}"/>
266 614 bojilova
      <filter token="install-dir" value="${installdir}"/>
267 1929 brooke
      <filter token="temp-dir" value="${temp-dir}"/>
268 586 berkley
      <filter token="server" value="${server}"/>
269 977 tao
      <filter token="systemidserver" value="${systemidserver}"/>
270 1929 brooke
      <filter token="cgi-prefix" value="${cgi-prefix}"/>
271
      <filter token="ldapUrl" value="${ldapUrl}"/>
272 586 berkley
      <filter token="replication-log" value="${replication-log}"/>
273 1579 tao
      <filter token="replicationerrorlog" value="${replicationerrorlog}"/>
274 348 jones
      <filter token="servlet-path" value="${servlet-path}"/>
275 359 bojilova
      <filter token="html-path" value="${html-path}"/>
276 362 jones
      <filter token="user" value="${user}"/>
277
      <filter token="password" value="${password}"/>
278 1783 jones
      <filter token="mcuser" value="${mcuser}"/>
279
      <filter token="mcpassword" value="${mcpassword}"/>
280 1801 tao
      <filter token="mcanotheruser" value="${mcanotheruser}"/>
281
      <filter token="mcanotherpassword" value="${mcanotherpassword}"/>
282 1929 brooke
      <filter token="knb-site-url" value="${knb-site-url}"/>
283 1933 brooke
      <filter token="eml-css" value="${eml-css}"/>
284 1929 brooke
      <filter token="style-skins-relpath" value="${style-skins-relpath}"/>
285
      <filter token="style-skins-path" value="${style-skins-path}"/>
286
      <filter token="style-common-relpath" value="${style-common-relpath}"/>
287
      <filter token="style-common-fullpath" value="${style-common-fullpath}"/>
288
      <filter token="style-common-path" value="${style-common-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
741 2395 tao
   <target name="sqlupgrade15" depends="prepare">
742
      <echo>Updating the database tables to upgrade to version 1.5 by sql command</echo>
743 2393 tao
      <sql driver="${dbDriver}"
744
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
745
          url="${jdbc-connect}"
746
          userid="${user}"
747
          password="${password}"
748
          src="${build.src}/${upgrade-1.5-sql}" />
749 2444 sgarg
      <sql driver="${dbDriver}"
750
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
751
          url="${jdbc-connect}"
752
          userid="${user}"
753
          password="${password}"
754
          rdbms="oracle"
755
          delimiter="/">
756
        <transaction>
757
           CREATE TRIGGER xml_returnfield_before_insert
758
           BEFORE INSERT ON xml_returnfield FOR EACH ROW
759
           BEGIN
760
              SELECT xml_returnfield_id_seq.nextval
761
                 INTO :new.returnfield_id
762
                 FROM dual;
763
           END;
764
           /
765
        </transaction>
766
        <transaction>
767
           CREATE TRIGGER xml_queryresult_before_insert
768
           BEFORE INSERT ON xml_queryresult FOR EACH ROW
769
           BEGIN
770
              SELECT xml_queryresult_id_seq.nextval
771
              INTO :new.queryresult_id
772
              FROM dual;
773
           END;
774
           /
775
        </transaction>
776
      </sql>
777 2393 tao
   </target>
778 2353 sgarg
779 3072 perry
   <target name="install-spatial" depends="jar,clientjar,harvesterjar"
780 3034 perry
           description="Installs spatial option for metacat">
781
782
      <property name="spatial.dir" value="./lib/spatial"/>
783
      <property name="spatial.geoserver.dir" value="${spatial.dir}/geoserver"/>
784
      <property name="spatial.webinf-mods" value="${spatial.dir}/WEB-INF"/>
785
786
      <!-- Copy geoserver libs into ${war.lib} -->
787
      <copy todir="${war.lib}" filtering="no">
788
        <fileset dir="${spatial.geoserver.dir}/WEB-INF/lib">
789
          <include name="**"/>
790
        </fileset>
791
      </copy>
792
793
      <!-- Copy everything in geoservers WEB-INF (except the libs) into ${war.webinf} -->
794
      <copy todir="${war.webinf}" filtering="no">
795
        <fileset dir="${spatial.geoserver.dir}/WEB-INF">
796
          <exclude name="lib/**"/>
797
          <exclude name="web.xml"/>
798
        </fileset>
799
      </copy>
800
801
      <!-- Copy the rest of the geoserver codebase into ${war.context} -->
802
      <copy todir="${war.context}" filtering="no">
803
        <fileset dir="${spatial.geoserver.dir}">
804
          <exclude name="WEB-INF/**"/>
805
          <exclude name="index.jsp"/>
806
        </fileset>
807
      </copy>
808
809
      <!-- Copy the geoserver index.jsp but rename it to avoid conflicting w/metcat   -->
810
     <copy file="${spatial.geoserver.dir}/WEB-INF/pages/index.jsp"
811
          tofile="${war.context}/geoserver.jsp"
812
          overwrite="true"
813
          filtering="no"/>
814
815
      <!-- Copy the geoserver/metacat combined web.xml into ${build.war}/web.xml   -->
816
      <copy file="${spatial.webinf-mods}/web.xml.combined"
817
          tofile="${build.war}/web.xml"
818
          overwrite="true"
819
          filtering="no"/>
820
821
      <!-- Copy the rest of the modified geoserver web-inf files
822
      <copy todir="${war.webinf}" filtering="no">
823
        <fileset dir="${spatial.webinf-mods}">
824
          <exclude name="web.xml.combined"/>
825
        </fileset>
826
      </copy> -->
827
828
    </target>
829
830
831 2957 tao
   <target name="install" depends="install-ecogrid" description="* Full Install *">
832 1079 tao
       <mkdir dir="${datafilepath}" />
833 1455 tao
       <mkdir dir="${inlinedatafilepath}" />
834 1079 tao
       <chmod dir="${datafilepath}" perm="ug+w" />
835 1929 brooke
       <mkdir dir="${temp-dir}"/>
836
       <chmod dir="${temp-dir}" perm="ug+w" />
837 2737 jones
       <copy file="${dist.dir}/${metacat.context}.war" todir="${deploy.dir}"/>
838 2993 tao
   	   <echo>If you enable ecogrid installation, please run "ant deploy-ecogrid" when installation or upgrade is done</echo>
839 1952 jones
   </target>
840 2957 tao
841 2965 tao
   <target name="install-ecogrid" depends="war, get-ecogrid" if="enable.ecogrid"
842 2957 tao
			    description="Install Ecogrid Compentent">
843 2965 tao
   	  <copyfile src="lib/metacat.url" dest="${ecogrid-dir}/conf/MetacatImpl/classes/metacat.properties" forceoverwrite="true" filtering="yes"/>
844 2991 berkley
   	  <ant antfile="build.xml" dir="${ecogrid-dir}" target ="clean" inheritall="false">
845 2977 tao
   	         <property name="context" value="${metacat.context}"/>
846
   	   	     <property name="target" value="${ecogrid-target-name}"/>
847
   	   	     <property name="metacat.dir" value="${metacat.dir}"/>
848
   	  </ant>
849 2991 berkley
   	  <ant antfile="build.xml" dir="${ecogrid-dir}" target ="war" inheritall="false">
850 2957 tao
   	     <property name="context" value="${metacat.context}"/>
851
   	     <property name="target" value="${ecogrid-target-name}"/>
852 2965 tao
   	     <property name="metacat.dir" value="${metacat.dir}"/>
853 2957 tao
   	  </ant>
854 2978 tao
   	  <war destfile="${ecogrid-dir}/build/${metacat.context}.war" update="true">
855
  	      <webinf dir="${ecogrid-dir}/lib">
856
   	        <include name="server-config.wsdd"/>
857
   	      </webinf>
858
   	  </war>
859 2965 tao
   	  <copy file="${ecogrid-dir}/build/${metacat.context}.war" todir="${dist.dir}" overwrite="true"/>
860 2978 tao
861
862 2957 tao
   </target>
863 2965 tao
864
   <target name="get-ecogrid" depends="init" if="ecogrid.required" description="Check out ecogrid module">
865
	<echo>Enter CVS password: </echo>
866
	     <cvs cvsRoot="${cvsroot}"
867
	          package="${ecogrid-module}" dest="${ecogrid-module-dest-dir}"/>
868
   </target>
869
870
871 2175 tao
   <target name="upgrade" depends="install"
872 1952 jones
          description="* Upgrade an existing metacat installation with a new version *">
873 2737 jones
       <unwar src="${deploy.dir}/${metacat.context}.war" dest="${deploy.dir}/${metacat.context}" />
874 1952 jones
   </target>
875 2957 tao
876 2978 tao
   <target name="deploy-ecogrid" depends="clean-ecogrid-server-config-wsdd" if="enable.ecogrid" description="Automately generate wsdd for ecogrid service">
877 2991 berkley
   	 <ant antfile="build.xml" dir="${ecogrid-dir}" target ="deploy" inheritall="false">
878 2957 tao
   	   	 <property name="context" value="${metacat.context}"/>
879
   	   	 <property name="target" value="${ecogrid-target-name}"/>
880 2965 tao
   	     <property name="metacat.dir" value="${metacat.dir}"/>
881 2977 tao
   	     <property name="hostname" value="${config.hostname}"/>
882
   	     <property name="port" value="${config.port}"/>
883 2957 tao
   	 </ant>
884
   </target>
885 2978 tao
886
   <target name="clean-ecogrid-server-config-wsdd" depends="init" description="Automately generate wsdd for ecogrid service">
887
      <delete file="${deploy.dir}/${metacat.context}/WEB-INF/server-config.wsdd"/>
888
   </target>
889 1952 jones
890 2175 tao
   <target name="install-registry" depends="init,getConversionXSL"
891 1952 jones
            description="Install Registry">
892 2175 tao
893 1952 jones
      <copy file="${srcdir}/perl/register-dataset.cgi"
894
            todir="${inst.cgi.dir}" filtering="yes"/>
895
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
896 2175 tao
897 1952 jones
      <mkdir dir="${temp-dir}" />
898 2343 sgarg
      <copy todir="${temp-dir}" filtering="yes">
899
       <fileset dir="lib/style/common/emlb6toeml2">
900 1952 jones
         <include name="*.xsl"/>
901
         <include name="*.xml"/>
902
       </fileset>
903 2343 sgarg
      </copy>
904 1952 jones
905
      <echo message="Install Registry completed." />
906
   </target>
907
908 2343 sgarg
   <target name="install-ldap" depends="init">
909
      <copy file="${srcdir}/perl/ldapweb.cgi"
910
            todir="${inst.cgi.dir}" filtering="yes"/>
911
      <chmod file="${inst.cgi.dir}/ldapweb.cgi" perm="ugo+x" />
912
      <copy file="lib/ldapweb.cfg"
913
            todir="${inst.cgi.dir}" filtering="yes"/>
914
      <chmod file="${inst.cgi.dir}/ldapweb.cfg" perm="ugo+x" />
915
      <mkdir dir="${templates.dir}" />
916
      <copy todir="${templates.dir}" filtering="yes">
917
        <fileset dir="lib/style/common/templates">
918
            <include name="${defaultChangePass}"/>
919
            <include name="${defaultResetPass}"/>
920
            <include name="${changePassSuccess}"/>
921
            <include name="${resetPassSuccess}"/>
922
            <include name="${registerFailed}"/>
923
            <include name="${registerLter}"/>
924
            <include name="${registerMatch}"/>
925
            <include name="${registerSuccess}"/>
926
            <include name="${register}"/>
927
            <include name="${searchResults}"/>
928 2974 jones
            <include name="${defaultHeader}"/>
929
            <include name="${defaultFooter}"/>
930
            <include name="${responseForm}"/>
931 2343 sgarg
        </fileset>
932
      </copy>
933
      <echo message="ldapweb install complete." />
934
   </target>
935
936
937 2175 tao
   <target name="install-skin" depends="init"
938 2052 sgarg
            description="Install a Skin">
939
940 2175 tao
      <input message="Please enter name of the skin"
941 2052 sgarg
             addproperty="skin-name"/>
942
943
      <mkdir dir="${installdir}/style/skins/${skin-name}" />
944
      <copy todir="${installdir}/style/skins/${skin-name}" filtering="yes">
945
       <fileset dir="lib/style/skins/${skin-name}">
946 3014 costa
           <exclude name="**/*.png"/>
947
           <exclude name="**/*.gif"/>
948
           <exclude name="**/*.jpg"/>
949 2277 jones
           <exclude name="**/CVS*"/>
950
           <exclude name="**/.#*"/>
951 2052 sgarg
       </fileset>
952
      </copy>
953 2054 sgarg
     <copy todir="${installdir}/style/skins/${skin-name}" filtering="no">
954
       <fileset dir="lib/style/skins/${skin-name}">
955 3014 costa
           <include name="**/*.png"/>
956
           <include name="**/*.gif"/>
957
           <include name="**/*.jpg"/>
958 2277 jones
           <exclude name="**/CVS*"/>
959
           <exclude name="**/.#*"/>
960 2054 sgarg
       </fileset>
961
      </copy>
962 2974 jones
      <copy todir="${installdir}/style/common" filtering="yes">
963
       <fileset dir="lib/style/common">
964
           <include name="*.js"/>
965
           <include name="*.jsp"/>
966
           <include name="*.css"/>
967
           <exclude name="*.png"/>
968
           <exclude name="*.gif"/>
969
           <exclude name="*.jpg"/>
970
           <exclude name="**/CVS*"/>
971
           <exclude name="**/.#*"/>
972
       </fileset>
973
      </copy>
974 2277 jones
      <!--
975 2210 jones
      <mkdir dir="${installdir}/style/skins/${skin-name}/images" />
976
     <copy todir="${installdir}/style/skins/${skin-name}/images" filtering="no">
977
       <fileset dir="lib/style/skins/${skin-name}/images">
978
           <include name="*.png"/>
979
           <include name="*.gif"/>
980
           <include name="*.jpg"/>
981
       </fileset>
982
      </copy>
983 2277 jones
      -->
984 2052 sgarg
985
      <echo message="Install Skin completed." />
986
   </target>
987
988 3034 perry
   <target name="war" depends="warPrepare,warMSSQL,install-spatial"
989 1952 jones
            description="Create a web archive (WAR) for servlet deployment">
990 2737 jones
       <mkdir dir="${dist.dir}" />
991
       <war destfile="${dist.dir}/${metacat.context}.war"
992 1952 jones
            webxml="${build.war}/web.xml">
993
         <fileset dir="${war.context}"/>
994
         <lib dir="${war.lib}"/>
995
         <webinf dir="${war.webinf}"/>
996
       </war>
997
   </target>
998 2957 tao
999
1000 1952 jones
1001 2059 costa
   <target name="warPrepare" depends="jar,clientjar,harvesterjar"
1002 1952 jones
            description="Prepare files for creating a web archive (WAR)">
1003
1004
       <property name="war.lib" value="${build.war}/lib" />
1005
       <property name="war.webinf" value="${build.war}/WEB-INF" />
1006 2737 jones
       <property name="war.context" value="${build.war}/${metacat.context}" />
1007 1952 jones
       <mkdir dir="${war.lib}" />
1008
       <mkdir dir="${war.webinf}" />
1009
       <mkdir dir="${war.context}" />
1010 2610 tao
1011
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
1012 1952 jones
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
1013
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
1014 2059 costa
       <copy file="${build.dir}/harvester.jar" todir="${war.lib}" />
1015 1952 jones
       <copy todir="${war.lib}" filtering="no">
1016 1823 jones
         <fileset dir="lib">
1017 2610 tao
            <not>
1018
               <filename name="${jdbc-jar-name}"/>
1019
            </not>
1020
            <include name="*.jar"/>
1021 1823 jones
         </fileset>
1022 3059 berkley
         <fileset dir="lib">
1023
           <include name="xalan.jar"/>
1024 1823 jones
         </fileset>
1025
       </copy>
1026 1729 tao
       <copy file="lib/web.xml.${tomcatversion}"
1027 1952 jones
             tofile="${build.war}/web.xml" />
1028
       <copy file="lib/metacat.properties" todir="${war.webinf}"
1029 1951 jones
             filtering="yes" />
1030 2900 sgarg
       <copy todir="${war.webinf}" filtering="yes">
1031
	   	  <fileset dir="lib">
1032
           <include name="skin.configs/**"/>
1033
		  </fileset>
1034
	   </copy>
1035 2583 sgarg
       <copy file="lib/log4j.properties" todir="${war.webinf}"
1036
             filtering="yes" />
1037 1952 jones
       <copy todir="${war.context}" filtering="no">
1038 822 jones
         <fileset dir="lib">
1039
           <include name="**/*.jpg"/>
1040
           <include name="**/*.png"/>
1041
           <include name="**/*.gif"/>
1042 2844 costa
           <include name="LiveMap_30/**"/>
1043 822 jones
         </fileset>
1044
       </copy>
1045 1952 jones
       <copy todir="${war.context}" filtering="yes">
1046 822 jones
         <fileset dir="lib">
1047
           <exclude name="*.jar"/>
1048
           <exclude name="*.properties"/>
1049
           <exclude name="web.xml"/>
1050 1437 berkley
           <exclude name="**/*.jpg"/>
1051
           <exclude name="**/*.png"/>
1052
           <exclude name="**/*.gif"/>
1053 2778 jones
           <exclude name="lsid_lib/**"/>
1054
           <exclude name="lsid_conf/**"/>
1055 2844 costa
           <exclude name="LiveMap_30/**"/>
1056 2900 sgarg
           <exclude name="skin.configs/**"/>
1057 3034 perry
           <exclude name="spatial/geoserver/**"/>
1058
           <exclude name="spatial/WEB-INF/**"/>
1059 822 jones
         </fileset>
1060
       </copy>
1061 1311 berkley
   </target>
1062 1929 brooke
1063 1952 jones
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
1064
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
1065
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
1066 1929 brooke
   </target>
1067
1068 2175 tao
   <target name="getConversionXSL" depends="prepare"
1069 1954 jones
            unless="styles.not.needed"
1070 1939 brooke
            description="Gets the conversion stylesheets for eml2 beta 6 to eml 2.0.0">
1071 2497 sgarg
1072 1929 brooke
     <echo>Enter CVS password: </echo>
1073 2497 sgarg
     <cvs cvsRoot="${cvsroot}"
1074
          package="${eml-module}"
1075
          tag="${eml2_0_1-tag}"
1076
          dest="${build.tmp}/eml_${eml2_0_1-tag}" />
1077 2343 sgarg
1078
     <mkdir dir="lib/style/common/emlb6toeml2" />
1079
      <copy todir="lib/style/common/emlb6toeml2" filtering="yes">
1080 2497 sgarg
       <fileset dir="${build.tmp}/eml_${eml2_0_1-tag}/${eml-module}/lib/beta6toeml2/xsl">
1081 2343 sgarg
         <include name="*.xsl"/>
1082
         <include name="*.xml"/>
1083
       </fileset>
1084
      </copy>
1085 1929 brooke
   </target>
1086
1087 2135 costa
   <target name="testprep" depends="jar,clientjar,harvesterjar">
1088 1783 jones
      <mkdir dir="${build.tests}"/>
1089
      <copy todir="${build.tests}" filtering="yes">
1090
        <fileset dir="${testdir}">
1091
          <include name="edu/**"/>
1092
        </fileset>
1093
      </copy>
1094 971 tao
      <!-- copy and compile the tests into a jar file -->
1095 1783 jones
      <javac srcdir="${build.tests}"
1096
             destdir="${build.tests}"
1097 1612 tao
             debug="on"
1098 2982 jones
             includes="**/*.java">
1099 2599 jones
        <classpath>
1100
          <path refid="compile.classpath"/>
1101
          <fileset dir="${build.dir}">
1102 2982 jones
            <include name="${name}.jar"/>
1103
            <include name="${name}-client.jar"/>
1104
            <include name="harvester.jar"/>
1105 2599 jones
          </fileset>
1106
        </classpath>
1107
      </javac>
1108 204 jones
1109 1311 berkley
      <jar jarfile="${build.dir}/${name}-junittests.jar"
1110 1783 jones
        basedir="${build.tests}"
1111 1311 berkley
                includes="**/*.class" />
1112 1822 jones
   </target>
1113 971 tao
1114 1939 brooke
   <target name="test" depends="testprep"
1115
            description="Uses the ant junit task to run all JUnit tests">
1116 1822 jones
1117 971 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
1118 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1119 971 tao
             haltonerror="no">
1120 1783 jones
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
1121 971 tao
        <classpath>
1122 2599 jones
          <path refid="compile.classpath"/>
1123
          <fileset dir="${build.dir}">
1124 2982 jones
            <include name="${name}.jar"/>
1125
            <include name="${name}-client.jar"/>
1126
            <include name="harvester.jar"/>
1127
            <include name="${name}-junittests.jar"/>
1128 2599 jones
          </fileset>
1129 971 tao
        </classpath>
1130
1131
        <formatter type="plain" />
1132
1133
        <batchtest fork="yes" todir="${build.dir}">
1134 1783 jones
          <fileset dir="${build.tests}">
1135 1116 tao
            <include name="**/*.class" />
1136 971 tao
          </fileset>
1137
        </batchtest>
1138
     </junit>
1139
   </target>
1140 1103 tao
1141 1939 brooke
    <target name="runonetest" depends="testprep"
1142
            description="Uses the ant junit task to run a single JUnit test, defined by the ${testtorun} property">
1143 1500 tao
1144 1939 brooke
              <echo>testtorun: ${testtorun}</echo>
1145
1146 1500 tao
      <!-- use the ant "junit" task to run JUnit tests. -->
1147 1783 jones
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1148 1500 tao
             haltonerror="no">
1149 2044 tao
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
1150 1500 tao
        <classpath>
1151 2599 jones
          <path refid="compile.classpath"/>
1152
          <fileset dir="${build.dir}">
1153 2982 jones
            <include name="${name}.jar"/>
1154
            <include name="${name}-client.jar"/>
1155
            <include name="harvester.jar"/>
1156
            <include name="${name}-junittests.jar"/>
1157 2599 jones
          </fileset>
1158 1500 tao
        </classpath>
1159
1160
        <formatter type="plain" />
1161
1162
        <batchtest fork="yes" todir="${build.dir}">
1163 1783 jones
          <fileset dir="${build.tests}">
1164 1500 tao
            <include name="**/${testtorun}.class" />
1165
          </fileset>
1166
        </batchtest>
1167
     </junit>
1168
   </target>
1169
1170 2175 tao
   <target name="testharvester"
1171 2135 costa
           depends="testprep"
1172
           description="Uses the ant junit task to test only the Harvester code">
1173 2175 tao
     <junit printsummary="yes"
1174
            haltonfailure="off"
1175 2135 costa
            fork="yes"
1176
            haltonerror="off">
1177 2599 jones
        <classpath>
1178
          <path refid="compile.classpath"/>
1179
          <fileset dir="${build.dir}">
1180 2982 jones
            <include name="${name}.jar"/>
1181
            <include name="${name}-client.jar"/>
1182
            <include name="harvester.jar"/>
1183
            <include name="${name}-junittests.jar"/>
1184 2599 jones
          </fileset>
1185
        </classpath>
1186 2135 costa
       <formatter type="plain" />
1187
       <batchtest fork="yes" todir="${build.dir}">
1188
         <fileset dir="${build.tests}">
1189
           <include name="**/harvesterClient/*.class" />
1190
         </fileset>
1191
       </batchtest>
1192
     </junit>
1193
   </target>
1194
1195 1939 brooke
  <target name="gethttpclient" depends="prepare"
1196
            description="checks out and compiles morpho httpclient code">
1197 1311 berkley
  <!--mkdir dir="${morphosourcedir}" -->
1198 1487 tao
        <cvs cvsRoot="${cvsroot}"
1199 1103 tao
             package="morpho"
1200
             dest="." />
1201 1107 tao
        <ant dir="${morphosourcedir}" inheritAll="false"  target="jar" />
1202 1103 tao
   </target>
1203
1204
   <!-- run this target, we need to check out a another morpho souce dir was checked out. -->
1205 1939 brooke
   <target name="nettest" depends="install"
1206
            description="compiles and runs the metacatnettest code">
1207 2175 tao
1208 1103 tao
      <echo>***********************************
1209 1311 berkley
      Please run ant gethttpclient first!
1210
      ***********************************
1211 1103 tao
      </echo>
1212
      <!-- copy and compile the tests into a jar file -->
1213 1116 tao
      <mkdir dir="${build.metacatnettest}"/>
1214 1103 tao
      <javac srcdir="${junitnettestsdir}"
1215 1116 tao
             destdir="${build.metacatnettest}"
1216 2599 jones
             includes="**/*.java">
1217
        <classpath>
1218
          <path refid="compile.classpath"/>
1219
          <fileset dir="${build.dir}">
1220 2982 jones
            <include name="${name}.jar"/>
1221 2599 jones
          </fileset>
1222
        </classpath>
1223
      </javac>
1224 1103 tao
1225
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
1226 1116 tao
                    basedir="${build.metacatnettest}"
1227 1103 tao
                    includes="**/*.class" />
1228
1229
      <!-- use the ant "junit" task to run JUnit tests. -->
1230 1107 tao
      <junit printsummary="yes" haltonfailure="no" fork="yes"
1231 1103 tao
             haltonerror="no">
1232 1107 tao
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
1233 1103 tao
        <classpath>
1234 2599 jones
          <path refid="compile.classpath"/>
1235
          <fileset dir="${build.dir}">
1236 2982 jones
            <include name="${name}.jar"/>
1237
            <include name="${name}-junitnettests.jar"/>
1238 2599 jones
          </fileset>
1239 1103 tao
        </classpath>
1240
1241
        <formatter type="plain" />
1242
1243
        <batchtest fork="yes" todir="${build.dir}">
1244 1116 tao
          <fileset dir="${build.metacatnettest}">
1245
            <include name="**/*.class" />
1246 1103 tao
          </fileset>
1247
        </batchtest>
1248
     </junit>
1249 1311 berkley
   </target>
1250 1103 tao
1251 1939 brooke
   <target name="cleanweb" depends="clean"
1252
            description="deletes tomcat web context dir and all its contents">
1253 1522 berkley
     <delete dir="${installdir}" />
1254
   </target>
1255
1256
1257 1939 brooke
   <target name="clean" depends="init"
1258 2320 jones
            description="deletes build dir and files that can be regenerated form the release">
1259 822 jones
       <delete dir="${build.dir}" />
1260 2737 jones
       <delete dir="${dist.dir}" />
1261 2320 jones
   </target>
1262
1263
   <target name="fullclean" depends="clean"
1264
            description="deletes even jars that depend on external sources such as stylesheets and jars">
1265
       <delete file="lib/httpclient.jar" />
1266
       <delete file="lib/utilities.jar" />
1267 1939 brooke
       <delete includeEmptyDirs="true" failonerror="false">
1268
         <fileset dir="${style-common-cvsrelpath}">
1269
           <include name="${eml-css}" />
1270
           <include name="eml-*/*.xsl" />
1271
           <include name="eml-*" />
1272
         </fileset>
1273 2320 jones
       </delete>
1274 113 jones
   </target>
1275
1276 1939 brooke
   <target name="jdoc" depends="prepare"
1277
            description="generates javadoc documentation">
1278 822 jones
       <javadoc packagenames="edu.ucsb.nceas.*"
1279 516 jones
           sourcepath="${build.src}"
1280
           destdir="${build.javadocs}"
1281 113 jones
           author="true"
1282
           version="true"
1283
           use="true"
1284 348 jones
           windowtitle="${Name} API"
1285
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1286 2599 jones
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1287
         <classpath>
1288
           <path refid="compile.classpath"/>
1289
         </classpath>
1290
       </javadoc>
1291 113 jones
   </target>
1292
1293 2461 sgarg
   <target name="dist"
1294 2965 tao
       depends="geteml,get-ecogrid,jar,protocol,jdoc,getConversionXSL,getutilities"
1295 1939 brooke
            description="prepares a full release distribution">
1296 806 jones
      <mkdir dir="${dist.dir}"/>
1297
      <delete dir="${ver.dir}" />
1298
      <mkdir dir="${ver.dir}"/>
1299
      <copy todir="${ver.dir}">
1300 1311 berkley
        <fileset dir="."
1301 2401 costa
            excludes="**/CVS* **/.#* src/** test/** build/** docs/** ${dist.dir}/** ${dist.dir.hle}/**"/>
1302 806 jones
      </copy>
1303
      <copy todir="${ver.dir}" file="build.xml"/>
1304 2317 jones
      <copy todir="${ver.dir}" file="build.properties"/>
1305 882 jones
1306
      <copy todir="${ver.dir}/docs" filtering="yes">
1307
        <fileset dir="docs" excludes="**/*gif **/*jpg **/*png" />
1308
      </copy>
1309
      <copy todir="${ver.dir}/docs" filtering="no">
1310
        <fileset dir="docs" includes="**/*gif **/*jpg **/*png" />
1311
      </copy>
1312 806 jones
      <copy todir="${ver.dir}/docs/dev">
1313
        <fileset dir="${build.dir}/docs"/>
1314
      </copy>
1315 917 berkley
      <copy todir="${ver.dir}/src">
1316
        <fileset dir="${build.dir}/src"/>
1317
      </copy>
1318 2391 tao
      <!-- copy loaddtdschemal.sql form src dir(which has the server token to ver.dir/src-->
1319
      <copy todir="${ver.dir}/src" file="${srcdir}/loaddtdschema.sql" overwrite="yes" filtering="no"/>
1320 2395 tao
      <copy todir="${ver.dir}/src" file="${srcdir}/upgrade-db-to-1.5.sql" overwrite="yes" filtering="no"/>
1321 2323 jones
      <!--
1322 992 berkley
      <delete dir="./${ver.dir}/${build.dir}"/>
1323
      <delete dir="./${ver.dir}/dist"/>
1324 2323 jones
      -->
1325 882 jones
      <delete file="./${name}-${release}.zip"/>
1326 1312 tao
      <zip zipfile="./${name}-${release}.zip" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1327 882 jones
      <delete file="./${name}-${release}.tar.gz" />
1328 1312 tao
      <tar tarfile="./${name}-${release}.tar" basedir="${dist.dir}" excludes="${name}-${release}/src/**, ${name}-${release}/build/src/**"/>
1329 1311 berkley
      <gzip zipfile="./${name}-${release}.tar.gz"
1330 882 jones
                src="./${name}-${release}.tar"/>
1331
      <delete file="./${name}-${release}.tar" />
1332 1311 berkley
  </target>
1333 806 jones
1334 1939 brooke
  <target name="distsrc" depends="dist"
1335
            description="prepares a source distribution">
1336 806 jones
      <mkdir dir="${ver.src}"/>
1337
      <copy todir="${ver.src}">
1338
        <fileset dir="./src"/>
1339
      </copy>
1340 2461 sgarg
      <mkdir dir="${util.dir}"/>
1341
      <copy todir="${util.dir}">
1342
        <fileset dir="${build.tmp}/utilities" excludes="**/CVS*" />
1343
      </copy>
1344 2965 tao
1345
  	  <mkdir dir="${ecogrid-dist-dir}"/>
1346
  	  <copy todir="${ecogrid-dist-dir}">
1347
  	        <fileset dir="${ecogrid-dir}" excludes="**/CVS*" />
1348
  	  </copy>
1349 806 jones
1350 882 jones
      <delete file="./${name}-src-${release}.zip"/>
1351
      <zip zipfile="./${name}-src-${release}.zip" basedir="${dist.dir}"/>
1352
      <delete file="./${name}-src-${release}.tar.gz" />
1353
      <tar tarfile="./${name}-src-${release}.tar" basedir="${dist.dir}"/>
1354 1311 berkley
      <gzip zipfile="./${name}-src-${release}.tar.gz"
1355 882 jones
                src="./${name}-src-${release}.tar"/>
1356
      <delete file="./${name}-src-${release}.tar" />
1357 807 jones
      <delete dir="${dist.dir}"/>
1358 1311 berkley
  </target>
1359 806 jones
1360 1702 tao
   <target name="stylesheettest">
1361 1939 brooke
     <xslt in="${input}" out="eml.html" style="${style-common-cvsrelpath}/eml-2.0.0/eml-2.0.0.xsl">
1362 1702 tao
      <param name="displaymodule" expression="${displaymodule}"/>
1363
      <param name="docid" expression="${input}"/>
1364
      <param name="entitytype" expression="${entitytype}"/>
1365
      <param name="entityindex" expression="${entityindex}"/>
1366
      <outputproperty name="method" value="html"/>
1367
      <outputproperty name="standalone" value="yes"/>
1368
      <outputproperty name="encoding" value="iso8859_1"/>
1369
      <outputproperty name="indent" value="yes"/>
1370
    </xslt>
1371
  </target>
1372 2175 tao
1373 1819 tao
 <target name="gridinit" depends="init">
1374
   <property name="java2wsdl.tool" value="org.apache.axis.wsdl.Java2WSDL" />
1375
   <property name="wsdldecorator.tool" value="org.globus.ogsa.tools.wsdl.DecorateWSDL" />
1376
   <property name="wsdl.tool" value="org.globus.ogsa.tools.wsdl.GSDL2Java"/>
1377
   <property environment="env"/>
1378
   <property name="binding.file" value="${env.GLOBUS_LOCATION}/schema/ogsi/ogsi_bindings.wsdl"/>
1379 1820 tao
    <path id="webservicepath">
1380
        <pathelement location="."/>
1381
        <pathelement location="${env.JAVA_HOME}/../lib/tools.jar"/>
1382
        <pathelement location="${build.dest}"/>
1383
        <fileset dir="${env.GLOBUS_LOCATION}/lib">
1384
           <include name="*.jar"/>
1385
        </fileset>
1386
      </path>
1387 1819 tao
</target>
1388
1389 1821 tao
 <target name="gridprepare" depends="gridinit, prepare">
1390 2175 tao
 </target>
1391
1392 1821 tao
  <target name="compileinterface" depends="clean, gridprepare">
1393 1817 tao
    <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/${interface.name}.java" />
1394 1811 tao
  </target>
1395 2175 tao
1396 1811 tao
  <target name="generateWSDL" depends="compileinterface">
1397
    <echo message="Generating wsdl from ${interface.name} interface"/>
1398
    <java classname="${java2wsdl.tool}"
1399 1814 tao
          dir="${build.src}" fork="yes"
1400 1811 tao
          classpathref="webservicepath"  failonerror="true" >
1401
      <arg value="-P"/>
1402
      <arg value="${interface.name}PortType"/>
1403
      <arg value="-S"/>
1404
      <arg value="${interface.name}Service"/>
1405
      <arg value="-y"/>
1406
      <arg value="WRAPPED"/>
1407
      <arg value="-u"/>
1408
      <arg value="LITERAL"/>
1409
      <arg value="-l"/>
1410
      <arg value="http://localhost/ogsa/services/${interface.name}Service"/>
1411
      <arg value="-n"/>
1412
      <arg value="http://${services.namespace}/${interface.name}"/>
1413
      <arg value="${interface.package}.${interface.name}"/>
1414
    </java>
1415
  </target>
1416 2175 tao
1417 1811 tao
   <target name="decorateWSDL" depends="generateWSDL">
1418
      <property name="wsdl.file" value="${interface.name}Service.wsdl"/>
1419 1814 tao
      <java classname="${wsdldecorator.tool}" dir="${build.src}"
1420 1811 tao
            fork="yes"
1421
            classpathref="webservicepath" failonerror="true" >
1422
        <arg value="${binding.file}"/>
1423
        <arg value="${wsdl.file}"/>
1424
      </java>
1425
   </target>
1426 2175 tao
1427 1811 tao
   <target name="generatestubs" depends="decorateWSDL">
1428
      <echo message=" Generating stubs " />
1429 1814 tao
      <echo message="wsdl file is ${wsdl.file}"/>
1430
      <echo message="build.src is ${build.src}"/>
1431 1811 tao
      <java classname="${wsdl.tool}" dir="${build.src}" fork="yes"
1432
            classpathref="webservicepath" failonerror="true" >
1433 1814 tao
         <arg value="${wsdl.file}"/>
1434 1811 tao
    </java>
1435
  </target>
1436 2175 tao
1437 1811 tao
  <target name="compileStubsAndImpl" depends="generatestubs, utilities">
1438
     <echo message=" Compiling stubs " />
1439
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" includes="**/${interface.name}/*.java" />
1440
     <echo message=" Compiling impl " />
1441
     <javac srcdir="${build.src}" destdir="${build.dest}" classpathref="webservicepath" classpath="./lib/utilities.jar" includes="**/impl/*.java" />
1442
  </target>
1443 2175 tao
1444 1811 tao
  <target name="jarStubsAndImpl" depends="compileStubsAndImpl">
1445
     <echo message=" jar stubs classes " />
1446
     <jar destfile="${build.dir}/${interface.name}-stubs.jar" basedir="${build.dest}" includes="**/${interface.name}/*.class" />
1447
     <echo message=" jar impl classes " />
1448
     <jar destfile="${build.dir}/${interface.name}.jar" basedir="${build.dest}" includes="**/impl/*.class" />
1449
  </target>
1450 2175 tao
1451 1811 tao
  <target name="gar" depends="jarStubsAndImpl">
1452
     <echo message=" jar the gar file"/>
1453
     <mkdir dir="${build.dir}/gar"/>
1454
     <mkdir dir="${build.dir}/gar/schema/edu"/>
1455
     <copy file="${build.dir}/${interface.name}.jar" todir="${build.dir}/gar" />
1456
     <copy file="${build.dir}/${interface.name}-stubs.jar" todir="${build.dir}/gar" />
1457 1814 tao
     <copy file="lib/utilities.jar" todir="${build.dir}/gar" />
1458
     <copy file="lib/server-deploy.wsdd" todir="${build.dir}/gar" />
1459
     <copy file="${build.src}/${interface.name}Service.wsdl" todir="${build.dir}/gar/schema/edu" />
1460
     <jar destfile="lib/${interface.name}.gar" basedir="${build.dir}/gar"/>
1461 1811 tao
  </target>
1462 2175 tao
1463 1814 tao
  <target name="compilewebclient" depends="prepare">
1464
     <javac srcdir="${build.src}" destdir="${build.dest}" includes="**/application/*.java" classpathref="webservicepath" />
1465
  </target>
1466 2175 tao
1467 1814 tao
  <target name="runwebclient" depends="compilewebclient">
1468 2175 tao
     <java classname="edu.ucsb.nceas.metacat.stringclient.application.MetacatStringServiceApplication"
1469 1814 tao
           dir="${build.dest}" fork="yes"
1470
           classpathref="webservicepath" classpath="./lib/utilities.jar" failonerror="true">
1471
         <arg value="${serviceUrl}"/>
1472
         <arg value="${docid}"/>
1473
     </java>
1474
  </target>
1475 2598 harris
1476 2639 harris
  <target name="spatial_option" depends="prepare" description=" -- compiles code for the spatial option">
1477 2598 harris
1478
    <echo message="Compiling the metatcat shapefile creator"/>
1479
    <echo message="using the shapelib at: ${shapelib.dir}"/>
1480
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1481
     <arg line="./src/spatial/cpp/metacat_shapefile.cpp -I ${shapelib.dir} -c -o build/metacat_shapefile.o" />
1482
    </exec>
1483
1484
    <exec dir="." executable="g++" os="Linux, Unix" failonerror="true">
1485 2639 harris
     <arg line="build/metacat_shapefile.o ${shapelib.dir}/.libs/libshp.a -o bin/metacat_shapefile" />
1486 2598 harris
    </exec>
1487
  </target>
1488
1489 2737 jones
    <!-- LSID Authority support -->
1490
    <patternset id="lsid.jars">
1491
        <include name="axis.jar" />
1492 2772 jones
        <include name="commons-discovery-0.2.jar" />
1493 2737 jones
        <include name="jaxrpc.jar" />
1494
        <include name="lsid-client-1.1.1.jar" />
1495
        <include name="lsid-server-1.1.1.jar" />
1496
        <include name="saaj.jar" />
1497 2772 jones
        <include name="wsdl4j-1.5.1.jar" />
1498 2737 jones
        <include name="activation.jar" />
1499
        <include name="castor-0.9.5.jar" />
1500
        <include name="dnsjava-1.3.2.jar" />
1501
        <include name="mail.jar" />
1502 2778 jones
        <include name="commons-logging-1.0.4.jar" />
1503
        <!-- These jars may be needed but seem to not actually be,
1504
             so leaving them out for now
1505
        <include name="axis-ant.jar" />
1506 2737 jones
        -->
1507
        <!--<include name="GenCastor.class" />-->
1508
    </patternset>
1509
    <patternset id="lib.jars">
1510
        <include name="httpclient.jar" />
1511
        <include name="log4j-1.2.12.jar" />
1512
        <include name="utilities.jar" />
1513
        <include name="xercesImpl.jar" />
1514
        <include name="xalan.jar" />
1515
        <include name="xml-apis.jar" />
1516
    </patternset>
1517
1518
    <path id="lsid.classpath">
1519
        <fileset dir="${lsid.lib.dir}">
1520
            <patternset refid="lsid.jars"/>
1521
        </fileset>
1522
        <fileset dir="${lib.dir}">
1523
            <patternset refid="lsid.jars"/>
1524
        </fileset>
1525 3059 berkley
        <fileset dir="${lib.dir}">
1526 2737 jones
            <include name="xalan.jar" />
1527
            <include name="xml-apis.jar" />
1528
        </fileset>
1529
        <fileset dir="${build.dir}">
1530
            <include name="metacat-client.jar" />
1531
        </fileset>
1532
    </path>
1533
1534
    <filterset id="configFilters">
1535
        <filter token="LSID_AUTHORITY_HOSTNAME"
1536
                value="${config.hostname}" />
1537
        <filter token="LSID_AUTHORITY_PORT"
1538
                value="${config.port}" />
1539
        <filter token="METADATA_LABELS"
1540
                value="${config.metadataLabelLsid}" />
1541
        <filter token="METACAT_SERVER"
1542
                value="${config.metacatserver}" />
1543
        <filter token="LSID_AUTHORITY_STRING"
1544
                value="${config.lsidauthority}" />
1545
    </filterset>
1546
1547
    <target name="prepare-lsid"
1548
            depends="prepare,utilities,clientjar"
1549
            description="Configure files prior to compilation">
1550
        <mkdir dir="${lsid.build.dir}" />
1551
        <!-- Copy the properties file into the build -->
1552
        <copy file="${conf.dir}/metacat-lsid.properties"
1553
              tofile="${lsid.build.dir}/WEB-INF/classes/metacat-lsid.properties"
1554
              overwrite="true">
1555
            <filterset refid="configFilters" />
1556
        </copy>
1557 2817 jones
        <copy file="${conf.dir}/log4j.properties"
1558
              tofile="${lsid.build.dir}/WEB-INF/classes/log4j.properties"
1559
              overwrite="true">
1560
            <filterset refid="configFilters" />
1561
        </copy>
1562 2737 jones
        <!-- Copy config files into the build -->
1563
        <copy todir="${lsid.build.dir}/WEB-INF">
1564
            <fileset dir="${webinf.dir}"
1565
                     includes="**/*.wsdd" />
1566
        </copy>
1567
        <!-- Copy the metadata configuration files into the build -->
1568
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}" />
1569
        <copy todir="${lsid.build.dir}/WEB-INF/classes/${lsid.classes.dir}">
1570
            <fileset dir="${conf.dir}"
1571
                     includes="**/*.xml" />
1572
            <fileset dir="${conf.dir}"
1573
                     includes="**/*.xslt" />
1574
            <filterset refid="configFilters" />
1575
        </copy>
1576
        <!-- Copy services files into the build -->
1577
        <mkdir dir="${lsid.build.dir}/services" />
1578
        <copy todir="${lsid.build.dir}/services">
1579
            <fileset dir="${services.dir}" />
1580
            <filterset refid="configFilters" />
1581
        </copy>
1582 2778 jones
        <!-- Copy axis files into the build -->
1583
        <mkdir dir="${lsid.build.dir}" />
1584
        <copy todir="${lsid.build.dir}">
1585
            <fileset dir="${conf.dir}/axis"
1586
                     excludes="*.properties"/>
1587
        </copy>
1588
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1589
        <copy todir="${lsid.build.dir}/WEB-INF/classes">
1590
            <fileset dir="${conf.dir}/axis"
1591
                     includes="*.properties"/>
1592
        </copy>
1593 2737 jones
    </target>
1594
1595
    <target name="compile-lsid"
1596
            depends="prepare-lsid"
1597
            description="Compile Java sources">
1598
        <mkdir dir="${lsid.build.dir}/WEB-INF/classes" />
1599
        <javac srcdir="src/edu/ucsb/nceas/metacat/lsid"
1600
               destdir="${lsid.build.dir}/WEB-INF/classes"
1601
               debug="${compile.debug}"
1602
               deprecation="${compile.deprecation}"
1603
               optimize="${compile.optimize}">
1604
            <classpath refid="lsid.classpath" />
1605
        </javac>
1606
    </target>
1607
1608
    <target name="war-lsid"
1609
            depends="compile-lsid"
1610
            description="Create a war file for the application">
1611
        <mkdir dir="${dist.dir}" />
1612
        <war destfile="${dist.dir}/${authority.context}.war"
1613
             webxml="${webinf.dir}/web.xml">
1614
            <fileset dir="${lsid.build.dir}" />
1615
            <lib dir="${lsid.lib.dir}">
1616
                <patternset refid="lsid.jars"/>
1617
            </lib>
1618
            <lib dir="${lib.dir}">
1619
                <patternset refid="lib.jars"/>
1620
            </lib>
1621 3059 berkley
            <lib dir="${lib.dir}">
1622 2737 jones
                <include name="xalan.jar" />
1623
                <include name="xml-apis.jar" />
1624
            </lib>
1625
            <lib dir="${build.dir}">
1626
                <include name="metacat-client.jar" />
1627
            </lib>
1628
        </war>
1629
    </target>
1630
1631
    <target name="deploy-lsid"
1632
            depends="war-lsid"
1633
            description="Deploy LSID war to servlet container">
1634
        <delete dir="${deploy.dir}/${authority.context}" />
1635
        <delete file="${deploy.dir}/${authority.context}.war" />
1636
        <mkdir dir="${deploy.dir}" />
1637
        <copy todir="${deploy.dir}">
1638
            <fileset dir="${dist.dir}" />
1639
        </copy>
1640
    </target>
1641 113 jones
</project>