Commit d5cae37a authored by Drain's avatar Drain

Added hdoc_to_optim to the folder

parent d23769ac
<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.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment