How to persist files to database directly from fr:attachment

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to persist files to database directly from fr:attachment

bsdang
Hi All,

We are using fr:attachment and use a mix of custom submissions i.e. xf:submission and fr:save-button and fr:submit button.

save and submit process have "require-uploads" which persists the uploaded files to the database. Is there a way to directly invoke the "require-uploads" from custom xf:submission?

If we define a custom process with just require-uploads, and try to invoke from the custom xf:submission it does not work.

<property as="xs:string" name="oxf.fr.detail.process.save-attachment.*.*"
  value="require-uploads"/>

Thanks,
Balvinder
Reply | Threaded
Open this post in threaded view
|

Re: How to persist files to database directly from fr:attachment

Alessandro  Vernet
Administrator
Hi Balvinder,

I think you're on the right track. To run this action, you'd have to create a process that runs it (defined it in your properties, more info about this in the page linked above), and run it with process:runProcessByName() as done by process-button.xbl:

https://github.com/orbeon/orbeon-forms/blob/master/src/resources-packaged/xbl/orbeon/process-button/process-button.xbl

I hope this helps,

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet