webgme-engine
Version:
WebGME server and Client API without a GUI
3,639 lines (1,396 loc) • 694 kB
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Core</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">Class: Core</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>Core<span class="signature">(project, options)</span><span class="type-signature"></span></h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Core"><span class="type-signature"></span>new Core<span class="signature">(project, options)</span><span class="type-signature"></span></h4>
<div class="description">
<p>The Core defines the main API for model manipulation and traversal. It is important to note, that
all 'Path' function must be used with caution as the returned information is just an estimate and does not
guarantee that the actual node will exist (as in certain scenarios they might become invalid and need to
be removed, but said removal can only take place during their load). Try to always 'Load' every
node before depending on their paths.</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>project</code></td>
<td class="type">
<span class="param-type"><a href="ProjectInterface.html">ProjectInterface</a></span>
</td>
<td class="description last"><p>project connected to storage</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><a href="global.html#object">object</a></span>
</td>
<td class="description last"><p>contains logging information</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>logger</code></td>
<td class="type">
<span class="param-type"><a href="global.html#object">object</a></span>
</td>
<td class="description last"><p>gmeLogger</p></td>
</tr>
<tr>
<td class="name"><code>globConf</code></td>
<td class="type">
<span class="param-type"><a href="global.html#object">object</a></span>
</td>
<td class="description last"><p>gmeConfig</p></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="common_core_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line354">line 354</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="addLibrary"><span class="type-signature"></span>addLibrary<span class="signature">(node, name, libraryRootHash, libraryInfo<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="external-Promise.html">external:Promise</a>}</span></h4>
<div class="description">
<p>It adds a project as library to your project by copying it over. The library will be a node
with the given name directly under your project's ROOT. It becomes a read-only portion of your project.
You will only be able to manipulate it with library functions, but cannot edit the individual nodes inside.
However you will be able to instantiate or copy the nodes into other places of your project. Every node
that was part of the META in the originating project becomes part of your project's meta.</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>any regular node in your project.</p></td>
</tr>
<tr>
<td class="name"><code>name</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>the name of the library you wish to use as a namespace in your project.</p></td>
</tr>
<tr>
<td class="name"><code>libraryRootHash</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>the hash of your library's root
(must exist in the project's collection at the time of call).</p></td>
</tr>
<tr>
<td class="name"><code>libraryInfo</code></td>
<td class="type">
<span class="param-type"><a href="global.html#object">object</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>information about your project.</p>
<h6>Properties</h6>
<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>projectId</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>the projectId of your library.</p></td>
</tr>
<tr>
<td class="name"><code>branchName</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>the branch that your library follows in the origin project.</p></td>
</tr>
<tr>
<td class="name"><code>commitHash</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>the version of your library.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="global.html#function">function</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Error">Error</a></span>
|
<span class="param-type">CoreIllegalArgumentError</span>
|
<span class="param-type">CoreIllegalOperationError</span>
|
<span class="param-type">CoreInternalError</span>
|
<span class="param-type"><a href="global.html#null">null</a></span>
</td>
<td class="description last"><p>the
result of the execution.</p></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="common_core_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line3684">line 3684</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<dl>
<dt>
<div class="param-desc">
<p>If some of the parameters don't match the input criteria.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalArgumentError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>If no callback is given, the result is provided in a promise like manner.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="external-Promise.html">external:Promise</a></span>
</dd>
</dl>
<h4 class="name" id="addMember"><span class="type-signature"></span>addMember<span class="signature">(node, name, member)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Adds a member to the given set.</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>the owner of the set.</p></td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="description last"><p>the name of the set.</p></td>
</tr>
<tr>
<td class="name"><code>member</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>the new member of the set.</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_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line1950">line 1950</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some of the parameters don't match the input criteria.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalArgumentError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If the context of the operation is not allowed.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some internal error took place inside the core layers.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreInternalError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="addMixin"><span class="type-signature"></span>addMixin<span class="signature">(node, path)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Adds a mixin to the mixin set of 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>the node in question.</p></td>
</tr>
<tr>
<td class="name"><code>path</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="description last"><p>the path of the mixin node.</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_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line3595">line 3595</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some of the parameters don't match the input criteria.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalArgumentError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If the context of the operation is not allowed.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some internal error took place inside the core layers.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreInternalError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="applyResolution"><span class="type-signature"></span>applyResolution<span class="signature">(conflict)</span><span class="type-signature"> → {<a href="global.html#object">object</a>}</span></h4>
<div class="description">
<p>When our attempt to merge two patches ended in some conflict, then we can modify that result highlighting
that in case of every conflict, which side we prefer (mine vs. theirs). If we give that object as an input
to this function, it will finish the merge resolving the conflict according our settings and present a final
patch.</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>conflict</code></td>
<td class="type">
<span class="param-type"><a href="global.html#object">object</a></span>
</td>
<td class="description last"><p>the object that represents our settings for every conflict and the so-far-merged
patch.</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_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line3342">line 3342</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some of the parameters don't match the input criteria.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalArgumentError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some internal error took place inside the core layers.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreInternalError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>The function results in a tree structured patch object that contains the changesthat cover
both parties modifications (and the conflicts are resolved according the input settings).</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="applyTreeDiff"><span class="type-signature"></span>applyTreeDiff<span class="signature">(node, patch, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="external-Promise.html">external:Promise</a>}</span></h4>
<div class="description">
<p>Apply changes to the current project.</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>the root of the containment hierarchy where we wish to apply the changes</p></td>
</tr>
<tr>
<td class="name"><code>patch</code></td>
<td class="type">
<span class="param-type"><a href="global.html#object">object</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>the tree structured collection of changes represented with a special JSON object</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type"><a href="global.html#function">function</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Error">Error</a></span>
|
<span class="param-type">CoreIllegalArgumentError</span>
|
<span class="param-type">CoreInternalError</span>
|
<span class="param-type"><a href="global.html#null">null</a></span>
</td>
<td class="description last"><p>the result of the execution.</p></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="common_core_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line3295">line 3295</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<dl>
<dt>
<div class="param-desc">
<p>If some of the parameters don't match the input criteria.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalArgumentError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>If no callback is given, the result will be provided in a promise.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="external-Promise.html">external:Promise</a></span>
</dd>
</dl>
<h4 class="name" id="canSetAsMixin"><span class="type-signature"></span>canSetAsMixin<span class="signature">(node, path)</span><span class="type-signature"> → {<a href="global.html#object">object</a>}</span></h4>
<div class="description">
<p>Checks if the given path can be added as a mixin to the given 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>the node in question.</p></td>
</tr>
<tr>
<td class="name"><code>path</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="description last"><p>the path of the mixin node.</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_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line3653">line 3653</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some of the parameters don't match the input criteria.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalArgumentError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some internal error took place inside the core layers.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreInternalError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns an object with isOk set to true if the given path can be added as a
mixin to the given node. If it cannot, the reason will be reported under reason.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="global.html#object">object</a></span>
</dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>result = core.canSetAsMixin(node, core.getPath(aValidMixinNode));
// result = { isOk: true, reason: '' }
result = core.canSetAsMixin(node, core.getPath(node));
// result = { isOk: false, reason: 'Node cannot be mixin of itself!' }
result = core.canSetAsMixin(node, core.getPath(nonMetaNode));
// result = { isOk: false, reason: 'Mixin must be on the Meta!!' }
result = core.canSetAsMixin(node, core.getPath(FCO));
// result = { isOk: false, reason: 'Base of node cannot be its mixin as well!' }</code></pre>
<h4 class="name" id="clearMetaRules"><span class="type-signature"></span>clearMetaRules<span class="signature">(node)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Removes all META rules defined at the node. Note that it does not clear any rules from other meta-nodes
where the node if referenced.</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>the node in question.</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_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line2805">line 2805</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some of the parameters don't match the input criteria.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalArgumentError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If the context of the operation is not allowed.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some internal error took place inside the core layers.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreInternalError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="clearMixins"><span class="type-signature"></span>clearMixins<span class="signature">(node)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Removes all mixins for a given 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>the node in question.</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_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line3610">line 3610</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some of the parameters don't match the input criteria.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalArgumentError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some internal error took place inside the core layers.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreInternalError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h4 class="name" id="copyNode"><span class="type-signature"></span>copyNode<span class="signature">(node, parent)</span><span class="type-signature"> → {<a href="module-Core.html#~Node">module:Core~Node</a>}</span></h4>
<div class="description">
<p>Copies the given node into parent.</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>the node to be copied.</p></td>
</tr>
<tr>
<td class="name"><code>parent</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>the parent node of the copy.</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_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line952">line 952</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some of the parameters don't match the input criteria.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalArgumentError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If the context of the operation is not allowed.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some internal error took place inside the core layers.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreInternalError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>The function returns the copied node.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span>
</dd>
</dl>
<h4 class="name" id="copyNodes"><span class="type-signature"></span>copyNodes<span class="signature">(nodes, parent)</span><span class="type-signature"> → {<a href="global.html#Array">Array</a>.<<a href="module-Core.html#~Node">module:Core~Node</a>>}</span></h4>
<div class="description">
<p>Copies the given nodes into parent.</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>nodes</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Array">Array</a>.<<a href="module-Core.html#~Node">module:Core~Node</a>></span>
</td>
<td class="description last"><p>the nodes to be copied.</p></td>
</tr>
<tr>
<td class="name"><code>parent</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>the parent node of the copy.</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_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line971">line 971</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some of the parameters don't match the input criteria.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalArgumentError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If the context of the operation is not allowed.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some internal error took place inside the core layers.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreInternalError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>The function returns an array of the copied nodes. The order follows
the order of originals.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="global.html#Array">Array</a>.<<a href="module-Core.html#~Node">module:Core~Node</a>></span>
</dd>
</dl>
<h4 class="name" id="createChild"><span class="type-signature"></span>createChild<span class="signature">(node, base)</span><span class="type-signature"> → {<a href="module-Core.html#~Node">module:Core~Node</a>}</span></h4>
<div class="description">
<p>Creates a child, with base as provided, inside 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>the parent of the node to be created.</p></td>
</tr>
<tr>
<td class="name"><code>base</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>the base of the node to be created.</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_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line917">line 917</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some of the parameters don't match the input criteria.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalArgumentError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If the context of the operation is not allowed.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreIllegalOperationError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
<li>
<dl>
<dt>
<div class="param-desc">
<p>If some internal error took place inside the core layers.</p>
</div>
</dt>
<dd></dd>
<dt>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">CoreInternalError</span>
</dd>
</dl>
</dt>
<dd></dd>
</dl>
</li>
</ul>
<h5>Returns:</h5>
<div class="param-desc">
<p>The function returns the created child node.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="module-Core.html#~Node">module:Core~Node</a></span>
</dd>
</dl>
<h4 class="name" id="createNode"><span class="type-signature"></span>createNode<span class="signature">(parameters<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="module-Core.html#~Node">module:Core~Node</a>}</span></h4>
<div class="description">
<p>Creates a node according to the given parameters.</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>parameters</code></td>
<td class="type">
<span class="param-type"><a href="global.html#object">object</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>the details of the creation.</p>
<h6>Properties</h6>
<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>parent</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#null">null</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>the parent of the node to be created.</p></td>
</tr>
<tr>
<td class="name"><code>base</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#null">null</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>the base of the node to be created.</p></td>
</tr>
<tr>
<td class="name"><code>relid</code></td>
<td class="type">
<span class="param-type"><a href="global.html#string">string</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>the relative id of the node to be created (if reserved, the function
returns the node behind the relative id)</p></td>
</tr>
<tr>
<td class="name"><code>guid</code></td>
<td class="type">
<span class="param-type"><a href="module-Core.html#~GUID">module:Core~GUID</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>the GUID of the node to be created</p></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="common_core_core.js.html">common/core/core.js</a>, <a href="common_core_core.js.html#line887">line 887</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<ul>
<li>
<dl>
<dt>
<div class="param-des