hdoc_to_optim.ant 1.38 KB
Newer Older
1
<project name="hdoc_to_optim" default="convert">
2 3 4 5 6 7

	<!-- Arguments properties -->
	<property name="InputPath" 			value="input" />
	<property name="OutputPath" 		value="output" />
	<property name="OutputScarPath" 			value="${OutputPath}/result.scar" />
	
8
    <target name="convert">
9 10 11 12 13 14 15
	
		<!-- get input hdoc file path -->
		<fileset id="fileset_hdoc" dir="${InputPath}" casesensitive="yes">
			<include name="*.hdoc"/>
		</fileset>
		<pathconvert property="HdocPath" pathsep="" refid="fileset_hdoc" />
		
16
        <!--unzips the hdoc to be converted-->
17 18 19
        <unzip dest="hdoc" src ="${HdocPath}"/>
        
		<!--gives all rights to avoid bugs-->
20
        <chmod dir="hdoc" perm="777"/>
21 22 23
        
		<!--launches the XSLT find_content to retrieve the content path-->
        <xslt in="hdoc/META-INF/container.xml" out="get_content.ant" style="xsl/find_content.xsl"/>
24
        <chmod file="get_content.ant" perm="777"/>
25 26

		<!--launches the ANT get_content resulting from the previous XSLT in order to launch the conversion-->
27
        <ant antfile="get_content.ant"/>
28 29 30 31
		<!--once the conversion is complete, the result is zipped-->
        <zip basedir="result" destfile="${OutputScarPath}"/>
        
		<!--temporary files and folders are deleted-->
32 33 34 35
        <delete dir="hdoc"/>
        <delete dir="result"/>
        <delete file="get_content.ant"/>
        <delete file="get_ressources.ant"/>
36
		
37 38
    </target>
</project>