Commit 909d5a50 authored by Tyrannas's avatar Tyrannas
Browse files

new xsl, working node script, working ant, initiating packahe.json

parent 10ebbd75
<?xml version="1.0" encoding="UTF-8"?>
<project name="antModule" default="main" basedir="./">
<property name="node" value="false" ></property>
<target name="main" depends="transformation, testNode, insertion">
<echo>On a fini!!</echo>
<target name="transformation" depends="preparation">
<echo>On transforme le fichier!!</echo>
<xslt in="./input/unziped/content.xml" out="./output/result.cql" style="./xsl/hdoc_to_neo4j.xsl" classpath="./lib/saxon9he.jar">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
<target name="preparation">
<echo>On initialise le dossier!</echo>
<delete dir="./output"></delete>
<mkdir dir="./output"></mkdir>
<delete dir="./input/unziped"></delete>
<mkdir dir='./input/unziped'></mkdir>
<unzip src="./input/result.hdoc" dest="./input/unziped/"/>
<target name="insertion" if="wantToInsert">
<exec executable="node" dir="./node">
<arg line="insert.js"/>
<target name="testNode">
<condition property="wantToInsert">
<matches pattern="true" string="${node}"/>
\ No newline at end of file
const fs = require('fs');
var maki = require('maki-sushi');
const config = JSON.parse(fs.readFileSync('config.json'));
maki.config.setEndpoint(, config.path);
var queries = fs.readFileSync('../output/result.cql').toString().replace(/[\n\t\r]/g,'').replace(/\s{4,}/g,'').split(';');
(function main(){
for(let i = 0; i < queries.length; ++i){
let q = queries[i];
console.log(q + ";");
if(q.indexOf('MATCH') !== -1){
maki.query.single(q + ';', function(status, response){
console.log("on insere un lien " + response);
}, 2000);
maki.query.single(q, function(status, response){
console.log("on insere un noeud " + response);
"name": "hdoc_to_neo4j",
"version": "1.0.0",
"main": "insert.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"author": "Félix Alié",
"license": "ISC",
"dependencies": {
"fs": "^0.0.1-security",
"maki-sushi": "^1.0.5"
"devDependencies": {},
"description": ""
@echo off
set ant=hdoc_to_neo4j.ant
set antparam=-Dprogram.param=%1
ant -buildfile %ant% %antparam%
REM start /MIN java.exe -classpath "%scJarList%" -Xmx150m -buildfile %ant% %antparam%
Supports Markdown
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