XPL not running

4 views
Skip to first unread message

Timothy Hollies

unread,
Aug 3, 2017, 12:03:22 PM8/3/17
to Orbeon Forms
Hi,

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))]">
<h4>Upload</h4>
<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"/>
</fr:image-attachment>
</div>
<xforms:trigger>
<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/')">
<!--Smoke  -->
<xforms:setvalue ref="$binding/mets:file[@USE='thumbnail']/mets:FLocat/@xlink:href" value="'test'"/>
<!--Set writing  -->
<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/'))"/>
<!--write file  -->
<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')"/>
</xforms:action>
</xforms:action>
</xforms:trigger>
</xforms:group>

Any ideas?

Many thanks,
Tim 

Erik Bruchez

unread,
Aug 3, 2017, 6:06:52 PM8/3/17
to orb...@googlegroups.com
You say the XPL is under:

/webapps/orbeon/WEB-INF/resources/apps/numishare/xpl/archive

Is `archive` a directory? The call refers to:

/apps/numishare/xpl/archive-file.xpl

Are the paths right?

--
View this message in context: http://discuss.orbeon.com/XPL-not-running-tp4662673p4662675.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

Timothy Hollies

unread,
Aug 4, 2017, 4:18:37 AM8/4/17
to orb...@googlegroups.com
Woops - sorry, I copied the path incorrectly. 

The XPL file is under `/webapps/orbeon/WEB-INF/resources/apps/numishare/xpl/` and is called 'archive-file.xpl'. 

Out of interest - if an non-existent file was specified, should any errors show up in the logs? 


--
You received this message because you are subscribed to a topic in the Google Groups "Orbeon Forms" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orbeon/IB_b8Nu6o6E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orbeon+unsubscribe@googlegroups.com.
To post to this group, send email to orb...@googlegroups.com.

Erik Bruchez

unread,
Aug 7, 2017, 3:51:34 PM8/7/17
to orb...@googlegroups.com
This translates into an XPath dynamic error. You should see an
`xforms-action-error` in the logs when this happens (assuming a fairly
recent version of Orbeon Forms), since this occurs within an action, if you
enable logging of events with XForms logging. [1]

-Erik

[1] https://doc.orbeon.com/configuration/advanced/xforms-logging.html

--
View this message in context: http://discuss.orbeon.com/XPL-not-running-tp4662673p4662687.html

Timothy Hollies

unread,
Aug 8, 2017, 6:21:52 AM8/8/17
to orb...@googlegroups.com
Ah, yes - that was the problem. I had not enabled the XForms logging. 

With it switched on errors are showing up in the logs when the action runs so I can debug the problem (something to do with namespaces). 

Thanks for your help,
Tim

Erik Bruchez

unread,
Aug 9, 2017, 3:07:33 PM8/9/17
to orb...@googlegroups.com
Very good, I am glad that helped.

-Erik

--
View this message in context: http://discuss.orbeon.com/XPL-not-running-tp4662673p4662692.html
Reply all
Reply to author
Forward
0 new messages