@wider/utils_proto
Version:
A set of extensions to basic objects giving uniform behaviour in various technical environments
677 lines (262 loc) • 22.8 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>Module: @wider/utils_proto/proto_string/contextParse | YDR</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/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="styles/prettify-jsdoc.css">
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/tui-doc.css">
</head>
<body>
<nav class="lnb" id="lnb">
<div class="logo" style="width: 50px">
<a href="http://y-d-r.co.uk" rel="noopener noreferrer" target="_blank">
<img src="http://y-d-r.co.uk/favicon.ico" width="100%" height="100%">
</a>
</div>
<div class="title">
<h1><a href="index.html" class="link">YDR</a></h1>
<span class="version">v1.0.23</span>
</div>
<div class="search-container" id="search-container">
<input type="text" placeholder="Search">
<ul></ul>
</div>
<ol class="lnb-tab">
<li id="api-tab">
<a href="#"><h4>API</h4></a>
</li>
<li id="examples-tab">
<a href="#"><h4>Examples</h4></a>
</li>
</ol>
<div class="lnb-examples hidden"><h3>Examples</h3><ul><li><a href="tutorial-Using Markdown with ydr_HTMLencode.html">Using Markdown with ydr_HTMLencode</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="Using Markdown with ydr_HTMLencode_sub"></div></li><li><a href="tutorial-Using Object Prototype extensions.html">Using Object Prototype extensions</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="Using Object Prototype extensions_sub"></div></li></ul></div><div class="lnb-api hidden"><h3>Modules</h3><ul><li><a href="module-@wider_utils_proto.html">@wider/utils_proto</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="module:@wider/utils_proto_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="module-@wider_utils_proto.html#~init">init</a></li></ul></div></li><li><a href="module-@wider_utils_proto_proto_array.html">@wider/utils_proto/proto_array</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="module:@wider/utils_proto/proto_array_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="module-@wider_utils_proto_proto_array.html#~keySort()">keySort()</a></li><li><a href="module-@wider_utils_proto_proto_array.html#~numericSortAsc()">numericSortAsc()</a></li><li><a href="module-@wider_utils_proto_proto_array.html#~permute()">permute()</a></li><li><a href="module-@wider_utils_proto_proto_array.html#~plainSortAsc()">plainSortAsc()</a></li><li><a href="module-@wider_utils_proto_proto_array.html#~plainSortDesc()">plainSortDesc()</a></li><li><a href="module-@wider_utils_proto_proto_array.html#~pushUnique()">pushUnique()</a></li></ul></div></li><li><a href="module-@wider_utils_proto_proto_array_test.html">@wider/utils_proto/proto_array/test</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="module:@wider/utils_proto/proto_array/test_sub"></div></li><li><a href="module-@wider_utils_proto_proto_date.html">@wider/utils_proto/proto_date</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="module:@wider/utils_proto/proto_date_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="module-@wider_utils_proto_proto_date.html#~toISOString">toISOString</a></li></ul></div></li><li><a href="module-@wider_utils_proto_proto_date_test.html">@wider/utils_proto/proto_date/test</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="module:@wider/utils_proto/proto_date/test_sub"></div></li><li><a href="module-@wider_utils_proto_proto_function.html">@wider/utils_proto/proto_function</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="module:@wider/utils_proto/proto_function_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="module-@wider_utils_proto_proto_function.html#~describe()">describe()</a></li></ul></div></li><li><a href="module-@wider_utils_proto_proto_function_test.html">@wider/utils_proto/proto_function/test</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="module:@wider/utils_proto/proto_function/test_sub"></div></li><li><a href="module-@wider_utils_proto_proto_number.html">@wider/utils_proto/proto_number</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="module:@wider/utils_proto/proto_number_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="module-@wider_utils_proto_proto_number.html#~bitsUpTo()">bitsUpTo()</a></li><li><a href="module-@wider_utils_proto_proto_number.html#~two()">two()</a></li></ul></div></li><li><a href="module-@wider_utils_proto_proto_number_test.html">@wider/utils_proto/proto_number/test</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="module:@wider/utils_proto/proto_number/test_sub"></div></li><li><a href="module-@wider_utils_proto_proto_object.html">@wider/utils_proto/proto_object</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="module:@wider/utils_proto/proto_object_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="module-@wider_utils_proto_proto_object.html#~assign()">assign()</a></li><li><a href="module-@wider_utils_proto_proto_object.html#~deepMerge()">deepMerge()</a></li></ul></div></li><li><a href="module-@wider_utils_proto_proto_object_test.html">@wider/utils_proto/proto_object/test</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="module:@wider/utils_proto/proto_object/test_sub"></div></li><li><a href="module-@wider_utils_proto_proto_string.html">@wider/utils_proto/proto_string</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="module:@wider/utils_proto/proto_string_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="module-@wider_utils_proto_proto_string.html#~asHTML()">asHTML()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~attrEncode()">attrEncode()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~camelIse()">camelIse()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~checkSum()">checkSum()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~checkSumValidate()">checkSumValidate()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~contextParse()">contextParse()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~deCamelIse()">deCamelIse()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~ellipses()">ellipses()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~escape()">escape()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~extendedCharCodeFixer()">extendedCharCodeFixer()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~formStrToXMLattr()">formStrToXMLattr()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~fuzzyValue()">fuzzyValue()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~HTMLencode()">HTMLencode()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~HTMLencodeInit">HTMLencodeInit</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~isHTML()">isHTML()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~isHTMLerror()">isHTMLerror()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~proper()">proper()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~regExpEncode()">regExpEncode()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~replaceSafe()">replaceSafe()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~searchEncode()">searchEncode()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~selectorEncode()">selectorEncode()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~simpleHTMLtoPlain()">simpleHTMLtoPlain()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~standardMarkups()">standardMarkups()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~stringEncode()">stringEncode()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~textSignature()">textSignature ()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~trim()">trim()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~unescape()">unescape()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~unHTMLencode()">unHTMLencode()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~wrapAsError()">wrapAsError()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~wrapAsOK()">wrapAsOK()</a></li><li><a href="module-@wider_utils_proto_proto_string.html#~XMLverify()">XMLverify()</a></li></ul></div></li><li><a href="module-@wider_utils_proto_proto_string_contextParse.html">@wider/utils_proto/proto_string/contextParse</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="module:@wider/utils_proto/proto_string/contextParse_sub"><div class="member-type">Typedef</div><ul class="inner"><li><a href="module-@wider_utils_proto_proto_string_contextParse.html#~rowId">rowId</a></li><li><a href="module-@wider_utils_proto_proto_string_contextParse.html#~wider_context">wider_context</a></li></ul></div></li><li><a href="module-@wider_utils_proto_proto_string_test.html">@wider/utils_proto/proto_string/test</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="module:@wider/utils_proto/proto_string/test_sub"></div></li></ul></div><div class="lnb-api hidden"><h3>Classes</h3><ul><li><a href="module-@wider_utils_proto_proto_string_contextParse-ContextParse.html">ContextParse</a><button type="button" class="hidden toggle-subnav btn btn-link"> <span class="glyphicon glyphicon-plus"></span></button><div class="hidden" id="module:@wider/utils_proto/proto_string/contextParse~ContextParse_sub"><div class="member-type">Methods</div><ul class="inner"><li><a href="module-@wider_utils_proto_proto_string_contextParse-ContextParse.html#toString">toString</a></li></ul></div></li></ul></div>
</nav>
<div id="resizer"></div>
<div class="main" id="main">
<section>
<header>
<h2>@wider/utils_proto/proto_string/contextParse</h2>
</header>
<article>
<div class="container-overview">
</div>
<h3 class="subsection-title">Classes</h3>
<dl>
<dt>
<h4 class="name">
<a href="module-@wider_utils_proto_proto_string_contextParse-ContextParse.html">ContextParse</a>
<div class="container-source members">
<code><a href="module-@wider_utils_proto_proto_string_contextParse-ContextParse.html">module:@wider/utils_proto/proto_string/contextParse~ContextParse</a></code>
</div>
</h4>
</dt>
</dl>
<h3 class="subsection-title">Type Definitions</h3>
<dl>
<dt>
<h4 class="name" id="~rowId">
rowId
<div class="container-source members">
<code><a href="proto_string_contextParse.js.html">proto_string/contextParse.js</a></code>,
<code><a href="proto_string_contextParse.js.html#line12">line 12</a></code>
</div>
</h4>
</dt>
<dd>
<div class="description">
<p>the name of a unique row in the dataset - this is regardless of the table in which the row lives. Also used to identify other components in the system such as resource. Format is</p>
</div>
<!--
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">objectname</span>
</li>
</ul>
-->
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>tableName</code></td>
<td class="type">
<span class="param-type">NCName</span>
</td>
<td class="description last"><p>table reference name - often the same as that tag name for the element to which it relates
RowId_ // fixed delimiter
number // being the nth item that was created - this is not the nth item is the current set of rows as some rows may have been deleted and the remainder are not renumbered
[.number] // zero or more numbers, one per required child depth related to instances of a child element. Numbers here restart anew for each of the parent numbers
`</pre></p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>contactrowsRowId_2345</code></pre>
</dd>
<dt>
<h4 class="name" id="~wider_context">
wider_context
<div class="container-source members">
<code><a href="proto_string_contextParse.js.html">proto_string/contextParse.js</a></code>,
<code><a href="proto_string_contextParse.js.html#line23">line 23</a></code>
</div>
</h4>
</dt>
<dd>
<div class="description">
<p>A ydr context may be considered like a url except that is provides a reference to data, normally to a specific single attribute or its containing element, or to a collection of elements. Contexts are used pervasively to link server side XSD schema and its related data to client side processing.</p>
<p>Just like a url - this is a reference. To use this to actually access the data to which it refers requires the use of code that is authorised to access the data</p>
<p>Contexts can also be extended with hints as to what a application or client browser might do with the reference</p>
</div>
<!--
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
-->
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>urn</code></td>
<td class="type">
<span class="param-type">objectname</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>the unique identifier for the database zone - as used for example in <code>$wider.data.find(urn)</code> to obtain access to a dataset related to the current login. Optional when the <strong>id</strong> is a system wide unique row id, mandatory otherwise.</p></td>
</tr>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">rowId</span>
|
<span class="param-type">objectname</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>a YDR @see rowId or the name of the table that holds the data</p></td>
</tr>
<tr>
<td class="name"><code>attribute</code></td>
<td class="type">
<span class="param-type">objectname</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>the name of an attribute in the selected row - if omitted then the context refers to the whole row</p></td>
</tr>
<tr>
<td class="name"><code>xpath</code></td>
<td class="type">
<span class="param-type">xpath</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>if present then defines a path from the selected row to the required child element</p></td>
</tr>
<tr>
<td class="name"><code>buttons</code></td>
<td class="type">
<span class="param-type">enum</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>possible values |pane|subPane|absent| used only in the schema document to direct the way this attribute or row might be rendered on a form</p></td>
</tr>
<tr>
<td class="name"><code>selector</code></td>
<td class="type">
<span class="param-type">enum</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>possible values |table|tableWithAttributesList|tableBase| a suggestion as to which process or report might be related to accessing this context</p></td>
</tr>
<tr>
<td class="name"><code>action</code></td>
<td class="type">
<span class="param-type">enum</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>possible values |_edit|_delete|_help| at run time as hints from the client to the server as to what to do next</p></td>
</tr>
<tr>
<td class="name"><code>context</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>stays fixed as the value originally used to create this object - to be kept static.</p>
<p>Use <code>.toString()</code> method on this object for the new string context value if anything has changed</p></td>
</tr>
<tr>
<td class="name"><code>target</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>deprecated - do not use f</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
</dl>
</article>
</section>
</div>
<footer>
<img class="logo" src="http://y-d-r.co.uk/favicon.ico" style="width: 50px">
<div class="footer-text">Copyright Dr. Martin W. Baker 1985 onwards - MIT License</div>
</footer>
<script>prettyPrint();</script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/tui-doc.js"></script>
<script src="scripts/linenumber.js"></script>
<script>
var id = 'module:@wider/utils_proto/proto_string/contextParse_sub'.replace(/"/g, '_');
var selectedApi = document.getElementById(id); // do not use jquery selector
var $selectedApi = $(selectedApi);
$selectedApi.removeClass('hidden');
$selectedApi.parent().find('.glyphicon').removeClass('glyphicon-plus').addClass('glyphicon-minus');
showLnbApi();
</script>
</body>
</html>