XBL Service Action

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

XBL Service Action

Joel Oates
Hello All,

So I have been using the Http service and Action in the form builder to
populate a series of check boxes. I have this working in a test form and all
works. Now my issue is when I try do the same thing within an XBL component.

Here is what I currently have in my XBL

<xf:model id="local-model" xxf:expose-xpath-types="true"
xxf:analysis.calculate="true">
    <xf:instance>
        <reject-referral>
            <specialty></specialty>
            <subSpecialty/>
            <reasonForRejection itemset-empty="false"></reasonForRejection>
        </reject-referral>
    </xf:instance>

    <xf:bind id="instance-bind" ref="instance()" name="instance">
            <xf:bind id="specialty-bind" ref="specialty" name="specialty" />
            <xf:bind id="sub-specialty-bind" ref="subSpecialty"/>
            <xf:bind id="rejection-reason-bind" ref="reasonForRejection" />
    </xf:bind>
   

    <xf:instance id="specialty-service-instance" class="fr-service"
             xxf:exclude-result-prefixes="#all">
            <body xmlns:xxbl="http://orbeon.org/oxf/xml/xbl"
          xmlns:fbf="java:org.orbeon.oxf.fb.FormBuilderXPathApi">
            &lt;s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
                &lt;column&gt;specialty&lt;/column&gt;
            &lt;/s:Envelope&gt;</body>
        </xf:instance>
    <xf:submission id="specialty-service-submission" class="fr-service"
                 
resource="http://localhost:8080/referrals-controller/configurations/serviceclinicmappings/searched"
                   method="post"
                   serialization="application/xml"
                   mediatype="application/xml">
           <xf:action event="xforms-submit"
ev:observer="specialty-service-submission">
           <xf:var name="request-instance-name"
value="'specialty-service-instance'"/>
           <xf:message value="$request-instance-name"/>
        </xf:action>
    </xf:submission>
         
    <xf:action id="specialty-action-binding">
        <xf:action event="xforms-value-changed xforms-ready"
ev:observer="local-model"
                   if="true()">
            <xf:send submission="specialty-service-submission"/>
        </xf:action>
        <xf:action event="xforms-submit"
ev:observer="specialty-service-submission">
            <xf:var name="request-instance-name"
value="'specialty-service-instance'"/>
            <xf:message value="$request-instance-name"/>
        </xf:action>
        <xf:action event="xforms-submit-done"
ev:observer="specialty-service-submission">
            <xf:action class="fr-itemset-action">
                <xf:var name="control-name" value="'specialty'"/>
                <xf:var name="response-items" value="./_/."/>
                <xf:var name="item-label" value="."/>
                <xf:var name="item-value" value="."/>
            </xf:action>
        </xf:action>
    </xf:action>
</xf:model>

The error I get in my logs are.. (Sorry about formatting)

12:17:00,073 DEBUG [org.orbeon.oxf.xforms.processor.XFormsServer] (default
task-33)                   start submission {id:
"mainSection-section≡grid-1-grid≡referral-details-control≡xf-1540≡xf-2396≡specialty-service-submission"}
12:17:00,073 DEBUG [org.orbeon.oxf.xforms.processor.XFormsServer] (default
task-33)                     found invalid node {element name:
"<reasonForRejection itemset-empty="false"/>"}
12:17:00,073 DEBUG [org.orbeon.oxf.xforms.processor.XFormsServer] (default
task-33)                     instance document or subset thereof cannot be
submitted {document: "<reject-referral xmlns:xbl="http://www.w3.org/ns/xbl"
xmlns:workflow="http://www.infomedix.com.au/workflow"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:saxon="http://saxon.sf.net/"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxbl="http://orbeon.org/oxf/xml/xbl"
xmlns:exf="http://www.exforms.org/exf/1-0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fb="http://orbeon.org/oxf/xml/form-builder">
                        <specialty>Maternity</specialty>
                        <subSpecialty>Neo-natal</subSpecialty>
                        <reasonForRejection itemset-empty="false"/>
                    </reject-referral>"}


It looks like the transformation from having the class  "fr-service" is not
being applied, and the submission is using the local instance in the
submission.

Is there any way around this?


Thanks,
Joel.

--
Sent from: http://discuss.orbeon.com/

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1579755436590-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: XBL Service Action

Alessandro  Vernet
Administrator
Hi Joel,

The definition for your services & actions are stored in the form
definitions what "looks like XForms", e.g. using class annotations like
`fr-service`, that provide some shortcuts (making the form shorter) and
allow some implementation details to be be skipped and thus change from
version to version without having to change the form definition. That is
then transformed into "real XForms". But nothing of that sort happens for
XBL. So, in your XBL, you need to write "real XForms". Does this help?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1579809367431-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: XBL Service Action

Joel Oates
Ah I see, that does make sense, and from looking at the action.xsl (below) I
can see why this will not apply to xbl components as they are not required
too follow the "real xform" convention.

So, trying to work around this, as I am already pretty deep into my XBL
componenets, I want to run some of the actions that you have in the
action.xsl  action.xsl
<https://github.com/orbeon/orbeon-forms/blob/master/form-runner/jvm/src/main/resources/apps/fr/components/actions.xsl>  

I have created the item sets into variables, taking heavily from what is in
'fr-itemset-action', now it comes to copying the variables into a resource
element.

I was looking through the github and found the 'form-to-xbl.xsl'
form-to-xbl.xsl
<https://github.com/orbeon/orbeon-forms/blob/master/form-builder/jvm/src/main/resources/forms/orbeon/builder/service/form-to-xbl.xsl>
, Is this something I can use to create forms in the builder then create
XBL's from them using this script? and if so, will it expand the annotations
on the instances, actions and submissions?

Sorry, Little off topic.

Joel.





--
Sent from: http://discuss.orbeon.com/

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1579839611143-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: XBL Service Action

Alessandro  Vernet
Administrator
Hi Joel,

The `form-to-xbl.xsl` is used to generate XBL for section templates (if
you're not familiar with that feature, see the link below). This allows a
section of a form to be packaged as an XBL component, which can be used in
another form, also creating a some level of isolation between the
implementation of the section and the form using that section (e.g. to avoid
potential conflicts with control names).

https://doc.orbeon.com/form-builder/advanced/section-templates

I suspect that in your case you'll just want to write "plain" XForms in your
XBL, without the "Form Runner shortcuts".

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1579895794763-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: XBL Service Action

Joel Oates
Hi Alex,

Thanks for your reply.. I had a workaround this which means i had to put the
"plain" xforms in my xbl, but at the moment its getting very hard to manage
and change.

Is there anyway I can do some pre-xsl processing on my xbl components?

Similar to what you already have with the http service and action?

Cheers,
Joel.

--
Sent from: http://discuss.orbeon.com/

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1584339991777-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: XBL Service Action

Alessandro  Vernet
Administrator
Hi Joel,

The XBL engine is able to XSLT processing "natively". You do so by adding
the `xxbl:transform="oxf:unsafe-xslt"` attribute on your `<xbl:template>`.
You can see an example in the source of `button.xbl` (see 1st link below)
and in the documentation (see 2nd link below). You'll let me know if this
works for you.

https://github.com/orbeon/orbeon-forms/blob/master/form-runner/jvm/src/main/resources/xbl/orbeon/button/button.xbl
https://doc.orbeon.com/xforms/xbl/advanced-topics/extensions#xbl-template-xxbl-transform-attribute

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1584388699978-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet