Commit da738412 authored by cliclac's avatar cliclac

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

parents 6f88b3eb f846480b
Converter hdoc_to_basex
-----------------------
The purpose of this converter is to obtain an XML data file suitable for importation into basex for futher XQuery requests from a HDOC file
License GPL3.0
--------------
http://www.gnu.org/licenses/gpl-3.0.txt
Credits
-------
* Simei YIN
* Baptiste MONTANGE
Dependance
----------
This project can be used alone if you want to import an HDOC file into basex.
## User stories
------------------
- Among a group of courses, user can search by title, author or keywords of the course.
- By searching a certain keyword, user can obtain the sections that contain it with their hierarchy levels in the course.
- In a certain section, by searching a key word, user can obtain paragraphes that contain it.
- User can get definitions related to a keyword
- User can get examples whose titles contain a keyword
[Step 1]
- Unzip works, creation of a XML file with the title of the hdoc. (little problem, all of the document is in the output).
- the file created is in the tmp/{hdocfile} directory.
\ 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 basedir="." name="myantce" default="convert">
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
<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"/>
<target name="convert">
<echo message="DEBUT"/>
<mkdir dir="${tmp}"/>
<delete dir="${out}" failonerror="false"/>
<mkdir dir="${out}"/>
<delete dir="${log}" failonerror="false"/>
<mkdir dir="${log}"/>
<for param="inputFile">
<path>
<fileset dir="${in}" includes="**/*.hdoc"/>
</path>
<sequential>
<local name="filename"/>
<basename property="filename" file="@{inputFile}"/>
<antcall target="UnzipHdocFile">
<param name="filename" value="${filename}"/>
</antcall>
<antcall target="content">
<param name="filename" value="${filename}"/>
</antcall>
<echo message="FIN"/>
</sequential>
</for>
</target>
<target name="UnzipHdocFile">
<!-- Unzip the input hdoc file. Decompressed folder is named "decompressedHdoc" : this name is the only one which
refers to the hdoc file furthermore in this project. -->
<unzip src="${in}/${filename}" dest="${tmp}/${filename}/decompressedHdoc"/>
<chmod dir="${tmp}/${filename}/decompressedHdoc" perm="777"/>
<echo message="${tmp}/${filename}/decompressedHdoc"/>
</target>
<target name="content" >
<xslt in="${tmp}/${filename}/decompressedHdoc/content.xml" out="${out}/${filename}_data.xml" style="${xsl}/transformation.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
<param name="filename" expression="${filename}"/>
<param name="lib" expression="${lib}"/>
</xslt>
<echo message="${filename}" />
<delete dir="${tmp}" failonerror="false"/>
</target>
</project>
\ No newline at end of file
@echo off
set lib=lib
set ant=hdoc_to_basex.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_basex.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:h="http://www.utc.fr/ics/hdoc/xhtml"
exclude-result-prefixes="xs"
version="2.0">
<xsl:template match="h:html">
<xsl:apply-templates mode="title"></xsl:apply-templates>
</xsl:template>
<xsl:template match="h:head" mode="title">
<titre><xsl:value-of select="./h:title"/></titre>
</xsl:template>
<xsl:template match="h:body" mode="title">
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
Converter hdoc_to_pdf
-----------------------
The purpose of this converter is to obtain an PDF file from a hdoc document.
The purpose of this converter is to obtain a PDF file from a hdoc document.
License GPL3.0
......@@ -51,9 +51,6 @@ Generic Todo
Technical notes
---------------
* The product backlog of the current project can be found through the following url: <https://framacalc.org/NF29_Opale_to_Pdf_PB>
* Time-sheets can be found through the following urls:
- <https://framacalc.org/NF29_Opale_to_Pdf_fichetemps_PERRAUD>
User Story
----------
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:h="urn:utc.fr:ics:hdoc:container"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
name="hdoc_to_pdf"
default="main">
<target name="main">
<xslt in="/home/raphael/Documents/Travail/NF29/projet/hdoc/hdoc_to_pdf/tmp/content.xml"
out="/home/raphael/Documents/Travail/NF29/projet/hdoc/hdoc_to_pdf/tmp/hdoc_nsless.xhtml"
style="xsl/ns_remover.xsl"/>
<xslt in="/home/raphael/Documents/Travail/NF29/projet/hdoc/hdoc_to_pdf/tmp/hdoc_nsless.xhtml"
out="/home/raphael/Documents/Travail/NF29/projet/hdoc/hdoc_to_pdf/tmp/flat_hdoc.xhtml"
style="xsl/hdoc_flattenizer.xsl"/>
</target>
</project>
File mode changed from 100644 to 100755
Converter opale_to_basex
-----------------------
The purpose of this converter is to obtain an HDOC file from an Opale document.
License GPL3.0
--------------
http://www.gnu.org/licenses/gpl-3.0.txt
Credits
-------
* Simei YIN
* Baptiste MONTANGE
Dependance
----------
In order to work properly, this module needs
1. [`opale_to_hdoc`](https://gitlab.utc.fr/crozatst/hdoc/tree/master/opale_to_hdoc) (Opale to Hdoc conversion)
2. [`hdoc_to_basex`](https://gitlab.utc.fr/crozatst/hdoc/tree/master/hdoc_to_basex) (Hdoc to Basex conversion)
User Stories
----------
Please consult the section "User Stories" of README.md file in [`hdoc_to_basex`] (https://gitlab.utc.fr/crozatst/hdoc/tree/master/hdoc_to_basex/README.md)
\ 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
<project name="opale_to_basex">
<property file="build.properties"/>
<echo message="To be implemented..."/>
</project>
\ No newline at end of file
@echo off
set lib=lib
set ant=opale_to_basex.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_basex.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
......@@ -19,3 +19,11 @@ Opale to ElasticSearch module extract data from an Opale file to use it with Ela
- Opale To Hdoc Converter
- Hdoc to ElasticSearch Converter
## User Story
-------------
"Vous disposez d'un ensemble de contenus Opale à votre disposition et vous aimeriez pouvoir l'analyser selon les différents types d'éléments possibles : cours, exercices, notions tout en permettant de trier par rapport aux différents sujets de ces dit contenus.
Pour se faire, vous mettrez les contenus que vous voulez analyser en input de opale_to_elasticSearch et vous lancerez le script lançant le fichier ANT.
Vous pourrez ensuite accéder à des graphiques Kibana à une adresse donnée et paramétrer vos graphiques afin d'obtenir les informations qui vous intéresse.
A savoir que les contenus opale de plusieurs machines/utilisateurs peuvent être capitalisés car l'ensemble des instances de base elasticSearch installées forment un cluster accessible via l'interface Kibana"
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