Commit 21084fe0 authored by Fremondiere Bastien's avatar Fremondiere Bastien

Merge branch 'master' into mindmapping

parents eb287fa3 2c09fc3a
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="hdoc_to_opale" basedir="." default="convert">
<property name="in" location="${basedir}/input"/>
<property name="out" location="${basedir}/output"/>
<property name="tmp" location="${basedir}/tmp"/>
<property name="xsl" location="${basedir}/xsl"/>
<property name="lib" location="${basedir}/lib"/>
<property name="log" location="${basedir}/log"/>
<property name="schema" location="${basedir}/schema"/>
<property name="bibtex" location="${basedir}/bibtex_to_opale"/>
<property file="global.properties"/>
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="lib/jing.jar"/>
</classpath>
</taskdef>
<target name="convert">
<!-- This is the main target : it is called whether by the project (as the default target) or by the user/converter
website, if specified in the command line. Basically, this target consists in several targets/ant buildfiles calls. -->
<antcall target="CleanDirectory"/>
<antcall target="UnzipHdocFile"/>
<antcall target="ValidateInput" />
<antcall target="FindContentFiles"/>
<ant antfile="${tmp}/generateContentPath.xml"/>
<antcall target="ValidateOutput"/>
<antcall target="DivideOutput"/>
<antcall target="ZipOutput"/>
<antcall target="ZipDividedOutput"/>
<antcall target="CleanDirectory"/>
</target>
<target name="CleanDirectory">
<delete>
<fileset dir="${tmp}">
<include name="**/*"/>
</fileset>
</delete>
</target>
<target name="UnzipHdocFile">
<!-- Unzip the input hdoc file. Decompressed folder is named "decompressedHdoc" : this name is the only one which
refers to the hdoc file furthermore in this project. -->
<unzip dest="${tmp}/decompressedHdoc">
<fileset dir="${in}">
<include name="**/*.hdoc"/>
</fileset>
</unzip>
<chmod dir="${tmp}/decompressedHdoc" perm="777"/>
</target>
<target name="FindContentFiles">
<!-- Finds the absolute path of container.xml and applies transformation0.xsl on it.-->
<first id="first">
<fileset dir="${tmp}/decompressedHdoc/META-INF" includes="**/container.xml"/>
</first>
<xslt in="${toString:first}" out="${tmp}/generateContentPath.xml" style="${xsl}/transformation0.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison" />
<chmod file="${tmp}/generateContentPath.xml" perm="777"/>
</target>
<target name="ZipOutput">
<copy file="${bibtex}/.wspmeta" todir="${tmp}/decompressedOpale"/>
<mkdir dir="${tmp}/decompressedOpale/res"/>
<ant antfile="${tmp}/moveRessourceFiles.xml"/>
<zip basedir="${tmp}/decompressedOpale" destfile="${out}/output.scar" encoding="UTF-8"/>
</target>
<target name="ZipDividedOutput">
<copy file="${bibtex}/.wspmeta" todir="${tmp}/decompressedOpaleDivided"/>
<copy todir="${tmp}/decompressedOpaleDivided/res" >
<fileset dir="${tmp}/decompressedOpale/res" includes="**"/>
</copy>
<copy todir="${tmp}/decompressedOpaleDivided/references" >
<fileset dir="${tmp}/decompressedOpale/references" includes="**"/>
</copy>
<zip basedir="${tmp}/decompressedOpaleDivided" destfile="${out}/outdividedOutput.scar" encoding="UTF-8"/>
</target>
<!-- Validating the XML container file -->
<target name="ValidateInput">
<jing file="${tmp}/decompressedHdoc/META-INF/container.xml" rngfile="${schema}/hdoc1-container.rng"></jing>
</target>
<!-- Validating the XML output -->
<target name="ValidateOutput">
<jing file="${tmp}/decompressedOpale/main.xml" rngfile="${schema}/op_ue.rng"></jing>
</target>
<target name="DivideOutput">
<mkdir dir="${tmp}/decompressedOpaleDivided"/>
<!-- Adding IDS to the general output file -->
<xslt
in="${tmp}/decompressedOpale/main.xml"
out="${tmp}/outputWithCourseUcIds.xml"
style="${xsl}/addCourseUcIds.xsl"
processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
/>
<!-- Generating the root file (with refs to other files) -->
<xslt
in="${tmp}/outputWithCourseUcIds.xml"
out="${tmp}/decompressedOpaleDivided/main.xml"
style="${xsl}/addCourseUcReferences.xsl"
processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
/>
<!-- Generating the ANT file that will copy the files -->
<xslt
in="${tmp}/outputWithCourseUcIds.xml"
out="${tmp}/exportUnits.ant"
style="${xsl}/prepareCourseUcCopies.xsl"
processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
/>
<!-- Executing that ANT file -->
<ant antfile="${tmp}/exportUnits.ant"/>
</target>
</project>
@echo off
set lib=lib
set ant=myantce.ant
set antparam=-Dprogram.param=%1
set scJarList=%lib%\*
java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
pause
REM start /MIN java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
#!/bin/sh
lib="lib"
ant="myantce.ant"
antparam="-Dprogram.param=$1"
#Recherche de java et controle que se soit une version SUN
vJavaCmd="java"
xCheckJava () {
vInputVarName=\$"$1"
vInputVarVal=`eval "expr \"$vInputVarName\" "`
if [ -z "$vInputVarVal" ];then
eval "$1=false"
return
fi
vSunJavaFound=`$vInputVarVal -version 2>&1 | grep -Eo -m 1 "(HotSpot)|(OpenJDK)"`
if [ "$vSunJavaFound" != "HotSpot" ] && [ "$vSunJavaFound" != "OpenJDK" ] ; then
eval "$1=false"
return
fi
}
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
vJavaCmd="$JAVA_HOME/bin/java"
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
echo "ERREUR: JRE de SUN introuvable. Veuillez déclarer la variable d'environnement JAVA_HOME."
exit 1
fi
fi
#Lancer la commande
scJarList="$lib/*"
$vJavaCmd -classpath "$scJarList:" -Xmx150m org.apache.tools.ant.Main -buildfile $ant $antparam
......@@ -9,7 +9,7 @@
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<!-- The ID of the courseUc element that needs to be copied has to be passed here -->
<xsl:param name="elementid" xsl:required="yes" xsl:as="xsl:string"/>
<xsl:param name="elementid"/>
<xsl:template match="sc:item">
<xsl:apply-templates select=".//sp:courseUc"/>
......@@ -18,9 +18,9 @@
<xsl:template match="sp:courseUc[@data-export-id = $elementid]">
<sc:item>
<!-- Once we are in the right courseUc, we can just copy everything -->
<xsl:copy-of select="./*"/>
<xsl:copy-of select="./*"/>
</sc:item>
</xsl:template>
<xsl:template match="*"/>
</xsl:stylesheet>
\ No newline at end of file
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:h="http://www.utc.fr/ics/hdoc/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
>
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<!-- This template matches the root and create a ANT project, the root of any ANT buildfile. -->
<xsl:template match="h:html">
<project name="moveRessourceFiles" basedir="." default="moveRessourceFiles">
<property file="global.properties"/>
<target name="moveRessourceFiles">
<xsl:apply-templates select="./*"/>
</target>
</project>
</xsl:template>
<!-- These templates guides XSL's motor. -->
<xsl:template match="h:body">
<xsl:apply-templates select="./h:section"/>
</xsl:template>
<xsl:template match="h:section">
<xsl:apply-templates select="./h:section | ./h:div"/>
</xsl:template>
<xsl:template match="h:div">
<xsl:apply-templates select="./h:img | ./h:audio | ./h:video | ./h:object"/>
</xsl:template>
<!-- Targeted markups. -->
<xsl:template match="h:img">
<copy tofile="${{tmpdir}}/decompressedOpale/res/{./@src}" file="${{tmpdir}}/decompressedHdoc/{./@src}"/>
</xsl:template>
<xsl:template match="h:audio">
<copy tofile="${{tmpdir}}/decompressedOpale/res/{./@src}" file="${{tmpdir}}/decompressedHdoc/{./@src}"/>
</xsl:template>
<xsl:template match="h:video">
<copy tofile="${{tmpdir}}/decompressedOpale/res/{./@src}" file="${{tmpdir}}/decompressedHdoc/{./@src}"/>
</xsl:template>
<xsl:template match="h:object">
<copy tofile="${{tmpdir}}/decompressedOpale/res/{./@data}" file="${{tmpdir}}/decompressedHdoc/{./@data}"/>
</xsl:template>
<!-- These markups are matched in order to minimize "apply-templates" side-effects (i.e. their contents are not relevant for this transformation). -->
<xsl:template match="h:head"/>
<xsl:template match="h:p"/>
<xsl:template match="h:em"/>
<xsl:template match="h:i"/>
<xsl:template match="h:span"/>
<xsl:template match="h:a"/>
<xsl:template match="h:ul"/>
<xsl:template match="h:ol"/>
<xsl:template match="h:li"/>
<xsl:template match="h:table"/>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:h="http://www.utc.fr/ics/hdoc/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
>
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<!-- This template matches the root and create a ANT project, the root of any ANT buildfile. -->
<xsl:template match="h:html">
<project name="moveRessourceFiles" basedir="." default="moveRessourceFiles">
<property file="global.properties"/>
<target name="moveRessourceFiles">
<xsl:apply-templates select="./*"/>
</target>
</project>
</xsl:template>
<!-- These templates guides XSL's motor. -->
<xsl:template match="h:body">
<xsl:apply-templates select="./h:section"/>
</xsl:template>
<xsl:template match="h:section">
<xsl:apply-templates select="./h:section | ./h:div"/>
</xsl:template>
<xsl:template match="h:div">
<xsl:apply-templates select="./h:img | ./h:audio | ./h:video | ./h:object"/>
</xsl:template>
<!-- Targeted markups. -->
<xsl:template match="h:img">
<copy tofile="${{tmp}}/decompressedOpale/res/{./@src}" file="${{tmp}}/decompressedHdoc/{./@src}"/>
</xsl:template>
<xsl:template match="h:audio">
<copy tofile="${{tmp}}/decompressedOpale/res/{./@src}" file="${{tmp}}/decompressedHdoc/{./@src}"/>
</xsl:template>
<xsl:template match="h:video">
<copy tofile="${{tmp}}/decompressedOpale/res/{./@src}" file="${{tmp}}/decompressedHdoc/{./@src}"/>
</xsl:template>
<xsl:template match="h:object">
<copy tofile="${{tmp}}/decompressedOpale/res/{./@data}" file="${{tmp}}/decompressedHdoc/{./@data}"/>
</xsl:template>
<!-- These markups are matched in order to minimize "apply-templates" side-effects (i.e. their contents are not relevant for this transformation). -->
<xsl:template match="h:head"/>
<xsl:template match="h:p"/>
<xsl:template match="h:em"/>
<xsl:template match="h:i"/>
<xsl:template match="h:span"/>
<xsl:template match="h:a"/>
<xsl:template match="h:ul"/>
<xsl:template match="h:ol"/>
<xsl:template match="h:li"/>
<xsl:template match="h:table"/>
</xsl:stylesheet>
......@@ -9,10 +9,17 @@
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="sc:item">
<project name="copy-ucs" default="main">
<project name="copy-ucs" basedir=".." default="main">
<property name="in" location="${{basedir}}/input"/>
<property name="out" location="${{basedir}}/output"/>
<property name="tmp" location="${{basedir}}/tmp"/>
<property name="xsl" location="${{basedir}}/xsl"/>
<property name="lib" location="${{basedir}}/lib"/>
<property name="log" location="${{basedir}}/log"/>
<property name="schema" location="${{basedir}}/schema"/>
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="lib/jing.jar"/>
<pathelement location="../lib/jing.jar"/>
</classpath>
</taskdef>
......@@ -26,16 +33,16 @@
<xsl:template match="sp:courseUc">
<xslt
in="${{tmpdir}}/outputWithCourseUcIds.xml"
out="${{tmpdir}}/decompressedOpaleDivided/{@data-export-file}"
style="copyCourseUc.xsl"
in="${{tmp}}/outputWithCourseUcIds.xml"
out="${{tmp}}/decompressedOpaleDivided/{@data-export-file}"
style="${{xsl}}/copyCourseUc.xsl"
processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
>
<param name="elementid" expression="{@data-export-id}"/>
</xslt>
<jing file="${{tmpdir}}/decompressedOpaleDivided/{@data-export-file}" rngfile="schema/op_expUc.rng"></jing>
<jing file="${{tmp}}/decompressedOpaleDivided/{@data-export-file}" rngfile="${{schema}}/op_expUc.rng"></jing>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:c="urn:utc.fr:ics:hdoc:container"
>
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="c:container">
<project name="getContentFileAndTransformIt" basedir="." default="start">
<property file="global.properties"/>
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="lib/jing.jar"/>
</classpath>
</taskdef>
<xsl:apply-templates select="./c:rootfiles"/>
</project>
</xsl:template>
<xsl:template match="c:rootfiles">
<target name="start">
<jing file="${{tmpdir}}/decompressedHdoc/{c:rootfile/@full-path}" rngfile="schema/hdoc1-xhtml.rng"></jing>
<xslt
in="${{tmpdir}}/decompressedHdoc/{c:rootfile/@full-path}"
out="${{tmpdir}}/moveRessourceFiles.xml"
style="moveRessourceFiles.xsl"
processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
/>
<chmod file="${{tmpdir}}/moveRessourceFiles.xml" perm="777"/>
<xslt
in="${{tmpdir}}/decompressedHdoc/{c:rootfile/@full-path}"
out="${{tmpdir}}/decompressedOpale/main.xml"
style="transformation2.xsl"
processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
/>
<chmod file="${{tmpdir}}/decompressedOpale/main.xml" perm="777"/>
<!-- Finding references and converting them -->
<xslt
in="${{tmpdir}}/decompressedHdoc/{c:rootfile/@full-path}"
out="${{tmpdir}}/convertReferences.xml"
style="prepareReferencesConversions.xsl"
processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
/>
<ant antfile="${{tmpdir}}/convertReferences.xml"/>
</target>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:c="urn:utc.fr:ics:hdoc:container"
>
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="c:container">
<project name="getContentFileAndTransformIt" basedir="." default="start">
<property file="global.properties"/>
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="../lib/jing.jar"/>
</classpath>
</taskdef>
<xsl:apply-templates select="./c:rootfiles"/>
</project>
</xsl:template>
<xsl:template match="c:rootfiles">
<target name="start">
<jing file="${{tmp}}/decompressedHdoc/{c:rootfile/@full-path}" rngfile="${{schema}}/hdoc1-xhtml.rng"></jing>
<xslt
in="${{tmp}}/decompressedHdoc/{c:rootfile/@full-path}"
out="${{tmp}}/moveRessourceFiles.xml"
style="${{xsl}}/moveRessourceFiles.xsl"
processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
/>
<chmod file="${{tmp}}/moveRessourceFiles.xml" perm="777"/>
<xslt
in="${{tmp}}/decompressedHdoc/{c:rootfile/@full-path}"
out="${{tmp}}/decompressedOpale/main.xml"
style="${{xsl}}/transformation2.xsl"
processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
/>
<chmod file="${{tmp}}/decompressedOpale/main.xml" perm="777"/>
<!-- Finding references and converting them -->
<xslt
in="${{tmp}}/decompressedHdoc/{c:rootfile/@full-path}"
out="${{tmp}}/convertReferences.xml"
style="${{xsl}}/prepareReferencesConversions.xsl"
processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"
/>
<ant antfile="${{tmp}}/convertReferences.xml"/>
</target>
</xsl:template>
</xsl:stylesheet>
<project name="hdoc_to_optim" default="convert">
<target name="convert">
<!--unzips the hdoc to be converted-->
<unzip dest="hdoc" src ="${InputPath}"/>
<!--gives all rights to avoid bugs-->
<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"/>
<chmod file="get_content.ant" perm="777"/>
<!--launches the ANT get_content resulting from the previous XSLT in order to launch the conversion-->
<ant antfile="get_content.ant"/>
<!--once the conversion is complete, the result is zipped-->
<zip basedir="result" destfile="${OutputPath}"/>
<!--temporary files and folders are deleted-->
<delete dir="hdoc"/>
<delete dir="result"/>
<delete file="get_content.ant"/>
<delete file="get_ressources.ant"/>
</target>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<wspType defaultCode="OptimOffice" title="OptimOffice 1.2 (fr-FR)" description="" uri="OptimOffice1-2_fr-FR_006" key="OptimOffice1-2" lang="fr-FR" version="1.2.006"><wspUpdate localAutoUpdate="minor"><res key="OptimOffice1-2.wsp"/></wspUpdate><systemSpace space="~param/OptimOffice1-2/ss"><res key="OptimOffice1-2.ss"/></systemSpace><systemSpace space="~param/OptimOffice1-2/bs" optional="true"><res key="OptimOffice1-2.bs"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/paperRpt"><res key="OptimOffice1-2.gen.paperRpt"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/paperLight"><res key="OptimOffice1-2.gen.paperLight"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/sldHtml"><res key="OptimOffice1-2.gen.sldHtml"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/site"><res key="OptimOffice1-2.gen.site"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/sldRptR"><res key="OptimOffice1-2.gen.sldRptR"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/sldRptS"><res key="OptimOffice1-2.gen.sldRptS"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/preSite"><res key="OptimOffice1-2.gen.preSite"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/control"><res key="OptimOffice1-2.gen.control"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/preSldHtml"><res key="OptimOffice1-2.gen.preSldHtml"/></systemSpace><systemSpace space="~param/OptimOffice1-2/gen/ftp"><res key="OptimOffice1-2.gen.ftp"/></systemSpace><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_paper.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_site"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/site/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_slideshow.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_site"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/site/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_webSite.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_site"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/site/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_section.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_site"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/site/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_paper.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_sldHtml"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/sldHtml/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_slideshow.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_sldHtml"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/sldHtml/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_webSite.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_sldHtml"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/sldHtml/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_section.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_sldHtml"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/sldHtml/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_paper.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_paperRpt"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/paperRpt/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_webSite.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_paperRpt"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/paperRpt/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_section.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_paperRpt"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/paperRpt/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_paper.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_paperLight"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/paperLight/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_webSite.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_paperLight"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/paperLight/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_section.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_paperLight"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/paperLight/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_slideshow.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_sldRptR"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/sldRptR/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_slideshow.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_sldRptS"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/sldRptS/skin/default.doss/skin.odt"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_paper.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_preSite"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/preSite/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_webSite.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_preSite"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/preSite/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_page.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_preSite"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/preSite/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_folder.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_preSite"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/preSite/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_section.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_preSite"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/preSite/skin/default.doss"/></module></ssFragment></ssOverlay><ssOverlay ssUri="/~param/OptimOffice1-2/ss/of_slideshow.ss.xml"><ssFragment xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"><module type="eu.scenari.wsp.module.gen.ModuleGenLoader" code="gen_preSldHtml"><skin owner="OptimOffice1-2" title="Habillage Classique" code="default" sc:refUri="/~param/OptimOffice1-2/gen/preSldHtml/skin/default.doss"/></module></ssFragment></ssOverlay><editionSheet pack="OptimOffice1-2_fr-FR_006" brickSelector="{OptimOffice1-2.moz;1.2.006;fr-FR}"/></wspType>
\ No newline at end of file
@echo off
set lib=lib
set ant=myantce.ant
set antparam=-Dprogram.param=%1
set scJarList=%lib%\*
java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
pause
REM start /MIN java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
#!/bin/sh
lib="lib"
ant="myantce.ant"
antparam="-Dprogram.param=$1"
#Recherche de java et controle que se soit une version SUN
vJavaCmd="java"
xCheckJava () {
vInputVarName=\$"$1"
vInputVarVal=`eval "expr \"$vInputVarName\" "`
if [ -z "$vInputVarVal" ];then
eval "$1=false"
return
fi
vSunJavaFound=`$vInputVarVal -version 2>&1 | grep -Eo -m 1 "(HotSpot)|(OpenJDK)"`
if [ "$vSunJavaFound" != "HotSpot" ] && [ "$vSunJavaFound" != "OpenJDK" ] ; then
eval "$1=false"
return
fi
}
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
vJavaCmd="$JAVA_HOME/bin/java"
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
echo "ERREUR: JRE de SUN introuvable. Veuillez déclarer la variable d'environnement JAVA_HOME."
exit 1
fi
fi
#Lancer la commande
scJarList="$lib/*"
$vJavaCmd -classpath "$scJarList:" -Xmx150m org.apache.tools.ant.Main -buildfile $ant $antparam
<?xml version="1.0" encoding="UTF-8"?>
<!--find_content.xsl creates a ANT file get_content-->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:h="urn:utc.fr:ics:hdoc:container"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:param name="destfile" required="yes" as="xs:string"/>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="h:container">
<project name="hdoc_to_optim" default="main">
<target name="main">
<mkdir dir="result"/>
<chmod dir="result" perm="777"/>
<copy file=".wspmeta" todir="result"/>
<xsl:apply-templates/>
</target>
</project>
</xsl:template>
<xsl:template match="h:rootfiles">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="h:rootfile">
<xsl:variable name="path" select="@full-path"/>
<!--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"/>
<chmod file="get_ressources.ant" perm="777"/>
<ant antfile="get_ressources.ant"/>
<!--the ANT runs the main XSLT transfo-->
<xslt in="hdoc/{$path}" out="result/content.paper" style="transfo.xsl"/>
</xsl:template>
</xsl:stylesheet>
<!--find_ressources.xsl creates a ANT file get_ressources-->
<!--the ANT copies all audio files, images and objects used in the content to convert-->
<xsl:stylesheet
version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:h="http://www.utc.fr/ics/hdoc/xhtml"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="h:html">
<project name="hdoc_to_optim" default="main">
<target name="main">
<xsl:apply-templates select="h:body"/>
</target>
</project>
</xsl:template>
<xsl:template match="h:body">
<xsl:apply-templates select="h:section"/>
</xsl:template>
<xsl:template match="h:section">
<xsl:apply-templates select="h:div"/>
<xsl:apply-templates select="h:section"/>
</xsl:template>
<xsl:template match="h:div">
<xsl:apply-templates select="h:section"/>
<xsl:apply-templates select="h:img"/>
<xsl:apply-templates select="h:object"/>
<xsl:apply-templates select="h:audio"/>
</xsl:template>
<xsl:template match="h:img">
<xsl:variable name="src" select="@src"/>
<copy file="hdoc/{$src}" tofile="result/{$src}"/>
</xsl:template>
<xsl:template match="h:object">
<xsl:variable name="data" select="@data"/>
<copy file="hdoc/{$data}" tofile="result/{$data}"/>
</xsl:template>
<xsl:template match="h:audio">
<xsl:variable name="src" select="@src"/>
<copy file="hdoc/{$src}" tofile="result/{$src}"/>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
This diff is collapsed.
<project name="ProjetOpale" default="convert">
<!-- Arguments properties -->
<property name="InputPath" value="source.scar" />
<property name="OutputPath" value="result.hdoc" />
<!-- Other properties -->
<property name="UnzipSourcePath" value="UnzipSourcePath" />
<property name="XmlModuleName" value="" />
<property name="TmpPath" value="TmpPath" />
<property name="TmpFile1" value="TmpFile1.xml" />
<property name="RacineFile" value="content.xml" />
<property name="HdocPath" value="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="content_xml" />
<antcall target="zip" />
</target>
<!-- Clean : delete old files -->
<target name="clean">
<!-- create folders (to be sure) -->
<mkdir dir="${UnzipSourcePath}"/>
<mkdir dir="${TmpPath}"/>
<mkdir dir="${HdocPath}"/>
<!-- delete folders -->
<delete dir="${UnzipSourcePath}"/>
<delete dir="${TmpPath}"/>
<delete dir="${HdocPath}"/>