I'm trying to set up an action so that after a file is uploaded to the 'temp' directory it is automatically copied to another directory.
The problem that I'm encountering is that the xpl never seems to run. I've tried adding debug statements, simplifying the XPL to just write some xml to file, even deliberately messing up the syntax in the XPL file to see if it will throw an error but nothing happens - the log never displays any messages related to the file.
The xpl file is loaded in `/webapps/orbeon/WEB-INF/resources/apps/numishare/xpl/archive. The code for the action is below. I'm sure that it runs because the 'setvalue' under 'Smoke' works - I'm checking that using the XForms inspector.
<xforms:group ref="$binding[not(string(mets:file[@USE='thumbnail']/mets:FLocat/@xlink:href))]">
<div style="margin:10px 0 20px 0">
<fr:image-attachment ref="instance('files-instance')/file" xxforms:size="60">
<xforms:filename ref="@filename"/>
<xforms:mediatype ref="@mediatype"/>
<xxforms:size ref="@size"/>
<xforms:label>Upload</xforms:label>
<xforms:action ev:event="DOMActivate">
<xforms:action ev:event="xxforms-upload-done" if="contains(instance('files-instance')/file/@mediatype, 'image/')">
<xforms:setvalue ref="$binding/mets:file[@USE='thumbnail']/mets:FLocat/@xlink:href" value="'test'"/>
<xforms:setvalue ref="instance('url-generator')/url" value="instance('files-instance')/file"/>
<xforms:setvalue ref="instance('serialize-config')/directory" value="instance('config')/images/absolute_path"/>
<xforms:setvalue ref="instance('serialize-config')/file" value="concat(substring-after(substring-before(instance('files-instance')/file, '.tmp'), 'xforms_upload_'), '.', substring-after(instance('files-instance')/file/@mediatype, 'image/'))"/>
<xforms:insert context="instance('dump')" origin="xxforms:call-xpl('oxf:/apps/numishare/xpl/archive-file.xpl', ('file', 'serialize-config', 'dump'), instance('files-instance')/file, instance('serialize-config'), instance('dump')), 'data')"/>