2026-08-22 14:56:38 +02:00
|
|
|
<script type="text/javascript">
|
|
|
|
|
RED.nodes.registerType('collabora-bridge', {
|
|
|
|
|
category: 'nextcloud collabora',
|
2026-08-22 17:10:34 +02:00
|
|
|
color: '#7950a2',
|
2026-08-22 14:56:38 +02:00
|
|
|
defaults: {
|
|
|
|
|
name: { value: '' },
|
|
|
|
|
config: { type: 'nc-collab-config', required: true },
|
|
|
|
|
operation: { value: 'ncFileToPdf' }
|
|
|
|
|
},
|
|
|
|
|
inputs: 1,
|
|
|
|
|
outputs: 1,
|
|
|
|
|
icon: 'font-awesome/fa-exchange',
|
|
|
|
|
label: function () {
|
|
|
|
|
return this.name || this.operation;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script type="text/html" data-template-name="collabora-bridge">
|
|
|
|
|
<div class="form-row">
|
2026-08-22 17:36:38 +02:00
|
|
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
2026-08-22 14:56:38 +02:00
|
|
|
<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-operation"><i class="fa fa-wrench"></i> Pipeline</label>
|
|
|
|
|
<select id="node-input-operation">
|
|
|
|
|
<option value="ncFileToPdf">ncFileToPdf</option>
|
|
|
|
|
<option value="ncFileToPng">ncFileToPng</option>
|
|
|
|
|
<option value="ncFileToHtml">ncFileToHtml</option>
|
|
|
|
|
<option value="htmlToOffice">htmlToOffice</option>
|
|
|
|
|
<option value="fillTemplateSave">fillTemplateSave</option>
|
|
|
|
|
<option value="compareVersionsPdf">compareVersionsPdf</option>
|
|
|
|
|
<option value="extractToPayload">extractToPayload</option>
|
|
|
|
|
<option value="createAssetLink">createAssetLink</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script type="text/html" data-help-name="collabora-bridge">
|
2026-08-22 17:36:38 +02:00
|
|
|
<p><strong>Ready-made pipelines.</strong> Chains WebDAV + CODE + (sometimes) OCS and usually writes back to Nextcloud. This is the node you'll reach for most often.</p>
|
|
|
|
|
<p>Default destination: <code>/Dokument/OfficeOut/</code> unless you set <code>destNcPath</code> / <code>destFolder</code> / <code>destName</code>.</p>
|
2026-08-22 17:10:34 +02:00
|
|
|
|
|
|
|
|
<table style="width:100%; font-size:11px;">
|
2026-08-22 17:36:38 +02:00
|
|
|
<tr><th>Operation</th><th>Result</th></tr>
|
|
|
|
|
<tr><td><code>ncFileToPdf</code></td><td>PDF saved in NC</td></tr>
|
|
|
|
|
<tr><td><code>ncFileToPng</code></td><td>Preview PNG</td></tr>
|
|
|
|
|
<tr><td><code>ncFileToHtml</code></td><td>HTML in NC</td></tr>
|
|
|
|
|
<tr><td><code>htmlToOffice</code></td><td>HTML → docx/pdf …</td></tr>
|
|
|
|
|
<tr><td><code>fillTemplateSave</code></td><td>Fill template via OCS, save in NC</td></tr>
|
|
|
|
|
<tr><td><code>compareVersionsPdf</code></td><td>Diff PDF (new + <code>compareNcPath</code>)</td></tr>
|
|
|
|
|
<tr><td><code>extractToPayload</code></td><td>Field JSON in msg</td></tr>
|
|
|
|
|
<tr><td><code>createAssetLink</code></td><td><code>msg.assetUrl</code> for insert</td></tr>
|
2026-08-22 17:10:34 +02:00
|
|
|
</table>
|
|
|
|
|
|
2026-08-22 17:36:38 +02:00
|
|
|
<p>Override via <code>msg.operation</code>. Does not overwrite originals unless <code>msg.allowOverwrite=true</code>.</p>
|
|
|
|
|
<p>The other palette nodes are building blocks when bridge isn't enough.</p>
|
2026-08-22 17:10:34 +02:00
|
|
|
|
2026-08-22 17:36:38 +02:00
|
|
|
<pre>inject { ncPath: "/Documents/contract.docx" }
|
2026-08-22 17:10:34 +02:00
|
|
|
→ collabora-bridge (ncFileToPdf)
|
2026-08-22 17:36:38 +02:00
|
|
|
→ debug { destNcPath: "/Dokument/OfficeOut/contract.pdf" }</pre>
|
2026-08-22 17:10:34 +02:00
|
|
|
|
2026-08-22 17:36:38 +02:00
|
|
|
<p><strong>Rule of thumb:</strong> PDF in Nextcloud → <code>ncFileToPdf</code>. Fill template → <code>fillTemplateSave</code>. Open in browser → <code>nc-office document:direct</code>.</p>
|
2026-08-22 14:56:38 +02:00
|
|
|
</script>
|