UNPKG

jive-sdk

Version:

Node.js SDK for Jive Software to assist with the development of add-ons

2,210 lines (851 loc) 31.6 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Jive SDK Module: events</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.spacelab.css"> </head> <body> <div class="container-fluid"> <div class="navbar navbar-fixed-top navbar-inverse"> <div class="navbar-inner"> <a class="brand" href="index.html">Jive SDK</a> <ul class="nav"> <li class="dropdown"> <a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="module-abstractDefinitions.html">abstractDefinitions</a> </li> <li> <a href="module-abstractInstances.html">abstractInstances</a> </li> <li> <a href="module-addOnRoutes.html">addOnRoutes</a> </li> <li> <a href="module-api.html">api</a> </li> <li> <a href="module-community.html">community</a> </li> <li> <a href="module-constants.html">constants</a> </li> <li> <a href="module-devRoutes.html">devRoutes</a> </li> <li> <a href="module-events.html">events</a> </li> <li> <a href="module-extensions.html">extensions</a> </li> <li> <a href="module-extstreamsInstances.html">extstreamsInstances</a> </li> <li> <a href="module-jiveutil.html">jiveutil</a> </li> <li> <a href="module-oauthRoutes.html">oauthRoutes</a> </li> <li> <a href="module-request.html">request</a> </li> <li> <a href="module-security.html">security</a> </li> <li> <a href="module-service.html">service</a> </li> <li> <a href="module-tasks.html">tasks</a> </li> <li> <a href="module-tileInstances.html">tileInstances</a> </li> <li> <a href="module-tileRoutes.html">tileRoutes</a> </li> <li> <a href="module-tilesDefinitions.html">tilesDefinitions</a> </li> <li> <a href="module-webhooks.html">webhooks</a> </li> </ul> </li> <li class="dropdown"> <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> <ul class="dropdown-menu "> <li> <a href="extstreamsDefinitions.html">extstreamsDefinitions</a> </li> <li> <a href="filePersistence.html">filePersistence</a> </li> <li> <a href="memoryPersistence.html">memoryPersistence</a> </li> <li> <a href="memoryScheduler.html">memoryScheduler</a> </li> <li> <a href="oauthHandler.html">oauthHandler</a> </li> </ul> </li> </ul> </div> </div> <div class="row-fluid"> <div class="span8"> <div id="main"> <h1 class="page-title">Module: events</h1> <section> <header> <h2> events </h2> </header> <article> <div class="container-overview"> <div class="description"><p>API for managing events. Use this to register event handlers for the various types of events emitted by the system, and also for definining your custom events and handlers. @see <a href="module-constants.html">module:constants</a> for a list of emitted system events.</p></div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="events.js.html">jive-sdk-api/lib/event/events.js</a>, <a href="events.js.html#sunlight-1-line-17">line 17</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Members</h3> <dl> <dt> <h4 class="name" id="systemEvents"><span class="type-signature">&lt;static> </span>systemEvents<span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>This is a map of system defined events to their respective event handlers.</p> </div> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>NEW_INSTANCE</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request to push tile data update to Jive.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"><p>Logs the request context</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>INSTANCE_UPDATED</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request to push tile data update to Jive.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"><p>Logs the request context</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>INSTANCE_REMOVED</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request to push tile data update to Jive.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"><p>Logs the request context</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>PUSH_DATA_TO_JIVE</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request to push tile data update to Jive.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"><p>Passed <b>context</b> contains <i>theInstance</i> and <i>data</i> attributes. These are used to push a tile update into Jive.</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>PUSH_ACTIVITY_TO_JIVE</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request to push externatstream activity to Jive.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"><p>Passed <b>context</b> contains <i>theInstance</i> and <i>activity</i> attributes. These are used to push an extstreamstream activity entry into Jive.</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>PUSH_COMMENT_TO_JIVE</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request to push a comment into Jive.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"><p>Logs the request context</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>COMMENT_ON_ACTIVITY</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request to push a comment on an activity entry into Jive.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>COMMENT_ON_ACTIVITY_BY_EXTERNAL_ID</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request to push a comment on an activity entry into Jive.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>FETCH_COMMENTS_ON_ACTIVITY</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request for activity comments from Jive.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>FETCH_ALL_COMMENTS_FOR_EXT_STREAM</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request for activity comments from Jive.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>INSTANCE_REGISTRATION</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request to register a new tile or externalstream instance.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>INSTANCE_UNREGISTRATION</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request to destroy a tile or externalstream instance.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>CLIENT_APP_REGISTRATION</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request to register a Jive instance on the service.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>GET_PAGINATED_RESULTS</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request for paginated results from a Jive service.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>GET_EXTERNAL_PROPS</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request for retrieving external props on a tile or externalstream instance.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>SET_EXTERNAL_PROPS</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request for setting external props on a tile or externalstream instance.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>DELETE_EXTERNAL_PROPS</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Fired on request for deleting external props on a tile or externalstream instance.</p> <h6>Properties</h6> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </dl> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="events.js.html">jive-sdk-api/lib/event/events.js</a>, <a href="events.js.html#sunlight-1-line-256">line 256</a> </li></ul></dd> </dl> </dd> </dl> <h3 class="subsection-title">Methods</h3> <dl> <dt> <h4 class="name" id="addLocalEventListener"><span class="type-signature">&lt;static> </span>addLocalEventListener<span class="signature">(event, handler)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Adds a local event handler.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>event</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="events.js.html">jive-sdk-api/lib/event/events.js</a>, <a href="events.js.html#sunlight-1-line-175">line 175</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="getEventListeners"><span class="type-signature">&lt;static> </span>getEventListeners<span class="signature">(event, eventListener)</span><span class="type-signature"> &rarr; {Array}</span></h4> </dt> <dd> <div class="description"> <p>Returns array of registered event handling functions for the given event listener and event. Otherwise returns undefined.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>event</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>eventListener</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="events.js.html">jive-sdk-api/lib/event/events.js</a>, <a href="events.js.html#sunlight-1-line-121">line 121</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> </dd> <dt> <h4 class="name" id="registerEventListener"><span class="type-signature">&lt;static> </span>registerEventListener<span class="signature">(event, handler, options)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Add an event handler. The handler is invoked when an event is fired which specifies the target event listener and event type, if both are specified in the event firing. If only event is specified, then the handler will be invoked whenever that event is fired. <br><br> The handler is added to an array of handler functions assigned for the event listener. Only one function per event listener per event is permitted.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>event</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"><p>the event id</p></td> </tr> <tr> <td class="name"><code>handler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"><p>the function to call</p></td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"> <h6>Properties</h6> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>eventListener</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"><p>the name of the listener</p></td> </tr> <tr> <td class="name"><code>description</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="events.js.html">jive-sdk-api/lib/event/events.js</a>, <a href="events.js.html#sunlight-1-line-86">line 86</a> </li></ul></dd> </dl> </dd> <dt> <h4 class="name" id="reset"><span class="type-signature">&lt;static> </span>reset<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Removes all event handlers.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="events.js.html">jive-sdk-api/lib/event/events.js</a>, <a href="events.js.html#sunlight-1-line-420">line 420</a> </li></ul></dd> </dl> </dd> </dl> </article> </section> </div> <div class="clearfix"></div> <footer> <span class="copyright"> Jive Software, Inc </span> <br /> <span class="jsdoc-message"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> on Wed Jan 22 2014 12:29:38 GMT-0800 (PST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. </span> </footer> </div> <div class="span3"> <div id="toc"></div> </div> <br clear="both"> </div> </div> <script src="scripts/sunlight.js"></script> <script src="scripts/sunlight.javascript.js"></script> <script src="scripts/sunlight-plugin.doclinks.js"></script> <script src="scripts/sunlight-plugin.linenumbers.js"></script> <script src="scripts/sunlight-plugin.menu.js"></script> <script src="scripts/jquery.min.js"></script> <script src="scripts/jquery.scrollTo.js"></script> <script src="scripts/jquery.localScroll.js"></script> <script src="scripts/bootstrap-dropdown.js"></script> <script src="scripts/toc.js"></script> <script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script> <script> $( function () { $( "#toc" ).toc( { selectors : "h1,h2,h3,h4", showAndHide : false, scrollTo : 60 } ); $( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" ); $( "#main span[id^='toc']" ).addClass( "toc-shim" ); } ); </script> </body> </html>