Files

53 lines
2.0 KiB
HTML
Raw Permalink Normal View History

<script type="text/javascript">
RED.nodes.registerType('collabora-extract', {
category: 'nextcloud collabora',
color: '#7950a2',
defaults: {
name: { value: '' },
config: { type: 'nc-collab-config', required: true },
filter: { value: 'contentcontrol' }
},
inputs: 1,
outputs: 1,
icon: 'font-awesome/fa-sitemap',
label: function () {
return this.name || 'extract structure';
}
});
</script>
<script type="text/html" data-template-name="collabora-extract">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name">
</div>
<div class="form-row">
<label for="node-input-config"><i class="fa fa-cog"></i> Config</label>
<input type="text" id="node-input-config">
</div>
<div class="form-row">
<label for="node-input-filter"><i class="fa fa-filter"></i> Filter</label>
<input type="text" id="node-input-filter" placeholder="contentcontrol">
</div>
</script>
<script type="text/html" data-help-name="collabora-extract">
<p><strong>List what's inside a document.</strong> Content controls, fields, or other structure depending on filter. Returns JSON — no new file.</p>
<h4>Input</h4>
<p>Same as convert: <code>msg.payload</code> or WebDAV GET <code>msg.ncPath</code>.</p>
<p>Filter: dropdown or <code>msg.filter</code>. Default <code>contentcontrol</code>.</p>
<h4>Output</h4>
<p>POST multipart to <code>/cool/extract-document-structure</code></p>
<p><code>msg.payload</code> and <code>msg.structure</code> = structure JSON</p>
<h4>When to use</h4>
<p>Before filling a template. You get field names (Customer, Date …) for the next node.</p>
<pre>inject { ncPath: "/Templates/contract.docx" }
→ collabora-extract (filter: contentcontrol)
→ function (map your data to field names)
→ collabora-transform / nc-office / bridge fillTemplateSave</pre>
</script>