Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hdoc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Stephane Crozat
hdoc
Commits
7e026ffb
Commit
7e026ffb
authored
Jan 05, 2017
by
Gregory
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
link scar to ELK stack
parent
48e18fcb
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
175 additions
and
20 deletions
+175
-20
hdoc_to_elasticSearch/hdoc_to_elasticsearch.ant
hdoc_to_elasticSearch/hdoc_to_elasticsearch.ant
+34
-20
hdoc_to_elasticSearch/lib/ant-contrib-0.3.jar
hdoc_to_elasticSearch/lib/ant-contrib-0.3.jar
+0
-0
hdoc_to_elasticSearch/logstash/input/.gitkeep
hdoc_to_elasticSearch/logstash/input/.gitkeep
+0
-0
hdoc_to_elasticSearch/sample/result.hdoc
hdoc_to_elasticSearch/sample/result.hdoc
+0
-0
hdoc_to_elasticSearch/sample/sample.hdoc
hdoc_to_elasticSearch/sample/sample.hdoc
+0
-0
hdoc_to_elasticSearch/sample/sample01.hdoc
hdoc_to_elasticSearch/sample/sample01.hdoc
+0
-0
hdoc_to_elasticSearch/sample/sample02.hdoc
hdoc_to_elasticSearch/sample/sample02.hdoc
+0
-0
opale_to_elasticSearch/build.properties
opale_to_elasticSearch/build.properties
+8
-0
opale_to_elasticSearch/lib/ant-contrib-0.3.jar
opale_to_elasticSearch/lib/ant-contrib-0.3.jar
+0
-0
opale_to_elasticSearch/lib/ant-launcher.jar
opale_to_elasticSearch/lib/ant-launcher.jar
+0
-0
opale_to_elasticSearch/lib/ant.jar
opale_to_elasticSearch/lib/ant.jar
+0
-0
opale_to_elasticSearch/lib/saxon9he.jar
opale_to_elasticSearch/lib/saxon9he.jar
+0
-0
opale_to_elasticSearch/logstash/input/.gitkeep
opale_to_elasticSearch/logstash/input/.gitkeep
+0
-0
opale_to_elasticSearch/logstash/input/es-1_2017-1-4.scar.json
...e_to_elasticSearch/logstash/input/es-1_2017-1-4.scar.json
+20
-0
opale_to_elasticSearch/opale_to_elasticsearch.ant
opale_to_elasticSearch/opale_to_elasticsearch.ant
+67
-0
opale_to_elasticSearch/run.bat
opale_to_elasticSearch/run.bat
+11
-0
opale_to_elasticSearch/run.sh
opale_to_elasticSearch/run.sh
+35
-0
opale_to_elasticSearch/sample/es-1_2017-1-4.scar
opale_to_elasticSearch/sample/es-1_2017-1-4.scar
+0
-0
No files found.
hdoc_to_elasticSearch/hdoc_to_elasticsearch.ant
View file @
7e026ffb
<project name="hdoc_to_elasticsearch" default="clean">
<!-- Use contribant -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="lib/ant-contrib-0.3.jar"/>
</classpath>
</taskdef>
<property file="build.properties"/>
<target name="
unzipSource">
<target name="
jsonFiles">
<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>
<echo>Entry file : ${fileToParse}</echo>
<!-- create subdirectory for each file -->
<mkdir dir="${tmpHdoc}/${hdocFileName}"/>
<!--unzips the hdoc to be converted into the previously created directory-->
<unzip dest="${tmpHdoc}/${hdocFileName}">
<fileset dir="${inputPath}" id="hdocFile">
<include name="${hdocFileName}.hdoc"/>
<mkdir dir="${tmpHdoc}" />
<basename property="fileToParseName" file="${inputPath}/${fileToParse}" suffix=".hdoc" />
<mkdir dir="${tmpHdoc}/${fileToParseName}"/>
<!--unzips the hdoc to be converted into the previously created directory -->
<unzip dest="${tmpHdoc}/${fileToParseName}">
<fileset dir="${inputPath}">
<include name="${fileToParseName}.hdoc"/>
</fileset>
</unzip>
<echo message="JSON File creation" />
<xslt in="${tmpHdoc}/${fileToParseName}/content.xml" out="${outputPath}/${fileToParseName}.json" style="xsl/content_extractor.xsl"/>
</target>
<target name="jsonFiles" depends="unzipSource">
<echo message="JSON File creation" />
<xslt in="${tmpHdoc}/${hdocFileName}/content.xml" out="${outputPath}/${hdocFileName}.json" style="xsl/content_extractor.xsl"/>
<!-- Parcours la liste des fichiers pour les transformer -->
<target name="targetAllFiles">
<delete>
<fileset dir="${outputPath}">
<include name="*.json"/>
</fileset>
</delete>
<foreach target="jsonFiles" param="fileToParse">
<fileset dir="${inputPath}">
<include name="*.hdoc"/>
</fileset>
</foreach>
</target>
<!-- Clear tmp files -->
<target name="clean" depends="
json
Files">
<target name="clean" depends="
targetAll
Files">
<echo message="Clean files" />
<!-- -->
<delete includeemptydirs="true" verbose="true">
...
...
hdoc_to_elasticSearch/lib/ant-contrib.jar
→
hdoc_to_elasticSearch/lib/ant-contrib
-0.3
.jar
View file @
7e026ffb
File moved
hdoc_to_elasticSearch/logstash/input/.gitkeep
0 → 100644
View file @
7e026ffb
hdoc_to_elasticSearch/sample/result.hdoc
0 → 100644
View file @
7e026ffb
File added
hdoc_to_elasticSearch/
input
/sample.hdoc
→
hdoc_to_elasticSearch/
sample
/sample.hdoc
View file @
7e026ffb
File moved
hdoc_to_elasticSearch/sample/sample01.hdoc
0 → 100644
View file @
7e026ffb
File added
hdoc_to_elasticSearch/sample/sample02.hdoc
0 → 100644
View file @
7e026ffb
File added
opale_to_elasticSearch/build.properties
0 → 100644
View file @
7e026ffb
libdir
=
${basedir}/lib
xsldir
=
${basedir}/xsl
inputPath
=
${basedir}/input
outputPath
=
${basedir}/logstash/input
inputOpaleToHdoc
=
../opale_to_hdoc/input
outputOpaleToHdoc
=
../opale_to_hdoc/output
inputHdocToElasticSearch
=
../hdoc_to_elasticSearch/input
outputHdocToElasticSearch
=
../hdoc_to_elasticSearch/output
\ No newline at end of file
opale_to_elasticSearch/lib/ant-contrib-0.3.jar
0 → 100644
View file @
7e026ffb
File added
opale_to_elasticSearch/lib/ant-launcher.jar
0 → 100644
View file @
7e026ffb
File added
opale_to_elasticSearch/lib/ant.jar
0 → 100644
View file @
7e026ffb
File added
opale_to_elasticSearch/lib/saxon9he.jar
0 → 100644
View file @
7e026ffb
File added
opale_to_elasticSearch/logstash/input/.gitkeep
0 → 100644
View file @
7e026ffb
opale_to_elasticSearch/logstash/input/es-1_2017-1-4.scar.json
0 → 100644
View file @
7e026ffb
{
"title"
:
"Elasticsearch - Indexation et recherches simples"
,
"keywords"
:
[
"REST"
,
"Elasticsearch"
,
"Filtre"
,
"Aggrégation"
],
"rights"
:
"by-sa"
,
"author"
:
"Robin Jolliet, 2016 (Contributions : Stéphane Crozat, les étudiants de l'UTC)"
}
\ No newline at end of file
opale_to_elasticSearch/opale_to_elasticsearch.ant
0 → 100644
View file @
7e026ffb
<project name="hdoc_to_elasticsearch" default="clean">
<!-- -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="lib/ant-contrib-0.3.jar"/>
</classpath>
</taskdef>
<property file="build.properties"/>
<!-- Parcours la liste des fichiers pour les transformer -->
<target name="targetAllFiles">
<delete>
<fileset dir="${outputPath}">
<include name="*.json"/>
</fileset>
</delete>
<!-- Copy files in opale_to_hdoc input dir -->
<copy todir="${inputOpaleToHdoc}">
<fileset dir="${inputPath}"/>
</copy>
<!-- Use ant transo opale_to_hdoc -->
<ant antfile="../opale_to_hdoc/opale_to_hdoc.ant" inheritAll="false"/>
<!-- Copy files in hdoc_to_elasticSearch input dir -->
<copy todir="${inputHdocToElasticSearch}">
<fileset dir="${outputOpaleToHdoc}"/>
</copy>
<!-- Use ant transo opale_to_hdoc -->
<ant antfile="../hdoc_to_elasticSearch/hdoc_to_elasticsearch.ant" inheritAll="false"/>
<copy todir="${outputPath}" >
<fileset dir="${outputHdocToElasticSearch}"/>
</copy>
</target>
<!-- Clear tmp files -->
<target name="clean" depends="targetAllFiles">
<echo message="Clean files" />
<!-- -->
<delete includeemptydirs="true" verbose="true">
<fileset dir="${inputOpaleToHdoc}">
<include name="*.scar"/>
</fileset>
</delete>
<delete includeemptydirs="true" verbose="true">
<fileset dir="${outputOpaleToHdoc}">
<include name="*.hdoc"/>
</fileset>
</delete>
<delete includeemptydirs="true" verbose="true">
<fileset dir="${inputHdocToElasticSearch}">
<include name="*.hdoc"/>
</fileset>
</delete>
<delete includeemptydirs="true" verbose="true">
<fileset dir="${outputHdocToElasticSearch}">
<include name="*.json"/>
</fileset>
</delete>
<echo message="Clean end" />
</target>
</project>
opale_to_elasticSearch/run.bat
0 → 100644
View file @
7e026ffb
@echo
off
set
lib
=
lib
set
ant
=
opale_to_elasticsearch
.ant
set
antparam
=
-Dprogram
.param
=
%
1
set
scJarList
=
%lib%
\
*
java
.exe
-classpath
"
%scJarList%
"
-Xmx
150
m
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%
opale_to_elasticSearch/run.sh
0 → 100644
View file @
7e026ffb
#!/bin/sh
lib
=
"lib"
ant
=
"opale_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/sample/es-1_2017-1-4.scar
0 → 100644
View file @
7e026ffb
File added
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