mindMapping2Opale.ant 3.52 KB
Newer Older
1 2 3 4
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="default">
    <property name="module" value="default"/>
    <!--
5 6 7 8
  only for the debug
  <property name="inputPath" value="test.mm"></property>
      <property name="outputPath" value="content.xml"/>
  <property name="converting" value="yes"/> 
9 10 11 12
    -->

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

16 17 18 19

  <!-- Sect Schema : only sect element -->
        <antcall target="Makehdoc">
            <param name="myXSLT" value="sect.xsl"/>
20 21 22
            <param name="hdocName" value="sect"/>
        </antcall>
        
23 24 25
  <!-- Div Schema : sect and div element -->
        <antcall target="Makehdoc">
            <param name="myXSLT" value="div.xsl"/>
26 27 28
            <param name="hdocName" value="div"/>
        </antcall>

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

36
        <delete dir="${basedir}/temp"/>
37 38
        <echo>----------------------------End of conversion----------------------------------</echo>
    </target>
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
    
    <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" />
        <delete dir="${resultFile}/scar"></delete>
        <mkdir dir="${resultFile}/scar" />
        <!--<condition>
          <equals arg1="${foo}" arg2=""/>
        </condition> -->
        <!-- //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}/../mindMapping_to_Hdoc/xslt/makeContainer.xsl"/>
       <!-- create the file which contains the freemind data converted-->
       <xslt in="${basedir}/${inputPath}" out="${basedir}/temp/${hdocName}/content.xml" xslresource="${basedir}/../mindMapping_to_Hdoc/xslt/${myXSLT}"/>
       
       <!-- zipping files as the hdoc format -->
       <zip destfile="${resultFile}/hdoc/${hdocName}.hdoc"
       basedir="${basedir}/temp/${hdocName}"/>
      <!-- to generate scar files -->
      <antcall target="opale_conversion"/>
    <!-- </condition> -->
       
        <delete dir="${resultFile}/hdoc"></delete>
       <echo>end data conversion</echo>
   </target>
76 77 78 79 80 81


   <!-- Connect this to the work of the other group about hdoc to opale (configure and call their ant etc.) -->
   <target name="opale_conversion">
      <!-- <condition property="converting.set" else="false"> -->
       <ant antfile="${basedir}/hdoc_to_opale/hdoc_to_opale.ant" dir="${basedir}/hdoc_to_opale">
82 83
            <property name="InputPath" value="${resultFile}/hdoc/${hdocName}.hdoc"/>
            <property name="OutputPath" value="${resultFile}/scar/${hdocName}.scar"/>
84 85 86 87
        </ant>
   </target>
    
</project>