mindMapping2Hdoc.ant 3.74 KB
Newer Older
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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="default">
    <property name="module" value="default"/>
    <!--
	only for the debug
	<property name="inputPath" value="test.mm"></property>
    	<property name="outputPath"	value="content.xml"/>
	<property name="converting"	value="yes"/> 
    -->

    <property name="resultFile" value="${basedir}/result"/>
    
    <target name="default" depends="preparation">
        <echo>----------------------------Begin of conversion----------------------------------</echo>


	<!-- Sect Schema : only sect element -->
        <antcall target="Makehdoc">
            <param name="myXSLT" value="sect.xsl"/>
            <param name="hdocName" value="sect"/>
        </antcall>
        
	<!-- Div Schema : sect and div element -->
        <antcall target="Makehdoc">
            <param name="myXSLT" value="div.xsl"/>
            <param name="hdocName" value="div"/>
        </antcall>

	<!-- Div Schema : sect, div and p element -->
	  <antcall target="Makehdoc">
            <param name="myXSLT" value="threeLevel.xsl"/>
            <param name="hdocName" value="three"/>
        </antcall>
        

36
  <!-- <delete dir="${basedir}/temp"/> -->
37
38
39
40
41
42
43
44
45
        <echo>----------------------------End of conversion----------------------------------</echo>
    </target>
    
    <target name="preparation">
        <echo>Setting up the conversion</echo>
        <delete dir="${basedir}/temp"></delete>
        <mkdir dir="${basedir}/temp" />
        <delete dir="${resultFile}/hdoc"></delete>
        <mkdir dir="${resultFile}/hdoc" />
46
        <delete dir="${resultFile}/scar"></delete>
47
        <mkdir dir="${resultFile}/scar" />
48
49
50
        <!--<condition>
          <equals arg1="${foo}" arg2=""/>
        </condition> -->
51
52
53
54
55
56
57
58
59
60
61
62
        <!-- //delete temp -->  
        <echo>--- End ----</echo>
    </target>
    
   <!-- Convert a mindMap file into a hdoc, with a xsl schema specified in the parameter -->
   <target name="Makehdoc" >
       <echo>Begin data conversion</echo>
       <mkdir dir="${basedir}/temp/${hdocName}"/>
       <mkdir dir="${basedir}/temp/${hdocName}/META-INF"/>
       <copy file="${basedir}/mimetype" tofile="${basedir}/temp/${hdocName}/mimetype"/>
       <!-- create the container file with an XSLT transformation -->
       <xslt in="${basedir}/${inputPath}" out="${basedir}/temp/${hdocName}/META-INF/container.xml" xslresource="${basedir}/xslt/makeContainer.xsl"/>
63
	     <!-- create the file which contains the freemind data converted-->
64
65
       <xslt in="${basedir}/${inputPath}" out="${basedir}/temp/${hdocName}/content.xml" xslresource="${basedir}/xslt/${myXSLT}"/>
       
66
	     <!-- zipping files as the hdoc format -->
67
68
69
70
71
72
73
74
75
       <zip destfile="${resultFile}/hdoc/${hdocName}.hdoc"
       basedir="${basedir}/temp/${hdocName}"/>
    	<!-- to generate scar files -->
      <antcall target="opale_conversion"/>
    <!-- </condition> -->
       
       <echo>end data conversion</echo>
   </target>

76
77

   <!-- Connect this to the work of the other group about hdoc to opale (configure and call their ant etc.) -->
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
   <target name="opale_conversion" if="${opale.exists}" depends="opale_test">
      <!-- <condition property="converting.set" else="false"> -->
       <ant antfile="${basedir}/hdoctoopale/hdoc_to_opale.ant" dir="${basedir}/hdoctoopale">
            <property name="InputPath" value="${resultFile}/hdoc/${hdocName}.hdoc"/>
            <property name="OutputPath" value="${resultFile}/scar/${hdocName}.scar"/>
        </ant>
   </target>

   <!-- check if opale convertion is asked by the user -->
    <target name="opale_test">
      <condition property="opale.exists" else="false">
          <equals arg1="${opale}" arg2="true"/>
      </condition>
      
      <echo message="Run opale conversion ? ${opale.exists}"/>
  </target>
    
</project>