Commit da86dac8 authored by Decorde Jeffrey's avatar Decorde Jeffrey

Merge branch 'master' of gitlab.utc.fr:crozatst/hdoc

parents 04f76337 ff17acc7
...@@ -4,4 +4,12 @@ ...@@ -4,4 +4,12 @@
wikipedia_to_hdoc/result/* wikipedia_to_hdoc/result/*
wikipedia_to_hdoc/tmp/* wikipedia_to_hdoc/tmp/*
wikipedia_to_hdoc/hdoc_to_opale/tmp/* wikipedia_to_hdoc/hdoc_to_opale/tmp/*
wikipedia_to_hdoc/output/* wikipedia_to_hdoc/output/*
\ No newline at end of file mindmapping_to_opale/result/*
mindmapping_to_opale/tmp/*
mindmapping_to_lexique/result/*
mindmapping_to_lexique/tmp/*
mindmapping_to_optim/result/*
mindmapping_to_optim/tmp/*
mindmapping_to_hdoc/result/*
mindmapping_to_hdoc/tmp/*
\ No newline at end of file
<project name="hdoc_to_optim" default="convert"> <project name="hdoc_to_optim" default="convert">
<!-- Arguments properties -->
<property name="InputPath" value="input" />
<property name="OutputPath" value="output" />
<property name="OutputScarPath" value="${OutputPath}/result.scar" />
<target name="convert"> <target name="convert">
<!-- get input hdoc file path -->
<fileset id="fileset_hdoc" dir="${InputPath}" casesensitive="yes">
<include name="*.hdoc"/>
</fileset>
<pathconvert property="HdocPath" pathsep="" refid="fileset_hdoc" />
<!--unzips the hdoc to be converted--> <!--unzips the hdoc to be converted-->
<unzip dest="hdoc" src ="${InputPath}"/> <unzip dest="hdoc" src ="${HdocPath}"/>
<!--gives all rights to avoid bugs-->
<!--gives all rights to avoid bugs-->
<chmod dir="hdoc" perm="777"/> <chmod dir="hdoc" perm="777"/>
<!--launches the XSLT find_content to retrieve the content path-->
<xslt in="hdoc/META-INF/container.xml" out="get_content.ant" style="find_content.xsl"/> <!--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"/>
<chmod file="get_content.ant" perm="777"/> <chmod file="get_content.ant" perm="777"/>
<!--launches the ANT get_content resulting from the previous XSLT in order to launch the conversion-->
<!--launches the ANT get_content resulting from the previous XSLT in order to launch the conversion-->
<ant antfile="get_content.ant"/> <ant antfile="get_content.ant"/>
<!--once the conversion is complete, the result is zipped--> <!--once the conversion is complete, the result is zipped-->
<zip basedir="result" destfile="${OutputPath}"/> <zip basedir="result" destfile="${OutputScarPath}"/>
<!--temporary files and folders are deleted-->
<!--temporary files and folders are deleted-->
<delete dir="hdoc"/> <delete dir="hdoc"/>
<delete dir="result"/> <delete dir="result"/>
<delete file="get_content.ant"/> <delete file="get_content.ant"/>
<delete file="get_ressources.ant"/> <delete file="get_ressources.ant"/>
</target> </target>
</project> </project>
\ No newline at end of file
@echo off @echo off
set lib=lib set lib=lib
set ant=myantce.ant set ant=hdoc_to_optim.ant
set antparam=-Dprogram.param=%1 set antparam=-Dprogram.param=%1
set scJarList=%lib%\* set scJarList=%lib%\*
......
#!/bin/sh #!/bin/sh
lib="lib" lib="lib"
ant="myantce.ant" ant="hdoc_to_optim.ant"
antparam="-Dprogram.param=$1" antparam="-Dprogram.param=$1"
#Recherche de java et controle que se soit une version SUN #Recherche de java et controle que se soit une version SUN
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:h="urn:utc.fr:ics:hdoc:container" xmlns:h="urn:utc.fr:ics:hdoc:container"
xmlns:xs="http://www.w3.org/2001/XMLSchema"> xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:param name="destfile" required="yes" as="xs:string"/> <!--<xsl:param name="destfile" required="yes" as="xs:string"/>-->
<xsl:output method="xml" indent="yes"/> <xsl:output method="xml" indent="yes"/>
<xsl:template match="h:container"> <xsl:template match="h:container">
<project name="hdoc_to_optim" default="main"> <project name="hdoc_to_optim" default="main">
<target name="main"> <target name="main">
<mkdir dir="result"/> <mkdir dir="result"/>
<chmod dir="result" perm="777"/> <chmod dir="result" perm="777"/>
<copy file=".wspmeta" todir="result"/> <copy file="output/.wspmeta" todir="result"/>
<xsl:apply-templates/> <xsl:apply-templates/>
</target> </target>
</project> </project>
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
<xsl:template match="h:rootfile"> <xsl:template match="h:rootfile">
<xsl:variable name="path" select="@full-path"/> <xsl:variable name="path" select="@full-path"/>
<!--the ANT runs the XSLT get_ressources then the ANT created by it--> <!--the ANT runs the XSLT get_ressources then the ANT created by it-->
<xslt in="hdoc/{$path}" out="get_ressources.ant" style="find_ressources.xsl"/> <xslt in="hdoc/{$path}" out="get_ressources.ant" style="xsl/find_ressources.xsl"/>
<chmod file="get_ressources.ant" perm="777"/> <chmod file="get_ressources.ant" perm="777"/>
<ant antfile="get_ressources.ant"/> <ant antfile="get_ressources.ant"/>
<!--the ANT runs the main XSLT transfo--> <!--the ANT runs the main XSLT transfo-->
<xslt in="hdoc/{$path}" out="result/content.paper" style="transfo.xsl"/> <xslt in="hdoc/{$path}" out="result/content.paper" style="xsl/transfo.xsl"/>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8" standalone="no"?><map version="0.8.1"><node CREATED="1450312359766" ID="2nngtspni6hi1484pfec44c8lk" MODIFIED="1450312359766" TEXT="MindMapping"><node CREATED="1450312359766" ID="00lp6bpfm6jibhcjrpdonrhoqb" MODIFIED="1450312359766" POSITION="right" TEXT="#1 MindMapping to Hdoc"><node CREATED="1450312359766" ID="3qm1jgu7dfgs328jthlek5fd4e" MODIFIED="1450312359766" TEXT="Prendre en main le projet existant"/><node CREATED="1450312359766" ID="0u38ectmhqqp4p08p5guvgij71" MODIFIED="1450312359766" TEXT="Corriger les bugs existants"/><node CREATED="1450312359766" ID="3b1t9o2te6enh59j4iv48f4mdi" MODIFIED="1450312359766" TEXT="Restructurer le ant"/></node><node CREATED="1450312359766" ID="6lohsep5crh5g3ngj8ld8loei6" MODIFIED="1450312359766" POSITION="right" TEXT="#2 MindMapping to Opale"><node CREATED="1450312359766" ID="5pl3210hq6if3nv7r2chtjstmo" MODIFIED="1450312359766" TEXT="Faire la connexion avec le transformateur Hdoc to Opale"/><node CREATED="1450312359766" ID="3haa2fgohe9j4n04ilddco84uh" MODIFIED="1450312359766" TEXT="Permettre la personnalisation de l'organisation du module"/><node CREATED="1450312359766" ID="11k2hbkcu415e1mgk5c5ucr48k" MODIFIED="1450312359766" TEXT="Permettre la personnalisation dy type de noeud (Intro, conclusion etc.)"/><node CREATED="1450312359766" ID="4npf8jpvak3lffn9c1rsogi0sq" MODIFIED="1450312359766" TEXT="Permettre la personnalisation grâce aux couleurs/icônes"/></node><node CREATED="1450312359766" ID="3n8v43p8qb005puq3qiv7aiubc" MODIFIED="1450312359766" POSITION="right" TEXT="#3 MindMapping to Optim"><node CREATED="1450312359766" ID="2bn1la3apnjf1fi8qqfqde226t" MODIFIED="1450312359766" TEXT="Faire la connexion avec le transformateur Hdoc to Optim"/></node><node CREATED="1450312359766" ID="3s00si3hquol4pldg7lo9opjd6" MODIFIED="1450312359766" POSITION="right" TEXT="#4 MindMapping to Lexique"><node CREATED="1450312359766" ID="37jlfl25iuaoe6f2cpiv30qksd" MODIFIED="1450312359766" TEXT="Faire la connexion avec le transformateur Hdoc to Lexique"/></node><node CREATED="1450312359767" ID="27gnl6pgottjfiukpa3ulfdjrj" MODIFIED="1450312359767" POSITION="left" TEXT="#5 Prendre d'autres outils de carte mentales en entrée"/><node CREATED="1450312359767" ID="24d41nnnnvvu7fv5m8m4vegu0g" MODIFIED="1450312359767" POSITION="left" TEXT="#intro This converter aims at convert a given MindMapping file into a Hdoc file which then will be imported in Opale (advanced only)."/><node CREATED="1450312359767" ID="6a7pr2b5vvmq6na5964dhf9e13" MODIFIED="1450312359767" POSITION="left" TEXT="#conclu Ma conclusion"/></node></map>
\ No newline at end of file
<map version="1.0.1"> <map version="1.0.1">
<!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net --> <!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->
<node CREATED="1449485059502" ID="ID_1970904157" MODIFIED="1449733283013"> <node CREATED="1449485059502" ID="ID_1970904157" MODIFIED="1449733283013">
<node CREATED="1449486713098" ID="ID_983701334" MODIFIED="1449486715515" TEXT="#intro Une introduction"/>
<node CREATED="1449486720318" ID="ID_737906523" MODIFIED="1449486722975" TEXT="#conclu Une conclusion"/>
<richcontent TYPE="NODE"><html> <richcontent TYPE="NODE"><html>
<head> <head>
...@@ -36,8 +38,6 @@ ...@@ -36,8 +38,6 @@
</node> </node>
<node CREATED="1449485926526" ID="ID_289476678" MODIFIED="1449486753624" POSITION="left" TEXT="Sc&#xe9;nario"> <node CREATED="1449485926526" ID="ID_289476678" MODIFIED="1449486753624" POSITION="left" TEXT="Sc&#xe9;nario">
<node CREATED="1449485946398" ID="ID_596698657" MODIFIED="1449734206316" TEXT="#p Mon personnage bien a&#xee;m&#xe9; attaque tous les monstres alentours pour de l&apos;argent"/> <node CREATED="1449485946398" ID="ID_596698657" MODIFIED="1449734206316" TEXT="#p Mon personnage bien a&#xee;m&#xe9; attaque tous les monstres alentours pour de l&apos;argent"/>
<node CREATED="1449486713098" ID="ID_983701334" MODIFIED="1449486715515" TEXT="#intro"/>
<node CREATED="1449486720318" ID="ID_737906523" MODIFIED="1449486722975" TEXT="#conclu"/>
<node CREATED="1449486747017" ID="ID_1777634105" MODIFIED="1449486750554" TEXT="#mcq"/> <node CREATED="1449486747017" ID="ID_1777634105" MODIFIED="1449486750554" TEXT="#mcq"/>
</node> </node>
</node> </node>
......
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
<!-- This is wrong -> xpath-default-namespace="http://www.utc.fr/ics/hdoc/xhtml"--> <!-- This is wrong -> xpath-default-namespace="http://www.utc.fr/ics/hdoc/xhtml"-->
<xsl:output method="xml" indent="yes"/> <xsl:output method="xml" indent="yes"/>
<!-- Remove spaces/tabs -->
<xsl:strip-space elements="*"/> <xsl:strip-space elements="*"/>
<!-- Entry point -->
<xsl:template match="map"> <xsl:template match="map">
<xsl:processing-instruction name="oxygen"> <xsl:processing-instruction name="oxygen">
RNGSchema="http://scenari.utc.fr/hdoc/schemas/xhtml/hdoc1-xhtml.rng" type="xml" RNGSchema="http://scenari.utc.fr/hdoc/schemas/xhtml/hdoc1-xhtml.rng" type="xml"
...@@ -22,10 +24,10 @@ ...@@ -22,10 +24,10 @@
</xsl:template> </xsl:template>
<!-- Header in hdoc -->
<xsl:template match="node[1]" mode="header"> <xsl:template match="node[1]" mode="header">
<title> <title>
<xsl:value-of select="@TEXT"/> <xsl:value-of select="utc:string-remove-order(@TEXT)"/>
<xsl:value-of select="richcontent"/> <xsl:value-of select="richcontent"/>
</title> </title>
<meta charset="utf-8"/> <meta charset="utf-8"/>
...@@ -37,11 +39,35 @@ ...@@ -37,11 +39,35 @@
<xsl:element name="section"> <xsl:element name="section">
<header> <header>
<h1> <h1>
<xsl:value-of select="@TEXT"/> <xsl:value-of select="utc:string-remove-order(@TEXT)"/>
<xsl:value-of select="richcontent"/> <xsl:value-of select="richcontent"/>
</h1> </h1>
</header> </header>
<!--Introduction-->
<xsl:if test="child::*[contains(@TEXT, '#intro')]">
<xsl:element name="section">
<header><h1>Introduction</h1>
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">introduction</xsl:attribute>
<xsl:value-of select="utc:string-remove-order(utc:string-remove-all(child::*[contains(@TEXT, '#intro')][1]/@TEXT, '#intro '))"/>
</xsl:element>
</header>
</xsl:element>
</xsl:if>
<!-- Process children -->
<xsl:apply-templates select="node"/> <xsl:apply-templates select="node"/>
<!--Conclusion-->
<xsl:if test="child::*[contains(@TEXT, '#conclu')]">
<xsl:element name="section">
<header><h1>Conclusion</h1></header>
<footer>
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">conclusion</xsl:attribute>
<xsl:value-of select="utc:string-remove-order(utc:string-remove-all(child::*[contains(@TEXT, '#conclu')][1]/@TEXT, '#conclu '))"/>
</xsl:element>
</footer>
</xsl:element>
</xsl:if>
</xsl:element> </xsl:element>
</xsl:template> </xsl:template>
...@@ -49,16 +75,16 @@ ...@@ -49,16 +75,16 @@
<xsl:template <xsl:template
match="node[not(node)]|node[child::*[contains(@TEXT, '#p')]]|node[child::*[contains(@TEXT, '#a')]]" match="node[not(node)]|node[child::*[contains(@TEXT, '#p')]]|node[child::*[contains(@TEXT, '#a')]]"
priority="1"> priority="1">
<xd:doc xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl">
<xd:desc>
<xd:p/>
</xd:desc>
</xd:doc>
<xsl:element name="section"> <xsl:element name="section">
<xsl:attribute name="data-hdoc-type">unit-of-content</xsl:attribute> <xsl:attribute name="data-hdoc-type">unit-of-content</xsl:attribute>
<xsl:if test="child::attribute[@NAME='anchor']">
<xsl:attribute name="id">
<xsl:value-of select="child::attribute[@NAME='anchor'][1]/@VALUE"></xsl:value-of>
</xsl:attribute>
</xsl:if>
<header> <header>
<h1> <h1>
<xsl:value-of select="@TEXT"/> <xsl:value-of select="utc:string-remove-order(@TEXT)"/>
<xsl:value-of select="richcontent"/> <xsl:value-of select="richcontent"/>
</h1> </h1>
</header> </header>
...@@ -66,28 +92,32 @@ ...@@ -66,28 +92,32 @@
</xsl:element> </xsl:element>
</xsl:template> </xsl:template>
<!-- Paragraph -->
<xsl:template match="node[contains(@TEXT, '#p')]" priority="2"> <xsl:template match="node[contains(@TEXT, '#p')]" priority="2">
<xsl:element name="p"> <xsl:element name="p">
<xsl:value-of select="utc:string-remove-all(@TEXT, '#p ')"/> <xsl:value-of select="utc:string-remove-order(utc:string-remove-all(@TEXT, '#p '))"/>
</xsl:element> </xsl:element>
</xsl:template> </xsl:template>
<!-- Link : need to use anchor attribute ? -->
<xsl:template match="node[contains(@TEXT, '#a')]" priority="2"> <xsl:template match="node[contains(@TEXT, '#a')]" priority="2">
<xsl:element name="a"> <xsl:element name="a">
<xsl:attribute name="href"> <xsl:attribute name="href">
<xsl:text>#</xsl:text> <xsl:text>#</xsl:text>
<xsl:value-of select="utc:string-remove-all(@TEXT, '#a ')"/> <xsl:value-of select="utc:string-remove-order(utc:string-remove-all(@TEXT, '#a '))"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="utc:string-remove-all(@TEXT, '#a ')"/> <xsl:value-of select="utc:string-remove-order(utc:string-remove-all(@TEXT, '#a '))"/>
</xsl:element> </xsl:element>
</xsl:template> </xsl:template>
<!-- Default behavior for intro and conclu nodes : do nothing -->
<xsl:template match="node[contains(@TEXT, '#intro')] | node[contains(@TEXT, '#conclu')]" priority="3"/>
<xsl:template match="richcontent"> <xsl:template match="richcontent">
<xsl:value-of select="html/body/p"/> <xsl:value-of select="utc:string-remove-order(html/body/p)"/>
</xsl:template> </xsl:template>
<!-- Utility functions --> <!-- Utility functions -->
<xsl:function name="utc:string-remove-all" as="xs:string"> <xsl:function name="utc:string-remove-all" as="xs:string">
<xsl:param name="text" as="xs:string"/> <xsl:param name="text" as="xs:string"/>
<xsl:param name="replace" as="xs:string"/> <xsl:param name="replace" as="xs:string"/>
...@@ -97,7 +127,7 @@ ...@@ -97,7 +127,7 @@
<xsl:with-param name="replace" select="$replace"/> <xsl:with-param name="replace" select="$replace"/>
</xsl:call-template> </xsl:call-template>
</xsl:variable> </xsl:variable>
<xsl:value-of select="$ret"></xsl:value-of> <xsl:value-of select="$ret"/>
</xsl:function> </xsl:function>
<xsl:template name="string-remove-all"> <xsl:template name="string-remove-all">
...@@ -116,4 +146,11 @@ ...@@ -116,4 +146,11 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:function name="utc:string-remove-order" as="xs:string">
<xsl:param name="text" as="xs:string?" />
<xsl:variable name="text2" select="string($text)"/>
<xsl:value-of select="replace($text2,'#[1-9][0-9]* ','')"></xsl:value-of>
</xsl:function>
</xsl:stylesheet> </xsl:stylesheet>
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<target name="opale_conversion.windows"> <target name="opale_conversion.windows">
<echo>This is a Windows machine.</echo> <echo>This is a Windows machine.</echo>
<copy file="${resultFile}/hdoc/${hdocName}.hdoc" todir="${basedir}/../hdoc_to_opale/input/${hdocName}.hdoc"/> <copy file="${resultFile}/hdoc/${hdocName}.hdoc" todir="${basedir}/../hdoc_to_opale/input"/>
<exec dir="." executable="cmd"> <exec dir="." executable="cmd">
<arg value="${basedir}/../hdoc_to_opale/run.bat"/> <arg value="${basedir}/../hdoc_to_opale/run.bat"/>
</exec> </exec>
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
<target name="opale_conversion.unix"> <target name="opale_conversion.unix">
<echo>This is an Unix machine.</echo> <echo>This is an Unix machine.</echo>
<copy file="${resultFile}/hdoc/${hdocName}.hdoc" todir="${basedir}/../hdoc_to_opale/input/${hdocName}.hdoc"/> <copy file="${resultFile}/hdoc/${hdocName}.hdoc" todir="${basedir}/../hdoc_to_opale/input"/>
<exec dir="." executable="/bin/sh"> <exec dir="." executable="/bin/sh">
<arg value="${basedir}/../hdoc_to_opale/run.sh"/> <arg value="${basedir}/../hdoc_to_opale/run.sh"/>
</exec> </exec>
......
<project name="ProjetOpale" default="convert"> <project name="ProjetOpale" default="convert">
<!-- Arguments properties -->
<property name="InputPath" value="source.scar" />
<property name="OutputPath" value="result.hdoc" />
<!-- Other properties --> <!-- Other properties -->
<property name="UnzipSourcePath" value="UnzipSourcePath" /> <property name="UnzipSourcePath" value="unzipSourcePath" />
<property name="XmlModuleName" value="" /> <property name="XmlModuleName" value="" />
<property name="TmpPath" value="TmpPath" /> <property name="TmpPath" value="tmp" />
<property name="TmpFile1" value="TmpFile1.xml" /> <property name="TmpFile1" value="tmpFile1.xml" />
<property name="RacineFile" value="content.xml" /> <property name="RacineFile" value="content.xml" />
<property name="HdocPath" value="hdoc" /> <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 --> <!-- Others properties (in another file) currently empty -->
<property file="opale_to_hdoc.properties" /> <property file="opale_to_hdoc.properties" />
...@@ -60,7 +58,12 @@ ...@@ -60,7 +58,12 @@
<!-- Unzip scar source file --> <!-- Unzip scar source file -->
<target name="unzip_scar"> <target name="unzip_scar">
<unzip src="${InputPath}" dest="./${UnzipSourcePath}"/> <!-- 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}"/>
</target> </target>
<!-- Create the hdoc structure --> <!-- Create the hdoc structure -->
...@@ -70,8 +73,8 @@ ...@@ -70,8 +73,8 @@
<touch file="${HdocPath}/META-INF/container.xml" /> <touch file="${HdocPath}/META-INF/container.xml" />
<touch file="${HdocPath}/mimetype" /> <touch file="${HdocPath}/mimetype" />
<echo message="application/x-hdoc+zip" file="${HdocPath}/mimetype" /> <echo message="application/x-hdoc+zip" file="${HdocPath}/mimetype" />
<echoxml file="${HdocPath}/META-INF/container.xml"> <echoxml file="${HdocPath}/META-INF/container.xml" namespacePolicy="elementsOnly">
<container version="1.0"> <container xmlns="urn:utc.fr:ics:hdoc:container" version="1.0">
<rootfiles> <rootfiles>
<rootfile full-path="${HdocPath}/${RacineFile}" media-type="text/xml" /> <rootfile full-path="${HdocPath}/${RacineFile}" media-type="text/xml" />
</rootfiles> </rootfiles>
...@@ -89,18 +92,18 @@ ...@@ -89,18 +92,18 @@
<pathconvert property="xml.path" pathsep="" refid="fileset_source_xml" /> <pathconvert property="xml.path" pathsep="" refid="fileset_source_xml" />
<!-- xsl --> <!-- xsl -->
<xslt style="opale_to_hdoc_regle1.xsl" in="${xml.path}" out="./${TmpPath}/${TmpFile1}"> <xslt style="xsl/opale_to_hdoc_regle1.xsl" in="${xml.path}" out="./${TmpPath}/${TmpFile1}">
</xslt> </xslt>
</target> </target>
<!-- Create content.xml --> <!-- Create content.xml -->
<target name="content_xml"> <target name="content_xml">
<xslt style="opale_to_hdoc_regle2.xsl" in="./${TmpPath}/${TmpFile1}" out="./${HdocPath}/${RacineFile}" /> <xslt style="xsl/opale_to_hdoc_regle2.xsl" in="./${TmpPath}/${TmpFile1}" out="./${HdocPath}/${RacineFile}" />
</target> </target>
<!-- Zip Hdoc --> <!-- Zip Hdoc -->
<target name="zip"> <target name="zip">
<zip destfile="${OutputPath}" basedir="${HdocPath}"/> <zip destfile="${ZipPath}" basedir="${HdocPath}"/>
</target> </target>
</project> </project>
\ No newline at end of file
@echo off @echo off
set lib=lib set lib=lib
set ant=myantce.ant set ant=opale_to_hdoc.ant
set antparam=-Dprogram.param=%1 set antparam=-Dprogram.param=%1
set scJarList=%lib%\* set scJarList=%lib%\*
......
#!/bin/sh #!/bin/sh
lib="lib" lib="lib"
ant="myantce.ant" ant="opale_to_hdoc.ant"
antparam="-Dprogram.param=$1" antparam="-Dprogram.param=$1"
#Recherche de java et controle que se soit une version SUN #Recherche de java et controle que se soit une version SUN
......
Usage Usage
----- -----
Put `.scar` files in the input folder, run `run.bat` or `run.sh` and get results in output folder (one folder and zip per .scar). Put `.scar` files in the input folder, run `run.bat` or `run.sh` and get results in output folder (one folder and a .hdoc per .scar).
Todo list Todo list
...@@ -11,9 +11,9 @@ Todo list ...@@ -11,9 +11,9 @@ Todo list
- add schema validation - add schema validation
- clean output of optim source files - clean output of optim source files
- resolve bugs - resolve bugs
- test the entier process from optim to opale
- the level of unit of content for the Opal conversion if basically set to sections witch doesn't contains any section but some could need it to be set to another level. Create a selection of this level could be a next step for this project. - the level of unit of content for the Opal conversion if basically set to sections witch doesn't contains any section but some could need it to be set to another level. Create a selection of this level could be a next step for this project.
Bugs Bugs
---- ----
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<sequential> <sequential>
<local name="folder_name"/> <local name="folder_name"/>
<basename property="folder_name" file="@{folder}"/> <basename property="folder_name" file="@{folder}"/>
<zip destfile="${out}/${folder_name}.zip" basedir="@{folder}" ></zip> <zip destfile="${out}/${folder_name}.hdoc" basedir="@{folder}" ></zip>
</sequential> </sequential>
</for> </for>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:of="scpf.org:office" xmlns:of="scpf.org:office"
xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive" xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive"
xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
<xsl:apply-templates select="node()|@*"> <xsl:apply-templates select="node()|@*">
<xsl:with-param name="src" select="$src"/> <xsl:with-param name="src" select="$src"/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:copy> </xsl:copy>
</xsl:template> </xsl:template>
<xsl:template match="/"> <xsl:template match="/">
<xsl:variable name="src"><xsl:value-of select="$currentDir"/>/</xsl:variable> <xsl:variable name="src"><xsl:value-of select="$currentDir"/>/</xsl:variable>
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
<xsl:apply-templates select="node()|@*"> <xsl:apply-templates select="node()|@*">
<xsl:with-param name="src" select="$src"/> <xsl:with-param name="src" select="$src"/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:copy> </xsl:copy>
</xsl:template> </xsl:template>
<xsl:template match="sp:main[@sc:refUri]" priority="1"> <xsl:template match="sp:main[@sc:refUri]" priority="1">
<xsl:param name="src" /> <xsl:param name="src" />
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<xsl:template match="sp:sec[@sc:refUri]" priority="1"> <xsl:template match="sp:sec[@sc:refUri]" priority="1">
<xsl:param name="src" /> <xsl:param name="src" />
<xsl:variable name="refUri" select="@sc:refUri" /> <xsl:variable name="refUri" select="@sc:refUri" />
<xsl:variable name="refDoc" select="document($refUri)" /> <xsl:variable name="refDoc" select="document($refUri)" />
<xsl:variable name="refUriWithoutLastPart"> <xsl:variable name="refUriWithoutLastPart">
<xsl:call-template name="removeLastPart"> <xsl:call-template name="removeLastPart">
<xsl:with-param name="value" select="$refUri" /> <xsl:with-param name="value" select="$refUri" />
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<xsl:template match="sp:subPage[@sc:refUri]" priority="1"> <xsl:template match="sp:subPage[@sc:refUri]" priority="1">
<xsl:param name="src" /> <xsl:param name="src" />
<xsl:variable name="refUri" select="@sc:refUri" /> <xsl:variable name="refUri" select="@sc:refUri" />
<xsl:variable name="refDoc" select="document($refUri)" /> <xsl:variable name="refDoc" select="document($refUri)" />
<xsl:variable name="refUriWithoutLastPart"> <xsl:variable name="refUriWithoutLastPart">
<xsl:call-template name="removeLastPart"> <xsl:call-template name="removeLastPart">
<xsl:with-param name="value" select="$refUri" /> <xsl:with-param name="value" select="$refUri" />
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<xsl:template match="sp:page[@sc:refUri]" priority="1"> <xsl:template match="sp:page[@sc:refUri]" priority="1">
<xsl:param name="src" /> <xsl:param name="src" />
<xsl:variable name="refUri" select="@sc:refUri" /> <xsl:variable name="refUri" select="@sc:refUri" />
<xsl:variable name="refDoc" select="document($refUri)" /> <xsl:variable name="refDoc" select="document($refUri)" />
<xsl:variable name="refUriWithoutLastPart"> <xsl:variable name="refUriWithoutLastPart">
<xsl:call-template name="removeLastPart"> <xsl:call-template name="removeLastPart">
<xsl:with-param name="value" select="$refUri" /> <xsl:with-param name="value" select="$refUri" />
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<xsl:template match="sp:frag" priority="1"> <xsl:template match="sp:frag" priority="1">
<xsl:param name="src" /> <xsl:param name="src" />
<xsl:variable name="refUri" select="@sc:refUri" /> <xsl:variable name="refUri" select="@sc:refUri" />
<xsl:variable name="refDoc" select="document($refUri)" /> <xsl:variable name="refDoc" select="document($refUri)" />
<xsl:variable name="totalUri"> <xsl:variable name="totalUri">
<xsl:value-of select="concat($src, $refUri)" /> <xsl:value-of select="concat($src, $refUri)" />
</xsl:variable> </xsl:variable>
...@@ -128,7 +128,6 @@ ...@@ -128,7 +128,6 @@
<xsl:with-param name="src" select="$totalUri"/> <xsl:with-param name="src" select="$totalUri"/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:template> </xsl:template>
<xsl:template match="sc:uLink[@role='ref' and contains(@sc:refUri, '.section')]" priority="2"> <xsl:template match="sc:uLink[@role='ref' and contains(@sc:refUri, '.section')]" priority="2">
<xsl:param name="src" /> <xsl:param name="src" />
...@@ -191,7 +190,7 @@ ...@@ -191,7 +190,7 @@
<xsl:template match="sp:gallery[@sc:refUri]"> <xsl:template match="sp:gallery[@sc:refUri]">
<xsl:param name="src" /> <xsl:param name="src" />
<xsl:variable name="refUri" select="@sc:refUri" /> <xsl:variable name="refUri" select="@sc:refUri" />
<xsl:variable name="refDoc" select="document($refUri)" /> <xsl:variable name="refDoc" select="document($refUri)" />
<xsl:variable name="refUriWithoutLastPart"> <xsl:variable name="refUriWithoutLastPart">
<xsl:call-template name="removeLastPart"> <xsl:call-template name="removeLastPart">
<xsl:with-param name="value" select="$refUri" /> <xsl:with-param name="value" select="$refUri" />
...@@ -239,8 +238,8 @@ ...@@ -239,8 +238,8 @@
<xsl:apply-templates select="node()|@*"> <xsl:apply-templates select="node()|@*">
<xsl:with-param name="src" select="$src"/> <xsl:with-param name="src" select="$src"/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:copy> </xsl:copy>
</xsl:template> </xsl:template>
<!--Retracer le bon lien pour tous les refUri...--> <!--Retracer le bon lien pour tous les refUri...-->
......
<?xml version="1.0"?>
<?oxygen RNGSchema="http://scenari.utc.fr/hdoc/schemas/container/hdoc1-container.rng" type="xml" ?>
<container version="1.0" xmlns="urn:utc.fr:ics:hdoc:container">
<rootfiles>
<rootfile full-path="content.xml" media-type="text/xml"/>
</rootfiles>
</container>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="http://hdoc.crzt.fr/schemas/xhtml/hdoc1-xhtml.rng" type="xml" ?>
<html xmlns="http://www.utc.fr/ics/hdoc/xhtml">
<head>
<title>Hello world</title>
<meta charset="utf-8"/>
<meta name="author" content="Stéphane Crozat"/>
</head>
<body>
<section>
<header>
<h1>First section</h1>
</header>
<div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
</section>
<section>
<header>
<h1>Second section</h1>
</header>
<div>
<p>Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
</section>
</body>
</html>
\ No newline at end of file
application/x-hdoc+zip