Commit 504a266b authored by Ivan D'halluin's avatar Ivan D'halluin
Browse files

fix url /optim and allow multiple scar at a time, need to be tested

parent d2db9473
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="myantce"> <project basedir="." name="myantce">
<property name="in" location="${basedir}/input"/>
<property name="out" location="${basedir}/output"/> <taskdef resource="net/sf/antcontrib/antlib.xml"/>
<property name="tmp" location="${basedir}/tmp"/>
<property name="xsl" location="${basedir}/xsl"/> <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="lib" location="${basedir}/lib"/>
<property name="log" location="${basedir}/log"/> <property name="log" location="${basedir}/log"/>
<delete dir="${tmp}" failonerror="false"/> <delete dir="${tmp}" failonerror="false"/>
<mkdir dir="${tmp}"/> <mkdir dir="${tmp}"/>
<delete dir="${out}" failonerror="false"/> <delete dir="${out}" failonerror="false"/>
<mkdir dir="${out}"/> <mkdir dir="${out}"/>
<delete dir="${log}" failonerror="false"/> <delete dir="${log}" failonerror="false"/>
<mkdir dir="${log}"/> <mkdir dir="${log}"/>
<mkdir dir="${tmp}/extract"/> <mkdir dir="${tmp}/extract"/>
<mkdir dir="${tmp}/internationalisation"/> <mkdir dir="${tmp}/internationalisation"/>
<echo message="Extract files..."/> <echo message="Extract files..."/>
<unzip dest="${tmp}/extract"> <for param="archive">
<fileset dir="${in}"> <path>
<include name="**/*.scar"/> <fileset dir="${in}" includes="*"/>
</fileset> </path>
</unzip> <sequential>
<echo message="@{archive}"></echo>
<echo message="Internationalize files..."/> <unzip src="@{archive}" dest="${tmp}/extract"></unzip>
</sequential>
</for>
<echo message="Internationalize files..."/>
<xslt useImplicitFileset="false" destdir="${tmp}/internationalisation" style="${xsl}/internalisation.xsl"> <xslt useImplicitFileset="false" destdir="${tmp}/internationalisation" style="${xsl}/internalisation.xsl">
<param name="currentDir" expression="${basedir}"/> <param name="currentDir" expression="."/>
<fileset dir="${tmp}/extract"> <fileset dir="${tmp}/extract">
<include name="*/*"/> <!-- only converting the root files, not the ressources of subfolders --> <!-- only converting the root files -->
</fileset> <include name="*/*.paper"/>
</xslt> <include name="*/*.section"/>
<include name="*/*.website"/>
<include name="*/*.slideshow"/>
<include name="*/*.webpage"/>
</fileset>
</xslt>
<echo message="Convert to hdoc..."/> <echo message="Convert to hdoc..."/>
<xslt basedir="${tmp}/internationalisation" destdir="${out}" style="${xsl}/optim_to_hdoc.xsl"/> <xslt basedir="${tmp}/internationalisation" destdir="${out}" style="${xsl}/optim_to_hdoc.xsl"/>
<echo message="Copy ressources files..."/> <echo message="Copy ressources files..."/>
<copy todir="${out}"> <copy todir="${out}">
<fileset dir="${tmp}/extract"> <fileset dir="${tmp}/extract">
<exclude name="*/*"/> <!-- only copying resources files --> <!-- only copying resources files -->
</fileset> <exclude name="*/*.paper"/>
</copy> <exclude name="*/*.section"/>
<exclude name="*/*.website"/>
<echo message="Zip result..."/> <exclude name="*/*.slideshow"/>
<antcall target="createApplicationDAA"/> <exclude name="*/*.webpage"/>
<target name="createApplicationDAA"> </fileset>
<for param="folder"> </copy>
<path>
<fileset dir="${out}/*"/> <echo message="Zip result..."/>
</path>
<sequential> <for param="folder">
<echo>@{folder}</echo> <path>
<zip basedir="${folder}" destfile="${folder}.zip"> <dirset dir="${out}" includes="*"/>
</zip> </path>
</sequential> <sequential>
</for> <local name="folder_name"/>
</target> <basename property="folder_name" file="@{folder}"/>
<zip destfile="${out}/${folder_name}.zip" basedir="@{folder}" ></zip>
</sequential>
</for>
</project> </project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="http://scenari.utc.fr/hdoc/schemas/xhtml/hdoc1-xhtml.rng" type="xml"
?>
<html xmlns:of="scpf.org:office"
xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive"
xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"
xmlns="http://www.utc.fr/ics/hdoc/xhtml">
<head>
<title>Hdoc Converter Portal (v0.2) Demo</title>
<meta charset="utf-8"/>
<meta name="author" content=""/>
</head>
<body>
<div>
<h6>Hdoc Converter Portal (v0.2) Demo </h6>
<img src="optim//home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/screen1.png/screen1.png"
alt=""/>
<img src="optim//home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/screen2.png/screen2.png"
alt=""/>
</div>
</body>
</html>
...@@ -32,10 +32,8 @@ ...@@ -32,10 +32,8 @@
<h6>Hdoc Converter Portal (v0.2) Demo </h6> <h6>Hdoc Converter Portal (v0.2) Demo </h6>
<img src="optim//home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/screen1.png/screen1.png" <img src="./re/screen1.png/screen1.png" alt=""/>
alt=""/> <img src="./re/screen2.png/screen2.png" alt=""/>
<img src="optim//home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/screen2.png/screen2.png"
alt=""/>
</div> </div>
</section> </section>
...@@ -49,7 +47,7 @@ ...@@ -49,7 +47,7 @@
<div> <div>
<h6>Code </h6> <h6>Code </h6>
<p> <p>
<a href="optim//home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/hdoc_converter.zip/hdoc_converter.zip">hdoc_converter.zip</a> <a href="./re/hdoc_converter.zip/hdoc_converter.zip">hdoc_converter.zip</a>
</p> </p>
</div> </div>
......
<?xml version="1.0" encoding="UTF-8"?>
<sc:item xmlns:sc="http://www.utc.fr/ics/scenari/v3/core">
<of:gallery xmlns:of="scpf.org:office"
xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive">
<of:galleryM>
<sp:title>Hdoc Converter Portal (v0.2) Demo</sp:title>
</of:galleryM>
<sp:img xmlns="http://www.utc.fr/ics/hdoc/xhtml"
role="ref"
sc:refUri="/home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/screen1.png"/>
<sp:img xmlns="http://www.utc.fr/ics/hdoc/xhtml"
role="ref"
sc:refUri="/home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/screen2.png"/>
</of:gallery>
</sc:item>
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
</of:galleryM> </of:galleryM>
<sp:img xmlns="http://www.utc.fr/ics/hdoc/xhtml" <sp:img xmlns="http://www.utc.fr/ics/hdoc/xhtml"
role="ref" role="ref"
sc:refUri="/home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/screen1.png"/> sc:refUri="./re/screen1.png"/>
<sp:img xmlns="http://www.utc.fr/ics/hdoc/xhtml" <sp:img xmlns="http://www.utc.fr/ics/hdoc/xhtml"
role="ref" role="ref"
sc:refUri="/home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/screen2.png"/> sc:refUri="./re/screen2.png"/>
</of:gallery> </of:gallery>
</of:fragment> </of:fragment>
</sp:content> </sp:content>
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<of:flow> <of:flow>
<sp:txt> <sp:txt>
<of:txt> <of:txt>
<sc:para xml:space="preserve" sc:id="t42"><!--sc:uLink src = /home/ivan/Downloads/projets/hdoc/optim_to_hdoc/ refUri = re/hdoc_converter.zip--><sc:uLink xmlns="http://www.utc.fr/ics/hdoc/xhtml" role="ref" sc:refUri="/home/ivan/Downloads/projets/hdoc/optim_to_hdoc/re/hdoc_converter.zip">hdoc_converter.zip</sc:uLink></sc:para> <sc:para xml:space="preserve" sc:id="t42"><!--sc:uLink src = ./ refUri = re/hdoc_converter.zip--><sc:uLink xmlns="http://www.utc.fr/ics/hdoc/xhtml" role="ref" sc:refUri="./re/hdoc_converter.zip">hdoc_converter.zip</sc:uLink></sc:para>
</of:txt> </of:txt>
</sp:txt> </sp:txt>
</of:flow> </of:flow>
......
<?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"
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<!--<xsl:template match="//*[@sc:refUri]"> <!--<xsl:template match="//*[@sc:refUri]">
<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:choose > <xsl:choose >
<xsl:when test="../self::sc:para"> <xsl:when test="../self::sc:para">
<xsl:apply-templates select="$refDoc/sc:item/of:def" /> <xsl:apply-templates select="$refDoc/sc:item/of:def" />
...@@ -89,12 +89,12 @@ ...@@ -89,12 +89,12 @@
<!--<h1><xsl:value-of select="of:sectionM/sp:title"/> </h1>--> <!--<h1><xsl:value-of select="of:sectionM/sp:title"/> </h1>-->
<xsl:choose> <xsl:choose>
<xsl:when test="string(of:sectionM/sp:title)"> <xsl:when test="string(of:sectionM/sp:title)">
<h1><xsl:value-of select="of:sectionM/sp:title"/>&#160;</h1> <h1><xsl:value-of select="of:sectionM/sp:title"/>&#160;</h1>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<h1>&#160;</h1> <h1>&#160;</h1>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
<xsl:call-template name="author"></xsl:call-template> <xsl:call-template name="author"></xsl:call-template>
</header> </header>
<xsl:apply-templates select="sp:sec | sp:content | of:section"/> <xsl:apply-templates select="sp:sec | sp:content | of:section"/>
...@@ -108,12 +108,12 @@ ...@@ -108,12 +108,12 @@
<!--<h1><xsl:value-of select="of:sectionM/sp:title"/> </h1>--> <!--<h1><xsl:value-of select="of:sectionM/sp:title"/> </h1>-->
<xsl:choose> <xsl:choose>
<xsl:when test="string(of:sectionM/sp:title)"> <xsl:when test="string(of:sectionM/sp:title)">
<h1><xsl:value-of select="of:sectionM/sp:title"/>&#160;</h1> <h1><xsl:value-of select="of:sectionM/sp:title"/>&#160;</h1>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<h1>&#160;</h1> <h1>&#160;</h1>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
<xsl:call-template name="author"></xsl:call-template> <xsl:call-template name="author"></xsl:call-template>
</header> </header>
<xsl:apply-templates select="sp:sec | sp:content | of:section"/> <xsl:apply-templates select="sp:sec | sp:content | of:section"/>
...@@ -124,14 +124,14 @@ ...@@ -124,14 +124,14 @@
</xsl:template> </xsl:template>
<xsl:template name="block" match="of:block"> <xsl:template name="block" match="of:block">
<div> <div>
<xsl:apply-templates select="of:blockM/sp:title"/> <xsl:apply-templates select="of:blockM/sp:title"/>
<xsl:apply-templates select="sp:co/of:flow/sp:txt/of:txt"/> <xsl:apply-templates select="sp:co/of:flow/sp:txt/of:txt"/>
</div> </div>
</xsl:template> </xsl:template>
<xsl:template name="block_emphasis" match="sp:emphasis/of:block"> <xsl:template name="block_emphasis" match="sp:emphasis/of:block">
<div> <div>
<xsl:attribute name="data-hdoc-type">emphasis</xsl:attribute> <xsl:attribute name="data-hdoc-type">emphasis</xsl:attribute>
<xsl:apply-templates select="of:blockM/sp:title"/> <xsl:apply-templates select="of:blockM/sp:title"/>
<xsl:apply-templates select="sp:co/of:flow/sp:txt/of:txt"/> <xsl:apply-templates select="sp:co/of:flow/sp:txt/of:txt"/>
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
</xsl:template> </xsl:template>
<xsl:template name="block_complementaire" match="sp:extra/of:block"> <xsl:template name="block_complementaire" match="sp:extra/of:block">
<div> <div>
<xsl:attribute name="data-hdoc-type">complement</xsl:attribute> <xsl:attribute name="data-hdoc-type">complement</xsl:attribute>
<xsl:apply-templates select="of:blockM/sp:title"/> <xsl:apply-templates select="of:blockM/sp:title"/>
<xsl:apply-templates select="sp:co/of:flow/sp:txt/of:txt"/> <xsl:apply-templates select="sp:co/of:flow/sp:txt/of:txt"/>
...@@ -364,8 +364,8 @@ ...@@ -364,8 +364,8 @@
<xsl:with-param name="value" select="$src" /> <xsl:with-param name="value" select="$src" />
</xsl:call-template> </xsl:call-template>
</xsl:param> </xsl:param>
<!--<img src="optim/{$src}/{$fileName}" alt="{$alt}"/>--> <!--<img src="{$src}/{$fileName}" alt="{$alt}"/>-->
<img src="optim/{$src}/{$fileName}" alt="{$alt}"/> <img src="{$src}/{$fileName}" alt="{$alt}"/>
</xsl:template> </xsl:template>
<xsl:template name="parseUriImgHref"> <xsl:template name="parseUriImgHref">
...@@ -378,7 +378,7 @@ ...@@ -378,7 +378,7 @@
</xsl:call-template> </xsl:call-template>
</xsl:param> </xsl:param>
<!--<a href="optim/{$src}"><xsl:value-of select="$alt"/></a>--> <!--<a href="optim/{$src}"><xsl:value-of select="$alt"/></a>-->
<a href="optim/{$src}/{$fileName}"><xsl:value-of select="$alt"/></a> <a href="{$src}/{$fileName}"><xsl:value-of select="$alt"/></a>
</xsl:template> </xsl:template>
<xsl:template name="parseUriAudio"> <xsl:template name="parseUriAudio">
...@@ -390,7 +390,7 @@ ...@@ -390,7 +390,7 @@
</xsl:call-template> </xsl:call-template>
</xsl:param> </xsl:param>
<!--<audio src="optim/{$src}" />--> <!--<audio src="optim/{$src}" />-->
<audio src="optim/{$src}/{$fileName}" /> <audio src="{$src}/{$fileName}" />
</xsl:template> </xsl:template>
<xsl:template name="parseUriAudioHref"> <xsl:template name="parseUriAudioHref">
...@@ -403,7 +403,7 @@ ...@@ -403,7 +403,7 @@
</xsl:call-template> </xsl:call-template>
</xsl:param> </xsl:param>
<!--<a href="optim/{$src}" ><xsl:value-of select="$alt"/></a>--> <!--<a href="optim/{$src}" ><xsl:value-of select="$alt"/></a>-->
<a href="optim/{$src}/{$fileName}" ><xsl:value-of select="$alt"/></a> <a href="{$src}/{$fileName}" ><xsl:value-of select="$alt"/></a>
</xsl:template> </xsl:template>
<xsl:template name="parseUriOdg"> <xsl:template name="parseUriOdg">
...@@ -415,7 +415,7 @@ ...@@ -415,7 +415,7 @@
</xsl:call-template> </xsl:call-template>
</xsl:param> </xsl:param>
<!--<object type="application/vnd.oasis.opendocument.graphics " data="optim/{$src}"/>--> <!--<object type="application/vnd.oasis.opendocument.graphics " data="optim/{$src}"/>-->
<object type="application/vnd.oasis.opendocument.graphics " data="optim/{$src}/{$fileName}"/> <object type="application/vnd.oasis.opendocument.graphics " data="{$src}/{$fileName}"/>
</xsl:template> </xsl:template>
<xsl:template name="parseUriOdgHref"> <xsl:template name="parseUriOdgHref">
...@@ -428,7 +428,7 @@ ...@@ -428,7 +428,7 @@
</xsl:call-template> </xsl:call-template>
</xsl:param> </xsl:param>
<!--<a href="optim/{$src}"><xsl:value-of select="$alt"/></a>--> <!--<a href="optim/{$src}"><xsl:value-of select="$alt"/></a>-->
<a href="optim/{$src}/{$fileName}"><xsl:value-of select="$alt"/></a> <a href="{$src}/{$fileName}"><xsl:value-of select="$alt"/></a>
</xsl:template> </xsl:template>
<xsl:template name="parseUriOds"> <xsl:template name="parseUriOds">
...@@ -440,7 +440,7 @@ ...@@ -440,7 +440,7 @@
</xsl:call-template> </xsl:call-template>
</xsl:param> </xsl:param>
<!--<object type="application/vnd.oasis.opendocument.spreadsheet" data="optim/{$src}"/>--> <!--<object type="application/vnd.oasis.opendocument.spreadsheet" data="optim/{$src}"/>-->
<object type="application/vnd.oasis.opendocument.spreadsheet" data="optim/{$src}/{$fileName}"/> <object type="application/vnd.oasis.opendocument.spreadsheet" data="{$src}/{$fileName}"/>
</xsl:template> </xsl:template>
<xsl:template name="parseUriOdsHref"> <xsl:template name="parseUriOdsHref">
...@@ -453,14 +453,14 @@ ...@@ -453,14 +453,14 @@
</xsl:call-template> </xsl:call-template>
</xsl:param> </xsl:param>
<!--<a href="optim/{$src}"><xsl:value-of select="$alt"/></a>--> <!--<a href="optim/{$src}"><xsl:value-of select="$alt"/></a>-->
<a href="optim/{$src}/{$fileName}"><xsl:value-of select="$alt"/></a> <a href="{$src}/{$fileName}"><xsl:value-of select="$alt"/></a>
</xsl:template> </xsl:template>
<xsl:template name="eventList" match="of:eventList"> <xsl:template name="eventList" match="of:eventList">
<!--<div> <!--<div>
<xsl:apply-templates select="of:eventListM/sp:title"/> <xsl:apply-templates select="of:eventListM/sp:title"/>
</div>--> </div>-->
<xsl:apply-templates select="sp:event"/> <xsl:apply-templates select="sp:event"/>
</xsl:template> </xsl:template>
<xsl:template name="event" match="sp:event"> <xsl:template name="event" match="sp:event">
...@@ -490,30 +490,30 @@ ...@@ -490,30 +490,30 @@
<!--<h1><xsl:value-of select="of:pageM/sp:title"/></h1>--> <!--<h1><xsl:value-of select="of:pageM/sp:title"/></h1>-->
<xsl:choose> <xsl:choose>
<xsl:when test="string(of:pageM/sp:title)"> <xsl:when test="string(of:pageM/sp:title)">
<h1><xsl:value-of select="of:pageM/sp:title"/>&#160;</h1> <h1><xsl:value-of select="of:pageM/sp:title"/>&#160;</h1>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<h1>&#160;</h1> <h1>&#160;</h1>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</header> </header>
<xsl:apply-templates select="sp:main | sp:margin | of:page | sp:subPage | of:section"/> <xsl:apply-templates select="sp:main | sp:margin | of:page | sp:subPage | of:section"/>
</section> </section>
</xsl:template> </xsl:template>
<xsl:template match="sp:main"> <xsl:template match="sp:main">
<xsl:apply-templates select="sp:sec | sp:content | of:section | sp:margin"/> <xsl:apply-templates select="sp:sec | sp:content | of:section | sp:margin"/>
</xsl:template> </xsl:template>
<xsl:template match="sp:title"> <xsl:template match="sp:title">
<xsl:choose> <xsl:choose>
<xsl:when test="string(.)"> <xsl:when test="string(.)">
<h6><xsl:value-of select="."/>&#160;</h6> <h6><xsl:value-of select="."/>&#160;</h6>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<h6>&#160;</h6> <h6>&#160;</h6>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:template match="sp:margin"> <xsl:template match="sp:margin">
...@@ -522,7 +522,7 @@ ...@@ -522,7 +522,7 @@
<h1>En Marge</h1> <h1>En Marge</h1>
</header> </header>
<xsl:apply-templates/> <xsl:apply-templates/>
</section> </section>
</xsl:template> </xsl:template>
<xsl:template name="getLastPart"> <xsl:template name="getLastPart">
...@@ -555,19 +555,19 @@ ...@@ -555,19 +555,19 @@
<header> <header>
<xsl:choose> <xsl:choose>
<xsl:when test="string(of:folderM/sp:title)"> <xsl:when test="string(of:folderM/sp:title)">
<h1><xsl:value-of select="of:folderM/sp:title"/></h1> <h1><xsl:value-of select="of:folderM/sp:title"/></h1>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<h1>&#160;</h1> <h1>&#160;</h1>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</header> </header>
<xsl:apply-templates select="sp:subPage | sp:page | of:section"/> <xsl:apply-templates select="sp:subPage | sp:page | of:section"/>
</section> </section>
</xsl:template> </xsl:template>
<xsl:template match="of:gallery"> <xsl:template match="of:gallery">
<div> <div>
<xsl:apply-templates/> <xsl:apply-templates/>
</div> </div>
</xsl:template> </xsl:template>
......
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