Skip to content
Snippets Groups Projects
Commit b87bd32b authored by Jaden Diefenbaugh's avatar Jaden Diefenbaugh
Browse files

whitespace fix factories

parent 26d18605
No related branches found
No related tags found
2 merge requests!223Reports overhaul,!220WIP: Experiment groups
/*
* Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
* Contact: beat.support@idiap.ch
*
*
* This file is part of the beat.web module of the BEAT platform.
*
*
* Commercial License Usage
* Licensees holding valid commercial BEAT licenses may use this file in
* accordance with the terms contained in a written agreement between you
* and Idiap. For further information contact tto@idiap.ch
*
*
* Alternatively, this file may be used under the terms of the GNU Affero
* Public License version 3 as published by the Free Software and appearing
* in the file LICENSE.AGPL included in the packaging of this file.
* The BEAT platform is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE.
*
*
* You should have received a copy of the GNU Affero Public License along
* with the BEAT platform. If not, see http://www.gnu.org/licenses/.
*/
*/
//This factory retrieves data from the static files and associates it with the $scope
app.factory('dataFactory', function($http)
{
var getData = function (URL) {
//return $http.get(URL + 'itemcontent.json');
var obj = {content:null};
//return $http.get(URL);
$http.get(URL).success(function(data)
{
obj.content = data;
});
app.factory('dataFactory', function($http){
var getData = function (URL) {
//return $http.get(URL + 'itemcontent.json');
var obj = {content:null};
//return $http.get(URL);
$http.get(URL).success(function(data){
obj.content = data;
});
return obj;
};
return obj;
};
return {
getData: getData
};
return {
getData: getData
};
});
/*
* Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
* Contact: beat.support@idiap.ch
*
*
* This file is part of the beat.web module of the BEAT platform.
*
*
* Commercial License Usage
* Licensees holding valid commercial BEAT licenses may use this file in
* accordance with the terms contained in a written agreement between you
* and Idiap. For further information contact tto@idiap.ch
*
*
* Alternatively, this file may be used under the terms of the GNU Affero
* Public License version 3 as published by the Free Software and appearing
* in the file LICENSE.AGPL included in the packaging of this file.
* The BEAT platform is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE.
*
*
* You should have received a copy of the GNU Affero Public License along
* with the BEAT platform. If not, see http://www.gnu.org/licenses/.
*/
*/
//This factory retrieves data from the REST API and associates it with the $scope
app.factory('experimentFactory', function($http, $q)
{
return {
getExperimentInformation: function (url_prefix, experiment_id)
{
urlBase = url_prefix + '/api/v1/experiments';
return $http.get(urlBase + '/' + experiment_id + '/')
.then(function(response){
return response.data;
});
},
app.factory('experimentFactory', function($http, $q){
return {
getExperimentInformation: function (url_prefix, experiment_id){
urlBase = url_prefix + '/api/v1/experiments';
return $http.get(urlBase + '/' + experiment_id + '/')
.then(function(response){
return response.data;
});
},
getAllExperimentResultsForAuthor: function (user, report_id, url_prefix)
{
urlBase = url_prefix + '/api/v1/reports';
return $http.get(urlBase + '/' + user + '/' + report_id + '/results_author/')
.then(function(response){
return response.data;
});
},
getAllExperimentResultsForAuthor: function (user, report_id, url_prefix){
urlBase = url_prefix + '/api/v1/reports';
return $http.get(urlBase + '/' + user + '/' + report_id + '/results_author/')
.then(function(response){
return response.data;
});
},
getAllExperimentResults: function (url_prefix, report_number)
{
urlBase = url_prefix + '/api/v1/reports';
return $http.get(urlBase + '/' + report_number + '/results/')
.then(function(response){
return response.data;
});
}
getAllExperimentResults: function (url_prefix, report_number){
urlBase = url_prefix + '/api/v1/reports';
return $http.get(urlBase + '/' + report_number + '/results/')
.then(function(response){
return response.data;
});
}
}
}
});
/*
* Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
* Contact: beat.support@idiap.ch
*
*
* This file is part of the beat.web module of the BEAT platform.
*
*
* Commercial License Usage
* Licensees holding valid commercial BEAT licenses may use this file in
* accordance with the terms contained in a written agreement between you
* and Idiap. For further information contact tto@idiap.ch
*
*
* Alternatively, this file may be used under the terms of the GNU Affero
* Public License version 3 as published by the Free Software and appearing
* in the file LICENSE.AGPL included in the packaging of this file.
* The BEAT platform is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE.
*
*
* You should have received a copy of the GNU Affero Public License along
* with the BEAT platform. If not, see http://www.gnu.org/licenses/.
*/
*/
//This factory retrieves data from the REST API and associates it with the $scope
app.factory('plotterFactory', ['$http', function($http)
{
var plotterFactory = {};
app.factory('plotterFactory', ['$http', function($http){
var plotterFactory = {};
plotterFactory.getPlotters = function (url_prefix)
{
urlBase = url_prefix + '/api/v1/plotters';
return $http.get(urlBase + '/');
};
plotterFactory.getPlotters = function (url_prefix){
urlBase = url_prefix + '/api/v1/plotters';
return $http.get(urlBase + '/');
};
plotterFactory.getDefaultPlotters = function (url_prefix)
{
urlBase = url_prefix + '/api/v1/plotters/defaultplotters';
return $http.get(urlBase + '/');
};
plotterFactory.getDefaultPlotters = function (url_prefix){
urlBase = url_prefix + '/api/v1/plotters/defaultplotters';
return $http.get(urlBase + '/');
};
plotterFactory.getPlotterParameter = function (url_prefix)
{
urlBase = url_prefix + '/api/v1/plotters/plotterparameter';
return $http.get(urlBase + '/');
};
plotterFactory.getPlotterParameter = function (url_prefix){
urlBase = url_prefix + '/api/v1/plotters/plotterparameter';
return $http.get(urlBase + '/');
};
return plotterFactory;
return plotterFactory;
}]);
/*
* Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
* Contact: beat.support@idiap.ch
*
*
* This file is part of the beat.web module of the BEAT platform.
*
*
* Commercial License Usage
* Licensees holding valid commercial BEAT licenses may use this file in
* accordance with the terms contained in a written agreement between you
* and Idiap. For further information contact tto@idiap.ch
*
*
* Alternatively, this file may be used under the terms of the GNU Affero
* Public License version 3 as published by the Free Software and appearing
* in the file LICENSE.AGPL included in the packaging of this file.
* The BEAT platform is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE.
*
*
* You should have received a copy of the GNU Affero Public License along
* with the BEAT platform. If not, see http://www.gnu.org/licenses/.
*/
*/
//This factory retrieves data from the REST API and associates it with the $scope
app.factory('reportFactory', ['$http', 'experimentFactory', function($http, experimentFactory)
{
var urlBase = '/api/v1/reports';
var reportFactory = {};
reportFactory.getReportInformation = function (user, report_id, url_prefix)
{
urlBase = url_prefix + '/api/v1/reports';
return $http.get(urlBase + '/' + user + '/' + report_id + '/');
};
reportFactory.getReportInformationFromNumber = function (report_number, url_prefix)
{
urlBase = url_prefix + '/api/v1/reports';
return $http.get(urlBase + '/' + report_number + '/');
};
reportFactory.updateReport = function (user, report_id, reportData, url_prefix)
{
urlBase = url_prefix + '/api/v1/reports';
//return $http.put(urlBase + '/' + user + '/' + report_id + '/');
return $http({
headers: {'Content-Type': 'application/json'},
url: urlBase + '/' + user + '/' + report_id + '/',
method: "PUT",
data: reportData,
})
};
reportFactory.lockReport = function (user, report_id, url_prefix)
{
urlBase = url_prefix + '/api/v1/reports';
//return $http.put(urlBase + '/' + user + '/' + report_id + '/');
return $http({
headers: {'Content-Type': 'application/json'},
url: urlBase + '/' + user + '/' + report_id + '/lock/',
method: "POST",
//data: reportData,
})
};
reportFactory.publishReport = function (url_prefix, user, report_id, reportData)
{
urlBase = url_prefix + '/api/v1/reports';
//return $http.put(urlBase + '/' + user + '/' + report_id + '/');
return $http({
headers: {'Content-Type': 'application/json'},
url: urlBase + '/' + user + '/' + report_id + '/publish/',
method: "POST",
data: reportData,
})
};
reportFactory.publishReportAlgorithms = function (user, report_id, url_prefix)
{
urlBase = url_prefix + '/api/v1/reports';
//return $http.put(urlBase + '/' + user + '/' + report_id + '/');
return $http({
headers: {'Content-Type': 'application/json'},
url: urlBase + '/' + user + '/' + report_id + '/algorithms/',
method: "GET",
//data: reportData,
})
};
reportFactory.removeExperiment = function (user, report_id, experiment, url_prefix)
{
urlBase = url_prefix + '/api/v1/reports';
//return $http.put(urlBase + '/' + user + '/' + report_id + '/');
return $http({
headers: {'Content-Type': 'application/json'},
url: urlBase + '/' + user + '/' + report_id + '/remove/',
method: "POST",
data: experiment,
})
};
return reportFactory;
app.factory('reportFactory', ['$http', 'experimentFactory', function($http, experimentFactory) {
var urlBase = '/api/v1/reports';
var reportFactory = {};
reportFactory.getReportInformation = function (user, report_id, url_prefix){
urlBase = url_prefix + '/api/v1/reports';
return $http.get(urlBase + '/' + user + '/' + report_id + '/');
};
reportFactory.getReportInformationFromNumber = function (report_number, url_prefix){
urlBase = url_prefix + '/api/v1/reports';
return $http.get(urlBase + '/' + report_number + '/');
};
reportFactory.updateReport = function (user, report_id, reportData, url_prefix){
urlBase = url_prefix + '/api/v1/reports';
//return $http.put(urlBase + '/' + user + '/' + report_id + '/');
return $http({
headers: {'Content-Type': 'application/json'},
url: urlBase + '/' + user + '/' + report_id + '/',
method: "PUT",
data: reportData,
})
};
reportFactory.lockReport = function (user, report_id, url_prefix){
urlBase = url_prefix + '/api/v1/reports';
//return $http.put(urlBase + '/' + user + '/' + report_id + '/');
return $http({
headers: {'Content-Type': 'application/json'},
url: urlBase + '/' + user + '/' + report_id + '/lock/',
method: "POST",
//data: reportData,
})
};
reportFactory.publishReport = function (url_prefix, user, report_id, reportData){
urlBase = url_prefix + '/api/v1/reports';
//return $http.put(urlBase + '/' + user + '/' + report_id + '/');
return $http({
headers: {'Content-Type': 'application/json'},
url: urlBase + '/' + user + '/' + report_id + '/publish/',
method: "POST",
data: reportData,
})
};
reportFactory.publishReportAlgorithms = function (user, report_id, url_prefix){
urlBase = url_prefix + '/api/v1/reports';
//return $http.put(urlBase + '/' + user + '/' + report_id + '/');
return $http({
headers: {'Content-Type': 'application/json'},
url: urlBase + '/' + user + '/' + report_id + '/algorithms/',
method: "GET",
//data: reportData,
})
};
reportFactory.removeExperiment = function (user, report_id, experiment, url_prefix){
urlBase = url_prefix + '/api/v1/reports';
//return $http.put(urlBase + '/' + user + '/' + report_id + '/');
return $http({
headers: {'Content-Type': 'application/json'},
url: urlBase + '/' + user + '/' + report_id + '/remove/',
method: "POST",
data: experiment,
})
};
return reportFactory;
}]);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment