Commit e3de7032 authored by taivo's avatar taivo
Browse files

KEEL-58: updated other services output.

parent ee362eec
......@@ -187,7 +187,7 @@ function SessionService() {
for(var i in session.outputFiles){
filesList.push({
key: i,
type: 'output',
type: session.outputFiles[i].type,
fileName: session.outputFiles[i].fileName,
contentType: session.outputFiles[i].contentType
});
......
......@@ -146,6 +146,7 @@ function ArchiveExtractor() {
session.addOutputFile(uniqid, {
filePath: filePath,
fileName: fileName,
type: 'output',
contentType: mime.lookup(filePath) // getting the original file mime type
});
}
......
......@@ -6,6 +6,8 @@ var SessionService = require('./../src/service/sessionService');
var async = require('async');
var CommandModel = require('../src/mapper/commandModel');
var fs = require('fs');
var mime = require('mime');
var path = require('path');
function ContentTokenizer(){
......@@ -68,8 +70,19 @@ function ContentTokenizer(){
var mapping = JSON.stringify(tokens);
logger.debug('Failide mappimine on lõpetatud');
SessionService.storeToFile(session.id, mapping, function (error, mappingPath) {
session.addOutputFile('output', model.outputPaths.outputPath1);
session.addOutputFile('mapping', mappingPath);
session.addOutputFile('output', {
type: 'output',
fileName: path.basename(model.outputPaths.outputPath1),
filePath: model.outputPaths.outputPath1,
contentType: mime.lookup(model.outputPaths.outputPath1)
});
session.addOutputFile('mapping', {
type: 'mapping',
fileName: path.basename(mappingPath),
filePath: mappingPath,
contentType: mime.lookup(mappingPath)
});
return callback( error, session );
});
......
......@@ -4,6 +4,8 @@ var localExecutor = require('./../src/service/executor/localExecutor');
var Session = require('../src/model/session');
var CommandModel = require('../src/mapper/commandModel');
var fs = require('fs');
var mime = require('mime');
var path = require('path');
function ContentTokenizer(){
......@@ -25,7 +27,13 @@ function ContentTokenizer(){
session.setErrors(response.errors);
}
session.addOutputFile('output', response.stdOutPath);
session.addOutputFile('output', {
type: 'output',
fileName: path.basename(response.stdOutPath),
filePath: response.stdOutPath,
contentType: mime.lookup(response.stdOutPath)
});
return callback( err, session );
});
});
......
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