Commit 306c906e authored by Ivan D'halluin's avatar Ivan D'halluin

beginning of the antce architecture, almost working, missing zip

parent 1982bbec
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="myantce">
<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"/>
<delete dir="${tmp}" failonerror="false"/>
<mkdir dir="${tmp}"/>
<delete dir="${out}" failonerror="false"/>
<mkdir dir="${out}"/>
<delete dir="${log}" failonerror="false"/>
<mkdir dir="${log}"/>
<mkdir dir="${tmp}/extract"/>
<mkdir dir="${tmp}/internationalisation"/>
<echo message="Extract files..."/>
<unzip dest="${tmp}/extract">
<fileset dir="${in}">
<include name="**/*.scar"/>
</fileset>
</unzip>
<echo message="Internationalize files..."/>
<xslt useImplicitFileset="false" destdir="${tmp}/internationalisation" style="${xsl}/internalisation.xsl">
<param name="currentDir" expression="${basedir}"/>
<fileset dir="${tmp}/extract">
<include name="*/*"/> <!-- only converting the root files, not the ressources of subfolders -->
</fileset>
</xslt>
<echo message="Convert to hdoc..."/>
<xslt basedir="${tmp}/internationalisation" destdir="${out}" style="${xsl}/optim_to_hdoc.xsl"/>
<echo message="Copy ressources files..."/>
<copy todir="${out}">
<fileset dir="${tmp}/extract">
<exclude name="*/*"/> <!-- only copying resources files -->
</fileset>
</copy>
<echo message="Zip result..."/>
<antcall target="createApplicationDAA"/>
<target name="createApplicationDAA">
<for param="folder">
<path>
<fileset dir="${out}/*"/>
</path>
<sequential>
<echo>@{folder}</echo>
<zip basedir="${folder}" destfile="${folder}.zip">
</zip>
</sequential>
</for>
</target>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project default="convert_to_hdoc">
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${basedir}/lib/ant-contrib-0.6.jar"/>
</classpath>
</taskdef>
<target name="convert_to_hdoc" depends="preparation">
<unzip src="${InputPath}" dest="${InputPath}_FILES"/>
<fileset id="rootFiles" dir="${InputPath}_FILES" includes="*.paper | *.section | *.website | *.slideshow | *.webpage"/>
<property name="prop.rootFiles" refid="rootFiles"/>
<property name="currentdir" value="${InputPath}_FILES"/>
<echo message=" "/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" ! CHECKING FOR ITEM FILE IN ROOT DIRECTORY !"/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" "/>
<antcall target="direct_conversion"/>
<antcall target="finde_file"/>
</target>
<target name="preparation">
<echo message=" "/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" !!!!!!! DEBUT PREPARATION !!!!!!!"/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" "/>
<delete dir="${InputPath}_HDOC"></delete>
<delete dir="${InputPath}_FILES"></delete>
<echo message=" "/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" !!!!!!!! FIN PREPARATION !!!!!!!!"/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" "/>
</target>
<target name="file_null">
<condition property="file.null" else="false">
<equals arg1="${prop.rootFiles}" arg2=""/>
</condition>
<echo message="Root file missing ? ${file.null}"/>
</target>
<target name="finde_file" if="${file.null}" depends="file_null">
<echo message=" "/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" ! NO ITEM FILE FOUND IN ROOT DIRECTORY !"/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" "/>
<echo message=" "/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" ! CHECKING FOR ITEM FILE IN SUB DIRECTORIES !"/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" "/>
<foreach target="finde_file_subdir" param="worksheet" inheritall="true">
<path>
<dirset dir="${InputPath}_FILES">
<include name="*"/>
</dirset>
</path>
</foreach>
</target>
<target name="finde_file_subdir">
<echo message="finde_file_subdir called with dir : ${worksheet}"/>
<fileset id="file" dir="${worksheet}" includes="*.paper | *.section | *.website | *.slideshow | *.webpage"/>
<property name="testfile" refid="file"/>
<basename property="dir.name" file="${worksheet}"/>
<if>
<equals arg1="${testfile}" arg2="" />
<then>
</then>
<else>
<antcall target="conversion">
<param name="rootfile" value="${worksheet}/${testfile}"/>
<param name="currentDir" value="${dir.name}"/>
</antcall>
</else>
</if>
</target>
<target name="direct_conversion" unless="${file.null}" depends="file_null">
<antcall target="conversion">
<param name="rootfile" value="${InputPath}_FILES/${prop.rootFiles}"/>
<param name="currentDir" value=""/>
</antcall>
</target>
<target name="conversion">
<echo message="conversion called with rootfile : ${rootfile} and currentDir : ${currentDir}"/>
<copy todir="${InputPath}_HDOC">
<fileset dir="hdoc"/>
</copy>
<echo message=" "/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" !!!!! DEBUT INTERNALISATION !!!!!"/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" "/>
<xslt in="${rootfile}" out="${InputPath}_FILES/content1.xml" style="xsl/internalisation.xsl">
<param name="currentDir" expression="${currentDir}"/>
</xslt>
<echo message=" "/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" !!!!!! FIN INTERNALISATION !!!!!!"/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" "/>
<echo message=" "/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" !!!!!!!! DEBUT CONVERSION !!!!!!!"/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" "/>
<xslt in="${InputPath}_FILES/content1.xml" out="${InputPath}_HDOC/content.xml" style="xsl/optim_to_hdoc.xsl"/>
<echo message=" "/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" !!!!!!!!! FIN CONVERSION !!!!!!!!"/>
<echo message=" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"/>
<echo message=" "/>
<copy todir="${InputPath}_HDOC/optim">
<fileset dir="${InputPath}_FILES"/>
</copy>
<zip basedir="${InputPath}_HDOC" destfile="${OutputPath}"></zip>
<delete dir="${InputPath}_HDOC"></delete>
<delete dir="${InputPath}_FILES"></delete>
</target>
</project>
\ No newline at end of file
This diff is collapsed.
<?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>
This diff is collapsed.
@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
This diff is collapsed.
<?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 sc:refUri="re/screen1.png"/>
<sp:img sc:refUri="re/screen2.png"/>
</of:gallery>
</sc:item>
\ No newline at end of file
<?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>
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xpath-default-namespace="http://www.utc.fr/ics/hdoc/xhtml"
xmlns:ns="http://www.utc.fr/ics/hdoc/xhtml"
>
<xsl:output method="xml" indent="yes"/>
<!-- Identity transformation -->
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<!-- section -->
<xsl:template match="ns:section" priority="1">
<xsl:choose>
<xsl:when test="ns:section">
<xsl:element name="section">
<xsl:apply-templates select="node()|@*"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="section">
<xsl:attribute name="data-hdoc-type">opale-expUc</xsl:attribute>
<xsl:apply-templates select="node()|@*"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
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