<?xml version="1.0"?> <project default="gar" basedir="."> <!-- the prefix of name of xml in undeploy directory, for this example the file name will be org-undeploy.xml--> <!-- <property name="undeploy.name" value="org-ecogrid-srb-query"/> <property name="gar.id" value="${undeploy.name}"/> --> <target name="clean"> <delete dir="${build.dir}"/> </target> <target name="tt"> <echo>undeply.name=${undeploy.name}</echo> </target> <!-- This target is only for srb--> <target name="srb"> <!-- This is the place for srb write xml and find data file--> <!-- don't put "/" in the start and please put "/" at end, they will be copied to java class--> </target> <target name="clientinit"> <!-- the gsiftp server uri for get method--> <property name="sourceURI" value="gsiftp://pine.nceas.ucsb.edu:5678/"/> <!-- the destination uri for get method--> <property name="destinationURI" value="file:///tmp/index.001.18"/> <!-- the file id or document id need to be transfer in get method--> <property name="identifier" value="index.001.18"/> <!-- the password to create proxy--> <property name="password" value="yourpassword"/> <!-- the path for ecogrid query file--> <property name="query.file.path" value="tests/testfiles/srb-test_1.xml"/> </target> <target name="init" depends="srb"> <!-- configurable--> <!-- base url for the grid service --> <property name="baseURL" value="http://sasa.sdsc.edu:8080/ogsa/services"/> <!-- the client url, this is for tcpmon, usually the port number will different to baseURL. If you don't use tcpmon, please keep as same as base url--> <property name="tcpMonURL" value="http://sasa.sdsc.edu:8080/ogsa/services"/> <!-- the tomcat home which need be to deploied--> <property name="tomcat.dir" value="/home/bzhu/jakarta-tomcat-4.1.27"/> <!-- the absolute path of current directory--> <property name="current.dir" value="/home/bzhu/seek/projects/ecogrid"/> <!-- the diretroy dir to put the wrap implementation class--> <property name="impl.package.dir" value="org/ecoinformatics/ecogrid/srb/impl"/> <!-- the package name of the wrap implementation --> <property name="impl.package.name" value="org.ecoinformatics.ecogrid.srb.impl"/> <!-- the class name of wrap implmentation --> <property name="impl.class.name" value="SRBImpl"/> <!-- the name of service, it also will copy to .wsdd file in lib--> <property name="service.name" value="org/ecoinformatics/ecogrid/SRBEcoGridLevelOneQueryService"/> <!-- the name of instance, it also will copy to .wsdd file in lib--> <property name="service.instance" value="srb"/> <property name="ecogrid.srb.dir" value="org/ecoinformatics/ecogrid/srb"/> <!-- your project dir for real implmentation for example srb dir, srb dir where you will create jar file--> <property name="project.dir" value="./"/> <!-- if the service turn on GSI security. If security on, please put "true", else put "false"--> <property name="GSI.security" value="false"/> <!-- common --> <!-- context which need be to deploied--> <property name="web.context" value="webapps/ogsa"/> <property name="gwsdl.interface" value="true"/> <!-- the name of security descriptor, it also will copy to .wsdd file in lib--> <property name="security.descriptor" value="security-config-levelone.xml"/> <property name="interface.name" value="EcoGridQueryInterfaceLevelOne"/> <property name="package" value="org.ecoinformatics.ecogrid"/> <property name="package.dir" value="org/ecoinformatics/ecogrid"/> <property name="client.dir" value="${package.dir}/client"/> <!-- client class name--> <property name="client.class.name" value="EcogridQueryClient"/> <property name="client.name" value="${package}.client.${client.class.name}"/> <!-- use different wsdd file, which deponds on turn gsi security on or off--> <condition property="wsdd.file" value="EcogridImpl.wsdd"> <equals arg1="${GSI.security}" arg2="true" /> </condition> <condition property="wsdd.file" value="EcogridImplWithoutSecurity.wsdd"> <equals arg1="${GSI.security}" arg2="false" /> </condition> <property name="gar.file" value="${interface.name}-${impl.class.name}.gar"/> <property name="gar.name" value="${build.lib}/${gar.file}"/> <property name="stubjar.name" value="${interface.name}-stub.jar"/> <property name="impljar.name" value="${interface.name}-${impl.class.name}.jar"/> <property name="clientjar.name" value="ecogrid-query-levelone-client.jar"/> <property name="client.lib.dir.name" value="ecogrid_client_lib"/> <property name="build.xml" value="build.xml"/> <property file="lib/build.properties"/> <property file="${user.home}/build.properties"/> <path id="classpath"> <pathelement location="${java.home}/../lib/tools.jar"/> <pathelement location="./"/> <pathelement location="${build.dest}"/> <fileset dir="lib"> <include name="*.jar"/> </fileset> <fileset dir="${ogsa.root}/lib"> <include name="*.jar"/> </fileset> <pathelement path="${java.class.path}"/> </path> <property name="src.dir" value="./src"/> <property name="test.dir" value="./tests"/> <property name="build.dir" value="./build"/> <property name="build.lib" value="${build.dir}/lib"/> <property name="build.stubs" value="${build.dir}/stubs"/> <property name="build.src" value="${build.dir}/src"/> <property name="build.dest" value="${build.dir}/classes"/> <property name="build.schema" value="${build.dir}/schema"/> <property name="build.tests" value="${build.dir}/tests" /> <property name="build.services" value="${ogsa.root}/build-services.xml"/> <property name="build.packages" value="${ogsa.root}/build-packages.xml"/> <property name="schema.origin" value="${ogsa.root}/schema"/> <!-- <property name="sde.schema.file" value="${package.dir}/schema/${interface}DataType.xsd"/>--> <property file="${ogsa.root}/ogsa.properties"/> <property name="mapping.file" value="lib/namespace2package.mappings"/> <property name="stubs.dest" value="../stubs"/> <filter token="interface.name" value="${interface.name}"/> <filter token="impl.packagename" value="${impl.package.name}"/> <filter token="impl.classname" value="${impl.class.name}"/> <filter token="package" value="${package}"/> <filter token="service.name" value="${service.name}"/> <filter token="service.instance" value="${service.instance}"/> <filter token="security.descriptor" value="${security.descriptor}"/> <filter token="GSI.security" value="${GSI.security}"/> </target> <!-- checkout the project jar, such as jargon.jar, put to lib--> <target name="getProjectJar" depends="init"> </target> <target name="copyFiles" depends="getProjectJar"> <mkdir dir="${build.src}"/> <mkdir dir="${build.dest}"/> <mkdir dir="${build.lib}"/> <mkdir dir="${build.schema}/ogsi"/> <mkdir dir="${build.stubs}"/> <mkdir dir="${build.schema}/${package}/${interface.name}"/> <!--<available file="${sde.schema.file}" property="sde.schema.file.present"/> <available property="stubs.present" type="dir" file="${stubs.dest}" />--> <copy toDir="${build.schema}/ogsi"> <fileset dir="${schema.origin}/ogsi"> <exclude name="*.wsdl.swp"/> </fileset> </copy> <copy toDir="${build.schema}/${package}/${interface.name}"> <fileset dir="${src.dir}/xsd"> <include name="**/emlQuery.xsd"/> <include name="**/query.xsd"/> <include name="**/resultset.xsd"/> <include name="**/EcoGridQueryInterfaceLevelOne.gwsdl"/> </fileset> </copy> <copy toDir="${build.src}" filtering="yes"> <fileset dir="${src.dir}"> <include name="**/${impl.package.dir}/*.java"/> <include name="**/${package.dir}/*.java"/> <include name="**/${client.class.name}.java"/> <include name="**/SRBuri.java"/> </fileset> </copy> <copy toDir="${build.lib}" file="lib/${wsdd.file}" filtering="yes"/> <copy toDir="${build.dest}" file="lib/${security.descriptor}" filtering="yes"/> <available file="${mapping.file}" property="mapping.file.present"/> </target> <target name="mergeMapping" if="mapping.file.present"> <ant antfile="${build.services}" target="mergePackageMapping" /> </target> <target name="setenv" depends="copyFiles,mergeMapping" /> <target name="generateWSDLfromGWSDL" if="gwsdl.interface" depends="setenv"> <property name="schema.file" value="${interface.name}_service.wsdl"/> <!--<copy todir="${build.schema}/${package}/${interface.name}" overwrite="true"> <fileset dir="${package.dir}/schema"/> </copy>--> <ant antfile="${build.services}" target="GWSDL2WSDL"> <property name="build.schema.dir" value="${package}/${interface.name}"/> <property name="wsdl.root" value="${interface.name}"/> </ant> <ant antfile="${build.services}" target="generateBinding"> <property name="binding.root" value="${interface.name}"/> <property name="build.schema.dir" value="${package}/${interface.name}"/> <property name="porttype.wsdl" value="${interface.name}.wsdl"/> </ant> </target> <!-- <target name="decorateSDD" if="sde.schema.file.present"> <copy file="${sde.schema.file}" toDir="${build.schema}/${package}/${interface.name}"/> <ant antfile="${build.services}" target="decorateSDD"> <property name="sdd.file" value="${interface}DataType.xsd"/> <property name="wsdl.dir" value="${package}/${interface}"/> <property name="wsdl.file" value="${interface}Service.wsdl"/> <property name="import.sdd" value="import"/> </ant> </target> --> <!-- copy the revised stubs code from src dir to build dir--> <target name="copystubs" depends="setenv, generateWSDLfromGWSDL"> <copy todir="${build.src}"> <fileset dir="${src.dir}"> <include name="**/EcoGridQueryInterfaceLevelOnePortType.java"/> <include name="**/GetResponseType.java"/> <include name="**/Get.java"/> <include name="**/EcoGridQueryLevelOneService*.java"/> </fileset> </copy> </target> <target name="stubs" depends="clean, setenv, generateWSDLfromGWSDL"> <ant antfile="${build.services}" target="generateStubs"> <property name="schema.file.dir" value="${package}/${interface.name}"/> <property name="schema.file" value="${schema.file}"/> </ant> <!-- copy the stubs file to src directory--> <copy toDir="${src.dir}" overwrite="yes"> <fileset dir="${build.stubs}"> <include name="**/*.java"/> </fileset> </copy> </target> <target name="compileStubs" depends="copystubs"> <javac srcdir="${build.src}" destdir="${build.dest}" debug="${debug}" deprecation="${deprecation}" classpathref="classpath"> <include name="**/${package.dir}/*.java" /> <include name="**/${package.dir}/stub/**" /> </javac> </target> <target name="compileImplUtil" depends="copystubs"> <javac srcdir="${build.src}/${ecogrid.srb.dir}" destdir="${build.dest}" debug="${debug}" deprecation="${deprecation}" classpathref="classpath"> <include name="*.java"/> </javac> </target> <target name="compileImpl" depends="compileImplUtil, compileStubs"> <javac srcdir="${build.src}/${impl.package.dir}" destdir="${build.dest}" debug="${debug}" deprecation="${deprecation}" classpathref="classpath"> </javac> </target> <target name="stubjar" depends="compileImpl"> <jar jarfile="${build.lib}/${stubjar.name}" basedir="${build.dest}" > <include name="**/${package.dir}/*.class" /> <include name="**/${package.dir}/stub/**" /> </jar> </target> <target name="jar" depends="stubjar"> <jar jarfile="${build.lib}/${impljar.name}"> <fileset dir="${build.dest}"> <!-- class file of implementation--> <include name="**/${impl.package.dir}/**" /> <include name="**/${ecogrid.srb.dir}/SRBuri.class"/> <!-- security descriptor file should in imple jar too--> <include name="${security.descriptor}"/> </fileset> </jar> </target> <target name="gar" depends="clean,jar"> <ant antfile="${build.packages}" target="makeGar"> <property name="gar.name" value="${build.lib}/${gar.file}"/> <property name="garlib.dir" value="${build.lib}"/> <property name="garserverdeployment.file" value="${build.lib}/${wsdd.file}"/> <property name="garschema.origin" value="${build.schema}/${package}"/> <property name="garschema.path" value="${package}"/> </ant> </target> <target name="checkUndeployFile" depends="gar"> <condition property="alreadyHasUndeployFile"> <available file="${ogsa.root}/undeploy/${undeploy.name}-undeploy.xml"/> </condition> </target> <target name="undeployment" depends="checkUndeployFile" if="alreadyHasUndeployFile"> <echo>In undeployment target</echo> <ant antfile="${build.xml}" target="undeploy" dir="${ogsa.root}"> </ant> </target> <target name="deploygt3" depends="undeployment"> <echo>the gar file is ${current.dir}${build.lib}/${gar.file}</echo> <property name="target.gar" value="${current.dir}/${build.lib}/${gar.file}"/> <ant antfile="${build.xml}" target="deploy" dir="${ogsa.root}"> <property name="gar.name" value="${target.gar}"/> </ant> </target> <target name="deployTomcat" depends="deploygt3"> <!-- delete the jar file in webapps--> <delete file="${tomcat.dir}/${web.context}/WEB-INF/lib/${impljar.name}"/> <delete file="${tomcat.dir}/${web.context}/WEB-INF/lib/${stubjar.name}"/> <ant antfile="${build.xml}" target="deployTomcat" dir="${ogsa.root}" inheritAll="false"> <property name="tomcat.dir" value="${tomcat.dir}"/> </ant> </target> <!--=============================================--> <!-- Client part, this developer test tool without compile client code--> <!--=============================================--> <target name="runClient" depends="clean, clientinit, init, clientjar"> <echo>Before running this target, please unzip the client lib zip file in lib dir</echo> <echo>here it is ${java.class.path}</echo> <path id="client.path"> <fileset dir="lib/${client.lib.dir.name}"> <include name="*.jar"/> </fileset> </path> <java classname="${client.name}" fork="yes" classpathref="client.path"> <arg value="${baseURL}/${service.name}"/> <arg value="${tcpMonURL}/${service.name}"/> <arg value="${query.file.path}"/> <arg value="${sourceURI}"/> <arg value="${destinationURI}"/> <arg value="${identifier}"/> <arg value="${password}"/> </java> </target> <!--=============================================--> <!-- Client part, this developer test tool which will compile client--> <!--=============================================--> <target name="client" depends="clean, clientinit, init"> <echo>Before running this target, please unzip the client lib zip file in lib dir</echo> <echo>here it is ${java.class.path}</echo> <!-- delete client.jar in lib--> <delete file="lib/${client.lib.dir.name}/${clientjar.name}"/> <path id="client.path"> <fileset dir="lib/${client.lib.dir.name}"> <include name="*.jar"/> </fileset> </path> <!-- copy source file of client to build.dir--> <mkdir dir="${build.src}"/> <mkdir dir="${build.dest}"/> <copy todir="${build.src}" filtering="yes"> <fileset dir="${src.dir}"> <include name="**/*.java"/> </fileset> </copy> <!-- compile the client src --> <javac srcdir="${build.src}/${client.dir}" destdir="${build.dest}" debug="${debug}" deprecation="${deprecation}" classpathref="client.path"> </javac> <java classname="${client.name}" fork="yes" classpathref="client.path" classpath="${build.dest}"> <arg value="${baseURL}/${service.name}"/> <arg value="${tcpMonURL}/${service.name}"/> <arg value="${query.file.path}"/> <arg value="${sourceURI}"/> <arg value="${destinationURI}"/> <arg value="${identifier}"/> <arg value="${password}"/> </java> </target> <!-- ========================================================================--> <!-- The following targets will ship unzip of directory as ecogrid client lib--> <!-- ========================================================================--> <target name="compileclient" depends="setenv"> <javac srcdir="${build.src}/${client.dir}" destdir="${build.dest}" debug="${debug}" deprecation="${deprecation}" classpathref="classpath"> </javac> </target> <target name="clientjar" depends="compileclient"> <jar jarfile="${build.lib}/${clientjar.name}"> <fileset dir="${build.dest}"> <!-- class file of implementation--> <!-- <include name="**/${client.dir}/**" /> --> <include name="**/${client.class.name}.class"/> </fileset> </jar> </target> <!-- copy the necesarry jar file into the build.lib/client.lib.dir.name--> <target name="copyjar" depends="stubjar, clientjar"> <mkdir dir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${build.lib}/${clientjar.name}" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${build.lib}/${stubjar.name}" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/axis.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/cog-axis.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/cog-jglobus.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/commons-discovery.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/commons-logging.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/cryptix32.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/cryptix-asn1.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/cryptix.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/jaxrpc.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/jce-jdk13-117.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/log4j-core.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/ogsa.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/puretls.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/saaj.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/wsdl4j.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/xalan.jar" todir="${build.lib}/${client.lib.dir.namehttp://www.cnn.com/2003/US/West/12/22/ca.earthquake/index.html}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/xmlsec.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/xercesImpl.jar" todir="${build.lib}/${client.lib.dir.namehttp://www.cnn.com/2003/US/West/12/22/ca.earthquake/index.html}/${client.lib.dir.name}"/> <copy file="${ogsa.root}/lib/xml-apis-1.1.jar" todir="${build.lib}/${client.lib.dir.name}/${client.lib.dir.name}"/> </target> <!-- build client library -a zip file --> <target name="buildclientlib" depends="copyjar"> <zip destfile="${build.lib}/${client.lib.dir.name}.zip" basedir="${build.lib}/${client.lib.dir.name}"/> <copy file="${build.lib}/${client.lib.dir.name}.zip" todir="lib" overwrite="yes"/> </target> <!--=============================================--> <!-- For building & running the client for Digir --> <!--=============================================--> <target name="clientDigir" depends=""> <antcall target="client" inheritall="false"> <param name="impl.class.name" value="DigirImpl"/> <param name="service.instance" value="digir"/> <param name="impl.package.dir" value="org/ecoinformatics/ecogrid/digir/impl"/> <param name="impl.package.name" value="org.ecoinformatics.ecogrid.digir.impl"/> <param name="query.file.path" value="tests/testfiles/query-digir.xml"/> <param name="sourceURI" value=""/> <param name="destinationURI" value=""/> <param name="identifier" value=""/> </antcall> </target> <!--=============================================--> <!-- test part--> <!--=============================================--> <target name="testprep" depends="compileImpl"> <path id="test.classpath"> <path refid="classpath"/> <pathelement location="${build.dest}"/> <pathelement location="${build.tests}"/> </path> <copy todir="${build.tests}" filtering="yes"> <fileset dir="${test.dir}"> <include name="org/**"/> </fileset> </copy> <!--compile the tests into a jar file --> <javac srcdir="${build.tests}" destdir="${build.tests}" classpathref="test.classpath" debug="on" includes="**/*.java" /> </target> <target name="runonetest" depends="clean, testprep"> <echo>testtorun: ${testname}</echo> <!-- use the ant "junit" task to run JUnit tests. --> <junit printsummary="yes" haltonfailure="no" fork="yes" haltonerror="no"> <classpath refid="test.classpath"> </classpath> <formatter type="plain" /> <batchtest fork="yes" todir="${build.dir}"> <fileset dir="${build.tests}"> <include name="**/${testname}.class" /> </fileset> </batchtest> </junit> </target> <target name="xslt"> <xslt in="tests/testfiles/query-test.xml" out="reslut.xml" style="./src/xsd/xslt/ecogridToPathquery.xsl"> <outputproperty name="method" value="xml"/> <outputproperty name="standalone" value="yes"/> <outputproperty name="encoding" value="iso8859_1"/> <outputproperty name="indent" value="yes"/> </xslt> </target> <target name="xslt2"> <xslt in="tests/testfiles/metacatresultset-test.xml" out="reslut2.xml" style="./src/xsd/xslt/metacatToEcogridResultSet.xsl"> <outputproperty name="method" value="xml"/> <outputproperty name="standalone" value="yes"/> <outputproperty name="encoding" value="iso8859_1"/> <outputproperty name="indent" value="yes"/> </xslt> </target> </project>