Commit 6a19b9c0 authored by Benoit Villain's avatar Benoit Villain

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

parents f01dcfa0 54e87780
Hdoc to Epub
------------
License
-------
http://www.gnu.org/licenses/gpl-3.0.txt
Credits
-------
### Autumn 2016
* Biagianti Marie
* Couturier Valentin
Presentation
------------
Dependencies
------------
User Documentation
------------------
Unsupported
-----------
Known bugs
----------
Todo list
---------
Technical Notes
---------------
<?xml version="1.0" encoding="UTF-8"?>
<!-- test.ant -->
<project>
<property name="p">Default</property>
<echo message="${p}"/>
</project>
@echo off
set lib=lib
set ant=hdoc_to_epub.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_epub.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
Converter hdoc_to_neo4j
-----------------------
The purpose of this converter is to obtain a file of Neo4j requests from HDOC format.
License GPL3.0
--------------
http://www.gnu.org/licenses/gpl-3.0.txt
Credits
-------
* Alié Félix
* Routier Clément
Dependance
----------
This project can be used alone if you only want to convert an HDOC into a Neo4j requests file.
User documentation
------------------
You have to respect the following steps :
0. If you start from an Opale format, you can use the opale_to_hdoc converter, or directly execute the opale_to_Neo4j one.
1. The first step is to put you HDOC document into the input directory inside the project hdoc_to_neo4j. Please, place only one file in that folder.
2. The second one is to launch the bash, the bat or start the ant (depending on your Operating System) by typing the following instruction :
ant -buildfile hdoc_to_neo4j
3. After the execution, you should find in the output folder (which is created in step 2) a result.cql file that contains all the requests to recreate the items and links of you hdoc input.
Unsupported
-----------
Known bugs
----------
Todo
----
Technical notes
---------------
Capitalisation
--------------
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project name="antModule" default="main" basedir="../">
<property name="m" value="default" ></property>
<target name="main" depends="preparation">
<echo>On transforme le fichier!!</echo>
<xslt basedir="./input" destdir="./output" extension=".cql" style="./xsl/hdoc_to_neo4j.xslt"></xslt>
</target>
<target name="preparation">
<echo>On initialise le dossier!</echo>
<delete dir="./output"></delete>
<mkdir dir="./output"></mkdir>
</target>
</project>
\ No newline at end of file
<?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"
xpath-default-namespace="http://www.utc.fr/ics/hdoc/xhtml"
exclude-result-prefixes="xs"
version="2.0">
<xsl:output method="text" indent="no"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="head"/>
<xsl:template match="body">
<xsl:apply-templates select="//section"/>
</xsl:template>
<xsl:template match="body/section">
MERGE (`<xsl:value-of select="./header/h1"/>`:Item { title:"<xsl:value-of select="./header/h1"/>" });
<xsl:apply-templates select="./section"/>
</xsl:template>
<xsl:template match="body/section/section">
MERGE (`<xsl:value-of select="./header/h1"/>`:Item { title:"<xsl:value-of select="./header/h1"/>" });
MATCH (`<xsl:value-of select="./header/h1"/>`:Item), (`<xsl:value-of select="parent::section/header/h1"/>`:Item)
CREATE (`<xsl:value-of select="./header/h1"/>`)-[:LIEN]-> (`<xsl:value-of select="parent::section/header/h1"/>`);
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
Converter opale_to_pdf
-----------------------
* WARNING : This module is not functionnal yet !
The purpose of this converter is to obtain a PDF file from an Opale document.
The Hdoc pivot format is used to convert one format to another, losing the least amount of information. It is based on HTML.
License GPL3.0
--------------
http://www.gnu.org/licenses/gpl-3.0.txt
Credits
-------
* Thibault DRAIN
* Christophe VIROT
* Pierre Lemaire
* Baptiste PERRAUD
* Raphaël DEBRAY
Dependance
----------
This converter is based on two converters :
* Opale to Hdoc
* Hdoc to Pdf
User documentation
------------------
Unsupported
-----------
Refer to the unsupported elements in Opale to Hdoc and in Hdoc to Pdf.
Known bugs
----------
Refer to the known bugs in Opale to Hdoc and in Hdoc to Pdf.
Todo
----
Technical notes
---------------
The converter contains 1 file:
* opale_to_pdf.ant
It checks wether or not the user specified the parameters and performs the following :
* Copy the input file in the opale_to_hdoc directory.
* Perform the opale_to_hdoc transformation.
* Copy the result in the hdoc_to_pdf directory.
* Perform the hdoc_to_pdf transformation.
* Copy the result in the opale_to_pdf directory.
Capitalisation
--------------
N/A
<project name="ProjetOpale" default="convert">
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="lib/ant-contrib.jar" />
</classpath>
</taskdef>
<!-- Arguments properties -->
<property name="DocType" value="paper" />
<property name="Source" value="none" />
<property name="InputPath" value="input" />
<!-- Beginning -->
<target name="convert">
<antcall target="clean_everything" />
<antcall target="opale_to_hdoc" />
<antcall target="hdoc_to_pdf" />
<antcall target="copy_pdf_output" />
</target>
<target name="clean_everything">
<delete dir="../opale_to_hdoc/input"/>
<delete dir="../opale_to_hdoc/output/result.hdoc"/>
<delete dir="../hdoc_to_pdf/input"/>
<delete dir="../hdoc_to_pdf/output/result.pdf"/>
</target>
<target name="opale_to_hdoc">
<!--Check wether there is an input using command line or not-->
<if>
<equals arg1="${Source}" arg2="none" />
<then>
<!--There is no input, check the input folder-->
<echo message="The value of property InputFile is ${Source} ... Checking the input folder" />
<echo message="The value of property DocType is ${DocType}" />
<!-- get input hdoc file path -->
<fileset id="fileset_scar" dir="${InputPath}" casesensitive="yes">
<include name="*.scar"/>
</fileset>
<pathconvert property="ScarFile" pathsep="" refid="fileset_scar" />
<copy tofile="../opale_to_hdoc/input/sample.scar" file="${ScarFile}"/>
<ant antfile="../opale_to_hdoc/opale_to_hdoc.ant" inheritAll="false"/>
</then>
<else>
<!--There is an input-->
<echo message="The value of property Source is ${Source}" />
<echo message="The value of property DocType is ${DocType}" />
<echo message="Executing conversion..." />
<copy tofile="../opale_to_hdoc/input/sample.scar" file="${Source}"/>
<ant antfile="../opale_to_hdoc/opale_to_hdoc.ant" inheritAll="false"/>
</else>
</if>
</target>
<target name="hdoc_to_pdf">
<copy tofile="../hdoc_to_pdf/input/sample.hdoc" file="../opale_to_hdoc/output/result.hdoc"/>
<ant antfile="../hdoc_to_pdf/hdoc_to_pdf.ant" inheritAll="false">
<property name="DocType" value="${DocType}"/>
</ant>
</target>
<target name="copy_pdf_output">
<copy tofile="output/result.pdf" file="../hdoc_to_pdf/output/result.pdf"/>
</target>
</project>
@echo off
set lib=lib
set ant=opale_to_pdf.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="opale_to_pdf.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
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