Commit 8757ec89 authored by Gregory's avatar Gregory

First commit.

This commit init the two convertors useful for the project.
Inside hdoc_to_elasticSearch directory there is a first ant script which allow
user to unzip hdoc files into sub-directories.
The opale_to_elasticSearch directory is created but still empty.
parent 7daf11a0
# HDOC to ElasticSearch
## License
-------------
License GPL3.0 http://www.gnu.org/licenses/gpl-3.0.txt
## Credits
-------------
DELAUNAY Grgory
KELLER Vincent
## Presentation
-------------
Hdoc to ElasticSearch module extract data from an Hdoc file to use it with ElasticSearch
## Dependence
-------------
No depedencies
\ No newline at end of file
libdir=${basedir}/lib
xsldir=${basedir}/xsl
inputPath=${basedir}/input
outputPath=${basedir}/output
\ No newline at end of file
<project name="hdoc_to_elasticsearch" default="unzipSource">
<property file="build.properties"/>
<target name="unzipSource">
<echo message="Conversion begin" />
<path id="hdocDirPath">
<fileset dir="${inputPath}" id="hdocFile">
<include name="*.hdoc"/>
</fileset>
</path>
<property name="hdocFile" refId="hdocDirPath"/>
<basename property="hdocFileName" file="${hdocFile}" suffix=".hdoc"/>
<echo>Entry file : ${hdocFileName}</echo>
<!-- create subdirectory for each file -->
<mkdir dir="${outputPath}/${hdocFileName}"/>
<!--unzips the hdoc to be converted into the previously created directory-->
<unzip dest="${outputPath}/${hdocFileName}">
<fileset dir="${inputPath}" id="hdocFile">
<include name="${hdocFileName}.hdoc"/>
</fileset>
</unzip>
<echo message="Conversion end" />
</target>
<target name="jsonFiles" depends="unzipSource">
<echo message="JSON File creation" />
<!-- TODO : create JSON & extract data -->
</target>
<!-- Clear tmp files -->
<target name="clean" depends="jsonFiles">
</target>
<echo message="Conversion end" />
</project>
\ No newline at end of file
@echo off
set lib=lib
set ant=hdoc_to_elasticsearch.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_elasticsearch.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
# Opale to ElasticSearch
## License
-------------
License GPL3.0 http://www.gnu.org/licenses/gpl-3.0.txt
## Credits
-------------
DELAUNAY Grgory
KELLER Vincent
## Presentation
-------------
Opale to ElasticSearch module extract data from an Opale file to use it with ElasticSearch
## Dependence
-------------
- Opale To Hdoc Converter
- Hdoc to ElasticSearch Converter
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