Commit 7a1862a6 authored by simei.yin's avatar simei.yin

Merge branch 'master' of ssh://gitlab.utc.fr/crozatst/hdoc

parents 2ac41b8e 991cf355
*/input/*
*/tmp/*
*/output/*
!*/input/.gitkeep
......
......@@ -18,7 +18,15 @@
<xsl:apply-templates select="*"/>
</ol>
</xsl:template>
<xsl:template match="code">
Code (non pris en compte pour l'instant) :<br/>
<xsl:apply-templates select="@*|node()"/>
<br/>
</xsl:template>
<xsl:template match="code[preceding-sibling::code]">
<xsl:apply-templates select="@*|node()"/>
<br/>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
......
......@@ -52,10 +52,7 @@
Titre (non pris en compte pour l'instant) :
<xsl:apply-templates select="@*|node()"/>
</xsl:template>
<xsl:template match="code">
Code (non pris en compte pour l'instant) :
<xsl:apply-templates select="@*|node()"/>
</xsl:template>
<xsl:template match="page">
<xsl:apply-templates select="@*|node()"/>
</xsl:template>
......
File mode changed from 100644 to 100755
......@@ -547,6 +547,17 @@
<xsl:apply-templates select="./*"/>
</sc:cell>
</xsl:template>
<!-- Display images -->
<xsl:template match="h:img">
<sp:txt>
<cp:txt>
<sc:para xml:space="preserve">
<sc:inlineImg role="ico" sc:refUri="res/{./@src}"/>
</sc:para>
</cp:txt>
</sp:txt>
</xsl:template>
<xsl:template match="h:header"/>
<!-- Its content is already used in <xsl:template match="h:section"> -->
......
......@@ -12,16 +12,29 @@ Kapilraj Thangeswaran
This module is able to extract data from a file in Hdoc format and insert them into MongoDB.
## Dependencies
In order to work properly this module needs
- In order to make this module work you have to download and install Node.js from the [Node.js download page](https://nodejs.org/en/).
- If needed, download and install MongoDB from the [MongoDB download page](https://www.mongodb.com/download-center#community).
In order to work properly this module needs :
- to download and install Node.js
For windows :
- from the [Node.js download page](https://nodejs.org/en/)
For linux (instruction for debian 8, may vary depending on your distrbution) execute the followings commands :
- `su`
- `apt install nodejs`
- `apt install node`
- `apt install npm`
- to download and install MongoDB
For Windows :
- from the [MongoDB download page](https://www.mongodb.com/download-center#community)
For linux :
- `su & apt install mongodb`
## Instructions
1. Install dependencies
2. Add all your hdoc documents in an "input" folder
3. Add or edit "config.xml" file in "input" folder (for more details, please check "Input configuration")
4. Edit "config.json" file from "mongo" folder (for more details, please check "Mongo configuration")
5. Execute run.bat or run.sh
5. Make sure that MongoDB is running (`mongod.exe --rest --jsonp` command from "MongoDB/Server/3.2/bin" folder)
6. Execute run.bat or run.sh
## Web
This module provides a Web application to access MongoDB and execute simples requests.
......
#!/bin/sh
#!/bin/bash
lib="lib"
ant="hdoc_to_mongo.ant"
antparam="-Dprogram.param=$1"
......
#!/bin/bash
npm link mongodb
......@@ -29,7 +29,7 @@
}
</xsl:template>
<xsl:template match="div[@data-hdoc-type='question']" >
<xsl:template match="div[@data-hdoc-type='question'][position() != last()]" >
{
<xsl:apply-templates select="div[@data-hdoc-type='description']"/>
<xsl:apply-templates select="div[@data-hdoc-type='solution']"/>
......
......@@ -24,6 +24,13 @@ Dependance
This project can be used alone if you only want to convert an HDOC into a Neo4j requests file or directly insert data in neo4j local database.
WARNINGS:
1) If you want to insert data automatically in a database, you need to have nodeJS installed!
Windows: https://nodejs.org/en/ and download + install the last stable version
Linux: install with your distribution's package manager
2) You need to configure the node/config.json file properly to fit with the parameters of the dabase you want to insert in. (host, db and password).
User documentation
------------------
......@@ -42,7 +49,8 @@ You have to respect the following steps :
Unsupported
-----------
There is no shared public database for now.
The "References" links are not fully supported yet. The opale_to_hdoc part is done, but needs an implementation in hdoc_to_neo4j.
Known bugs
----------
......
......@@ -73,10 +73,10 @@
<trycatch property="foo" reference="bar">
<try>
<jing file="${tmpdir}/META-INF/container.xml" rngfile="${Schema}/container/hdoc1-container.rng"></jing>
<echo>Validation container.xml ok !</echo>
<echo>container.xml is valid</echo>
</try>
<catch>
<echo>Validation failed</echo>
<echo>Warning : Validation for container.xml failed</echo>
</catch>
</trycatch>
......
......@@ -51,10 +51,10 @@
<trycatch property="foo" reference="bar">
<try>
<jing file="{$TempDirectory}/{$path}" rngfile="${{Schema}}/xhtml/hdoc1-xhtml.rng"></jing>
<echo>Validation content.xml ok !</echo>
<echo>content.xml is valid</echo>
</try>
<catch>
<echo>Validation failed</echo>
<echo>Warning : Validation for content.xml failed</echo>
</catch>
</trycatch>
......
......@@ -27,6 +27,10 @@ The project aims at converting Freemind files in Opale files. If you use another
-------------------------------
In dependence with mindmapping_to_hdoc and hdoc_to_opale
##Installation
-------------------------------
* To get the tool, go to the page https://gitlab.utc.fr/crozatst/hdoc/tree/master4 and click the download icon on the right of the screen : you can get a .zip version of the project. For the git users, the clone link is available on the same site.
## User documentation
-------------------------------
......@@ -38,16 +42,13 @@ In dependence with mindmapping_to_hdoc and hdoc_to_opale
* On Windows : 'run.bat'
If you want to convert one specific file that is in the input folder, use the parameters ' -DinputPath input/<yourFilename>' (ex : 'sh run.sh -DinputPath input/<yourFilename>')
If the input folder happens to be missing, you should create your own input folder in the root of the mindmapping_to_opale folder, and add your own samples inside.
*You will find the result of the conversion in the folder mindmapping_to_opale/output*
*You can find a sample file il the folder /samples.*
### Rules to follow
You can use the native formating in order to complete your Module :
* By using the "Text Bold" option, you will get an emphasis.
* By using the "Text Italic" option, you will get a quote.
You can use special rules in Freemind to personnalize your Scenari Module :
* By default, a "Division" is created with the name of the main node of your MindMap
......@@ -67,7 +68,7 @@ You can use special rules in Freemind to personnalize your Scenari Module :
* **#question** : a MCQ
* **#singlechoicequestion** : a QCU
* **#choice-qcu** : an answer within a QCU
* **#list** : a list, first node being the title and children being the content.
* **#list** : a list inside a paragraph, first node being the title and children being the content.
* **#solution** : a solution associated to a single choice within a QCU (matches an integer)
* **#choice-correct** : a correct answer within a MCQ
* **#choice-incorrect** : an incorrect answer within a MCQ
......@@ -83,11 +84,12 @@ You can use special rules in Freemind to personnalize your Scenari Module :
## Known bugs
* Current xsl cant handle anything else than a hierarchy of nodes named "nodes". It should be investigated in order to be able to use other types of children, in order to work with native mindmap formatting, as bold or italic.
* Currently, the xsl is lacking : there is no support for childs of nodes who are not named "nodes" themselves. The bug has been investigated and is therefore non trivial, and should be solved in order to handle functionnalities outside of the special rules formatting.
## TODO
* Develop new hashtags to create other type of Opale contents (such as self-evaluation, exercices other than QCM or QCU, etc.)
* Develop new hashtags to create other type of Opale contents (such as new exercises types, self-evaluation etc.)
* Explore native freemind functionalities to allow a more user friendly formatting : using the bold and italic formatting was tried but failed due to a xsl malfunction.
## Technicals notes
......@@ -100,7 +102,7 @@ This converter is using standard NF29 conversion project structure : a main ANT
This ant file is called by a script (run.sh or run.bat), with ou without parameters.
### Hdoc files
During the conversion process, the converter is using the converter mindmapping_to_hdoc. The result of this conversion is also available in the folder output.
During the conversion process, the converter is using the converter mindmapping_to_hodc. The result of this conversion is also available in the folder output.
### What does the main ANT file do ?
......@@ -113,4 +115,8 @@ During the conversion process, the converter is using the converter mindmapping_
* Copy the results of the conversion in the folder /output/scar
* Finally, clean temporary files
## Capitalization
\ No newline at end of file
## Capitalization
* Concerning the xsl malfunction, we know that the issue comes from a mispriority between nodes without childs and nodes with childs who aren't named "nodes". There is a confusion between the two because previous implementation didn't take the seconds into account. We didnt manage to find a way to force the xsl to recognize those nodes, but this is where you should look if you happen to need to fix the issue. A simple but time consuming fix would be to rewrite the xsl with the functionnality in mind, but we didn't took that option as we lacked time. The problematic functions are at the root of the xsl transformation, and therefore a simple fix hasn't been found yet.
* There's post on the Scenari forum to explain what has been achieved so far with the mindmapping_to_opale project. Here is the link to the post : https://forums.scenari.org/t/transformation-dune-framindmap-en-module-opale/1079
<?xml version="1.0" encoding="UTF-8" standalone="no"?><map version="0.8.1"><node CREATED="1450696201432" ID="2nngtspni6hi1484pfec44c8lk" MODIFIED="1450696201432" TEXT="MindMapping"><node CREATED="1450696201432" ID="00lp6bpfm6jibhcjrpdonrhoqb" MODIFIED="1450696201432" POSITION="right" TEXT="#1 MindMapping to Hdoc"><node CREATED="1450696201432" ID="3qm1jgu7dfgs328jthlek5fd4e" MODIFIED="1450696201432" TEXT="Prendre en main le projet existant"/><node CREATED="1450696201432" ID="0u38ectmhqqp4p08p5guvgij71" MODIFIED="1450696201432" TEXT="#wrng Corriger les bugs existants"><node CREATED="1450696201432" ID="6cl96umgglk7bg98n0u6v3tena" MODIFIED="1450696201432" TEXT="#p Il subsiste des bugs dans la transformation."/></node><node CREATED="1450696201432" ID="3b1t9o2te6enh59j4iv48f4mdi" MODIFIED="1450696201432" TEXT="Restructurer le ant"/></node><node CREATED="1450696201432" ID="6lohsep5crh5g3ngj8ld8loei6" MODIFIED="1450696201432" POSITION="right" TEXT="#2 MindMapping to Opale"><node CREATED="1450696201432" ID="5pl3210hq6if3nv7r2chtjstmo" MODIFIED="1450696201432" TEXT="Faire la connexion avec le transformateur Hdoc to Opale"/><node CREATED="1450696201432" ID="3haa2fgohe9j4n04ilddco84uh" MODIFIED="1450696201432" TEXT="Permettre la personnalisation de l'organisation du module"><node CREATED="1450696201432" ID="4ie264076qt3tnlu0pqpp1dh1p" MODIFIED="1450696201432" TEXT="#ex A l'aide de hashtag"><node CREATED="1450696201432" ID="6qegjh2snbh0s21cn7sdukun6v" MODIFIED="1450696201432" TEXT="#p L'idée est d'utiliser les hashtag pour identifier le type de contenu"/></node><node CREATED="1450696201432" ID="23mafrh60fmdmkjsp1jdg6c58g" MODIFIED="1450696201432" TEXT="#ex A l'aide d'attributs"><node CREATED="1450696201432" ID="3cofh24e4l95fo0pgcqiefc3gv" MODIFIED="1450696201432" TEXT="#p L'idée est d'utiliser les attributs pour identifier le type de contenu"/></node></node><node CREATED="1450696201432" ID="11k2hbkcu415e1mgk5c5ucr48k" MODIFIED="1450696201432" TEXT="Permettre la personnalisation dy type de noeud (Intro, conclusion etc.)"><node CREATED="1450696201432" ID="5pf0idbv9nln725d14rs1c1p0a" MODIFIED="1450696201432" TEXT="#ex A l'aide d'attributs"><node CREATED="1450696201432" ID="6pa7h6p941mljiimpb18tv628g" MODIFIED="1450696201432" TEXT="#p L'idée est d'utiliser les hashtag pour identifier le type de contenu"/></node><node CREATED="1450696201432" ID="48799q1i5c6rns3smpa8vnekfb" MODIFIED="1450696201432" TEXT="#ex A l'aide de hashtag"><node CREATED="1450696201432" ID="1j3m1erstm0171a1i29hg3dgj6" MODIFIED="1450696201432" TEXT="#p L'idée est d'utiliser les attributs pour identifier le type de contenu"/></node></node><node CREATED="1450696201432" ID="4npf8jpvak3lffn9c1rsogi0sq" MODIFIED="1450696201432" TEXT="Permettre la personnalisation grâce aux couleurs/icônes"/></node><node CREATED="1450696201432" ID="3n8v43p8qb005puq3qiv7aiubc" MODIFIED="1450696201432" POSITION="right" TEXT="#3 MindMapping to Optim"><node CREATED="1450696201432" ID="2bn1la3apnjf1fi8qqfqde226t" MODIFIED="1450696201432" TEXT="#def Faire la connexion avec le transformateur Hdoc to Optim"><node CREATED="1450696201432" ID="2juvq1lehuivco8c1h0scqh1lr" MODIFIED="1450696201432" TEXT="#p Le connecteur hdoc_to_optim n'est pas encore opérationnel"/></node></node><node CREATED="1450696201432" ID="3s00si3hquol4pldg7lo9opjd6" MODIFIED="1450696201432" POSITION="right" TEXT="#4 MindMapping to Lexique"><node CREATED="1450696201432" ID="37jlfl25iuaoe6f2cpiv30qksd" MODIFIED="1450696201432" TEXT="#p Faire la connexion avec le transformateur Hdoc to Lexique"/></node><node CREATED="1450696201432" ID="27gnl6pgottjfiukpa3ulfdjrj" MODIFIED="1450696201432" POSITION="left" TEXT="#5 Prendre d'autres outils de carte mentales en entrée"><node CREATED="1450696201432" ID="6ci8ukhfg8fd96vsvgn9sb30cr" MODIFIED="1450696201432" TEXT="#a http://hdoc.crzt.fr/www/co/hdocConverter.html"/></node><node CREATED="1450696201432" ID="24d41nnnnvvu7fv5m8m4vegu0g" MODIFIED="1450696201432" POSITION="left" TEXT="#intro This converter aims at convert a given MindMapping file into a Hdoc file which then will be imported in Opale (advanced only)."/><node CREATED="1450696201432" ID="6a7pr2b5vvmq6na5964dhf9e13" MODIFIED="1450696201432" POSITION="left" TEXT="#conclu DONE : MindMapping to Hdoc, MindMapping to Opale TODO : MindMapping to Optim, MindMapping to Lexique"/></node></map>
\ No newline at end of file
......@@ -31,16 +31,19 @@ A savoir que les contenus opale de plusieurs machines/utilisateurs peuvent être
##Utilisation
-------------
L'utilisation complète d'opale_to_elasticSearch nécessite l'utilisation de la stack ELK (ElasticSearch, Logstash, Kibana).
- Télécharger ElasticSearch : https://www.elastic.co/fr/downloads/elasticsearch
- Télécharger Logstash : https://www.elastic.co/fr/downloads/logstash
- Télécharger Kibana : https://www.elastic.co/fr/downloads/kibana
- Télécharger le fichier de conf de Logstash : https://www.dropbox.com/s/lkz3dgmto2d378m/esconf.conf?dl=0
- Mettre le fichier téléchargé dans %{dossier_installation_logstash}/
- Télécharger ElasticSearch : https://www.elastic.co/fr/downloads/elasticsearch et extraire l'archive
- Télécharger Logstash : https://www.elastic.co/fr/downloads/logstash et extraire l'archive
- Télécharger Kibana : https://www.elastic.co/fr/downloads/kibana et extraire l'archive
- Mettre le fichier esconf.conf situé dans opale_to_elasticSearch/logstash/conf/ dans %{dossier_installation_logstash}/
- Editer le fichier esconf.conf : ligne 11, remplacez "path => ["/opale_to_elasticSearch/logstash/input/*.json"]" par "path => ["%{votreCheminAbsolu}/opale_to_elasticSearch/logstash/input/*.json"]"
- Sauvegarder les modifications.
Etapes :
- aller dans votre dossier d'installation d'elasticsearch et lancer bin/elasticsearch
- aller dans votre dossier d'installation de kibana et lancer bin/kibana
- aller dans votre dossier d'installation de logstash et lancer bin/logstash - f esconf.conf
- Attendre les messages de logstash qui indiquent le lancement sans problème.
- lancer la transformation opale_to_elasticsearch en mettant d'abord les *.scar dans opale_to_elasticsearch/input
- Le dossier de sortie n'est pas le classique opale_to_elasticsearch/output mais opale_to_elasticsearch/logstash/input afin de faire directement le lien avec Logstash
- Normalement les log de logstash indique l'insertion des sorties de la transformation, il arrive pour le moment qu'il ne le fasse qu'au moment où logstash s'arrête, l'arrêter alors.
- aller sur http://localhost:5601/app/kibana#/dashboard/NF29_DATA_DASHBOARD?_g=(filters%3A!()%2CrefreshInterval%3A(display%3AOff%2Cpause%3A!f%2Cvalue%3A0)%2Ctime%3A(from%3Anow%2Fy%2Cmode%3Aquick%2Cto%3Anow%2Fy))
\ No newline at end of file
- aller sur http://localhost:5601/app/kibana#/dashboard/NF29_DATA_DASHBOARD?_g=(filters%3A!()%2CrefreshInterval%3A(display%3AOff%2Cpause%3A!f%2Cvalue%3A0)%2Ctime%3A(from%3Anow%2Fy%2Cmode%3Aquick%2Cto%3Anow%2Fy))
input
{
file
{
codec => multiline
{
pattern => '^\{'
negate => true
what => previous
}
path => ["/elasticSearch/logstash/input/*.json"]
start_position => "beginning"
sincedb_path => "/dev/null"
exclude => "*.gz"
}
}
filter
{
mutate
{
replace => [ "message", "%{message}" ]
gsub => [ 'message','\n','']
}
if [message] =~ /^{.*}$/
{
json { source => message }
}
}
output
{
stdout {}
elasticsearch { "hosts" => ["localhost:9200"] }
}
......@@ -32,6 +32,14 @@
<!-- MODULE's COMPONENTS -->
<body>
<xsl:apply-templates select="child::*[name() != 'op:ueM']"/>
<section data-hdoc-type="references">
<header>
<h1>Liste des grains liés</h1>
</header>
<li>
<xsl:apply-templates mode="ref" select=".//sp:comp[op:pbTi/sp:title = 'Voir aussi']"/>
</li>
</section>
</body>
</html>
</xsl:template>
......@@ -536,5 +544,11 @@
</xsl:template>
<xsl:template match="*"/>
<xsl:template mode="ref" match="sp:comp[op:pbTi/sp:title = 'Voir aussi']">
<xsl:for-each select="./op:res//sc:uLink">
<ul><xsl:value-of select="."/> - <xsl:value-of select="./@sc:refUri"/></ul>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
......@@ -12,18 +12,31 @@ Kapilraj Thangeswaran
This module is able to extract data from a file in Opale format and insert them into MongoDB.
## Dependencies
In order to work properly this module needs
- In order to make this module work you have to download and install Node.js from the [Node.js download page](https://nodejs.org/en/).
- If needed, download and install MongoDB from the [MongoDB download page](https://www.mongodb.com/download-center#community).
In order to work properly this module needs :
- [`opale_to_hdoc`](https://gitlab.utc.fr/crozatst/hdoc/tree/master/opale_to_hdoc) (Opale to Hdoc conversion)
- [`hdoc_to_mongo`](https://gitlab.utc.fr/crozatst/hdoc/tree/master/hdoc_to_mongo) (Hdoc to Mongo conversion)
- to download and install Node.js
For windows :
- from the [Node.js download page](https://nodejs.org/en/)
For linux (instruction for debian 8, may vary depending on your distrbution) execute the followings commands :
- `su`
- `apt install nodejs`
- `apt install node`
- `apt install npm`
- to download and install MongoDB
For Windows :
- from the [MongoDB download page](https://www.mongodb.com/download-center#community)
For linux :
- `su & apt install mongodb`
## Instructions
1. Install dependencies
2. Add all your hdoc documents in an "input" folder
3. Add or edit "config.xml" file in "input" folder (for more details, please check "Input configuration")
4. Edit "config.json" file from "mongo" folder in "hdoc_to_mongo" module (for more details, please check "Mongo configuration")
5. Execute run.bat or run.sh
5. Make sure that MongoDB is running (`mongod.exe --rest --jsonp` command from "MongoDB/Server/3.2/bin" folder)
6. Execute run.bat or run.sh
## Input configuration
You can add or edit "config.xml" in "input" folder to provide more information about your documents.
......
#!/bin/sh
#!/bin/bash
lib="lib"
ant="opale_to_mongo.ant"
antparam="-Dprogram.param=$1"
......
......@@ -24,6 +24,13 @@ Dependance
This project can be used alone if you only want to convert a .scar into a Neo4j requests file or directly insert data in neo4j local database.
WARNINGS:
1) If you want to insert data automatically in a database, you need to have nodeJS installed!
Windows: https://nodejs.org/en/ and download + install the last stable version
Linux: install with your distribution's package manager
2) You need to configure the ../hdoc_to_neo4j/node/config.json file properly to fit with the parameters of the dabase you want to insert in. (host, db and password).
User documentation
------------------
......@@ -42,7 +49,8 @@ You have to respect the following steps :
Unsupported
-----------
There is no shared public database for now.
The "References" links are not fully supported yet. The opale_to_hdoc part is done, but needs an implementation in hdoc_to_neo4j.
Known bugs
----------
......
......@@ -8,7 +8,7 @@
<basename property="filename" file="${inputFile}" suffix=".xml"/>
<!-- Path -->
<property name="resultPath" value="${basedir}/result"/>
<property name="resultPath" value="${basedir}/output"/>
<property name="hdoc_to_canoprof" location="${basedir}/../hdoc_to_canoprof"/>
<target name="main">
......
......@@ -2,7 +2,7 @@
<project name="wikiToCanoprof" default="main" basedir="..">
<!-- Path -->
<property name="resultPath" value="${basedir}/result"/>
<property name="resultPath" value="${basedir}/output"/>
<property name="hdoc_to_canoprof" location="${basedir}/../hdoc_to_canoprof"/>
<target name="main">
......
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