node-red-contrib-filemaker
Version:
Node-RED FileMaker nodes. These nodes use the FileMaker Data API to connect with a FileMaker database.
185 lines (179 loc) • 8.06 kB
HTML
<script type="text/javascript">
RED.nodes.registerType("dapi-list-records", {
category: "FileMaker",
defaults: {
name: { value: null, required: false },
client: { value: null, type: "dapi-client", required: true },
layout: {
value: "payload.layout",
required: true
},
layoutType: { value: "msg" },
limit: { value: null, required: false },
limitType: { value: "num" },
offset: { value: null, required: false },
offsetType: { value: "num" },
sort: { value: null, required: false },
sortType: { value: "none" },
scripts: { value: null, required: false },
scriptsType: { value: "none" },
portals: { value: null, required: false },
portalsType: { value: "none" },
output: { value: "payload", required: true }
},
inputs: 1,
outputs: 1,
icon: "list.png",
color: "#39D1C0",
paletteLabel: "List",
label: function() {
return this.name || "List Records";
},
oneditprepare: function() {
var nullType = {
value: "none",
label: "None",
icon: "",
hasValue: false
};
$("#node-input-layout").typedInput({
default: "msg",
types: ["str", "msg", "flow", "global"],
typeField: $("#node-input-layoutType")
});
$("#node-input-limit").typedInput({
default: "none",
types: ["num", "msg", "flow", "global",nullType],
typeField: $("#node-input-limitType")
});
$("#node-input-offset").typedInput({
default: "none",
types: ["num", "msg", "flow", "global",nullType],
typeField: $("#node-input-offsetType")
});
$("#node-input-sort").typedInput({
default: "none",
types: ["json", "msg", "flow", "global", nullType],
typeField: $("#node-input-sortType")
});
$("#node-input-scripts").typedInput({
default: "none",
types: ["json", "msg", "flow", "global", nullType],
typeField: $("#node-input-scriptsType")
});
$("#node-input-portals").typedInput({
default: "none",
types: ["json", "msg", "flow", "global", nullType],
typeField: $("#node-input-portalsType")
});
$("#node-input-output").typedInput({
default: "msg",
types: ["msg"]
});
}
});
</script>
<script type="text/x-red" data-template-name="dapi-list-records">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag" aria-hidden="true"></i> <span>Name</span></label>
<input type="text" id="node-input-name" placeholder="Specific Node">
</div>
<hr>
<div class="form-row">
<label for="node-input-client"><i class="fa fa-cogs" aria-hidden="true"></i> <span>Client</span></label>
<input type="text" id="node-input-client">
</div>
<div class="form-row">
<label for="node-input-layout"><i class="fa fa-list-alt" aria-hidden="true"></i> <span>Layout</span></label>
<input type="hidden" id="node-input-layoutType">
<input type="text" id="node-input-layout">
</div>
<hr>
<div class="form-row">
<label for="node-input-limit"><i class="fa fa-stop-circle-o" aria-hidden="true"></i> <span>Limit</span></label>
<input type="hidden" id="node-input-limitType">
<input type="text" id="node-input-limit">
</div>
<div class="form-row">
<label for="node-input-offset"><i class="fa fa-step-forward" aria-hidden="true"></i> <span>Offset</span></label>
<input type="hidden" id="node-input-offsetType">
<input type="text" id="node-input-offset">
</div>
<div class="form-row">
<label for="node-input-sort"><i class="fa fa-sort" aria-hidden="true"></i> <span>Sort</span></label>
<input type="hidden" id="node-input-sortType">
<input type="text" id="node-input-sort">
</div>
<div class="form-row">
<label for="node-input-scripts"><i class="fa fa-files-o" aria-hidden="true"></i> <span>Scripts</span></label>
<input type="hidden" id="node-input-scriptsType">
<input type="text" id="node-input-scripts">
</div>
</div>
<div class="form-row">
<label for="node-input-portals"><i class="fa fa-code-fork" aria-hidden="true"></i> <span>Portals</span></label>
<input type="hidden" id="node-input-portalsType">
<input type="text" id="node-input-portals">
</div>
<hr>
<div class="form-row">
<label for="node-input-output"><i class="fa fa-arrow-circle-o-right" aria-hidden="true"></i> <span>Output</span></label>
<input type="hidden" id="node-input-outputType">
<input type="text" id="node-input-output">
</div>
</script>
<script type="text/x-red" data-help-name="dapi-list-records">
<p>
This node lists FileMaker records for a specified layout. By default this node will use the value found in
<code>msg.payload.layout</code> as layout context.
</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>layout<span class="property-type">String</span><dd>The layout to use when listing records</dd>
<dt>limit<span class="property-type">Number</span><dd>The number of records to return in the list. Default is <code>100</code>.</dd>
<dt>offset<span class="property-type">Number</span><dd>The position to start listing records. Default is <code>0</code>.</dd>
<dt>sort<span class="property-type">Object</span><dd>The sort order of the records.<a target="_blank" href="https://github.com/Luidog/fms-api-client#sort-syntax"> More Info.</a></dd>
<dt>portals<span class="property-type">Array</span><dd>An array of portals to return with the list.<a target="_blank" href="https://github.com/Luidog/fms-api-client#portals-array-syntax"> More Info.</a></dd>
<dt>scripts<span class="property-type">Array</span><dd>The FileMaker scripts to run when listing records.<a target="_blank" href="https://github.com/Luidog/fms-api-client#script-array-syntax"> More Info.</a></dd>
</dl>
<h3>Outputs</h3>
<ol class="node-ports">
<li>Standard Output
<dl class="message-properties">
<dt>data <span class="property-type">Array</span>
<dd>The listed records.</dd>
</dt>
<dt>dataInfo<span class="property-type">Object</span>
<dd>Request metadata information.</dd>
</dt>
</dl>
</li>
<li>Standard Error
<dl class="message-properties">
<dt>message<span class="property-type">String</span>
<dd>The FileMaker or client error message.</dd>
</dt>
<dt>error<span class="property-type">String</span>
<dd>The applicable FileMaker error code.</dd>
</dt>
</dl>
</li>
</ol>
<h3>Details</h3>
<p>
This node lists FileMaker records from the specified layout. By default this node will use <code>msg.payload.layout</code>
as the layout context for listing records. <br/><br/>This node can be configured to use either static or dynamic input
parameters. Dynamic parameters may be read from either the <code>msg</code> property or the <code>flow</code> and
<code>global</code> contexts.<br/><br/>The default output of this node is <code>msg.payload</code>. This node can also
be configured to merge its output with any property on the <code>msg</code> object.
</p>
<h3>References</h3>
<ul>
<li><a href="https://github.com/Luidog/fms-api-client#list-records">List Method</a> - Base Client Documentation.</li>
<li><a href="https://github.com/Luidog/fms-api-client#sort-syntax"> Sort Syntax.</a> - Sort Syntax Documentation</li>
<li><a href="https://github.com/Luidog/fms-api-client#script-array-syntax">Scripts Array</a> - Scripts Array Documentation</li>
<li><a href="https://github.com/Luidog/fms-api-client#portals-array-syntax">Portals Array</a> - Portals Array Documentation</li>
<li><a href="https://github.com/Luidog/node-red-contrib-filemaker">Node-Red FileMaker</a> - The Node's Github Repository</li>
<li><a href="https://github.com/Luidog/fms-api-client">Data API Client</a> - Data API Client Github Repository</li>
</ul>
</script>