Commit a9ee3961 by Fernando Martínez Santiago Committed by root

bug #531 fixed. It's required to reinstall the database triggers to take effect of this patch

parent fe69eda6
......@@ -89,7 +89,7 @@ INSERT INTO `picto_core` (`id`, `id_pic`, `id_cat_pic`, `coord_x`, `coord_y`,`co
(154, 11523,NULL, 1, 1, '#FE9A2E'), -- Rooms
(155, 12303,NULL, 4, 1, '#F4FA58'), -- Clasroom items
(156, 5393, NULL, 4, 0, '#F4FA58'), -- Furniture
(157, 11368,NULL, 4, 1, '#F4FA58'), -- Kitchen items
(157, 11368,NULL, 4, 2, '#F4FA58'), -- Kitchen items
(159, 2547,NULL, 4, 9, '#2E9AFE'), -- Articles and determinants
(190, 4724,NULL, 4, 7, '#F4FA58'), -- Body parts
(191, 50956,NULL, 4, 8, '#F4FA58'), -- Stuff
......@@ -218,8 +218,8 @@ INSERT INTO `picto_core` (`id`, `id_pic`, `id_cat_pic`, `coord_x`, `coord_y`,`co
(152, 8460, 12303,4, 7, NULL), -- Classroom.notebook
(153, 10908, 12303,4, 4, NULL), -- Classroom.book
(160, 51295, 11368, 4, 0, NULL), -- Kitchen.plate
(161, 5394, 11368, 4, 1, NULL), -- Kitchen.glass
(162, 5387, 11368, 4, 2, NULL), -- Kitchen.fork
(161, 5394, 11368, 4, 1, NULL), -- Kitchen.glass
(162, 5387, 11368, 4, 2, NULL), -- Kitchen.fork
(163, 11442, 11368, 4, 3, NULL), -- Kitchen.spoon
(164, 11491, 11368, 4, 4, NULL), -- Kitchen.knife
(165, 11257, 11368, 4, 5, NULL), -- Kitchen.bowl
......
......@@ -200,7 +200,7 @@ thisTrigger: BEGIN
END IF;
CASE NEW.type
WHEN 'Show' THEN
WHEN 'Show' THEN
SELECT id_ws, id_sup, id_opentry INTO idws, idsup_ws, idopentry
FROM
stu_opentry
......@@ -212,22 +212,26 @@ thisTrigger: BEGIN
WHERE id=idopentry;
call newTry(new.id_stu, idsup_ws, idws);
END IF;
WHEN 'Pause' THEN
WHEN 'pausesession' THEN
SELECT id_ws, id_opentry INTO idws, idopentry
FROM
stu_opentry
WHERE
id_stu = NEW.id_stu;
IF (idopentry IS NULL) THEN
call newTry(new.id_stu, new.id_sup,idws);
ELSE
IF (idopentry IS NOT NULL) THEN
call deleteOpenTry(idws);
END IF;
WHEN 'resumesession' THEN
SELECT id_ws, id_opentry INTO idws, idopentry
FROM
stu_opentry
WHERE
id_stu = NEW.id_stu;
call newTry(new.id_stu, new.id_sup,idws);
ELSE BEGIN END;
END CASE;
END;;
-- Integrity rule 2: when a session is closed, last try must be discharged
-- when: state COM, event a4
-- current is to NULL (integrity rule 6)
......
......@@ -10,6 +10,11 @@
module.exports = {
// dummy function to test timeouts
eternal: function (req, res) {
setTimeout(function(){return;}, 1000*60*6);
},
/**
* Login in the server as student, getting a toker for interacting with the platform
* @param {request} req
......
......@@ -174,3 +174,7 @@ dashboardApp.factory('newconfirm', function ($window, $q, $timeout) {
}
return newconfirm;
});
// force websocket transport protocol
io.sails.transports=['polling'];
......@@ -300,7 +300,8 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr
"supervisor": $scope.user.id
})
.success(function(data, status, headers, config) {
// Adding pause action to the list of actions
// Gettinf rid of last try and adding pause action to the list of actions
$scope.actual_try.actions = [];
$scope.actual_try.actions.push({ action: 'pausesession'} );
})
......@@ -388,8 +389,9 @@ dashboardControllers.controller('StudentSessionCtrl', function StudentSessionCtr
// as the last action, added $scope.apply() that lets angular know
// what data has updated, and refresh what needs to be refreshed.
if($scope.ws){
console.log(data.action);
console.log($scope.paused);
if($scope.ws && $scope.paused == false){
switch(data.action){
case 'Add':
$scope.actual_try.actions.push(data);
......
......@@ -21,6 +21,12 @@ module.exports.http = {
* *
****************************************************************************/
timeout: function(req, res, next) {
var timeout = require('connect-timeout');
timeout('300s');
next();
},
/***************************************************************************
* *
* The order in which middleware should be run for HTTP request. (the Sails *
......@@ -28,7 +34,7 @@ module.exports.http = {
* *
***************************************************************************/
// order: [
order: ['timeout']
// 'startRequestTimer',
// 'cookieParser',
// 'session',
......
......@@ -69,6 +69,7 @@ module.exports.policies = {
},
StudentController: {
eternal: true,
getInfo: ['tokenAuth'],
supervisors: ['tokenAuth'],
therapists: ['tokenAuth'],
......
......@@ -23,6 +23,8 @@ module.exports.routes = {
// Grouped by API url (/a, /b, ...)
// Sorted by HTTP method (GET, PUT, POST and DELETE)
'GET /student/eternal': 'StudentController.eternal',
'POST /action': 'ActionController.create',
'POST /actions': 'ActionController.createlist',
......
......@@ -12,6 +12,8 @@
module.exports.sockets = {
pingTimeout: 300000, // set timeout to 5 minutes
/***************************************************************************
* *
* This custom onConnect function will be run each time AFTER a new socket *
......@@ -47,12 +49,12 @@ module.exports.sockets = {
* flashsockets by adding 'flashsocket' to this list: *
* *
***************************************************************************/
// transports: [
// 'websocket',
transports: [
// 'websocket'
// 'htmlfile',
// 'xhr-polling',
// 'jsonp-polling'
// ],
// 'xhr-polling'
'polling'
]
/***************************************************************************
* *
......
......@@ -8,6 +8,7 @@
"async": "^2.0.0-rc.4",
"bcrypt-nodejs": "0.0.3",
"connect-redis": "3.0.2",
"connect-timeout": "^1.7.0",
"ejs": "^0.8.8",
"forever": "^0.14.1",
"grunt": "^1.0.1",
......
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 sign in to comment