Commit 29749a83 authored by Kapilraj Thangeswaran's avatar Kapilraj Thangeswaran

Ajout attribut link et mise à jour readme

parent c0f99887
......@@ -12,13 +12,16 @@ 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).
## Instructions
1. Install dependencies
2. Edit "config.json" file from "mongo" folder (for more details, please check "Mongo configuration")
3. Execute run.bat or run.sh
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
## Web
This module provides a Web application to access MongoDB and execute simples requests.
......@@ -26,9 +29,22 @@ This module provides a Web application to access MongoDB and execute simples req
2. Edit "config.json" file from "web" folder (for more details, please check "MongoDB configuration")
3. Open "index.html" in "web" folder
## Input configuration
You can add or edit "config.xml" in "input" folder in order to provide more information about your documents.
Supported information
- link
```
<?xml version="1.0" encoding="UTF-8"?>
<config>
<file title='sample.hdoc'>
<link>https://stph.scenari-community.org/nf17/co/nf17.html</link>
</file>
</config>
```
## MongoDB configuration
### In "mongo" folder
Use "config.json" in the "mongo" folder to specify :
Use "config.json" in the "mongo" folder to specify
- url : mongodb's url
- database : the database you are using
- collection : the collection you are using
......@@ -43,7 +59,7 @@ Use "config.json" in the "mongo" folder to specify :
```
### In "web" folder
Use "config.json" in the "web" folder to specify :
Use "config.json" in the "web" folder to specify
- url : mongodb's url including the database
- collection : the collection you are using
```
......@@ -61,4 +77,4 @@ Use "config.json" in the "web" folder to specify :
## User stories
- En tant qu’utilisateur rédigeant des documents sous opale, je veux récupérer les exercices corrigés d’un sujet donné dans le but de les réutiliser.
- En tant qu’utilisateur rédigeant des documents sous opale, je veux récupérer les cours d’un auteur précis dans le but d’utiliser ses cours comme références.
- En tant qu’utilisateur universitaire, je souhaite mettre à disposition mes exercices sur internet de manière structuré dans le but de permettre à d’autre utilisateurs universitaires de les trouver, par thème, auteur ou contenu et de les réutiliser.
- En tant qu’utilisateur universitaire, je souhaite mettre à disposition mes exercices sur internet de manière structuré dans le but de permettre à d’autre utilisateurs universitaires de les trouver, par thème, auteur ou contenu et de les réutiliser.
\ No newline at end of file
......@@ -48,7 +48,10 @@
<target name="convertHdoc">
<echo>Convert ${inputPath}/${file}</echo>
<basename property="basename" file="${inputPath}/${file}" suffix=".hdoc"/>
<xslt in="${tmpdir}/content.xml" out="${outputPath}/${basename}.json" style="xsl/main.xsl"/>
<xslt in="${tmpdir}/content.xml" out="${outputPath}/${basename}.json" style="xsl/main.xsl">
<param name="file" expression="${file}"/>
<param name="inputPath" expression="${inputPath}"/>
</xslt>
</target>
<target name="clean">
......
......@@ -10,11 +10,19 @@
<xsl:import href="subroutines/right.xsl"/>
<xsl:import href="subroutines/introduction.xsl"/>
<xsl:import href="subroutines/exercise.xsl"/>
<xsl:import href="subroutines/config.xsl"/>
<xsl:output method="text" encoding="UTF-8" omit-xml-declaration="yes"/>
<xsl:param name="file" required="yes" as="xs:string"/>
<xsl:param name="inputPath" required="yes" as="xs:string"/>
<xsl:template match="/">
{
<xsl:call-template name="config-main">
<xsl:with-param name="file"><xsl:value-of select="$file"/></xsl:with-param>
<xsl:with-param name="inputPath"><xsl:value-of select="$inputPath"/></xsl:with-param>
</xsl:call-template>
"title" : <xsl:call-template name="title-main"/>,
"authors" : <xsl:call-template name="author-main"/>,
"keywords" : <xsl:call-template name="keyword-main"/>,
......
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:h2m="http://www.utc.fr/hdoc/hdoc_to_mongo">
<xsl:import href="../xsl-import/string.xsl"/>
<xsl:template name="config-main">
<xsl:param name="file"/>
<xsl:param name="inputPath"/>
"link" : <xsl:value-of select="h2m:escape-string(document('C:\Users\Kapil\Documents\Projets\github\hdoc\hdoc_to_mongo/input/config.xml')/config/file[@title = $file]/link)" />,
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
......@@ -13,6 +13,54 @@ This module is able to extract data from a file in Opale format and insert them
## 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).
- [`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)
1. [`opale_to_hdoc`](https://gitlab.utc.fr/crozatst/hdoc/tree/master/opale_to_hdoc) (Opale to Hdoc conversion)
2. [`hdoc_to_mongo`](https://gitlab.utc.fr/crozatst/hdoc/tree/master/hdoc_to_mongo) (Hdoc to Mongo conversion)
\ No newline at end of file
## 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
## Input configuration
You can add or edit "config.xml" in "input" folder in order to provide more information about your documents.
Supported information
- link
```
<?xml version="1.0" encoding="UTF-8"?>
<config>
<file title='sample.hdoc'>
<link>https://stph.scenari-community.org/nf17/co/nf17.html</link>
</file>
</config>
```
## MongoDB configuration
### In "mongo" folder from "hdoc_to_mongo" module
Use "config.json" in the "mongo" folder to specify
- url : mongodb's url
- database : the database you are using
- collection : the collection you are using
- request : the request you want to perform (for allowed requests, please check "Supported requests")
```
{
"url" : "mongodb://localhost:27017/",
"database" : "database",
"collection" : "collection",
"request" : "insert"
}
```
## Supported requests
- insert
- update (using the title as filter)
- remove (using the title as filter)
## User stories
- En tant qu’utilisateur rédigeant des documents sous opale, je veux récupérer les exercices corrigés d’un sujet donné dans le but de les réutiliser.
- En tant qu’utilisateur rédigeant des documents sous opale, je veux récupérer les cours d’un auteur précis dans le but d’utiliser ses cours comme références.
- En tant qu’utilisateur universitaire, je souhaite mettre à disposition mes exercices sur internet de manière structuré dans le but de permettre à d’autre utilisateurs universitaires de les trouver, par thème, auteur ou contenu et de les réutiliser.
\ No newline at end of file
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