Commit ced15ba7 authored by Tyrannas's avatar Tyrannas

support multiFichiers opale_to_hdoc

parent 00cab33c
......@@ -23,12 +23,12 @@
<antcall target="transformation">
<param name="file" value="${newFileName}"/>
</antcall>
<echo>${newFileName}</echo>
</sequential>
</for>
<antcall target="insertion"/>
</target>
<!-- on initilialise les répertoires -->
<target name="preparation">
<echo>On initialise le dossier!</echo>
<delete dir="./output"></delete>
......@@ -36,11 +36,13 @@
<delete dir="./input/unziped"></delete>
<mkdir dir='./input/unziped'></mkdir>
</target>
<!-- unzip -->
<target name="unZip">
<unzip src="./input/${file}" dest="./input/unziped/" overwrite="false"/>
</target>
<!-- transformation xsl -->
<target name="transformation">
<sequential>
<xslt in="./input/unziped/content.xml" out="./output/${file}.cql" style="./xsl/hdoc_to_neo4j.xsl" classpath="./lib/saxon9he.jar">
......@@ -51,7 +53,7 @@
</sequential>
</target>
<!-- insertion dans la base en appelant le script node si jamais la propriete node vaut true -->
<target name="insertion" if="wantToInsert">
<exec executable="node" dir="./node">
<arg line="insert.js"/>
......
<project name="ProjetOpale" default="convert">
<!-- additionnal lib -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="lib/ant-contrib.jar"/>
</classpath>
</taskdef>
<!-- Other properties -->
<property name="ScarPath" value="input" />
<property name="UnzipSourcePath" value="unzipSourcePath" />
<property name="XmlModuleName" value="" />
<property name="TmpPath" value="tmp" />
......@@ -8,31 +16,38 @@
<property name="RacineFile" value="content.xml" />
<property name="OutputPath" value="output" />
<property name="HdocPath" value="${OutputPath}/hdoc" />
<property name="ZipPath" value="${OutputPath}/result.hdoc" />
<!-- Others properties (in another file) currently empty -->
<property file="opale_to_hdoc.properties" />
<!-- Beginning -->
<target name="convert">
<antcall target="clean" />
<antcall target="unzip_scar" />
<antcall target="check_source_xml" />
<antcall target="hdoc_structure" />
<antcall target="fusion_xml" />
<antcall target="copy_ressources"/>
<antcall target="content_xml" />
<antcall target="zip" />
<for param="filename">
<path>
<fileset dir="./input" includes="*.scar"/>
</path>
<sequential>
<var name="newFileName" unset="true"/>
<basename property="newFileName" file="@{filename}"/>
<antcall target="clean" />
<antcall target="unzip_scar">
<param name="file" value="${newFileName}"/>
</antcall>
<antcall target="check_source_xml" />
<antcall target="hdoc_structure" />
<antcall target="fusion_xml" />
<antcall target="copy_ressources"/>
<antcall target="content_xml" />
<antcall target="zip">
<param name="file" value="${newFileName}"/>
</antcall>
</sequential>
</for>
<antcall target="clean" />
</target>
<!-- Clean : delete old files -->
<target name="clean">
<!-- create folders (to be sure) -->
<mkdir dir="${UnzipSourcePath}"/>
<mkdir dir="${TmpPath}"/>
<mkdir dir="${HdocPath}"/>
<touch file="get_ressources.ant"/>
<!-- delete folders -->
<delete dir="${UnzipSourcePath}"/>
<delete dir="${TmpPath}"/>
......@@ -63,11 +78,7 @@
<!-- Unzip scar source file -->
<target name="unzip_scar">
<!-- get scar file path -->
<fileset id="fileset_scar" dir="input" casesensitive="yes">
<include name="*.scar"/>
</fileset>
<pathconvert property="scar.path" pathsep="" refid="fileset_scar" />
<unzip src="${scar.path}" dest="./${UnzipSourcePath}"/>
<unzip src="${ScarPath}/${file}" dest="./${UnzipSourcePath}"/>
</target>
<!-- Create the hdoc structure -->
......@@ -120,6 +131,6 @@
<!-- Zip Hdoc -->
<target name="zip">
<zip destfile="${ZipPath}" basedir="${HdocPath}"/>
<zip destfile="${OutputPath}/${file}.hdoc" basedir="${HdocPath}"/>
</target>
</project>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment