a6ff9b20e5
Human-readable help in all six palette nodes, docs/NODES.md with usage examples, expanded example flows, and auto-detect NODERED_DIR plus CODE bridge IP from .env on any VM. Co-authored-by: Cursor <cursoragent@cursor.com>
55 lines
2.1 KiB
HTML
55 lines
2.1 KiB
HTML
<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> Namn</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>Lista vad som finns i dokumentet.</strong> Content controls, fält, ev. annan struktur beroende på filter. Returnerar JSON — ingen ny fil.</p>
|
|
|
|
<h4>Varifrån</h4>
|
|
<p>Samma som convert: <code>msg.payload</code> eller WebDAV GET <code>msg.ncPath</code>.</p>
|
|
<p>Filter: dropdown eller <code>msg.filter</code>. Default <code>contentcontrol</code>.</p>
|
|
|
|
<h4>Vart</h4>
|
|
<p>POST multipart → <code>/cool/extract-document-structure</code></p>
|
|
|
|
<h4>Ut</h4>
|
|
<p><code>msg.payload</code> och <code>msg.structure</code> = struktur-JSON</p>
|
|
|
|
<h4>När</h4>
|
|
<p>Innan du fyller en mall. Du får fältnamnen (Kund, Datum …) så nästa nod vet vad den ska slå in.</p>
|
|
|
|
<pre>inject { ncPath: "/Mallar/avtal.docx" }
|
|
→ collabora-extract (filter: contentcontrol)
|
|
→ function (mappa data till fältnamn)
|
|
→ collabora-transform / nc-office / bridge fillTemplateSave</pre>
|
|
</script>
|