Commit c08edc5b authored by Decorde Jeffrey's avatar Decorde Jeffrey

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

parents da86dac8 355e15ff
# Converter hdoc_to_lexique
In order to use this converter, follow those steps :
1. Copy your hdoc file (.scar or .zip) into the input directory.
2. Execute the run that correspond to your OS.
3. You will find the result into the output directory.
\ No newline at end of file
libdir=${basedir}/lib
rngdir=${basedir}/rng
xsldir=${basedir}/xsl
srcdir=${basedir}/in
outdir=${basedir}/out
\ No newline at end of file
libdir=${basedir}/lib
rngdir=${basedir}/rng
xsldir=${basedir}/xsl
srcdir=${basedir}/in
outdir=${basedir}/out
InputPath=${basedir}/input
OutputPath=${basedir}/output
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="clean" basedir=".">
<property file="build.properties"/>
<property name="InputPath" value="" />
<property name="OutputPath" value="" />
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="${libdir}/jing.jar"/>
</classpath>
</taskdef>
<target name="init">
<mkdir dir="${outdir}"/>
<chmod perm="777" dir="${outdir}"></chmod>
<mkdir dir="${srcdir}"/>
<chmod perm="777" dir="${srcdir}"></chmod>
</target>
<target name="unzipSource" depends="init">
<echo>Fichier en entree : ${InputPath}</echo>
<echo>Fichier de sortie : ${OutputPath}</echo>
<unzip src="${InputPath}" dest="${srcdir}"></unzip>
</target>
<target name="buildOutput" depends="unzipSource">
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/termToRef.xsl" basedir="${srcdir}" destdir="${outdir}" followsymlinks="false" extension=".ref">
<include name="**/*.term"/>
</xslt>
<!--<jing rngfile="${rngdir}/op_glos.rng">
<fileset dir="${outdir}">
<include name="**/*.ref"/>
</fileset>
</jing>-->
</target>
<target name="exportOutput" depends="buildOutput">
<copy file="opale.wspmeta" tofile="${outdir}/.wspmeta"></copy>
<zip basedir="${outdir}" destfile="${OutputPath}" encoding="UTF-8"></zip>
</target>
<target name="clean" depends="exportOutput">
<delete dir="${srcdir}" />
<delete dir="${outdir}" />
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="clean" basedir=".">
<property file="build.properties"/>
<!-- <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="${libdir}/jing.jar"/>
</classpath>
</taskdef> -->
<target name="init">
<mkdir dir="${outdir}"/>
<chmod perm="777" dir="${outdir}"></chmod>
<mkdir dir="${srcdir}"/>
<chmod perm="777" dir="${srcdir}"></chmod>
</target>
<target name="unzipSource" depends="init">
<fileset dir="${InputPath}" id="inputsId">
<include name="*.zip"/>
<include name="*.scar"/>
</fileset>
<property name="nameInputsId" refid="inputsId"/>
<echo>Fichier en entree : ${nameInputsId}</echo>
<unzip src="${InputPath}/${nameInputsId}" dest="${srcdir}/${nameInputsId}"></unzip>
</target>
<target name="buildOutput" depends="unzipSource">
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/hdoc_to_lexique.xsl" basedir="${srcdir}" destdir="${outdir}" followsymlinks="false" extension=".term">
<include name="**/*.xml"/>
</xslt>
<!--<jing rngfile="${rngdir}/op_glos.rng">
<fileset dir="${outdir}">
<include name="**/*.ref"/>
</fileset>
</jing>-->
</target>
<target name="exportOutput" depends="buildOutput">
<copy file="lexique.wspmeta" tofile="${outdir}/.wspmeta"></copy>
<copydir src="${outdir}/${nameInputsId}" dest="${OutputPath}/lexique-${nameInputsId}"></copydir>
<!--<zip basedir="${outdir}" destfile="${OutputPath}/opale-${nameInputsId}" encoding="UTF-8"></zip>-->
</target>
<target name="clean" depends="exportOutput">
<delete dir="${srcdir}" />
<delete dir="${outdir}" />
</target>
</project>
@echo off
set lib=lib
set ant=hdoc_to_lexique.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="hdoc_to_lexique.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"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:hodoc="http://www.utc.fr/ics/hdoc/xhtml"
exclude-result-prefixes="xs"
version="2.0">
<xsl:output method="xml" indent="yes" />
<xsl:template match="/">
<sc:item xmlns:sc="http://www.utc.fr/ics/scenari/v3/core">
<lx:term xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive" xmlns:lx="scpf.org:lexicon">
<lx:termM>
<sp:name><xsl:value-of select="hodoc:html/hodoc:body/hodoc:h2[@span='titre_def']"></xsl:value-of></sp:name>
</lx:termM>
<sp:def>
<lx:definition>
<sp:desc>
<lx:defTxt>
<xsl:apply-templates select="hodoc:html/hodoc:body/hodoc:p[@span='def_content']"></xsl:apply-templates>
</lx:defTxt>
</sp:desc>
</lx:definition>
</sp:def>
</lx:term>
</sc:item>
</xsl:template>
<xsl:template match="hodoc:p[@span='def_content']" >
<xsl:value-of select="."/>
<!--
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>-->
</xsl:template>
</xsl:stylesheet>
<?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
# Converter lexique_to_hdoc
In order to use this converter, follow those steps :
1. Copy your Lexique file (.scar or .zip) into the input directory.
2. Execute the run that correspond to your OS. (run.sh for linux, run.bat for ubuntu
3. You will find the result into the output directory.
libdir=${basedir}/lib
rngdir=${basedir}/rng
xsldir=${basedir}/xsl
srcdir=${basedir}/in
outdir=${basedir}/out
InputPath=${basedir}/input
OutputPath=${basedir}/output
libdir=${basedir}/lib
rngdir=${basedir}/rng
xsldir=${basedir}/xsl
srcdir=${basedir}/in
outdir=${basedir}/out
InputPath=${basedir}/input
OutputPath=${basedir}/output
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="clean" basedir=".">
<property file="build.properties"/>
<!-- <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="${libdir}/jing.jar"/>
</classpath>
</taskdef> -->
<target name="init">
<mkdir dir="${outdir}"/>
<chmod perm="777" dir="${outdir}"></chmod>
<mkdir dir="${srcdir}"/>
<chmod perm="777" dir="${srcdir}"></chmod>
</target>
<target name="unzipSource" depends="init">
<fileset dir="${InputPath}" id="inputsId">
<include name="*.zip"/>
<include name="*.scar"/>
</fileset>
<property name="nameInputsId" refid="inputsId"/>
<echo>Fichier en entree : ${nameInputsId}</echo>
<unzip src="${InputPath}/${nameInputsId}" dest="${srcdir}/${nameInputsId}"></unzip>
</target>
<target name="buildOutput" depends="unzipSource">
<<<<<<< HEAD
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/lexique_to_hdoc.xsl" basedir="${srcdir}" destdir="${outdir}" followsymlinks="false" extension=".xml">
=======
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/lexique_to_hdoc.xsl.xsl" basedir="${srcdir}" destdir="${outdir}" followsymlinks="false" extension=".xml">
>>>>>>> e6164602e4169b2cb7eaf6215434ae0ed8be47a3
<include name="**/*.term"/>
</xslt>
<!--<jing rngfile="${rngdir}/op_glos.rng">
<fileset dir="${outdir}">
<include name="**/*.ref"/>
</fileset>
</jing>-->
</target>
<!--ajout du mimetype au fichier racine
TODO rajouter le container.xml dans le fichier META-INF et qui pointe sur le fichier transformé : un mkdir avec les inputs à transformer en parametre?-->
<target name="exportOutput" depends="buildOutput">
<copy file="mimetype" tofile="${outdir}/mimetype"></copy>
<<<<<<< HEAD
<copydir src="META-INF" dest="${OutputPath}/hdoc-${nameInputsId}"></copydir>
=======
>>>>>>> e6164602e4169b2cb7eaf6215434ae0ed8be47a3
<copydir src="${outdir}/${nameInputsId}" dest="${OutputPath}/hdoc-${nameInputsId}"></copydir>
<!--<zip basedir="${outdir}" destfile="${OutputPath}/opale-${nameInputsId}" encoding="UTF-8"></zip>-->
</target>
<target name="clean" depends="exportOutput">
<delete dir="${srcdir}" />
<delete dir="${outdir}" />
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="clean" basedir=".">
<property file="build.properties"/>
<!-- <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="${libdir}/jing.jar"/>
</classpath>
</taskdef> -->
<target name="init">
<mkdir dir="${outdir}"/>
<chmod perm="777" dir="${outdir}"></chmod>
<mkdir dir="${srcdir}"/>
<chmod perm="777" dir="${srcdir}"></chmod>
</target>
<target name="unzipSource" depends="init">
<fileset dir="${InputPath}" id="inputsId">
<include name="*.zip"/>
<include name="*.scar"/>
</fileset>
<property name="nameInputsId" refid="inputsId"/>
<echo>Fichier en entree : ${nameInputsId}</echo>
<unzip src="${InputPath}/${nameInputsId}" dest="${srcdir}/${nameInputsId}"></unzip>
</target>
<target name="buildOutput" depends="unzipSource">
<<<<<<< HEAD
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/lexique_to_hdoc.xsl" basedir="${srcdir}" destdir="${outdir}" followsymlinks="false" extension=".xml">
=======
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/lexique_to_hdoc.xsl.xsl" basedir="${srcdir}" destdir="${outdir}" followsymlinks="false" extension=".xml">
>>>>>>> e6164602e4169b2cb7eaf6215434ae0ed8be47a3
<include name="**/*.term"/>
</xslt>
<!--<jing rngfile="${rngdir}/op_glos.rng">
<fileset dir="${outdir}">
<include name="**/*.ref"/>
</fileset>
</jing>-->
</target>
<!--ajout du mimetype au fichier racine
TODO rajouter le container.xml dans le fichier META-INF et qui pointe sur le fichier transformé : un mkdir avec les inputs à transformer en parametre?-->
<target name="exportOutput" depends="buildOutput">
<copy file="mimetype" tofile="${outdir}/mimetype"></copy>
<copydir src="${outdir}/${nameInputsId}" dest="${OutputPath}/hdoc-${nameInputsId}"></copydir>
<!--<zip basedir="${outdir}" destfile="${OutputPath}/opale-${nameInputsId}" encoding="UTF-8"></zip>-->
</target>
<target name="clean" depends="exportOutput">
<delete dir="${srcdir}" />
<delete dir="${outdir}" />
</target>
</project>
application/x-hdoc+zip
application/x-hdoc+zip
This diff is collapsed.
@echo off
set lib=lib
<<<<<<< HEAD
set ant=lexique_to_hdoc.ant
=======
set ant=lexique_to_opale.ant
>>>>>>> e6164602e4169b2cb7eaf6215434ae0ed8be47a3
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="lexique_to_hdoc.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"?>
<?oxygen RNGSchema="http://scenari.utc.fr/hdoc/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
This diff is collapsed.
This diff is collapsed.
# Converter lexique_to_opale
In order to use this converter, follow those steps :
1. Copy your Lexique file(s) (.scar or .zip) into the input directory.
2. Execute the run that correspond to your OS.
3. You will find the result into the output directory. The names of the output are linked to the hour it was processed.
......@@ -2,4 +2,6 @@ libdir=${basedir}/lib
rngdir=${basedir}/rng
xsldir=${basedir}/xsl
srcdir=${basedir}/in
outdir=${basedir}/out
\ No newline at end of file
outdir=${basedir}/out
InputPath=${basedir}/input
OutputPath=${basedir}/output
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="clean" basedir=".">
<property file="build.properties"/>
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="${libdir}/jing.jar"/>
</classpath>
</taskdef>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="lib/ant-contrib.jar"/>
</classpath>
</taskdef>
<target name="init">
<mkdir dir="${outdir}"/>
<chmod perm="777" dir="${outdir}"></chmod>
<mkdir dir="${srcdir}"/>
<chmod perm="777" dir="${srcdir}"></chmod>
</target>
<target name="unzipSource" depends="init">
<for param="file">
<path>
<fileset dir="${InputPath}" id="inputsId">
<include name="*.zip"/>
<include name="*.scar"/>
</fileset>
</path>
<sequential>
<local name="TODAY_MY"/>
<tstamp>
<format property="TODAY_MY" pattern="yyyyMMdd-HHmmss" locale="en,UK" />
</tstamp>
<var name="name" unset="true"/>
<basename file="@{file}" property="name" />
<unzip src="${InputPath}/${name}" dest="${srcdir}/${TODAY_MY}"></unzip>
<sleep seconds="1"> </sleep>
</sequential>
</for>
</target>
<target name="buildOutput" depends="unzipSource">
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/termToRef.xsl" basedir="${srcdir}" destdir="${OutputPath}" followsymlinks="false" extension=".ref">
<include name="**/*.term"/>
</xslt>
<copy file="opale.wspmeta" tofile="${OutputPath}/.wspmeta"></copy>
<!--<jing rngfile="${rngdir}/op_glos.rng">
<fileset dir="${outdir}">
<include name="**/*.ref"/>
</fileset>
</jing>-->
</target>
<target name="clean" depends="buildOutput">
<delete dir="${srcdir}" />
<delete dir="${outdir}" />
</target>
</project>
\ No newline at end of file
@echo off
set lib=lib
set ant=lexique_to_opale.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="lexique_to_opale.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
......@@ -96,6 +96,11 @@
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="lx:defTxt/lx_defTxt_blocs/sc:para" >
<i>definition : </i>
<xsl:value-of select="."/>
</xsl:template>
<!--
FILTRAGE DES CONTENUS DE LA DEFINITION
......@@ -192,4 +197,4 @@
<xsl:value-of select="document(@sc:refUri)/sc:item/lx:tag/lx:tagM/sp:title"></xsl:value-of>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
</xsl:stylesheet>
# Converter lexique_to_optim
In order to use this converter, follow those steps :
1. Copy your Lexique file(s) (.scar or .zip) into the input directory.
2. Execute the run that correspond to your OS.
3. You will find the result into the output directory. The name of the output files depends of the hour it was processed.
......@@ -2,4 +2,6 @@ libdir=${basedir}/lib
rngdir=${basedir}/rng
xsldir=${basedir}/xsl
srcdir=${basedir}/in
outdir=${basedir}/out
\ No newline at end of file
outdir=${basedir}/out
InputPath=${basedir}/input
OutputPath=${basedir}/output
\ No newline at end of file
......@@ -3,16 +3,19 @@
<property file="build.properties"/>
<property name="InputPath" value="" />
<property name="OutputPath" value="" />
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="${libdir}/jing.jar"/>
</classpath>
</taskdef>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="lib/ant-contrib.jar"/>
</classpath>
</taskdef>
<target name="init">