Commit af314464 authored by Tyrannas's avatar Tyrannas

opale_to_neo4j

parent ced15ba7
*/input/*
*/tmp/*
*/output/*
*/node_modules*/
*.DS_Store*
......@@ -5,21 +5,26 @@
<pathelement location="lib/ant-contrib.jar"/>
</classpath>
</taskdef>
<property name="node" value="false" ></property>
<!-- properties -->
<property name="Node" value="false" ></property>
<target name="main" depends="preparation, testNode">
<!-- pour chaque fichier hdoc en entrée -->
<for param="filename">
<path>
<fileset dir="./input" includes="*.hdoc"/>
</path>
<sequential>
<!-- on récupere le nom du fichier -->
<var name="newFileName" unset="true"/>
<basename property="newFileName" file="@{filename}"/>
<!-- on unzip -->
<antcall target="unZip">
<param name="file" value="${newFileName}"/>
</antcall>
<!-- et on transforme -->
<antcall target="transformation">
<param name="file" value="${newFileName}"/>
</antcall>
......@@ -62,7 +67,7 @@
<target name="testNode">
<condition property="wantToInsert">
<matches pattern="true" string="${node}"/>
<matches pattern="true" string="${Node}"/>
</condition>
</target>
......
@echo off
set ant=hdoc_to_neo4j.ant
set antparam=-Dnode false;
set antparam=-DNode false;
ant -buildfile %ant% %antparam%
......
#!/bin/sh
lib="lib"
ant="hdoc_to_mongo.ant"
antparam="-Dnode false"
ant="hdoc_to_neo4j.ant"
antparam="-DNode false"
#Recherche de java et controle que se soit une version SUN
vJavaCmd="java"
......
@echo off
set ant=hdoc_to_neo4j.ant
set antparam=-Dnode true;
set antparam=-DNode true;
IF NOT EXIST ./node_modules call npm install
ant -buildfile %ant% %antparam%
......
#!/bin/sh
lib="lib"
ant="hdoc_to_mongo.ant"
antparam="-Dnode true"
ant="hdoc_to_neo4j.ant"
antparam="-DNode true"
#Recherche de java et controle que se soit une version SUN
vJavaCmd="java"
......
<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="Node" value="false" />
<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_neo4j" />
<antcall target="copy_cql_output" />
</target>
<target name="clean_everything">
<delete dir="../opale_to_hdoc/input"/>
<delete dir="../opale_to_hdoc/output/result.hdoc"/>
<delete dir="../hdoc_to_neo4j/input"/>
<delete dir="../hdoc_to_neo4j/output/"/>
</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 -->
<copy todir="../opale_to_hdoc/input/sample.scar">
<fileset dir="${InputPath}"/>
</copy>
<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_neo4j">
<copy todir="../hdoc_to_neo4j/input/">
<fileset dir="../opale_to_hdoc/output/"/>
</copy>
<ant antfile="../hdoc_to_neo4j/hdoc_to_neo4j.ant" inheritAll="false">
<property name="Node" value="${Node}"/>
</ant>
</target>
<target name="copy_cql_output">
<copy todir="output/">
<fileset dir="../hdoc_to_neo4j/output"/>
</copy>
</target>
</project>
@echo off
set ant=opale_to_neo4j.ant
set antparam=-DNode false;
ant -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_neo4j.ant"
antparam="-DNode false"
#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
@echo off
set ant=opale_to_neo4j.ant
set antparam=-DNode true;
IF NOT EXIST ./node_modules call npm install
ant -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_neo4j.ant"
antparam="-DNode true"
#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/*"
#test si les packages ont été installés
if [ ! -d "$node_modules" ]; then
npm install
fi
$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