XPL not running

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

XPL not running

Timothy Hollies
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 

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XPL not running

Erik Bruchez
Administrator
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?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XPL not running

Timothy Hollies
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? 

On Thu, Aug 3, 2017 at 11:06 PM, Erik Bruchez <[hidden email]> wrote:
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XPL not running

Erik Bruchez
Administrator
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XPL not running

Timothy Hollies
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

On Mon, Aug 7, 2017 at 8:50 PM, Erik Bruchez <[hidden email]> wrote:
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
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

--
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 [hidden email].
To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XPL not running

Erik Bruchez
Administrator
Very good, I am glad that helped.

-Erik
Loading...