-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
80 lines (71 loc) · 4.02 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="marcus2oria" default="test">
<fileset dir="./lib/jsch-0.1.53.jar"></fileset>
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask" classpath="./lib/jing.jar"/>
<property file="properties/marcus.properties"/>
<target name="main" depends="queryMarcusForData,transformMarcus2oria,copyAndCommitIdentifierFile,DivideAndPackageResults,copyAndCommitIdentifierFile,validateByRNG"/>
<target name="testProperty">
<property file="properties/example.properties"/>
</target>
<target name="marcusProperty">
<property file="properties/marcus.properties"/>
</target>
<target name="test" depends="testProperty,main"/>
<target name="marcus" depends="marcusProperty,main,uploadToBibsys"/>
<target name="queryMarcusForData">
<xslt in="dummy.xml" style="xsl/getDocuments.xsl" force="yes" out="${queryMarcusForData.out}">
<param name="limit" expression="${queryMarcusForData.limit}" type="INT"/>
<param name="test-run" expression="${queryMarcusForData.test-run}"/>
<classpath path="lib/saxon9he.jar"/>
</xslt>
</target>
<target name="transformMarcus2oria">
<xslt style="xsl/marcus2pnx.xsl" in="${queryMarcusForData.out}" out="${transformMarcus2oria.out}">
<param name="library" expression="${transformMarcus2oria.library}"/>
<param name="institution" expression="${transformMarcus2oria.institution}"/>
<param name="searchscope" expression="${transformMarcus2oria.searchscope}"/>
<param name="scope" expression="${transformMarcus2oria.scope}"/>
<param name="publisher" expression="${transformMarcus2oria.publisher}"/>
<classpath path="lib/saxon9he.jar"/>
</xslt>
</target>
<classloader></classloader>
<target name="copyAndCommitIdentifierFile">
<property name="copyAndCommitIdentifierFile.out" value="./${name}_identifiers.tmp"/>
<property name="copyAndCommitIdentifierFile.identifier" value="${name}_identifiers.xml"/>
<xslt in="${transformMarcus2oria.out}" force="yes" style="xsl/updateIdentifiers.xsl"
out="${copyAndCommitIdentifierFile.out}">
<param name="identifiers" expression="${copyAndCommitIdentifierFile.identifier}"/>
<!--SaxonB-->
<classpath path="lib/saxon9.jar"/>
</xslt>
<tstamp/>
<xslt in="${copyAndCommitIdentifierFile.out}" style="xsl/createDeleteRecordsOai.xsl"
out="./output/pnx/${name}_deleted_${DSTAMP}.xml">
<classpath path="lib/saxon9he.jar"/>
</xslt>
<move file="${copyAndCommitIdentifierFile.out}" tofile="./${copyAndCommitIdentifierFile.identifier}"/>
</target>
<target name="DivideAndPackageResults" depends="">
<length file="${transformMarcus2oria.out}" property="pnx.length"/>
<echo message="${pnx.length}"/>
<xslt in="${transformMarcus2oria.out}" style="xsl/divideRecordsToChunks.xsl" out="${dummy.out}" force="yes">
<param name="file-size-in-bytes" expression="${pnx.length}"/>
<classpath path="lib/saxon9he.jar"/>
</xslt>
<property name="archive" value="./output/${name}-${searchServiceName}-${DSTAMP}.tar.gz"/>
<tar basedir="output/pnx/" destfile="${archive}" compression="gzip"/>
<delete dir="output/pnx/"/>
</target>
<target name="uploadToBibsys">
<property file="properties/local.bibsys.properties"/>
<echo message="Uploading file to Bibsys import server ..."/>
<!--scp file="${archive}" remotefile="${bibsys.user}:${bibsys.password}@${bibsys.host}:~/${archive}" trust="yes"/-->
<scp sftp="true" file="${archive}" todir="${bibsys.user}:${bibsys.password}@${bibsys.host}:${name}-${searchServiceName}-${DSTAMP}.tar.gz" trust="yes"/>
</target>
<target name="validateByRNG">
<jing rngfile="schema/PNX.rng">
<fileset file="${transformMarcus2oria.out}"/>
</jing>
</target>
</project>