Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hdoc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Stephane Crozat
hdoc
Commits
909d5a50
Commit
909d5a50
authored
Dec 15, 2016
by
Tyrannas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new xsl, working node script, working ant, initiating packahe.json
parent
10ebbd75
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
0 deletions
+93
-0
hdoc_to_neo4j/hdoc_to_neo4j.ant
hdoc_to_neo4j/hdoc_to_neo4j.ant
+38
-0
hdoc_to_neo4j/lib/saxon9he.jar
hdoc_to_neo4j/lib/saxon9he.jar
+0
-0
hdoc_to_neo4j/node/insert.js
hdoc_to_neo4j/node/insert.js
+30
-0
hdoc_to_neo4j/node/package.json
hdoc_to_neo4j/node/package.json
+16
-0
hdoc_to_neo4j/run.bat
hdoc_to_neo4j/run.bat
+9
-0
No files found.
hdoc_to_neo4j/hdoc_to_neo4j.ant
0 → 100644
View file @
909d5a50
<?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>
<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"
/>
</xslt>
</target>
<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>
<target
name=
"insertion"
if=
"wantToInsert"
>
<exec
executable=
"node"
dir=
"./node"
>
<arg
line=
"insert.js"
/>
</exec>
</target>
<target
name=
"testNode"
>
<condition
property=
"wantToInsert"
>
<matches
pattern=
"true"
string=
"${node}"
/>
</condition>
</target>
</project>
\ No newline at end of file
hdoc_to_neo4j/lib/saxon9he.jar
0 → 100644
View file @
909d5a50
File added
hdoc_to_neo4j/node/insert.js
0 → 100644
View file @
909d5a50
const
fs
=
require
(
'
fs
'
);
var
maki
=
require
(
'
maki-sushi
'
);
const
config
=
JSON
.
parse
(
fs
.
readFileSync
(
'
config.json
'
));
maki
.
config
.
setId
(
config
.
db
,
config
.
pwd
);
maki
.
config
.
setEndpoint
(
config
.
host
,
config
.
path
);
maki
.
config
.
setPort
(
config
.
port
);
var
queries
=
fs
.
readFileSync
(
'
../output/result.cql
'
).
toString
().
replace
(
/
[\n\t\r]
/g
,
''
).
replace
(
/
\s{4,}
/g
,
''
).
split
(
'
;
'
);
queries
.
pop
();
(
function
main
(){
for
(
let
i
=
0
;
i
<
queries
.
length
;
++
i
){
let
q
=
queries
[
i
];
console
.
log
(
q
+
"
;
"
);
if
(
q
.
indexOf
(
'
MATCH
'
)
!==
-
1
){
setTimeout
(
function
(){
maki
.
query
.
single
(
q
+
'
;
'
,
function
(
status
,
response
){
console
.
log
(
"
on insere un lien
"
+
response
);
});
},
2000
);
}
else
{
maki
.
query
.
single
(
q
,
function
(
status
,
response
){
console
.
log
(
"
on insere un noeud
"
+
response
);
});
}
}
})();
hdoc_to_neo4j/node/package.json
0 → 100644
View file @
909d5a50
{
"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"
:
""
}
hdoc_to_neo4j/run.bat
0 → 100644
View file @
909d5a50
@echo
off
set
ant
=
hdoc_to_neo4j
.ant
set
antparam
=
-Dprogram
.param
=
%
1
ant
-buildfile
%ant%
%antparam%
pause
REM start /MIN java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment