etherpad_to_hdoc.ant 1.47 KB
Newer Older
Etienne Chognard's avatar
Update  
Etienne Chognard committed
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
<project name="EtherpadToHdoc" default="convert" basedir=".">
	
	<property file="build.properties"/>

	<!-- Builds Hdoc structure -->
	<target name="construct_hdoc">
		<mkdir dir="${emplacement_hdoc}" />
		<mkdir dir="${emplacement_hdoc}/META-INF" />
		<mkdir dir="${emplacement_hdoc}/OPS" />
		<touch file="${emplacement_hdoc}/META-INF/container.xml" />
		<touch file="${emplacement_hdoc}/mimetype" />
		<echo message="application/x-hdoc+zip" file="${emplacement_hdoc}/mimetype" />
	</target>
	
	<!-- Fills Hdoc container -->
	<target name="fill_container" depends="construct_hdoc">
		<echoxml file="${emplacement_hdoc}/META-INF/container.xml">
			<container version="1.0">
				<rootfiles>
					<rootfile full-path="${rootfile1}" media-type="text/xml" />
				</rootfiles>
			</container>
		</echoxml>
	</target>
	
	<!-- Applies Perl Script to exported HTML file from Etherpad -->
	<target name="perl_exec" depends="fill_container">
		<exec executable="perl">
			<arg value="src/normalization.pl"/>
			<arg value="${InputPath}"/>
			<!-- output dans intermediaire.xml -->
		</exec>
	</target>
	
	<!-- Launches XSLT transform to Perl script output -->
	<target name="xslt_exec">
		<xslt style="src/etherpadTohdoc.xsl" in="tmp/intermediaire.xml" out="${output_xml}" />
	</target>
	
	<!-- Zipping Hdoc container -->
	<target name="zip">
		<zip basedir="${emplacement_hdoc}" destfile="${OutputPath}" />
	</target>
	
	<target name="convert" depends="fill_container, perl_exec, xslt_exec, zip"/>
	
</project>