• Workflow Forms - Clickable Download/Preview Buttons for Email Attachments -

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #54914  by marius_i
 
Environment: OpenKM Community Edition

Hi,

I'm developing a workflow that processes emails with attachments. The workflow successfully extracts email content and detects attachments, but I'm struggling to implement clickable download/preview functionality within the workflow form.

What Works:

Email content extraction (from, subject, body, date)
Attachment detection and metadata (filename, size, UUID)
Basic workflow form display

What I'm Trying to Achieve:

Clickable "Download Attachment" button that directly downloads the file
Clickable "Preview Attachment" button that opens file preview
Similar functionality to the native OpenKM email properties interface

Current Implementation:
Code: Select all
<!-- forms.xml -->
<button name="downloadAttachment" label="Download Attachment" width="200px" style="download" transition="download"/>
<button name="previewAttachment" label="Preview Attachment" width="200px" style="view" transition="preview"/>

<!-- processdefinition.xml -->
<node name="download_attachment">
    <script>
        String attachmentUuid = (String) executionContext.getVariable("attachmentUuid");
        String downloadUrl = "/OpenKM/frontend/Download?uuid=" + attachmentUuid;
        // No way to trigger actual download from here
    </script>
    <transition to="afisare_formular"/>
</node>
Question:
Is there any way to make workflow form buttons trigger direct file downloads?

Thank you in advance for any guidance!

Marius

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.