Commit c9935765 authored by Kapilraj Thangeswaran's avatar Kapilraj Thangeswaran

Mise ant, main.js pour version linux

parent 7a1862a6
......@@ -34,7 +34,7 @@ In order to work properly this module needs :
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. 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
6. Execute run.bat or chmod +x run.sh & ./run.sh
## Web
This module provides a Web application to access MongoDB and execute simples requests.
......
......@@ -58,9 +58,27 @@
<delete dir="${tmpdir}" />
</target>
<target name="mongoDB" depends="main">
<exec executable="node" dir="mongo">
<arg line="main.js"/>
</exec>
</target>
<condition property="isWindows">
<os family="windows" />
</condition>
<condition property="isUnix">
<os family="unix" />
</condition>
<target name="windowsMongoDB" if="isWindows" depends="main">
<exec executable="node" dir="mongo">
<arg line="main.js"/>
</exec>
</target>
<target name="linuxMongoDB" if="isUnix" depends="main">
<exec executable="nodejs" dir="mongo">
<arg line="main.js"/>
</exec>
</target>
<target name="mongoDB" depends="windowsMongoDB, linuxMongoDB">
<echo>End</echo>
</target>
</project>
\ No newline at end of file
......@@ -42,8 +42,8 @@ var removeDocument = function(db, collection, json) {
MongoClient.connect(url, function(err, db) {
assert.equal(null, err);
fs.readdir(outputFolder, (err, files) => {
files.forEach(file => {
fs.readdir(outputFolder, function(err, files) {
files.forEach(function(file) {
var json = JSON.parse(fs.readFileSync(outputFolder + "/" + file));
if(config.request === 'insert') {
insertDocument(db, config.collection, json);
......
......@@ -29,7 +29,7 @@
}
</xsl:template>
<xsl:template match="div[@data-hdoc-type='question'][position() != last()]" >
<xsl:template match="div[@data-hdoc-type='question' and position() != last()]" >
{
<xsl:apply-templates select="div[@data-hdoc-type='description']"/>
<xsl:apply-templates select="div[@data-hdoc-type='solution']"/>
......
......@@ -36,7 +36,7 @@ In order to work properly this module needs :
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. 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
6. Execute run.bat or chmod +x run.sh & ./run.sh
## Input configuration
You can add or edit "config.xml" in "input" folder to provide more information about your documents.
......
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