Skip to content

Instantly share code, notes, and snippets.

View amb26's full-sized avatar

Antranig Basman amb26

View GitHub Profile
fluid.defaults("souq.codeMirror", {
gradeNames: ["fluid.viewComponent", "autoInit"],
codeMirrorOpts: ["lineNumbers", "mode", "gutters"],
// we relay all raw CodeMirror events with additional argument "that" in 0th place, rest shifted to the right
codeMirrorEvents: ["onChange", "onCursorActivity", "onViewportChange", "onGutterClick", "onScroll", "onUpdate"],
events: {
onCreateCodeMirror: null,
onChange: null,
onCursorActivity: null,

ChangeApplier API

This section explains and documents the various Javascript API calls for instantiating and working with ChangeAppliers. In practice, users will use the ChangeAppliers which are automatically constructed for every Model Component as its top-level member applier and will not construct their own. Furthermore, a good deal of the use made of ChangeAppliers will take the form of Declarative Configuration rather than literal JavaScript API calls - many more declarative uses are supported in Infusion 1.5 and even more will be supported in Infusion 2.0. This page presents both programmatic calls and their declarative equivalents where they exist.

Registering interest in model changes using a ChangeApplier

Declarative style

The declarative style for registering interest in change events uses an entry in the modelListeners options area of a modelRelayComponent. These lis

@amb26
amb26 / configLoader.js
Created August 27, 2014 00:19
configLoader.js
/*
Kettle config loader.
Copyright 2012-2013 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/kettle/LICENSE.txt
@amb26
amb26 / kettle.dataSource.set
Created September 28, 2014 23:06
dataSource.set using fluid.promise.follow
kettle.dataSource.set = function (that, directModel, model, options) {
options = kettle.dataSource.defaultiseOptions(options, directModel, true); // shared and writeable between all participants
var transformPromise = fluid.fireTransformEvent(that.events.onWrite, model, options);
var togo = fluid.promise();
transformPromise.then(function (transformed) {
var innerPromise = thet.setImpl(options, directModel, transformed);
fluid.promise.follow(innerPromise, togo);
});
kettle.dataSource.registerStandardPromiseHandlers(that, togo, options);
return togo;
@amb26
amb26 / Integration.js
Last active August 29, 2015 14:07
Advice throughout the system
/**
* GPII Integration Testing
*
* Copyright 2013 Raising the Floor International
* Copyright 2013 OCAD University
* Copyright 2014 Lucendo Development Ltd.
*
* Licensed under the New BSD license. You may not use this file except in
* compliance with this License.
*
@amb26
amb26 / LifecycleManager.js
Created October 20, 2014 21:46
Asynchrouwnous LifecycleManager
/*!
Lifecycle Manager
Copyright 2012 Antranig Basman
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
@amb26
amb26 / appalling-trace.txt
Created December 3, 2014 22:11
Appalling Trace of 6/11/14
20:21:37.261: Registering module infusion from path E:\source\gits\gpii\node_modules\universal\node_modules\infusion
20:21:37.293: Registering module kettle from path E:\source\gits\gpii\node_modules\universal\node_modules\kettle
20:21:37.594: Clearing cache for component flowManager.io with gradeNames [
"flowManager.io",
"fluid.littleComponent",
"kettle.config",
"autoInit"
]
20:21:37.864: Created new instantiator with id 9wrq5kv4-19 in order to operate on component kettle.test.serverEnvironment
20:21:37.906: Successfully queued test Flow Manager update tests

Introduction

This page describes how to set up an environment that can run the backend online services that GPII generally depend on in production mode. These are preferences server and cloud based flowmanager.

The setup will be using Vagrant and Virtual Box to set up a machine with CentOS 7.0.

The document contain the following parts:

  • The first part describes how to create and spin up a CentOS virtual machine and installing the dependencies (node, npm, git).
  • Next is a section describing how to install couchDB and initialize, which is used when running the preferences server in production mode.
  • Then a very brief description on installing the GPII and dependencies
@amb26
amb26 / privacy-flat.json
Created December 15, 2014 17:34
privacy-flat
{
"http://registry\\.gpii\\.net/common/highContrastEnabled": "change-contrast",
"http://registry\\.gpii\\.net/common/fontSize": "increase-size.appearance.text-size",
"http://registry\\.gpii\\.net/common/cursorSize": "increase-size.appearance.cursor-size",
"http://registry\\.gpii\\.net/common/magnifierEnabled": "increase-size.magnifier", // problem here
"http://registry\\.gpii\\.net/common/magnification": "increase-size.magnifier.magnification-level",
"http://registry\\.gpii\\.net/common/magnifierPosition": "increase-size.magnifier.magnifier-position",
"http://registry\\.gpii\\.net/common/volume": "universal-volume",

This directory contains configuration and driver files for the EASIT4ALL OAuth 2 integration demonstration. The initial datastore for the OAuth authorization server is held in EasitTestOauthDatastore.js. To start up the cloud-based flow manager secured by these records, simply type

node driver.js

from this directory. The endpoints exposed will be the ones as documented in http://wiki.gpii.net/w/GPII_OAuth_2_Guide - e.g. localhost:8081/settings holding the OAauth2-secured settings for the authenticated user.