Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions examples/gpii-driver/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This directory contains an example that provides customisations to the GPII by means of the "driver" pattern.

This example demonstrates how to inject a component named `gpii.app` as a subcomponent of the GPII flow manager. To start the customized GPII, simply type:

node driver.js

from this directory. The logging information output by `gpii.app` will appear on the GPII console.
30 changes: 30 additions & 0 deletions examples/gpii-driver/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2017 OCAD University
*
* Licensed under the New BSD license. You may not use this file except in
* compliance with this License.
*
* You may obtain a copy of the License at
* https://github.com/GPII/universal/blob/master/LICENSE.txt
*/

"use strict";

var fluid = require("infusion");

fluid.defaults("gpii.app", {
gradeNames: ["fluid.component"],
components: {
appImpl: {
type: "fluid.component",
options: {
listeners: {
"onCreate.log": {
listener: "console.log",
args: ["!!! The app component has been created!"]
}
}
}
}
}
});
15 changes: 15 additions & 0 deletions examples/gpii-driver/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "gpii.appDemo",
"options": {
"gradeNames": ["fluid.component"],
"distributeOptions": {
"distributeApp": {
"record": "gpii.app",
"target": "{that flowManager}.options.gradeNames"
}
}
},
"mergeConfigs": [
"../../gpii/configs/gpii.config.cloudBased.development.all.local.json"
]
}
26 changes: 26 additions & 0 deletions examples/gpii-driver/driver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*!
* Driver file to demonstrate GPII customisations
*
* Copyright 2012 OCAD University
* Copyright 2017 OCAD University
*
* Licensed under the New BSD license. You may not use this file except in
* compliance with this License.
*
* You may obtain a copy of the License at
* https://github.com/GPII/universal/blob/master/LICENSE.txt
*/

"use strict";

var fluid = require("infusion"),
kettle = fluid.registerNamespace("kettle");

require("kettle");
require("../../index.js");
require("./app.js");

kettle.config.loadConfig({
configName: kettle.config.getConfigName("app"),
configPath: __dirname
});