forked from GPII/universal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthDataLoader.js
More file actions
48 lines (39 loc) · 1.41 KB
/
authDataLoader.js
File metadata and controls
48 lines (39 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*!
Copyright 2017 OCAD University
Licensed under the New BSD license. You may not use this file except in
compliance with this License.
The research leading to these results has received funding from the European Union's
Seventh Framework Programme (FP7/2007-2013) under grant agreement no. 289016.
You may obtain a copy of the License at
https://github.com/GPII/universal/blob/master/LICENSE.txt
*/
"use strict";
var fluid = require("infusion"),
gpii = fluid.registerNamespace("gpii");
require("./dataLoader.js");
fluid.defaults("gpii.dataLoader.authDataLoader", {
gradeNames: ["gpii.dataLoader", "gpii.dataLoader.reporter"],
databases: {
expander: {
funcName: "gpii.dataLoader.authDataLoader.constructAuthData",
args: ["{that}.options.dbName", "{that}.options.dataFile"]
}
},
listeners: {
"onCreate.load": {
listener: "gpii.dataLoader.performLoad",
args: ["{that}.options.dbName", "{that}"]
}
}
});
/**
* Construct the value of `options.databases` that to be accepted by `gpii.dataLoader` (See dataLoader.js).
*
* @param dbName {String} The database name;
* @param dataFile {Array} An array of data paths to files to be loaded into the database.
*/
gpii.dataLoader.authDataLoader.constructAuthData = function (dbName, dataFile) {
var togo = {};
fluid.set(togo, [dbName, "dataFile"], dataFile);
return togo;
};