├── .tmp ├── concat │ ├── scripts │ │ ├── main.js │ │ ├── plugins.js │ │ └── vendor.js │ └── styles │ │ ├── main.css │ │ └── vendor.css └── styles │ └── main.css ├── api-docs ├── cognicity-reports-powertrack │ ├── CognicityReportsPowertrack.html │ ├── CognicityReportsPowertrack.js.html │ ├── app.js.html │ ├── config.html │ ├── fonts │ │ ├── OpenSans-Bold-webfont.eot │ │ ├── OpenSans-Bold-webfont.svg │ │ ├── OpenSans-Bold-webfont.woff │ │ ├── OpenSans-BoldItalic-webfont.eot │ │ ├── OpenSans-BoldItalic-webfont.svg │ │ ├── OpenSans-BoldItalic-webfont.woff │ │ ├── OpenSans-Italic-webfont.eot │ │ ├── OpenSans-Italic-webfont.svg │ │ ├── OpenSans-Italic-webfont.woff │ │ ├── OpenSans-Light-webfont.eot │ │ ├── OpenSans-Light-webfont.svg │ │ ├── OpenSans-Light-webfont.woff │ │ ├── OpenSans-LightItalic-webfont.eot │ │ ├── OpenSans-LightItalic-webfont.svg │ │ ├── OpenSans-LightItalic-webfont.woff │ │ ├── OpenSans-Regular-webfont.eot │ │ ├── OpenSans-Regular-webfont.svg │ │ └── OpenSans-Regular-webfont.woff │ ├── global.html │ ├── index.html │ ├── sample-reports-config.js.html │ ├── scripts │ │ ├── linenumber.js │ │ └── prettify │ │ │ ├── Apache-License-2.0.txt │ │ │ ├── lang-css.js │ │ │ └── prettify.js │ └── styles │ │ ├── jsdoc-default.css │ │ ├── prettify-jsdoc.css │ │ └── prettify-tomorrow.css ├── cognicity-server │ ├── CognicityServer.html │ ├── CognicityServer.js.html │ ├── Validation.html │ ├── Validation.js.html │ ├── config.html │ ├── config.js.html │ ├── fonts │ │ ├── OpenSans-Bold-webfont.eot │ │ ├── OpenSans-Bold-webfont.svg │ │ ├── OpenSans-Bold-webfont.woff │ │ ├── OpenSans-BoldItalic-webfont.eot │ │ ├── OpenSans-BoldItalic-webfont.svg │ │ ├── OpenSans-BoldItalic-webfont.woff │ │ ├── OpenSans-Italic-webfont.eot │ │ ├── OpenSans-Italic-webfont.svg │ │ ├── OpenSans-Italic-webfont.woff │ │ ├── OpenSans-Light-webfont.eot │ │ ├── OpenSans-Light-webfont.svg │ │ ├── OpenSans-Light-webfont.woff │ │ ├── OpenSans-LightItalic-webfont.eot │ │ ├── OpenSans-LightItalic-webfont.svg │ │ ├── OpenSans-LightItalic-webfont.woff │ │ ├── OpenSans-Regular-webfont.eot │ │ ├── OpenSans-Regular-webfont.svg │ │ └── OpenSans-Regular-webfont.woff │ ├── global.html │ ├── index.html │ ├── scripts │ │ ├── linenumber.js │ │ └── prettify │ │ │ ├── Apache-License-2.0.txt │ │ │ ├── lang-css.js │ │ │ └── prettify.js │ ├── server.js.html │ └── styles │ │ ├── jsdoc-default.css │ │ ├── prettify-jsdoc.css │ │ └── prettify-tomorrow.css └── petajakarta-web │ ├── analytics.js.html │ ├── fonts │ ├── OpenSans-Bold-webfont.eot │ ├── OpenSans-Bold-webfont.svg │ ├── OpenSans-Bold-webfont.woff │ ├── OpenSans-BoldItalic-webfont.eot │ ├── OpenSans-BoldItalic-webfont.svg │ ├── OpenSans-BoldItalic-webfont.woff │ ├── OpenSans-Italic-webfont.eot │ ├── OpenSans-Italic-webfont.svg │ ├── OpenSans-Italic-webfont.woff │ ├── OpenSans-Light-webfont.eot │ ├── OpenSans-Light-webfont.svg │ ├── OpenSans-Light-webfont.woff │ ├── OpenSans-LightItalic-webfont.eot │ ├── OpenSans-LightItalic-webfont.svg │ ├── OpenSans-LightItalic-webfont.woff │ ├── OpenSans-Regular-webfont.eot │ ├── OpenSans-Regular-webfont.svg │ └── OpenSans-Regular-webfont.woff │ ├── global.html │ ├── index.html │ ├── map.js.html │ ├── module-analytics.html │ ├── module-map.html │ ├── module-reports.html │ ├── reports.js.html │ ├── scripts │ ├── linenumber.js │ └── prettify │ │ ├── Apache-License-2.0.txt │ │ ├── lang-css.js │ │ └── prettify.js │ └── styles │ ├── jsdoc-default.css │ ├── prettify-jsdoc.css │ └── prettify-tomorrow.css ├── bower_components └── bootstrap-sass-official │ └── vendor │ └── assets │ └── fonts │ └── bootstrap │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff ├── favicon.ico ├── images ├── Analyse.svg ├── Collect.svg ├── Communicate.svg ├── cognicity_system_diagram.png ├── logo-dark.svg ├── logo-light.svg └── wp_fig06.jpg ├── index.html ├── robots.txt ├── scripts ├── main.js └── vendor.js └── styles └── main.css /.tmp/concat/scripts/main.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | $(function() { 4 | // Figure out and save aspect ratio for each video 5 | $('iframe[src^="//player.vimeo.com"]').each(function() { 6 | $(this).data('aspectRatio', this.height / this.width) 7 | .removeAttr('height') 8 | .removeAttr('width'); 9 | }); 10 | 11 | // When the window is resized 12 | $(window).resize(function() { 13 | // Resize all videos according to their own aspect ratio 14 | $('iframe[src^="//player.vimeo.com"]').each(function() { 15 | var $this = $(this); 16 | var newWidth = $this.parent().width(); 17 | $this.width(newWidth) 18 | .height(newWidth * $this.data('aspectRatio')); 19 | }); 20 | }).resize(); 21 | }); 22 | -------------------------------------------------------------------------------- /.tmp/concat/styles/vendor.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/.tmp/concat/styles/vendor.css -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/app.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: app.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: app.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
'use strict';
 30 | 
 31 | // app.js - cognicity-reports-powertrack application setup
 32 | 
 33 | /**
 34 |  * @file Collect unconfirmed reports from Twitter via Gnip PowerTrack & send report verification tweets
 35 |  * @copyright (c) Tomas Holderness & SMART Infrastructure Facility January 2014
 36 |  * @license Released under GNU GPLv3 License (see LICENSE.txt).
 37 |  * @example
 38 |  * Usage:
 39 |  *     node daemon.js cognicity-reports-config.js start
 40 |  *     node daemon.js cognicity-reports-config.js status
 41 |  *     node daemon.js cognicity-reports-config.js stop
 42 |  */
 43 | 
 44 | // Node dependencies
 45 | var path = require('path');
 46 | 
 47 | // Modules
 48 | // ntwitter twitter interface module
 49 | var twitter = require('ntwitter');
 50 | // Postgres interface module
 51 | var pg = require('pg');
 52 | // Winston logger module
 53 | var logger = require('winston');
 54 | // Gnip PowerTrack interface module
 55 | var Gnip = require('gnip');
 56 | // CognicityReportsPowertrack interface module
 57 | var CognicityReportsPowertrack = require('./CognicityReportsPowertrack.js');
 58 | 
 59 | // Verify expected arguments
 60 | if (process.argv[2]) {
 61 | 	var config = require( __dirname + path.sep + process.argv[2] );
 62 | } else {
 63 | 	throw new Error('No config file. Usage: node app.js config.js');
 64 | }
 65 | 
 66 | // Logging configuration
 67 | var logPath = ( config.logger.logDirectory ? config.logger.logDirectory : __dirname );
 68 | logPath += path.sep;
 69 | logPath += config.logger.filename + ".log";
 70 | 
 71 | logger
 72 | 	// Configure custom File transport to write plain text messages
 73 | 	.add(logger.transports.File, {
 74 | 		filename: logPath, // Write to projectname.log
 75 | 		json: false, // Write in plain text, not JSON
 76 | 		maxsize: config.logger.maxFileSize, // Max size of each file
 77 | 		maxFiles: config.logger.maxFiles, // Max number of files
 78 | 		level: config.logger.level // Level of log messages
 79 | 	})
 80 | 	// Console transport is no use to us when running as a daemon
 81 | 	.remove(logger.transports.Console);
 82 | 
 83 | // FIXME This is a workaround for https://github.com/flatiron/winston/issues/228
 84 | // If we exit immediately winston does not get a chance to write the last log message.
 85 | // So we wait a short time before exiting.
 86 | function exitWithStatus(exitStatus) {
 87 | 	logger.info( "Exiting with status " + exitStatus );
 88 | 	setTimeout( function() {
 89 | 		process.exit(exitStatus);
 90 | 	}, 500 );
 91 | }
 92 | 
 93 | logger.info("Application starting...");
 94 | 
 95 | // Verify DB connection is up
 96 | pg.connect(config.pg.conString, function(err, client, done){
 97 | 	if (err){
 98 | 		logger.error("DB Connection error: " + err);
 99 | 		logger.error("Fatal error: Application shutting down");
100 | 		done();
101 | 		exitWithStatus(1);
102 | 	} else {
103 | 		logger.info("DB connection successful");
104 | 	}
105 | });
106 | 
107 | // Configure new instance of the ntwitter interface
108 | var twit = new twitter({
109 | 	consumer_key: config.twitter.consumer_key,
110 | 	consumer_secret: config.twitter.consumer_secret,
111 | 	access_token_key: config.twitter.access_token_key,
112 | 	access_token_secret: config.twitter.access_token_secret
113 | });
114 | 
115 | // Verify that the twitter connection was successful, fail if not
116 | twit.verifyCredentials(function (err, data) {
117 | 	if (err) {
118 | 		logger.error("twit.verifyCredentials: Error verifying credentials: " + err);
119 | 		logger.error("Fatal error: Application shutting down");
120 | 		exitWithStatus(1);
121 | 	} else {
122 | 		logger.info("twit.verifyCredentials: Twitter credentials succesfully verified");
123 | 	}
124 | });
125 | 
126 | // Construct new instance of the cognicity module,
127 | // passing in the configuration and pre-configured instances
128 | // of other modules
129 | var server = new CognicityReportsPowertrack(
130 | 	config,
131 | 	twit,
132 | 	pg,
133 | 	logger,
134 | 	Gnip
135 | );
136 | 
137 | // Handle postgres idle connection error (generated by RDS failover among other possible causes)
138 | pg.on('error', function(err) {
139 | 	logger.error('Postgres connection error: ' + err);
140 | 
141 | 	logger.info('Enabling caching mode and attempting to reconnect at intervals');
142 | 	server.enableCacheMode();
143 | 
144 | 	var reconnectionAttempts = 0;
145 | 	var reconnectionFunction = function() {
146 | 		// Try and reconnect
147 | 		pg.connect(config.pg.conString, function(err, client, done){
148 | 			if (err) {
149 | 				reconnectionAttempts++;
150 | 				if (reconnectionAttempts >= config.pg.reconnectionAttempts) {
151 | 					// We have tried the maximum number of times, tweet admin and exit in failure state
152 | 					logger.error( 'Postgres reconnection failed' );
153 | 					logger.error( 'Maximum reconnection attempts reached, exiting' );
154 | 					server.tweetAdmin( 'Postgres connection cannot be re-established, shutting down', function() {
155 | 						exitWithStatus(1);
156 | 					});
157 | 				} else {
158 | 					// If we failed, try and reconnect again after a delay
159 | 					logger.error( 'Postgres reconnection failed, queuing next attempt for ' + config.pg.reconnectionDelay + 'ms' );
160 | 					setTimeout( reconnectionFunction, config.pg.reconnectionDelay );
161 | 				}
162 | 			} else {
163 | 				// If we succeeded, disable harvester caching mode
164 | 				logger.info( 'Postgres reconnection succeeded, re-enabling real time processing' );
165 | 				server.disableCacheMode();
166 | 			}
167 | 		});
168 | 	};
169 | 
170 | 	reconnectionFunction();
171 | });
172 | 
173 | // Catch unhandled exceptions, log, and exit with error status
174 | process.on('uncaughtException', function (err) {
175 | 	logger.error('uncaughtException: ' + err.message + ", " + err.stack);
176 | 	logger.error("Fatal error: Application shutting down");
177 | 	server.tweetAdmin( 'Uncaught exception, shutting down', function() {
178 | 		exitWithStatus(1);
179 | 	});
180 | });
181 | 
182 | // Catch kill and interrupt signals and log a clean exit status
183 | process.on('SIGTERM', function() {
184 | 	logger.info('SIGTERM: Application shutting down');
185 | 	exitWithStatus(0);
186 | });
187 | process.on('SIGINT', function() {
188 | 	logger.info('SIGINT: Application shutting down');
189 | 	exitWithStatus(0);
190 | });
191 | 
192 | // Verify that messages to tweet are acceptable length
193 | if ( !server.areTweetMessageLengthsOk() ) {
194 | 	logger.error( "Tweet message lengths not ok, shutting down" );
195 | 	exitWithStatus(1);
196 | }
197 | 
198 | // Start up the twitter feed - connect the Gnip stream
199 | if ( config.gnip.stream ) server.connectStream();
200 | 
201 |
202 |
203 | 204 | 205 | 206 | 207 |
208 | 209 | 212 | 213 |
214 | 215 | 218 | 219 | 220 | 221 | 222 | 223 | -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/fonts/OpenSans-Bold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-reports-powertrack/fonts/OpenSans-Bold-webfont.eot -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/fonts/OpenSans-Bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-reports-powertrack/fonts/OpenSans-Bold-webfont.woff -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/fonts/OpenSans-BoldItalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-reports-powertrack/fonts/OpenSans-BoldItalic-webfont.eot -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/fonts/OpenSans-BoldItalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-reports-powertrack/fonts/OpenSans-BoldItalic-webfont.woff -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/fonts/OpenSans-Italic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-reports-powertrack/fonts/OpenSans-Italic-webfont.eot -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/fonts/OpenSans-Italic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-reports-powertrack/fonts/OpenSans-Italic-webfont.woff -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/fonts/OpenSans-Light-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-reports-powertrack/fonts/OpenSans-Light-webfont.eot -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/fonts/OpenSans-Light-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-reports-powertrack/fonts/OpenSans-Light-webfont.woff -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/fonts/OpenSans-LightItalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-reports-powertrack/fonts/OpenSans-LightItalic-webfont.eot -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/fonts/OpenSans-LightItalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-reports-powertrack/fonts/OpenSans-LightItalic-webfont.woff -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/fonts/OpenSans-Regular-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-reports-powertrack/fonts/OpenSans-Regular-webfont.eot -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/fonts/OpenSans-Regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-reports-powertrack/fonts/OpenSans-Regular-webfont.woff -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/global.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Global 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Global

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 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 |
80 | 81 | 82 | 83 | 84 |
85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 |

Type Definitions

102 | 103 | 104 | 105 | 106 | 107 | 108 |

DbQuerySuccess(result)

109 | 110 | 111 | 112 | 113 | 114 |
115 | DB query success callback 116 |
117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 |
Parameters:
127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 |
NameTypeDescription
result 155 | 156 | 157 | object 158 | 159 | 160 | 161 | The 'pg' module result object on a successful query
173 | 174 | 175 | 176 | 177 | 178 |
179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 |
Source:
206 |
209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 |
217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 |

GnipTweetActivity

236 | 237 | 238 | 239 | 240 |
241 | Gnip PowerTrack Tweet Activity object. 242 |
243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 |
251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 |
Source:
278 |
281 | 282 | 283 | 284 | 285 | 286 |
See:
287 |
288 | 291 |
292 | 293 | 294 | 295 |
296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 |
307 | 308 |
309 | 310 | 311 | 312 | 313 |
314 | 315 | 318 | 319 |
320 | 321 | 324 | 325 | 326 | 327 | 328 | -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Home 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Home

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |

cognicity-reports-powertrack 1.0.4

30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 |
54 | 55 |
56 | 57 |

58 | app.js 59 |

60 | 61 | 62 |
63 | 64 |
65 |
66 | 67 | 68 |
Collect unconfirmed reports from Twitter via Gnip PowerTrack & send report verification tweets
69 | 70 | 71 | 72 | 73 | 74 |
75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 |
License:
101 |
  • Released under GNU GPLv3 License (see LICENSE.txt).
102 | 103 | 104 | 105 | 106 | 107 |
Source:
108 |
111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 |
119 | 120 | 121 | 122 |

Example

123 | 124 |
Usage:
125 |     node daemon.js cognicity-reports-config.js start
126 |     node daemon.js cognicity-reports-config.js status
127 |     node daemon.js cognicity-reports-config.js stop
128 | 129 | 130 | 131 |
132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 |
151 | 152 |
153 | 154 | 155 | 156 | 157 |
158 | 159 | 162 | 163 |
164 | 165 | 168 | 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/sample-reports-config.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: sample-reports-config.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: sample-reports-config.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
'use strict';
 30 | 
 31 | // sample-config.js - sample configuration file for cognicity-reports module
 32 | 
 33 | /**
 34 |  * Configuration for cognicity-reports-powertrack
 35 |  * @namespace {object} config
 36 |  * @property {?string} adminTwitterUsernames Twitter usernames (without @, comma separated for multiples) to send a notification tweet on error conditions
 37 |  * @property {object} logger Configuration object for logging module
 38 |  * @property {string} logger.level Logging level - info, verbose or debug are most useful. Levels are (npm defaults): silly, debug, verbose, info, warn, error.
 39 |  * @property {number} logger.maxFileSize Max file size in bytes of each log file
 40 |  * @property {number} logger.maxFiles Max number of log files kept
 41 |  * @property {?string} logger.logDirectory Full path to directory for log files - if null, logs will be written to the application directory
 42 |  * @property {string} logger.filename Name of log file
 43 |  * @property {object} twitter Configuration object for Twitter interface
 44 |  * @property {string} twitter.usernameReplyBlacklist Twitter usernames (without @, comma separated for multiples) which will never be responded to as part of tweet processing
 45 |  * @property {string} twitter.consumer_key Take from the twitter dev admin interface
 46 |  * @property {string} twitter.consumer_secret Take from the twitter dev admin interface
 47 |  * @property {string} twitter.access_token_key Take from the twitter dev admin interface
 48 |  * @property {string} twitter.access_token_secret Take from the twitter dev admin interface
 49 |  * @property {string} twitter.defaultLanguage The default language code to use if we can't resolve one from the tweet
 50 |  * @property {object} twitter.invite_text Object of twitter message texts mapping a language code to a message
 51 |  * @property {string} twitter.invite_text.(name) Language code to resolve
 52 |  * @property {string} twitter.invite_text.(value) Message to be tweeted
 53 |  * @property {object} twitter.askforgeo_text Object of twitter message texts mapping a language code to a message
 54 |  * @property {string} twitter.askforgeo_text.(name) Language code to resolve
 55 |  * @property {string} twitter.askforgeo_text.(value) Message to be tweeted
 56 |  * @property {object} twitter.thanks_text Object of twitter message texts mapping a language code to a message
 57 |  * @property {string} twitter.thanks_text.(name) Language code to resolve
 58 |  * @property {string} twitter.thanks_text.(value) Message to be tweeted
 59 |  * @property {boolean} twitter.addTimestamp If true, append a timestamp to each sent tweet
 60 |  * @property {object} gnip Configuration object for Gnip PowerTrack interface
 61 |  * @property {boolean} gnip.stream If true, connect to the Gnip stream and process tweets
 62 |  * @property {number} gnip.streamTimeout Network timeout for Gnip stream connection, in milliseconds. Must be >30s as a keep-alive is sent at least every 30s. {@link http://support.gnip.com/apis/consuming_streaming_data.html#keepalive_signals}
 63 |  * @property {string} gnip.username Username for Gnip PowerTrack
 64 |  * @property {string} gnip.password Password for Gnip PowerTrack
 65 |  * @property {string} gnip.streamUrl URL for Gnip PowerTrack stream, take from the PowerTrack admin interface. Append '?client=1' to use backfill. {@link http://support.gnip.com/apis/consuming_streaming_data.html#Backfill}
 66 |  * @property {string} gnip.rulesUrl URL for the Gnip PowerTrack rules interface, take from the PowerTrack admin interface.
 67 |  * @property {object} gnip.rules Object of Gnip rules mapping rule names to rule text
 68 |  * @property {string} gnip.rules.(name) Rule name
 69 |  * @property {string} gnip.rules.(value) Rule text
 70 |  * @property {number} gnip.maxReconnectTimeout Maximum reconnection delay in milliseconds. Exponential backoff strategy is used starting at 1000 and will stop growing at this value.
 71 |  * @property {object} pg Configuration object for PostGres interface
 72 |  * @property {string} pg.conString PostGres connection string
 73 |  * @property {string} pg.table_tweets Database table name for tweets
 74 |  * @property {string} pg.table_users Database table name for user information
 75 |  * @property {string} pg.table_invitees Database table name for users who have been tweeted
 76 |  * @property {string} pg.table_unconfirmed Database table name for unconfirmed reports
 77 |  * @property {string} pg.table_nonspatial_users Database table name for users who have had a non-spatial report received
 78 |  * @property {string} pg.table_nonspatial_tweet_reports Database table name for nonspatial tweets
 79 |  * @property {string} pg.table_all_users Database table name for user hashes
 80 |  * @property {number} pg.reconnectionDelay Delay before attempting a reconnection in ms
 81 |  * @property {number} pg.reconnectionAttempts Number of times to attempt reconnection before notifying admin and exiting
 82 |  */
 83 | var config = {};
 84 | 
 85 | // Notification settings
 86 | config.adminTwitterUsernames = null; // Enter twitter usernames here (without @, comma separated for multiples) to send a notification tweet on error conditions
 87 | 
 88 | // Logging configuration
 89 | config.logger = {};
 90 | config.logger.level = "info"; // What level to log at; info, verbose or debug are most useful. Levels are (npm defaults): silly, debug, verbose, info, warn, error.
 91 | config.logger.maxFileSize = 1024 * 1024 * 100; // Max file size in bytes of each log file; default 100MB
 92 | config.logger.maxFiles = 10; // Max number of log files kept
 93 | config.logger.logDirectory = null; // Set this to a full path to a directory - if not set logs will be written to the application directory.
 94 | config.logger.filename = 'cognicity-reports-powertrack'; // base filename to use
 95 | 
 96 | // Twitter app authentication details
 97 | config.twitter = {};
 98 | config.twitter.usernameReplyBlacklist = ''; // Twitter usernames (without @, comma separated for multiples) which will never be sent to in response to tweet processing
 99 | config.twitter.consumer_key = ''; // Take from the twitter dev admin interface
100 | config.twitter.consumer_secret = ''; // Take from the twitter dev admin interface
101 | config.twitter.access_token_key = ''; // Take from the twitter dev admin interface
102 | config.twitter.access_token_secret = ''; // Take from the twitter dev admin interface
103 | 
104 | // Twitter parameters
105 | config.twitter.send_enabled = false; // Enable sending of tweets?
106 | 
107 | // Twitter message texts
108 | // Note we use IN and ID because twitter and Gnip return different language codes for Indonesian
109 | // The messages should be no longer than 109 characters if timestamps are enabled, or 123 characters if timestamps are disabled
110 | config.twitter.defaultLanguage = 'en'; // The default language code to use if we can't resolve one from the tweet
111 | // Message codes. The name of the object (config.twitter.foo) is the name of the message type, that object should contain key value pairs
112 | // where the key is the language code to resolve and the value is the message as a string.
113 | // Note we have both ID and IN for indonesian
114 | config.twitter.invite_text = {
115 | 	'in' : 'Invite/Verification Tweet Text [IN]',
116 | 	'id' : 'Invite/Verification Tweet Text [ID]',
117 | 	'en' : 'Invite/Verification Tweet Text [EN]'
118 | };
119 | config.twitter.askforgeo_text = {
120 | 	'in' : 'Location-enabled reminder Tweet Text [IN]',
121 | 	'id' : 'Location-enabled reminder Tweet Text [ID]',
122 | 	'en' : 'Location-enabled reminder Tweet Text [EN]'
123 | };
124 | config.twitter.thanks_text = {
125 | 	'in' : 'Thank-you Tweet Text [IN]',
126 | 	'id' : 'Thank-you Tweet Text [ID]',
127 | 	'en' : 'Thank-you Tweet Text [EN]'
128 | };
129 | // Append a timestamp to each sent tweet
130 | config.twitter.addTimestamp = true;
131 | 
132 | //Gnip Powertrack API
133 | config.gnip = {};
134 | config.gnip.stream = true; // Connect to stream and log reports?
135 | config.gnip.streamTimeout = 1000 * 60; // In milliseconds. Must be >30s as a keep-alive is sent at least every 30s
136 | config.gnip.username = 'username'; // Gnip username
137 | config.gnip.password = 'password'; // Gnip password
138 | config.gnip.streamUrl = 'https://stream.gnip.com:443/accounts/ACCOUNT_NAME/publishers/twitter/streams/track/prod.json?client=1'; // Gnip stream URL, take from the Gnip admin interface. Append ?client=1 to use backfill
139 | config.gnip.rulesUrl = 'https://api.gnip.com:443/accounts/ACCOUNT_NAME/publishers/twitter/streams/track/prod/rules.json'; // Gnip rules URL, take from the Gnip admin interface.
140 | // Gnip rules, enter as an object where the key is the rule name and the value is the rule as a string
141 | config.gnip.rules = {
142 |     "boundingbox":"( contains:flood OR contains:banjir ) ( bounding_box:[106.5894 -6.4354 106.799999999 -6.2] OR bounding_box:[106.8 -6.4354 107.0782 -6.2] OR bounding_box:[106.5894 -6.199999999 106.799999999 -5.9029] OR bounding_box:[106.8 -6.199999999 107.0782 -5.9029] )",
143 |     "addressed":"( contains:flood OR contains:banjir ) @petajkt",
144 |     "location":"( contains:flood OR contains:banjir ) ( bio_location_contains:jakarta OR place_contains:jakarta OR profile_bounding_box:[106.5894 -6.4354 106.799999999 -6.2] OR profile_bounding_box:[106.8 -6.4354 107.0782 -6.2] OR profile_bounding_box:[106.5894 -6.199999999 106.799999999 -5.9029] OR profile_bounding_box:[106.8 -6.199999999 107.0782 -5.9029] )"
145 | };
146 | config.gnip.maxReconnectTimeout = 1000 * 60 * 5; // In milliseconds; 5 minutes for max reconnection timeout - will mean ~10 minutes from first disconnection
147 | 
148 | // Postgres database connection
149 | config.pg = {};
150 | config.pg.conString = "postgres://postgres:password@localhost:5432/cognicity";
151 | // Database tables
152 | config.pg.table_tweets = 'tweet_reports';
153 | config.pg.table_users = 'tweet_users';
154 | config.pg.table_invitees = 'tweet_invitees';
155 | config.pg.table_unconfirmed = 'tweet_reports_unconfirmed';
156 | config.pg.table_nonspatial_users = 'nonspatial_tweet_users';
157 | config.pg.table_nonspatial_tweet_reports = 'nonspatial_tweet_reports';
158 | config.pg.table_all_users = 'all_users';
159 | // Database reconnection settings
160 | config.pg.reconnectionDelay = 1000 * 60 * 3; // Delay before attempting a reconnection in ms
161 | config.pg.reconnectionAttempts = 5; // Number of times to attempt reconnection before notifying admin and exiting
162 | 
163 | module.exports = config;
164 | 
165 |
166 |
167 | 168 | 169 | 170 | 171 |
172 | 173 | 176 | 177 |
178 | 179 | 182 | 183 | 184 | 185 | 186 | 187 | -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/scripts/linenumber.js: -------------------------------------------------------------------------------- 1 | /*global document */ 2 | (function() { 3 | var source = document.getElementsByClassName('prettyprint source linenums'); 4 | var i = 0; 5 | var lineNumber = 0; 6 | var lineId; 7 | var lines; 8 | var totalLines; 9 | var anchorHash; 10 | 11 | if (source && source[0]) { 12 | anchorHash = document.location.hash.substring(1); 13 | lines = source[0].getElementsByTagName('li'); 14 | totalLines = lines.length; 15 | 16 | for (; i < totalLines; i++) { 17 | lineNumber++; 18 | lineId = 'line' + lineNumber; 19 | lines[i].id = lineId; 20 | if (lineId === anchorHash) { 21 | lines[i].className += ' selected'; 22 | } 23 | } 24 | } 25 | })(); 26 | -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/scripts/prettify/Apache-License-2.0.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/scripts/prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", 2 | /^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); 3 | -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/scripts/prettify/prettify.js: -------------------------------------------------------------------------------- 1 | var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= 3 | [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), 9 | l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, 11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, 12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), 13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} 14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ 21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), 22 | ["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", 23 | /^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), 24 | ["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", 25 | hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= 26 | !k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p p:first-child 338 | { 339 | margin-top: 0; 340 | padding-top: 0; 341 | } 342 | 343 | .params td.description > p:last-child 344 | { 345 | margin-bottom: 0; 346 | padding-bottom: 0; 347 | } 348 | 349 | .disabled { 350 | color: #454545; 351 | } 352 | -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/styles/prettify-jsdoc.css: -------------------------------------------------------------------------------- 1 | /* JSDoc prettify.js theme */ 2 | 3 | /* plain text */ 4 | .pln { 5 | color: #000000; 6 | font-weight: normal; 7 | font-style: normal; 8 | } 9 | 10 | /* string content */ 11 | .str { 12 | color: #006400; 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | 17 | /* a keyword */ 18 | .kwd { 19 | color: #000000; 20 | font-weight: bold; 21 | font-style: normal; 22 | } 23 | 24 | /* a comment */ 25 | .com { 26 | font-weight: normal; 27 | font-style: italic; 28 | } 29 | 30 | /* a type name */ 31 | .typ { 32 | color: #000000; 33 | font-weight: normal; 34 | font-style: normal; 35 | } 36 | 37 | /* a literal value */ 38 | .lit { 39 | color: #006400; 40 | font-weight: normal; 41 | font-style: normal; 42 | } 43 | 44 | /* punctuation */ 45 | .pun { 46 | color: #000000; 47 | font-weight: bold; 48 | font-style: normal; 49 | } 50 | 51 | /* lisp open bracket */ 52 | .opn { 53 | color: #000000; 54 | font-weight: bold; 55 | font-style: normal; 56 | } 57 | 58 | /* lisp close bracket */ 59 | .clo { 60 | color: #000000; 61 | font-weight: bold; 62 | font-style: normal; 63 | } 64 | 65 | /* a markup tag name */ 66 | .tag { 67 | color: #006400; 68 | font-weight: normal; 69 | font-style: normal; 70 | } 71 | 72 | /* a markup attribute name */ 73 | .atn { 74 | color: #006400; 75 | font-weight: normal; 76 | font-style: normal; 77 | } 78 | 79 | /* a markup attribute value */ 80 | .atv { 81 | color: #006400; 82 | font-weight: normal; 83 | font-style: normal; 84 | } 85 | 86 | /* a declaration */ 87 | .dec { 88 | color: #000000; 89 | font-weight: bold; 90 | font-style: normal; 91 | } 92 | 93 | /* a variable name */ 94 | .var { 95 | color: #000000; 96 | font-weight: normal; 97 | font-style: normal; 98 | } 99 | 100 | /* a function name */ 101 | .fun { 102 | color: #000000; 103 | font-weight: bold; 104 | font-style: normal; 105 | } 106 | 107 | /* Specify class=linenums on a pre to get line numbering */ 108 | ol.linenums { 109 | margin-top: 0; 110 | margin-bottom: 0; 111 | } 112 | -------------------------------------------------------------------------------- /api-docs/cognicity-reports-powertrack/styles/prettify-tomorrow.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Theme */ 2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 3 | /* Pretty printing styles. Used with prettify.js. */ 4 | /* SPAN elements with the classes below are added by prettyprint. */ 5 | /* plain text */ 6 | .pln { 7 | color: #4d4d4c; } 8 | 9 | @media screen { 10 | /* string content */ 11 | .str { 12 | color: #718c00; } 13 | 14 | /* a keyword */ 15 | .kwd { 16 | color: #8959a8; } 17 | 18 | /* a comment */ 19 | .com { 20 | color: #8e908c; } 21 | 22 | /* a type name */ 23 | .typ { 24 | color: #4271ae; } 25 | 26 | /* a literal value */ 27 | .lit { 28 | color: #f5871f; } 29 | 30 | /* punctuation */ 31 | .pun { 32 | color: #4d4d4c; } 33 | 34 | /* lisp open bracket */ 35 | .opn { 36 | color: #4d4d4c; } 37 | 38 | /* lisp close bracket */ 39 | .clo { 40 | color: #4d4d4c; } 41 | 42 | /* a markup tag name */ 43 | .tag { 44 | color: #c82829; } 45 | 46 | /* a markup attribute name */ 47 | .atn { 48 | color: #f5871f; } 49 | 50 | /* a markup attribute value */ 51 | .atv { 52 | color: #3e999f; } 53 | 54 | /* a declaration */ 55 | .dec { 56 | color: #f5871f; } 57 | 58 | /* a variable name */ 59 | .var { 60 | color: #c82829; } 61 | 62 | /* a function name */ 63 | .fun { 64 | color: #4271ae; } } 65 | /* Use higher contrast and text-weight for printable form. */ 66 | @media print, projection { 67 | .str { 68 | color: #060; } 69 | 70 | .kwd { 71 | color: #006; 72 | font-weight: bold; } 73 | 74 | .com { 75 | color: #600; 76 | font-style: italic; } 77 | 78 | .typ { 79 | color: #404; 80 | font-weight: bold; } 81 | 82 | .lit { 83 | color: #044; } 84 | 85 | .pun, .opn, .clo { 86 | color: #440; } 87 | 88 | .tag { 89 | color: #006; 90 | font-weight: bold; } 91 | 92 | .atn { 93 | color: #404; } 94 | 95 | .atv { 96 | color: #060; } } 97 | /* Style */ 98 | /* 99 | pre.prettyprint { 100 | background: white; 101 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 102 | font-size: 12px; 103 | line-height: 1.5; 104 | border: 1px solid #ccc; 105 | padding: 10px; } 106 | */ 107 | 108 | /* Specify class=linenums on a pre to get line numbering */ 109 | ol.linenums { 110 | margin-top: 0; 111 | margin-bottom: 0; } 112 | 113 | /* IE indents via margin-left */ 114 | li.L0, 115 | li.L1, 116 | li.L2, 117 | li.L3, 118 | li.L4, 119 | li.L5, 120 | li.L6, 121 | li.L7, 122 | li.L8, 123 | li.L9 { 124 | /* */ } 125 | 126 | /* Alternate shading for lines */ 127 | li.L1, 128 | li.L3, 129 | li.L5, 130 | li.L7, 131 | li.L9 { 132 | /* */ } 133 | -------------------------------------------------------------------------------- /api-docs/cognicity-server/Validation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Class: Validation 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Class: Validation

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 |

32 | Validation 33 |

34 | 35 | 36 |
37 | 38 |
39 |
40 | 41 | 42 |
43 | 44 | 45 |

Constructor

46 | 47 | 48 |

new Validation()

49 | 50 | 51 | 52 |
53 |
54 | 55 | 56 |
57 | Validation routines used by our Express server to validate user input 58 |
59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 |
73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 |
Source:
100 |
103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 |
111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 |
127 | 128 | 129 |
130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 |

Methods

145 | 146 |
147 | 148 |
149 | 150 | 151 | 152 |

validateNumberParameter(param, minopt, maxopt)

153 | 154 | 155 | 156 |
157 |
158 | 159 | 160 |
161 | Validate a parameter which should be a number, optionally with min and max values. 162 |
163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 |
Parameters:
173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 210 | 211 | 212 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 241 | 242 | 243 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 274 | 275 | 276 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 |
NameTypeAttributesDescription
param 203 | 204 | 205 | number 206 | 207 | 208 | 209 | 213 | 214 | 215 | 216 | 217 | 218 | Parameter to validate
min 234 | 235 | 236 | number 237 | 238 | 239 | 240 | 244 | 245 | <optional>
246 | 247 | 248 | 249 | 250 | 251 |
Minimum value parameter can have and be valid
max 267 | 268 | 269 | number 270 | 271 | 272 | 273 | 277 | 278 | <optional>
279 | 280 | 281 | 282 | 283 | 284 |
Maximum value parameter can have and be valid
295 | 296 | 297 | 298 | 299 | 300 |
301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 |
Source:
328 |
331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 |
339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 |
355 | 356 |
357 | 358 | 359 | 360 | 361 | 362 |
363 | 364 |
365 | 366 | 367 | 368 | 369 |
370 | 371 | 374 | 375 |
376 | 377 |
378 | Documentation generated by JSDoc 3.3.0-alpha11 on Tue Sep 29 2015 09:30:14 GMT+1000 (AEST) 379 |
380 | 381 | 382 | 383 | 384 | -------------------------------------------------------------------------------- /api-docs/cognicity-server/Validation.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: Validation.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: Validation.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
'use strict';
30 | 
31 | /**
32 |  * Validation routines used by our Express server to validate user input
33 |  * @constructor
34 |  */
35 | var Validation = function(){};
36 | 
37 | Validation.prototype = {
38 | 	
39 | 	/**
40 | 	 * Validate a parameter which should be a number, optionally with min and max values.
41 | 	 * @param {number} param Parameter to validate
42 | 	 * @param {number=} min Minimum value parameter can have and be valid
43 | 	 * @param {number=} max Maximum value parameter can have and be valid
44 | 	 */
45 | 	validateNumberParameter: function(param, min, max) {
46 | 		var valid = true;
47 | 		if ( typeof param !== 'number' ) valid = false;
48 | 		if ( isNaN(param) ) valid = false;
49 | 		if ( min && param < min ) valid = false;
50 | 		if ( max && param > max ) valid = false;
51 | 		return valid;
52 | 	}
53 | 		
54 | };
55 | 
56 | module.exports = new Validation();
57 |
58 |
59 | 60 | 61 | 62 | 63 |
64 | 65 | 68 | 69 |
70 | 71 |
72 | Documentation generated by JSDoc 3.3.0-alpha11 on Tue Sep 29 2015 09:30:14 GMT+1000 (AEST) 73 |
74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /api-docs/cognicity-server/config.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: config.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: config.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
'use strict';
 30 | 
 31 | // config.js - Configuration for cognicity-server
 32 | 
 33 | /**
 34 |  * Cognicity server configuration object.
 35 |  * @namespace {object} config
 36 |  * @property {string} instance The name of this instance of the cognicity server
 37 |  * @property {string} public_dir Path to root of files to serve
 38 |  * @property {string} robots Path to robots.txt to server under at '/robots.txt'
 39 |  * @property {string} url_prefix Prefix for start of public URLs
 40 |  * @property {string} root_redirect If the user browses to '/', redirect them to here
 41 |  * @property {number} cache_timeout How long data will live in the cache, in milliseconds
 42 |  * @property {boolean} data If true, enable the data query routes
 43 |  * @property {boolean} aggregates If true, enable the aggregate query routes
 44 |  * @property {boolean} compression If true, enable gzip compression on the server responses
 45 |  * @property {object} api Configuration options for the API
 46 |  * @property {object} api.aggregates Configuration options for the aggregates
 47 |  * @property {object} api.aggregates.archive Configuration options for the archive aggregates
 48 |  * @property {string} api.aggregates.archive.level Polygon level to bucket response data in an archive aggregate query
 49 |  * @property {object} pg Configuration options for the PostGres connection
 50 |  * @property {string} pg.conString The connection URL for PostGres
 51 |  * @property {number} pg.reconnectionDelay The delay between attempts to reconnect to PostGres
 52 |  * @property {number} pg.reconnectionAttempts The number of attempts to reconnect to PostGres before exiting
 53 |  * @property {string} pg.tbl_reports Database table containing confirmed reports
 54 |  * @property {string} pg.tbl_reports_unconfirmed Database table containing unconfirmed reports
 55 |  * @property {object} pg.aggregate_levels Object of aggregate levels mapping a name to a database table
 56 |  * @property {string} pg.aggregate_levels.(name) Name of the aggregate level
 57 |  * @property {string} pg.aggregate_levels.(value) Database table for the aggregate level
 58 |  * @property {object} pg.infrastructure_tbls Object of infrastructure tables mapping a name to a database table
 59 |  * @property {string} pg.infrastructure_tbls.(name) Name of the infrastructure type
 60 |  * @property {string} pg.infrastructure_tbls.(value) Database table for the infrastructure type
 61 |  * @property {?number} pg.limit Limit of number of confirmed reports to return in data query
 62 |  * @property {?number} pg.uc_limit Limit of number of unconfirmed reports to return in data query
 63 |  * @property {object} logger Configuration options for logging
 64 |  * @property {string} logger.level Log level - info, verbose or debug are most useful. Levels are (npm defaults): silly, debug, verbose, info, warn, error.
 65 |  * @property {number} logger.maxFileSize Maximum size of each log file in bytes
 66 |  * @property {number} logger.maxFiles Maximum number of log files to keep
 67 |  * @property {?number} logger.logDirectory Full path to directory to store log files in, if not set logs will be written to the application directory
 68 |  * @property {number} port Port to launch server on
 69 |  */
 70 | var config = {};
 71 | 
 72 | // Instance name - default name for this configuration (will be server process name)
 73 | config.instance = 'cognicity-server';
 74 | 
 75 | // Location of HTML files to serve
 76 | config.public_dir = __dirname+'/petajakarta-web/build/banjir';
 77 | 
 78 | // Location of robots.txt file to server at root level
 79 | config.robots = __dirname+'/petajakarta-web/build/robots.txt';
 80 | 
 81 | // Optional URL prefix - e.g. http://localhost/project-name/
 82 | config.url_prefix = 'banjir';
 83 | 
 84 | // Optional redirect path for root ['/] requests
 85 | config.root_redirect = 'banjir/in';
 86 | 
 87 | // Default cache time expiry
 88 | config.cache_timeout = 60000; // Data cache expiry (1 minute)
 89 | 
 90 | config.data = true; // Enable data routes
 91 | config.aggregates = true; // Enable aggregate data outputs
 92 | config.compression = false; // Enable express compression middleware
 93 | 
 94 | // API settings
 95 | config.api = {};
 96 | config.api.aggregates = {};
 97 | config.api.aggregates.archive = {};
 98 | config.api.aggregates.archive.level = 'rw';
 99 | 
100 | // Postgres database connection
101 | config.pg = {};
102 | // Sample connection string using environment variables, e.g. from AWS Elastic Beanstalk.
103 | // Substitute variable names for constants in other environments.
104 | config.pg.conString = 'postgres://' + process.env.RDS_USERNAME + ':' + process.env.RDS_PASSWORD +'@' + process.env.RDS_HOSTNAME + ':' + process.env.RDS_PORT + '/' + process.env.DB_NAME;
105 | // Database reconnection settings
106 | config.pg.reconnectionDelay = 1000 * 60 * 3; // Delay before attempting a reconnection in ms
107 | config.pg.reconnectionAttempts = 5; // Number of times to attempt reconnection before notifying admin and exiting
108 | // Database tables
109 | config.pg.tbl_reports = 'tweet_reports';
110 | config.pg.tbl_reports_unconfirmed = 'tweet_reports_unconfirmed';
111 | 
112 | // Optional support for report aggregation, required if config.data.aggregates set to true.
113 | config.pg.aggregate_levels = {
114 | 	'city':'jkt_city_boundary',
115 | 	'subdistrict':'jkt_subdistrict_boundary',
116 | 	'village':'jkt_village_boundary',
117 | 	'rw':'jkt_rw_boundary'
118 | };
119 | config.pg.infrastructure_tbls = {
120 | 	'waterways':'waterways',
121 | 	'pumps':'pumps',
122 | 	'floodgates':'floodgates'
123 | };
124 | config.pg.limit = null; // Limit number of rows returned in a query
125 | config.pg.uc_limit = null; // Limit number of unconfirmed reports.
126 | 
127 | // Logging configuration
128 | config.logger = {};
129 | config.logger.level = "debug"; // What level to log at; info, verbose or debug are most useful. Levels are (npm defaults): silly, debug, verbose, info, warn, error.
130 | config.logger.maxFileSize = 1024 * 1024 * 100; // Max file size in bytes of each log file; default 100MB
131 | config.logger.maxFiles = 10; // Max number of log files kept
132 | config.logger.logDirectory = '/var/log/nodejs'; // Set this to a full path to a directory - if not set logs will be written to the application directory.
133 | 
134 | // Server port
135 | config.port = process.env.PORT || 8081;
136 | 
137 | module.exports = config;
138 | 
139 |
140 |
141 | 142 | 143 | 144 | 145 |
146 | 147 | 150 | 151 |
152 | 153 |
154 | Documentation generated by JSDoc 3.3.0-alpha11 on Tue Sep 29 2015 09:30:14 GMT+1000 (AEST) 155 |
156 | 157 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /api-docs/cognicity-server/fonts/OpenSans-Bold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-server/fonts/OpenSans-Bold-webfont.eot -------------------------------------------------------------------------------- /api-docs/cognicity-server/fonts/OpenSans-Bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-server/fonts/OpenSans-Bold-webfont.woff -------------------------------------------------------------------------------- /api-docs/cognicity-server/fonts/OpenSans-BoldItalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-server/fonts/OpenSans-BoldItalic-webfont.eot -------------------------------------------------------------------------------- /api-docs/cognicity-server/fonts/OpenSans-BoldItalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-server/fonts/OpenSans-BoldItalic-webfont.woff -------------------------------------------------------------------------------- /api-docs/cognicity-server/fonts/OpenSans-Italic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-server/fonts/OpenSans-Italic-webfont.eot -------------------------------------------------------------------------------- /api-docs/cognicity-server/fonts/OpenSans-Italic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-server/fonts/OpenSans-Italic-webfont.woff -------------------------------------------------------------------------------- /api-docs/cognicity-server/fonts/OpenSans-Light-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-server/fonts/OpenSans-Light-webfont.eot -------------------------------------------------------------------------------- /api-docs/cognicity-server/fonts/OpenSans-Light-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-server/fonts/OpenSans-Light-webfont.woff -------------------------------------------------------------------------------- /api-docs/cognicity-server/fonts/OpenSans-LightItalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-server/fonts/OpenSans-LightItalic-webfont.eot -------------------------------------------------------------------------------- /api-docs/cognicity-server/fonts/OpenSans-LightItalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-server/fonts/OpenSans-LightItalic-webfont.woff -------------------------------------------------------------------------------- /api-docs/cognicity-server/fonts/OpenSans-Regular-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-server/fonts/OpenSans-Regular-webfont.eot -------------------------------------------------------------------------------- /api-docs/cognicity-server/fonts/OpenSans-Regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/cognicity-server/fonts/OpenSans-Regular-webfont.woff -------------------------------------------------------------------------------- /api-docs/cognicity-server/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Home 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Home

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |

cognicity-server 1.0.4

30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 |
54 | 55 |
56 | 57 |

58 | server.js 59 |

60 | 61 | 62 |
63 | 64 |
65 |
66 | 67 | 68 |
REST service querying cognicity database and responding with JSON data
69 | 70 | 71 | 72 | 73 | 74 |
75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 |
License:
101 |
  • Released under GNU GPLv3 License (see LICENSE.txt).
102 | 103 | 104 | 105 | 106 | 107 |
Source:
108 |
111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 |
119 | 120 | 121 | 122 |

Example

123 | 124 |
Usage:
125 |     node server.js config.js
126 | 127 | 128 | 129 |
130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 |
149 | 150 |
151 | 152 | 153 | 154 | 155 |
156 | 157 | 160 | 161 |
162 | 163 |
164 | Documentation generated by JSDoc 3.3.0-alpha11 on Tue Sep 29 2015 09:30:14 GMT+1000 (AEST) 165 |
166 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /api-docs/cognicity-server/scripts/linenumber.js: -------------------------------------------------------------------------------- 1 | /*global document */ 2 | (function() { 3 | var source = document.getElementsByClassName('prettyprint source linenums'); 4 | var i = 0; 5 | var lineNumber = 0; 6 | var lineId; 7 | var lines; 8 | var totalLines; 9 | var anchorHash; 10 | 11 | if (source && source[0]) { 12 | anchorHash = document.location.hash.substring(1); 13 | lines = source[0].getElementsByTagName('li'); 14 | totalLines = lines.length; 15 | 16 | for (; i < totalLines; i++) { 17 | lineNumber++; 18 | lineId = 'line' + lineNumber; 19 | lines[i].id = lineId; 20 | if (lineId === anchorHash) { 21 | lines[i].className += ' selected'; 22 | } 23 | } 24 | } 25 | })(); 26 | -------------------------------------------------------------------------------- /api-docs/cognicity-server/scripts/prettify/Apache-License-2.0.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /api-docs/cognicity-server/scripts/prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", 2 | /^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); 3 | -------------------------------------------------------------------------------- /api-docs/cognicity-server/scripts/prettify/prettify.js: -------------------------------------------------------------------------------- 1 | var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= 3 | [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), 9 | l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, 11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, 12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), 13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} 14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ 21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), 22 | ["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", 23 | /^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), 24 | ["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", 25 | hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= 26 | !k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p p:first-child 337 | { 338 | margin-top: 0; 339 | padding-top: 0; 340 | } 341 | 342 | .params td.description > p:last-child 343 | { 344 | margin-bottom: 0; 345 | padding-bottom: 0; 346 | } 347 | 348 | .disabled { 349 | color: #454545; 350 | } 351 | -------------------------------------------------------------------------------- /api-docs/cognicity-server/styles/prettify-jsdoc.css: -------------------------------------------------------------------------------- 1 | /* JSDoc prettify.js theme */ 2 | 3 | /* plain text */ 4 | .pln { 5 | color: #000000; 6 | font-weight: normal; 7 | font-style: normal; 8 | } 9 | 10 | /* string content */ 11 | .str { 12 | color: #006400; 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | 17 | /* a keyword */ 18 | .kwd { 19 | color: #000000; 20 | font-weight: bold; 21 | font-style: normal; 22 | } 23 | 24 | /* a comment */ 25 | .com { 26 | font-weight: normal; 27 | font-style: italic; 28 | } 29 | 30 | /* a type name */ 31 | .typ { 32 | color: #000000; 33 | font-weight: normal; 34 | font-style: normal; 35 | } 36 | 37 | /* a literal value */ 38 | .lit { 39 | color: #006400; 40 | font-weight: normal; 41 | font-style: normal; 42 | } 43 | 44 | /* punctuation */ 45 | .pun { 46 | color: #000000; 47 | font-weight: bold; 48 | font-style: normal; 49 | } 50 | 51 | /* lisp open bracket */ 52 | .opn { 53 | color: #000000; 54 | font-weight: bold; 55 | font-style: normal; 56 | } 57 | 58 | /* lisp close bracket */ 59 | .clo { 60 | color: #000000; 61 | font-weight: bold; 62 | font-style: normal; 63 | } 64 | 65 | /* a markup tag name */ 66 | .tag { 67 | color: #006400; 68 | font-weight: normal; 69 | font-style: normal; 70 | } 71 | 72 | /* a markup attribute name */ 73 | .atn { 74 | color: #006400; 75 | font-weight: normal; 76 | font-style: normal; 77 | } 78 | 79 | /* a markup attribute value */ 80 | .atv { 81 | color: #006400; 82 | font-weight: normal; 83 | font-style: normal; 84 | } 85 | 86 | /* a declaration */ 87 | .dec { 88 | color: #000000; 89 | font-weight: bold; 90 | font-style: normal; 91 | } 92 | 93 | /* a variable name */ 94 | .var { 95 | color: #000000; 96 | font-weight: normal; 97 | font-style: normal; 98 | } 99 | 100 | /* a function name */ 101 | .fun { 102 | color: #000000; 103 | font-weight: bold; 104 | font-style: normal; 105 | } 106 | 107 | /* Specify class=linenums on a pre to get line numbering */ 108 | ol.linenums { 109 | margin-top: 0; 110 | margin-bottom: 0; 111 | } 112 | -------------------------------------------------------------------------------- /api-docs/cognicity-server/styles/prettify-tomorrow.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Theme */ 2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 3 | /* Pretty printing styles. Used with prettify.js. */ 4 | /* SPAN elements with the classes below are added by prettyprint. */ 5 | /* plain text */ 6 | .pln { 7 | color: #4d4d4c; } 8 | 9 | @media screen { 10 | /* string content */ 11 | .str { 12 | color: #718c00; } 13 | 14 | /* a keyword */ 15 | .kwd { 16 | color: #8959a8; } 17 | 18 | /* a comment */ 19 | .com { 20 | color: #8e908c; } 21 | 22 | /* a type name */ 23 | .typ { 24 | color: #4271ae; } 25 | 26 | /* a literal value */ 27 | .lit { 28 | color: #f5871f; } 29 | 30 | /* punctuation */ 31 | .pun { 32 | color: #4d4d4c; } 33 | 34 | /* lisp open bracket */ 35 | .opn { 36 | color: #4d4d4c; } 37 | 38 | /* lisp close bracket */ 39 | .clo { 40 | color: #4d4d4c; } 41 | 42 | /* a markup tag name */ 43 | .tag { 44 | color: #c82829; } 45 | 46 | /* a markup attribute name */ 47 | .atn { 48 | color: #f5871f; } 49 | 50 | /* a markup attribute value */ 51 | .atv { 52 | color: #3e999f; } 53 | 54 | /* a declaration */ 55 | .dec { 56 | color: #f5871f; } 57 | 58 | /* a variable name */ 59 | .var { 60 | color: #c82829; } 61 | 62 | /* a function name */ 63 | .fun { 64 | color: #4271ae; } } 65 | /* Use higher contrast and text-weight for printable form. */ 66 | @media print, projection { 67 | .str { 68 | color: #060; } 69 | 70 | .kwd { 71 | color: #006; 72 | font-weight: bold; } 73 | 74 | .com { 75 | color: #600; 76 | font-style: italic; } 77 | 78 | .typ { 79 | color: #404; 80 | font-weight: bold; } 81 | 82 | .lit { 83 | color: #044; } 84 | 85 | .pun, .opn, .clo { 86 | color: #440; } 87 | 88 | .tag { 89 | color: #006; 90 | font-weight: bold; } 91 | 92 | .atn { 93 | color: #404; } 94 | 95 | .atv { 96 | color: #060; } } 97 | /* Style */ 98 | /* 99 | pre.prettyprint { 100 | background: white; 101 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 102 | font-size: 12px; 103 | line-height: 1.5; 104 | border: 1px solid #ccc; 105 | padding: 10px; } 106 | */ 107 | 108 | /* Specify class=linenums on a pre to get line numbering */ 109 | ol.linenums { 110 | margin-top: 0; 111 | margin-bottom: 0; } 112 | 113 | /* IE indents via margin-left */ 114 | li.L0, 115 | li.L1, 116 | li.L2, 117 | li.L3, 118 | li.L4, 119 | li.L5, 120 | li.L6, 121 | li.L7, 122 | li.L8, 123 | li.L9 { 124 | /* */ } 125 | 126 | /* Alternate shading for lines */ 127 | li.L1, 128 | li.L3, 129 | li.L5, 130 | li.L7, 131 | li.L9 { 132 | /* */ } 133 | -------------------------------------------------------------------------------- /api-docs/petajakarta-web/analytics.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: analytics.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: analytics.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
//analytics.js - JavaScript for PetaJakarta web map
 30 | 
 31 | /**
 32 | *@file JavaScript to display analytics from cognicity server (PetaJakarta.org)
 33 | *@copyright (c) Tomas Holderness & SMART Infrastructure Facility January 2014
 34 | *@module analytics
 35 | */
 36 | 
 37 | /**
 38 | 	Transforms a number into a formatted, comma separated string. e.g. `1234567`
 39 | 	becomes `"1,234,567"`.
 40 | 
 41 | 	@function
 42 | 	@param {number} x the number to be formatted
 43 | */
 44 | var formatNumberAsString = function(x) {
 45 | 	return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
 46 | };
 47 | 
 48 | var aggregateHours = 24;
 49 | 
 50 | /**
 51 | 	Get GeoJSON representing counts of reports in RW polygons
 52 | 	@param {function} callback - a function to be called when data is finished loading
 53 | 	@param {level} string - administrative boundary level to load. Can be 'rw' or 'village', also passed to load function for identification
 54 | */
 55 | var getAggregates = function(level) {
 56 | 
 57 | 		jQuery.getJSON('/banjir/data/api/v1/aggregates/live?format=topojson&level='+level+'&hours='+aggregateHours, function(data) {
 58 | 
 59 | 			var array = {};
 60 | 			for (var i=0;i<data.objects.collection.geometries.length;i++){
 61 | 				array[i] = data.objects.collection.geometries[i].properties;
 62 | 			}
 63 | 			loadChart(array);
 64 | 
 65 | 			loadAggregates(level, topojson.feature(data, data.objects.collection));
 66 | 		});
 67 | };
 68 | 
 69 | var loadChart = function(data){
 70 | 
 71 | 	var names = [];
 72 | 	var counts = [];
 73 | 	for (var key in data){
 74 | 		names.push(data[key].level_name);
 75 | 		counts.push(data[key].count);
 76 | 	}
 77 | 
 78 | 	var chart_data = {
 79 | 		labels: names,
 80 | 		datasets: [
 81 | 		{
 82 | 			label: "My First dataset",
 83 | 			fillColor: "rgba(93, 160, 240, 0.9)",
 84 | 			strokeColor: "rgba(220,220,220,0.8)",
 85 | 			highlightFill: "rgba(220,220,220,0.75)",
 86 | 			highlightStroke: "rgba(220,220,220,1)",
 87 | 			data: counts
 88 | 		}
 89 | 		]
 90 | 	};
 91 | 	var ctx2 = document.getElementById("barchart").getContext("2d");
 92 | 	var barchart = new Chart(ctx2).Bar(chart_data,{});
 93 | };
 94 | 
 95 | var loadTimeseries = function(data){
 96 | 
 97 | 	var labels = [];
 98 | 	var c_counts = [];
 99 | 	var uc_counts = [];
100 | 
101 | 	for (var key in data){
102 | 		labels.push(data[key].stamp);
103 | 		c_counts.push(data[key].c_count);
104 | 		uc_counts.push(data[key].uc_count);
105 | 	}
106 | 
107 | 
108 | 	var data2 = {
109 | 		labels: labels,
110 | 		datasets: [
111 | 			{
112 | 				label: "Confirmed reports",
113 | 				fillColor: "rgba(220,220,220,0.2)",
114 | 				strokeColor: "rgba(220,220,220,1)",
115 | 				pointColor: "rgba(220,220,220,1)",
116 | 				pointStrokeColor: "#fff",
117 | 				pointHighlightFill: "#fff",
118 | 				pointHighlightStroke: "rgba(220,220,220,1)",
119 | 				data: c_counts
120 | 			},
121 | 			{
122 | 				label: "Unconfirmed reports",
123 | 				fillColor: "rgba(151,187,205,0.2)",
124 | 				strokeColor: "rgba(151,187,205,1)",
125 | 				pointColor: "rgba(151,187,205,1)",
126 | 				pointStrokeColor: "#fff",
127 | 				pointHighlightFill: "#fff",
128 | 				pointHighlightStroke: "rgba(151,187,205,1)",
129 | 				data: uc_counts
130 | 			}
131 | 		]
132 | 	};
133 | 	var ctx = document.getElementById("timechart").getContext("2d");
134 | 	var myLineChart = new Chart(ctx).Line(data2, {});
135 | };
136 | 
137 | var getTimeseries = function(){
138 | 	jQuery.getJSON('/banjir/data/api/v1/reports/timeseries', function(data) {
139 | 		var array = {};
140 | 		for (var i=0;i<data.data.length;i++){
141 | 			array[i] = data.data[i];
142 | 		}
143 | 		loadTimeseries(array);
144 | 	});
145 | };
146 | 
147 | 
148 | /**
149 | 	Plots counts of reports in RW polygons
150 | 
151 | 	@param {string} level - string - administrative boundary level to load. Can be 'rw' or 'village', should be passed from getfunction
152 | 	@param {object} aggregates - a GeoJSON object containing polygon features
153 | */
154 | 
155 | var aggregateLayers = {};
156 | var aggregateVersions = {};
157 | var aggregateInc = 0;
158 | 
159 | var onEachFeature = function(feature, layer){
160 | 	if (feature.properties && feature.properties.level_name){
161 | 		layer.bindPopup(feature.properties.level_name);
162 | 	}
163 | };
164 | 
165 | var loadAggregates = function(level, aggregates){
166 | 	var aggregateLayer = L.geoJson(aggregates, {style:styleAggregates, onEachFeature:onEachFeature});
167 | 	aggregateLayer.addTo(map);
168 | };
169 | 
170 | /**
171 | 	Styles counts of reports in RW polygons
172 | 
173 | 	@param {object} feature - individual Leaflet/GeoJSON feature object
174 | 	*/
175 | function styleAggregates(feature) {
176 |     return {
177 |         fillColor: getColor(feature.properties.count),
178 |         weight: 1,
179 | 				//disabled polygon borders for clarity
180 |         opacity: 1,
181 |         color: 'black',
182 |         //dashArray: '3',
183 |         fillOpacity: 0.7
184 |     };
185 | }
186 | 
187 | /**
188 | 	Return a colour based on input number - based on Color Brewer
189 | 
190 | 	@param {integer} d - number representing some attribute (e.g. count)
191 | 
192 | */
193 | function getColor(d) {
194 | 	return d > 30 ? '#800026' :
195 | 					d > 25  ? '#BD0026' :
196 | 					d > 20  ? '#E31A1C' :
197 | 					d > 15  ? '#FC4E2A' :
198 | 					d > 10   ? '#FD8D3C' :
199 | 					d > 5   ? '#FEB24C' :
200 | 					d > 1   ? '#FED976' :
201 | 					d > 0	?	'#FFEDA0' :
202 | 					'#FFEDA0';
203 | }
204 | 
205 | /**
206 | 	Centre the map on a given location and open a popup's text box
207 | 
208 | 	@param {string} pkey - the key of the marker to display
209 | 	@param {number} lat - latitude to center on
210 | 	@param {number} lon - longitude to center on
211 | */
212 | var centreMapOnPopup = function(pkey,lat,lon) {
213 | 	var m = markerMap[pkey];
214 | 	map.setView(m._latlng, 17);
215 | 	m.openPopup();
216 | };
217 | 
218 | 
219 | /**
220 | 	Legend box
221 | */
222 | var legend = L.control({position:'bottomleft'});
223 | 
224 | legend.onAdd = function(map) {
225 | 
226 | 	var div = L.DomUtil.create('div', 'info legend'),
227 | 	grades = [0,1, 5, 10, 15, 20, 25, 30],
228 | 	labels = [];
229 |   // label for legend
230 | 	// label for legend
231 | 	if (document.documentElement.lang == 'in') {
232 | 		div.innerHTML+='Jumlah laporan<BR>';
233 | 	}
234 | 	else {
235 | 		div.innerHTML+='Number of reports<BR>';
236 | 	}
237 | 	// loop through density intervals and generate label with coloured square
238 | 	for (var i=0; i <grades.length; i++) {
239 | 		div.innerHTML += '<i class="color" style="background:'+getColor(grades[i]+1) + '"></i>';
240 | 	}
241 | 	div.innerHTML += '<br>';
242 | 	// loop through density intervals and generate label with coloured square
243 | 	for (i=0; i <grades.length-1; i++) {
244 | 		div.innerHTML += '<span class="number">'+grades[i]+'</span>';
245 | 	}
246 | 	div.innerHTML +='<span class="number" style="margin-left:1px;">'+grades[grades.length-1]+'+</span>';
247 | 
248 | 	return div;
249 | };
250 | 
251 | //Initialise map
252 | var latlon = new L.LatLng(-6.26, 106.8317); //Centre Jakarta
253 | var map = L.map('static_map', {zoomControl:false}).setView(latlon, 11); // Initialise map
254 | map.attributionControl.setPrefix('');
255 | map.dragging.disable();
256 | map.touchZoom.disable();
257 | map.doubleClickZoom.disable();
258 | map.scrollWheelZoom.disable();
259 | if (map.tap) map.tap.disable();
260 | 
261 | getAggregates('city');
262 | 
263 | //Add legend
264 | legend.addTo(map);
265 | 
266 | //Count of reports
267 | jQuery.getJSON("/banjir/data/api/v1/reports/count?hours=24", function(data){
268 | 	$("#c_count").append(' '+data.data.c_count);
269 | 	$("#uc_count").append(' '+data.data.uc_count);
270 | });
271 | 
272 | getTimeseries();
273 | 
274 |
275 |
276 | 277 | 278 | 279 | 280 |
281 | 282 | 285 | 286 |
287 | 288 |
289 | Documentation generated by JSDoc 3.3.3 on Wed Sep 30 2015 18:41:27 GMT+1000 (AEST) 290 |
291 | 292 | 293 | 294 | 295 | 296 | -------------------------------------------------------------------------------- /api-docs/petajakarta-web/fonts/OpenSans-Bold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/petajakarta-web/fonts/OpenSans-Bold-webfont.eot -------------------------------------------------------------------------------- /api-docs/petajakarta-web/fonts/OpenSans-Bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/petajakarta-web/fonts/OpenSans-Bold-webfont.woff -------------------------------------------------------------------------------- /api-docs/petajakarta-web/fonts/OpenSans-BoldItalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/petajakarta-web/fonts/OpenSans-BoldItalic-webfont.eot -------------------------------------------------------------------------------- /api-docs/petajakarta-web/fonts/OpenSans-BoldItalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/petajakarta-web/fonts/OpenSans-BoldItalic-webfont.woff -------------------------------------------------------------------------------- /api-docs/petajakarta-web/fonts/OpenSans-Italic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/petajakarta-web/fonts/OpenSans-Italic-webfont.eot -------------------------------------------------------------------------------- /api-docs/petajakarta-web/fonts/OpenSans-Italic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/petajakarta-web/fonts/OpenSans-Italic-webfont.woff -------------------------------------------------------------------------------- /api-docs/petajakarta-web/fonts/OpenSans-Light-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/petajakarta-web/fonts/OpenSans-Light-webfont.eot -------------------------------------------------------------------------------- /api-docs/petajakarta-web/fonts/OpenSans-Light-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/petajakarta-web/fonts/OpenSans-Light-webfont.woff -------------------------------------------------------------------------------- /api-docs/petajakarta-web/fonts/OpenSans-LightItalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/petajakarta-web/fonts/OpenSans-LightItalic-webfont.eot -------------------------------------------------------------------------------- /api-docs/petajakarta-web/fonts/OpenSans-LightItalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/petajakarta-web/fonts/OpenSans-LightItalic-webfont.woff -------------------------------------------------------------------------------- /api-docs/petajakarta-web/fonts/OpenSans-Regular-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/petajakarta-web/fonts/OpenSans-Regular-webfont.eot -------------------------------------------------------------------------------- /api-docs/petajakarta-web/fonts/OpenSans-Regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/api-docs/petajakarta-web/fonts/OpenSans-Regular-webfont.woff -------------------------------------------------------------------------------- /api-docs/petajakarta-web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Home 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Home

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 | 49 | 50 |
51 | 52 | 55 | 56 |
57 | 58 |
59 | Documentation generated by JSDoc 3.3.3 on Wed Sep 30 2015 18:41:27 GMT+1000 (AEST) 60 |
61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /api-docs/petajakarta-web/module-reports.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Module: reports 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Module: reports

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 |
36 | 37 |
38 |
39 | 40 | 41 |
JavaScript to display confirmed reports within map (PetaJakarta.org) via map.js
42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
Parameters:
58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 |
NameTypeDescription
reports 86 | 87 | 88 | object 89 | 90 | 91 | 92 | a GeoJSON object
104 | 105 | 106 | 107 | 108 | 109 | 110 |
111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 |
Source:
141 |
144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 |
152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 |
171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 |
190 | 191 |
192 | 193 | 194 | 195 | 196 |
197 | 198 | 201 | 202 |
203 | 204 |
205 | Documentation generated by JSDoc 3.3.3 on Wed Sep 30 2015 18:41:27 GMT+1000 (AEST) 206 |
207 | 208 | 209 | 210 | 211 | -------------------------------------------------------------------------------- /api-docs/petajakarta-web/reports.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JSDoc: Source: reports.js 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |

Source: reports.js

21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
/**
30 |  * Generate a table based on the provided reports
31 |  *@file JavaScript to display confirmed reports within map (PetaJakarta.org) via map.js
32 |  *@copyright (c) Tomas Holderness & SMART Infrastructure Facility January 2014
33 |  *@module reports
34 |  *
35 |  * @param {object} reports - a GeoJSON object
36 |  */
37 | function loadTable(reports) {
38 | 	var rows, thead;
39 | 
40 | 	rows = "";
41 | 
42 | 	for (var i=0;i<reports.features.length;i++) {
43 | 		var report = reports.features[i].properties;
44 | 		var reportGeo = reports.features[i].geometry;
45 | 
46 | 		rows +='<tr>';
47 | 			rows += '<td>' + report.created_at.substring(11, 19) + '</td>'; // Time
48 | 			rows += '<td><a data-dismiss="modal" href="#map" onclick="javascript:centreMapOnPopup('+report.pkey+','+reportGeo.coordinates[1]+','+reportGeo.coordinates[0]+')">'+report.text+'</a></td>'; // Message
49 | 		rows += '</tr>';
50 | 	}
51 | 	if (document.documentElement.lang == 'in') {
52 | 		thead = '<table class="table table-hover"><thead><tr><th class="col-xs-2">Waktu</th><th class="col-xs-6">Sumber</th></tr></thead>';
53 | 	} else {
54 | 		thead = '<table class="table table-hover"><thead><tr><th class="col-xs-2">Time</th><th class="col-xs-6">Message</th></tr></thead>';
55 | 	}
56 | 	var tbody = '<tbody>'+rows+'</tbody></table>';
57 | 	$("#modal-reports-body").append(thead+tbody);
58 | }
59 | 
60 |
61 |
62 | 63 | 64 | 65 | 66 |
67 | 68 | 71 | 72 |
73 | 74 |
75 | Documentation generated by JSDoc 3.3.3 on Wed Sep 30 2015 18:41:27 GMT+1000 (AEST) 76 |
77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /api-docs/petajakarta-web/scripts/linenumber.js: -------------------------------------------------------------------------------- 1 | /*global document */ 2 | (function() { 3 | var source = document.getElementsByClassName('prettyprint source linenums'); 4 | var i = 0; 5 | var lineNumber = 0; 6 | var lineId; 7 | var lines; 8 | var totalLines; 9 | var anchorHash; 10 | 11 | if (source && source[0]) { 12 | anchorHash = document.location.hash.substring(1); 13 | lines = source[0].getElementsByTagName('li'); 14 | totalLines = lines.length; 15 | 16 | for (; i < totalLines; i++) { 17 | lineNumber++; 18 | lineId = 'line' + lineNumber; 19 | lines[i].id = lineId; 20 | if (lineId === anchorHash) { 21 | lines[i].className += ' selected'; 22 | } 23 | } 24 | } 25 | })(); 26 | -------------------------------------------------------------------------------- /api-docs/petajakarta-web/scripts/prettify/Apache-License-2.0.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /api-docs/petajakarta-web/scripts/prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", 2 | /^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); 3 | -------------------------------------------------------------------------------- /api-docs/petajakarta-web/scripts/prettify/prettify.js: -------------------------------------------------------------------------------- 1 | var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= 3 | [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), 9 | l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, 11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, 12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), 13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} 14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ 21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), 22 | ["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", 23 | /^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), 24 | ["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", 25 | hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= 26 | !k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p p:first-child, 338 | .props td.description > p:first-child 339 | { 340 | margin-top: 0; 341 | padding-top: 0; 342 | } 343 | 344 | .params td.description > p:last-child, 345 | .props td.description > p:last-child 346 | { 347 | margin-bottom: 0; 348 | padding-bottom: 0; 349 | } 350 | 351 | .disabled { 352 | color: #454545; 353 | } 354 | -------------------------------------------------------------------------------- /api-docs/petajakarta-web/styles/prettify-jsdoc.css: -------------------------------------------------------------------------------- 1 | /* JSDoc prettify.js theme */ 2 | 3 | /* plain text */ 4 | .pln { 5 | color: #000000; 6 | font-weight: normal; 7 | font-style: normal; 8 | } 9 | 10 | /* string content */ 11 | .str { 12 | color: #006400; 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | 17 | /* a keyword */ 18 | .kwd { 19 | color: #000000; 20 | font-weight: bold; 21 | font-style: normal; 22 | } 23 | 24 | /* a comment */ 25 | .com { 26 | font-weight: normal; 27 | font-style: italic; 28 | } 29 | 30 | /* a type name */ 31 | .typ { 32 | color: #000000; 33 | font-weight: normal; 34 | font-style: normal; 35 | } 36 | 37 | /* a literal value */ 38 | .lit { 39 | color: #006400; 40 | font-weight: normal; 41 | font-style: normal; 42 | } 43 | 44 | /* punctuation */ 45 | .pun { 46 | color: #000000; 47 | font-weight: bold; 48 | font-style: normal; 49 | } 50 | 51 | /* lisp open bracket */ 52 | .opn { 53 | color: #000000; 54 | font-weight: bold; 55 | font-style: normal; 56 | } 57 | 58 | /* lisp close bracket */ 59 | .clo { 60 | color: #000000; 61 | font-weight: bold; 62 | font-style: normal; 63 | } 64 | 65 | /* a markup tag name */ 66 | .tag { 67 | color: #006400; 68 | font-weight: normal; 69 | font-style: normal; 70 | } 71 | 72 | /* a markup attribute name */ 73 | .atn { 74 | color: #006400; 75 | font-weight: normal; 76 | font-style: normal; 77 | } 78 | 79 | /* a markup attribute value */ 80 | .atv { 81 | color: #006400; 82 | font-weight: normal; 83 | font-style: normal; 84 | } 85 | 86 | /* a declaration */ 87 | .dec { 88 | color: #000000; 89 | font-weight: bold; 90 | font-style: normal; 91 | } 92 | 93 | /* a variable name */ 94 | .var { 95 | color: #000000; 96 | font-weight: normal; 97 | font-style: normal; 98 | } 99 | 100 | /* a function name */ 101 | .fun { 102 | color: #000000; 103 | font-weight: bold; 104 | font-style: normal; 105 | } 106 | 107 | /* Specify class=linenums on a pre to get line numbering */ 108 | ol.linenums { 109 | margin-top: 0; 110 | margin-bottom: 0; 111 | } 112 | -------------------------------------------------------------------------------- /api-docs/petajakarta-web/styles/prettify-tomorrow.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Theme */ 2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 3 | /* Pretty printing styles. Used with prettify.js. */ 4 | /* SPAN elements with the classes below are added by prettyprint. */ 5 | /* plain text */ 6 | .pln { 7 | color: #4d4d4c; } 8 | 9 | @media screen { 10 | /* string content */ 11 | .str { 12 | color: #718c00; } 13 | 14 | /* a keyword */ 15 | .kwd { 16 | color: #8959a8; } 17 | 18 | /* a comment */ 19 | .com { 20 | color: #8e908c; } 21 | 22 | /* a type name */ 23 | .typ { 24 | color: #4271ae; } 25 | 26 | /* a literal value */ 27 | .lit { 28 | color: #f5871f; } 29 | 30 | /* punctuation */ 31 | .pun { 32 | color: #4d4d4c; } 33 | 34 | /* lisp open bracket */ 35 | .opn { 36 | color: #4d4d4c; } 37 | 38 | /* lisp close bracket */ 39 | .clo { 40 | color: #4d4d4c; } 41 | 42 | /* a markup tag name */ 43 | .tag { 44 | color: #c82829; } 45 | 46 | /* a markup attribute name */ 47 | .atn { 48 | color: #f5871f; } 49 | 50 | /* a markup attribute value */ 51 | .atv { 52 | color: #3e999f; } 53 | 54 | /* a declaration */ 55 | .dec { 56 | color: #f5871f; } 57 | 58 | /* a variable name */ 59 | .var { 60 | color: #c82829; } 61 | 62 | /* a function name */ 63 | .fun { 64 | color: #4271ae; } } 65 | /* Use higher contrast and text-weight for printable form. */ 66 | @media print, projection { 67 | .str { 68 | color: #060; } 69 | 70 | .kwd { 71 | color: #006; 72 | font-weight: bold; } 73 | 74 | .com { 75 | color: #600; 76 | font-style: italic; } 77 | 78 | .typ { 79 | color: #404; 80 | font-weight: bold; } 81 | 82 | .lit { 83 | color: #044; } 84 | 85 | .pun, .opn, .clo { 86 | color: #440; } 87 | 88 | .tag { 89 | color: #006; 90 | font-weight: bold; } 91 | 92 | .atn { 93 | color: #404; } 94 | 95 | .atv { 96 | color: #060; } } 97 | /* Style */ 98 | /* 99 | pre.prettyprint { 100 | background: white; 101 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 102 | font-size: 12px; 103 | line-height: 1.5; 104 | border: 1px solid #ccc; 105 | padding: 10px; } 106 | */ 107 | 108 | /* Specify class=linenums on a pre to get line numbering */ 109 | ol.linenums { 110 | margin-top: 0; 111 | margin-bottom: 0; } 112 | 113 | /* IE indents via margin-left */ 114 | li.L0, 115 | li.L1, 116 | li.L2, 117 | li.L3, 118 | li.L4, 119 | li.L5, 120 | li.L6, 121 | li.L7, 122 | li.L8, 123 | li.L9 { 124 | /* */ } 125 | 126 | /* Alternate shading for lines */ 127 | li.L1, 128 | li.L3, 129 | li.L5, 130 | li.L7, 131 | li.L9 { 132 | /* */ } 133 | -------------------------------------------------------------------------------- /bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/favicon.ico -------------------------------------------------------------------------------- /images/Analyse.svg: -------------------------------------------------------------------------------- 1 | Analyse -------------------------------------------------------------------------------- /images/Collect.svg: -------------------------------------------------------------------------------- 1 | Collect -------------------------------------------------------------------------------- /images/Communicate.svg: -------------------------------------------------------------------------------- 1 | Communicate -------------------------------------------------------------------------------- /images/cognicity_system_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/images/cognicity_system_diagram.png -------------------------------------------------------------------------------- /images/logo-dark.svg: -------------------------------------------------------------------------------- 1 | logo-dark -------------------------------------------------------------------------------- /images/logo-light.svg: -------------------------------------------------------------------------------- 1 | logo-light -------------------------------------------------------------------------------- /images/wp_fig06.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smart-facility/cognicity/6b0e67d43bb68a683d6da767f8adcc3bce73d5e1/images/wp_fig06.jpg -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | CogniCity

An open framework for urban data

CogniCity harnesses the power of social media by gathering, sorting and displaying real-time situational reports from urgent urban infrastructure issues such as flooding or traffic congestion. Our powerful toolset makes this information available in real-time to citizens in need of daily information, and meanwhile conducts predictive analysis to better inform prepare for future planning.

Collect

Real-time two-way communication using Twitter, to collect citizen infrastructure reports.

Analyse

Using spatial database technology, cognicity can use real time data to develop predictive tools to ready cities for future disasters and become more resilient in day to day operations.

Communicate

Real time maps help citizens plan and react to changing infrastructural conditions, communicating through cognicity to utilize the power of citizen knowledge and crowd sourced information to navigate fluxuating infrastructure.

PetaJakarta.org CogniCity in Action

petajakarta.org/banjir is an open source, community-led platform to collect and disseminate information about flooding and critical water infrastructure in Jakarta.

CogniCity Featured in White Paper

Read about how CogniCity was used to map flooding in real-time

White Paper ‑ PetaJakarta.org: Assessing the Role of Social Media for Civic Co‑Management During Monsoon Flooding in Jakarta, Indonesia

How CogniCity Works

CogniCity is split into three main projects:

  • cognicity-server
  • cognicity-reports
  • cognicity-web

This modular approach allows you to pick and choose what parts of the framework you wish to use, while also providing a solid foundation for adding yor own modules.

CogniCity is written in JavaScript, and uses the PostgreSQL/PostGIS database to store data. The server-side components are written using the NodeJS framework.

Data is passed between the server and client device (map) using a RESTFul GeoJSON API.

cognicity-server

View on GitHub

API documentation

NodeJS server for CogniCity data and web files

cognicity-server is the central module of the CogniCity framework, providing the main database server and HTTP API. The server can additionally serve up static web content.

The cognicity-server Data API is exposed via a HTTP/JSON interface. View the documentation at https://petajakarta.org/banjir/en/data/api/

cognicity-reports

View on GitHub

API documentation

NodeJS app to collect crowd-sourced data via social media

cognicity-reports interacts with the Gnip Powertrack API to gather reports in real-time. Using Twitter's location services, the reporting module can determine where an report has originated from. Additionally, the module can confirm reports by messaging their users.

cognicity-web (PetaJakarta.org)

View on GitHub

API documentation

Front-end JavaScript & HTML5 for mobile web application

cognicity-web is a web based app to map collected data using the LeafletJS library.

11 | -------------------------------------------------------------------------------- /robots.txt: -------------------------------------------------------------------------------- 1 | # robotstxt.org/ 2 | 3 | User-agent: * 4 | -------------------------------------------------------------------------------- /scripts/main.js: -------------------------------------------------------------------------------- 1 | "use strict";$(function(){$('iframe[src^="//player.vimeo.com"]').each(function(){$(this).data("aspectRatio",this.height/this.width).removeAttr("height").removeAttr("width")}),$(window).resize(function(){$('iframe[src^="//player.vimeo.com"]').each(function(){var a=$(this),b=a.parent().width();a.width(b).height(b*a.data("aspectRatio"))})}).resize()}); --------------------------------------------------------------------------------