hdoc_to_mongo.ant 1.15 KB
Newer Older
1
<project name="hdoc_to_optim" default="insertion">
2
3
4
5

	<property file="build.properties"/>
	
	<target name="preparation">
6
7
        <mkdir dir="${tmpdir}"/>
        <chmod perm="777" dir="${tmpdir}"></chmod>
8
9
10
11
12
13
14
15
16
17
18
19
20
21
		<delete dir="${outputPath}" />
        <mkdir dir="${outputPath}"/>
        <chmod perm="777" dir="${outputPath}"></chmod>
    </target>
	
    <target name="unzipSource" depends="preparation">
        <fileset dir="${inputPath}" id="hdocFile">
            <include name="*.hdoc"/>
        </fileset>      
        <pathconvert property="hdocFilePath" pathsep="" refid="hdocFile" />
        
        <echo>Entry file : ${hdocFilePath}</echo>
		
		<!--unzips the hdoc to be converted-->
22
		<unzip dest="${tmpdir}" src ="${hdocFilePath}"/>
23
24
    </target>
	
25
26
27
28
29
30
31
32
	<target name="convertHdoc" depends="unzipSource">
        <xslt in="${tmpdir}/content.xml" out="${outputPath}/result.json" style="xsl/main.xsl"/>
    </target>
	
	<target name="insertion" depends="convertHdoc">
        <exec executable="node" dir="mongo">
            <arg line="main.js"/>
        </exec>
33
34
    </target>
	
35
	<target name="clean" depends="unzipSource">
36
		<delete dir="${tmpdir}" />
37
38
    </target>
</project>