UNPKG

webgme-engine

Version:

WebGME server and Client API without a GUI

2,371 lines (616 loc) 32.4 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Module: crosscuts</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Module: crosscuts</h1> <section> <header> </header> <article> <div class="container-overview"> <div class="description"><p>Module for handling of crosscuts using the core. <br> To include in your module (e.g. Plugin) require via 'common/core/users/crosscut' and invoke initialize by passing a reference to a core instance. <br></p></div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_users_crosscuts.js.html">common/core/users/crosscuts.js</a>, <a href="common_core_users_crosscuts.js.html#line17">line 17</a> </li></ul></dd> </dl> <h3>Example</h3> <pre class="prettyprint"><code>crosscuts.initialize(core); crosscuts.getIds();</code></pre> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id=".addMember"><span class="type-signature">(static) </span>addMember<span class="signature">(node, crosscutId, memberNode, position<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> <p>Adds a member to the crosscut at an optionally provided position.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>node</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>Owner of the crosscut.</p></td> </tr> <tr> <td class="name"><code>crosscutId</code></td> <td class="type"> <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>Crosscut id to add member to.</p></td> </tr> <tr> <td class="name"><code>memberNode</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>Node that should be added to crosscut.</p></td> </tr> <tr> <td class="name"><code>position</code></td> <td class="type"> <span class="param-type"><a href="global.html#object">object</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> {x:100, y:100} </td> <td class="description last"><p>Position of the member inside crosscut.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_users_crosscuts.js.html">common/core/users/crosscuts.js</a>, <a href="common_core_users_crosscuts.js.html#line239">line 239</a> </li></ul></dd> </dl> <h4 class="name" id=".createCrosscut"><span class="type-signature">(static) </span>createCrosscut<span class="signature">(node, title, order<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="global.html#string">string</a>}</span></h4> <div class="description"> <p>Adds a new crosscut to the node.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>node</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span> </td> <td class="attributes"> </td> <td class="description last"><p>Owner of the new crosscut.</p></td> </tr> <tr> <td class="name"><code>title</code></td> <td class="type"> <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="attributes"> </td> <td class="description last"><p>Visible title of crosscut.</p></td> </tr> <tr> <td class="name"><code>order</code></td> <td class="type"> <span class="param-type"><a href="global.html#number">number</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>Tab order starting from 0, if not given will be placed at end.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_users_crosscuts.js.html">common/core/users/crosscuts.js</a>, <a href="common_core_users_crosscuts.js.html#line174">line 174</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>The id of the newly created crosscut.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="global.html#string">string</a></span> </dd> </dl> <h4 class="name" id=".delMember"><span class="type-signature">(static) </span>delMember<span class="signature">(node, crosscutId, memberNodeOrPath)</span><span class="type-signature"></span></h4> <div class="description"> <p>Removes the member from the specified crosscut.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>node</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span> </td> <td class="description last"><p>Owner of the crosscut.</p></td> </tr> <tr> <td class="name"><code>crosscutId</code></td> <td class="type"> <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="description last"><p>Id of crosscut.</p></td> </tr> <tr> <td class="name"><code>memberNodeOrPath</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span> | <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="description last"><p>Node, or path of, member to delete from crosscut.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_users_crosscuts.js.html">common/core/users/crosscuts.js</a>, <a href="common_core_users_crosscuts.js.html#line289">line 289</a> </li></ul></dd> </dl> <h4 class="name" id=".deleteCrosscut"><span class="type-signature">(static) </span>deleteCrosscut<span class="signature">(node, crosscutId)</span><span class="type-signature"></span></h4> <div class="description"> <p>Deletes the crosscut from the node.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>node</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span> </td> <td class="description last"><p>Owner of the crosscut.</p></td> </tr> <tr> <td class="name"><code>crosscutId</code></td> <td class="type"> <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="description last"><p>Id of crosscut to delete.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_users_crosscuts.js.html">common/core/users/crosscuts.js</a>, <a href="common_core_users_crosscuts.js.html#line251">line 251</a> </li></ul></dd> </dl> <h4 class="name" id=".getIdFromTitle"><span class="type-signature">(static) </span>getIdFromTitle<span class="signature">(node, title)</span><span class="type-signature"> &rarr; {<a href="global.html#string">string</a>}</span></h4> <div class="description"> <p>If title exists and is unique will return the id of the crosscut. If not it will throw an exception.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>node</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span> </td> <td class="description last"><p>Owner of the crosscut.</p></td> </tr> <tr> <td class="name"><code>title</code></td> <td class="type"> <span class="param-type"><a href="global.html#string">string</a></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="common_core_users_crosscuts.js.html">common/core/users/crosscuts.js</a>, <a href="common_core_users_crosscuts.js.html#line122">line 122</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>The crosscut id.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="global.html#string">string</a></span> </dd> </dl> <h4 class="name" id=".getIds"><span class="type-signature">(static) </span>getIds<span class="signature">(node)</span><span class="type-signature"> &rarr; {<a href="global.html#Array">Array</a>.&lt;<a href="global.html#string">string</a>>}</span></h4> <div class="description"> <p>Returns all the cross-cut ideas at the provided node.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>node</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span> </td> <td class="description last"><p>Owner of the crosscuts.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_users_crosscuts.js.html">common/core/users/crosscuts.js</a>, <a href="common_core_users_crosscuts.js.html#line109">line 109</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>The crosscut ids.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="global.html#Array">Array</a>.&lt;<a href="global.html#string">string</a>></span> </dd> </dl> <h4 class="name" id=".getInfo"><span class="type-signature">(static) </span>getInfo<span class="signature">(node)</span><span class="type-signature"> &rarr; {<a href="global.html#Array">Array</a>.&lt;<a href="global.html#object">object</a>>}</span></h4> <div class="description"> <p>Returns the raw stored crosscut info at the provided node.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>node</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></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="common_core_users_crosscuts.js.html">common/core/users/crosscuts.js</a>, <a href="common_core_users_crosscuts.js.html#line87">line 87</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="global.html#Array">Array</a>.&lt;<a href="global.html#object">object</a>></span> </dd> </dl> <h4 class="name" id=".getMemberPaths"><span class="type-signature">(static) </span>getMemberPaths<span class="signature">(node, crosscutId)</span><span class="type-signature"> &rarr; {<a href="global.html#Array">Array</a>.&lt;<a href="global.html#string">string</a>>}</span></h4> <div class="description"> <p>Returns the paths to all members in the specified crosscut.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>node</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span> </td> <td class="description last"><p>Owner of the crosscut.</p></td> </tr> <tr> <td class="name"><code>crosscutId</code></td> <td class="type"> <span class="param-type"><a href="global.html#string">string</a></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="common_core_users_crosscuts.js.html">common/core/users/crosscuts.js</a>, <a href="common_core_users_crosscuts.js.html#line148">line 148</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Paths of members</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="global.html#Array">Array</a>.&lt;<a href="global.html#string">string</a>></span> </dd> </dl> <h4 class="name" id=".getMemberPosition"><span class="type-signature">(static) </span>getMemberPosition<span class="signature">(node, crosscutId, memberNodeOrPath)</span><span class="type-signature"> &rarr; {<a href="global.html#object">object</a>}</span></h4> <div class="description"> <p>Return the position at the cross-cuts for the member in the given crosscut at the provided node.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>node</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span> </td> <td class="description last"><p>Owner of the crosscut.</p></td> </tr> <tr> <td class="name"><code>crosscutId</code></td> <td class="type"> <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="description last"><p>Crosscut id to add member to.</p></td> </tr> <tr> <td class="name"><code>memberNodeOrPath</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span> | <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="description last"><p>Node, or path of, member to get position of.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_users_crosscuts.js.html">common/core/users/crosscuts.js</a>, <a href="common_core_users_crosscuts.js.html#line160">line 160</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>The position of the member inside the crosscut.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="global.html#object">object</a></span> </dd> </dl> <h4 class="name" id=".getTitles"><span class="type-signature">(static) </span>getTitles<span class="signature">(node)</span><span class="type-signature"> &rarr; {<a href="global.html#Array">Array</a>.&lt;<a href="global.html#string">string</a>>}</span></h4> <div class="description"> <p>Returns all titles of the crosscuts at the provided node.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>node</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span> </td> <td class="description last"><p>Owner of the crosscuts.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_users_crosscuts.js.html">common/core/users/crosscuts.js</a>, <a href="common_core_users_crosscuts.js.html#line98">line 98</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="global.html#Array">Array</a>.&lt;<a href="global.html#string">string</a>></span> </dd> </dl> <h4 class="name" id=".initialize"><span class="type-signature">(static) </span>initialize<span class="signature">(core)</span><span class="type-signature"></span></h4> <div class="description"> <p>Initializes the module with a core instance. This must be called before any other method.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>core</code></td> <td class="type"> <span class="param-type"><a href="Core.html">Core</a></span> </td> <td class="description last"><p>An instance of a Core module.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_users_crosscuts.js.html">common/core/users/crosscuts.js</a>, <a href="common_core_users_crosscuts.js.html#line33">line 33</a> </li></ul></dd> </dl> <h4 class="name" id=".setMemberPosition"><span class="type-signature">(static) </span>setMemberPosition<span class="signature">(node, crosscutId, memberNodeOrPath, newPosition)</span><span class="type-signature"></span></h4> <div class="description"> <p>Updates the position of the member inside the specified crosscut.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>node</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span> </td> <td class="description last"><p>Owner of the crosscut.</p></td> </tr> <tr> <td class="name"><code>crosscutId</code></td> <td class="type"> <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="description last"><p>Id of crosscut.</p></td> </tr> <tr> <td class="name"><code>memberNodeOrPath</code></td> <td class="type"> <span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span> | <span class="param-type"><a href="global.html#string">string</a></span> </td> <td class="description last"><p>Node, or path of, member to update position for.</p></td> </tr> <tr> <td class="name"><code>newPosition</code></td> <td class="type"> <span class="param-type"><a href="global.html#object">object</a></span> </td> <td class="description last"><p>Position of the member inside the crosscut.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="common_core_users_crosscuts.js.html">common/core/users/crosscuts.js</a>, <a href="common_core_users_crosscuts.js.html#line225">line 225</a> </li></ul></dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="Server_GMEAuth.html">Server:GMEAuth</a></li><li><a href="Server_SafeStorage.html">Server:SafeStorage</a></li><li><a href="Server_UserProject.html">Server:UserProject</a></li><li><a href="module-Core.html">Core</a></li><li><a href="module-Storage.html">Storage</a></li><li><a href="module-crosscuts.html">crosscuts</a></li><li><a href="module-serialization.html">serialization</a></li></ul><h3>Externals</h3><ul><li><a href="external-Promise.html">Promise</a></li></ul><h3>Classes</h3><ul><li><a href="AddOnBase.html">AddOnBase</a></li><li><a href="AddOnUpdateResult.html">AddOnUpdateResult</a></li><li><a href="Artifact.html">Artifact</a></li><li><a href="BlobClient.html">BlobClient</a></li><li><a href="BlobMetadata.html">BlobMetadata</a></li><li><a href="BlobRunPluginClient.html">BlobRunPluginClient</a></li><li><a href="Client.html">Client</a></li><li><a href="Core.html">Core</a></li><li><a href="ExecutorClient.html">ExecutorClient</a></li><li><a href="GMENode.html">GMENode</a></li><li><a href="GmeLogger.html">GmeLogger</a></li><li><a href="InterPluginResult.html">InterPluginResult</a></li><li><a href="JobInfo.html">JobInfo</a></li><li><a href="OutputInfo.html">OutputInfo</a></li><li><a href="PluginBase.html">PluginBase</a></li><li><a href="PluginConfig.html">PluginConfig</a></li><li><a href="PluginMessage.html">PluginMessage</a></li><li><a href="PluginNodeDescription.html">PluginNodeDescription</a></li><li><a href="PluginResult.html">PluginResult</a></li><li><a href="Project.html">Project</a></li><li><a href="ProjectInterface.html">ProjectInterface</a></li><li><a href="Server_GMEAuth-GMEAuth.html">GMEAuth</a></li><li><a href="Server_SafeStorage-SafeStorage.html">SafeStorage</a></li><li><a href="Server_UserProject-UserProject.html">UserProject</a></li><li><a href="WebsocketRouter.html">WebsocketRouter</a></li><li><a href="WebsocketRouterUser.html">WebsocketRouterUser</a></li></ul><h3>Events</h3><ul><li><a href="Client.html#event:BRANCH_CHANGED">BRANCH_CHANGED</a></li><li><a href="Client.html#event:BRANCH_CLOSED">BRANCH_CLOSED</a></li><li><a href="Client.html#event:BRANCH_OPENED">BRANCH_OPENED</a></li><li><a href="Client.html#event:BRANCH_STATUS_CHANGED">BRANCH_STATUS_CHANGED</a></li><li><a href="Client.html#event:CONNECTED_USERS_CHANGED">CONNECTED_USERS_CHANGED</a></li><li><a href="Client.html#event:NETWORK_STATUS_CHANGED">NETWORK_STATUS_CHANGED</a></li><li><a href="Client.html#event:NOTIFICATION">NOTIFICATION</a></li><li><a href="Client.html#event:PLUGIN_FINISHED">PLUGIN_FINISHED</a></li><li><a href="Client.html#event:PLUGIN_INITIATED">PLUGIN_INITIATED</a></li><li><a href="Client.html#event:PLUGIN_NOTIFICATION">PLUGIN_NOTIFICATION</a></li><li><a href="Client.html#event:PROJECT_CLOSED">PROJECT_CLOSED</a></li><li><a href="Client.html#event:PROJECT_OPENED">PROJECT_OPENED</a></li></ul><h3><a href="global.html">Global</a></h3> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Fri Jun 21 2024 09:43:40 GMT-0400 (Eastern Daylight Time) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>