Instance not replacing, what do I do wrong?

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

Instance not replacing, what do I do wrong?

Mike Ahlers
Hi,

I am sure this questions has been asked alot, and I think I have circumvented a few pitfalls, but it isn't working. So obviously, I am overlooking one. The goal is to request 'list' with preloaded data. Here is what I have:

--- page flow ---
<page id="list" path-info="/visum-country-data/list" view="list/summary.xhtml"/>
<page id="list-data" path-info="/visum-country-data/list-data">
    <action action="list/list-country-data.xpl"/>
</page>

-- summary.xhtml ---
<xforms:model id="common-model">
    <xforms:instance id="data-instance">
        <countries xmlns=""/>
    </xforms:instance>
    <xforms:instance id="control-instance">
        <status xmlns="">
            <message/>
        </status>
    </xforms:instance>

    <xforms:action ev:event="xforms-model-construct-done">
        <xforms:send submission="list-submission"/>
        <xforms:setvalue ref="instance('control-instance')/message" value="'oke loaded'"/>
    </xforms:action>

    <xforms:submission id="list-submission"
        ref="instance('data-instance')"
        method="post"
        serialize="false"
        resource="list-data"
        validate="false"
        replace="instance"
        xxforms:instance="documents-instance"
        f:url-type="resource"
        xxforms:readonly="true"
    />

--- list-country-data.xpl ---
    <p:param name="data" type="output"/>
   
    <p:processor name="oxf:identity">
        <p:input name="data">
            <countries xmlns="">
                <country id="cn"/>
                <country id="nl"/>
                <country id="au"/>
            </countries>
        </p:input>
        <p:output name="data" ref="data" id="static" debug="STATIC-DATA"/>
    </p:processor>


I do have an actual xquery which works, but the above should work as well in my opinion. Anyways, the log reports the processor called with XML content:

2008-06-23 15:43:08,190 INFO  DebugProcessor  - STATIC-DATA:
line 18, column 72 of oxf:/apps/visum-country-data/list/list-country-data.xpl

<countries xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:xdb="http://orbeon.org/oxf/xml/xmldb" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <country id="cn"/>
    <country id="nl"/>
    <country id="au"/>
</countries>

But, it is not replacing the data-instance. How come?

Thanks!
- Mike
Reply | Threaded
Open this post in threaded view
|

Re: Instance not replacing, what do I do wrong?

Alexander Žaťko
I just glanced over this quickly (so sorry if it does not work). It  
seems you need to make the following change in page-flow:

<page id="list" path-info="/visum-country-data/list" view="list/
summary.xhtml"/>

<page id="list-data" path-info="/visum-country-data/list-data"  
view="list/list-country-data.xpl"/>

A.

On Jun 23, 2008, at 3:48 PM, Mike Ahlers wrote:

>
> Hi,
>
> I am sure this questions has been asked alot, and I think I have
> circumvented a few pitfalls, but it isn't working. So obviously, I am
> overlooking one. The goal is to request 'list' with preloaded data.  
> Here is
> what I have:
>
> --- page flow ---
> <page id="list" path-info="/visum-country-data/list"
> view="list/summary.xhtml"/>
> <page id="list-data" path-info="/visum-country-data/list-data">
>    <action action="list/list-country-data.xpl"/>
> </page>
>
> -- summary.xhtml ---
> <xforms:model id="common-model">
>    <xforms:instance id="data-instance">
>        <countries xmlns=""/>
>    </xforms:instance>
>    <xforms:instance id="control-instance">
>        <status xmlns="">
>            <message/>
>        </status>
>    </xforms:instance>
>
>    <xforms:action ev:event="xforms-model-construct-done">
>        <xforms:send submission="list-submission"/>
>        <xforms:setvalue ref="instance('control-instance')/message"
> value="'oke loaded'"/>
>    </xforms:action>
>
>    <xforms:submission id="list-submission"
>        ref="instance('data-instance')"
>        method="post"
>        serialize="false"
>        resource="list-data"
>        validate="false"
>        replace="instance"
>        xxforms:instance="documents-instance"
>        f:url-type="resource"
>        xxforms:readonly="true"
>    />
>
> --- list-country-data.xpl ---
>    <p:param name="data" type="output"/>
>
>    <p:processor name="oxf:identity">
>        <p:input name="data">
>            <countries xmlns="">
>                <country id="cn"/>
>                <country id="nl"/>
>                <country id="au"/>
>            </countries>
>        </p:input>
>        <p:output name="data" ref="data" id="static" debug="STATIC-
> DATA"/>
>    </p:processor>
>
>
> I do have an actual xquery which works, but the above should work as  
> well in
> my opinion. Anyways, the log reports the processor called with XML  
> content:
>
> 2008-06-23 15:43:08,190 INFO  DebugProcessor  - STATIC-DATA:
> line 18, column 72 of
> oxf:/apps/visum-country-data/list/list-country-data.xpl
>
> <countries xmlns:oxf="http://www.orbeon.com/oxf/processors"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:p="http://www.orbeon.com/oxf/pipeline"
> xmlns:xdb="http://orbeon.org/oxf/xml/xmldb"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>    <country id="cn"/>
>    <country id="nl"/>
>    <country id="au"/>
> </countries>
>
> But, it is not replacing the data-instance. How come?
>
> Thanks!
> - Mike
> --
> View this message in context: http://www.nabble.com/Instance-not-replacing%2C-what-do-I-do-wrong--tp18069325p18069325.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Instance not replacing, what do I do wrong?

Mike Ahlers
Hi Alexander,

Thanks for the feedback, and I think I understand where you're getting at. However, it doesn't work. I am receiving a binding exception, with no caused by... what else could it be?

As far I can tell I don't have any binding rules at all, not to mention I have validate="false"...

2008-06-23 19:08:06,531 ERROR XFormsServer  - XForms - submission - xforms-submit-error throwable: org.orbeon.oxf.common.OXFException: Binding exception.
        at org.orbeon.oxf.xforms.XFormsModelSubmission.performDefaultAction(XFormsModelSubmission.java:895)
        at org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEvent(XFormsContainingDocument.java:980)
        at org.orbeon.oxf.xforms.XFormsModelSubmission.performDefaultAction(XFormsModelSubmission.java:777)
        at org.orbeon.oxf.xforms.XFormsContainingDocument.dispatchEvent(XFormsContainingDocument.java:980)
        at org.orbeon.oxf.xforms.action.actions.XFormsSendAction.execute(XFormsSendAction.java:45)
....

Regards,
Mike
Reply | Threaded
Open this post in threaded view
|

Re: Re: Instance not replacing, what do I do wrong?

Alexander Žaťko
Not having the complete code, here are couple of more guesses. In:

>  <xforms:submission id="list-submission"
>       ref="instance('data-instance')"
>       method="post"
>       serialize="false"
>       resource="list-data"
>       validate="false"
>       replace="instance"
>       xxforms:instance="documents-instance"
>       f:url-type="resource"
>       xxforms:readonly="true"
>   />
Why do you have argument  xxforms:instance="documents-instance" in the  
xforms:submission? Its presence does not make sense to me and also - I  
don't see instance named "documents-instance" in the code you sent  
previously.

Same applies to xxforms:readonly="true" and  f:url-type="resource" -  
what is the purpose for having these in there? I think you should  
simplify your code.

Try this:

<xforms:submission id="list-submission" ref="instance('data-
instance')" resource="list-data" method="post" replace="instance">

A.

On Jun 23, 2008, at 7:12 PM, Mike Ahlers wrote:

>
> Hi Alexander,
>
> Thanks for the feedback, and I think I understand where you're  
> getting at.
> However, it doesn't work. I am receiving a binding exception, with  
> no caused
> by... what else could it be?
>
> As far I can tell I don't have any binding rules at all, not to  
> mention I
> have validate="false"...
>
> 2008-06-23 19:08:06,531 ERROR XFormsServer  - XForms - submission -
> xforms-submit-error throwable: org.orbeon.oxf.common.OXFException:  
> Binding
> exception.
> at
> org
> .orbeon
> .oxf
> .xforms
> .XFormsModelSubmission
> .performDefaultAction(XFormsModelSubmission.java:895)
> at
> org
> .orbeon
> .oxf
> .xforms
> .XFormsContainingDocument
> .dispatchEvent(XFormsContainingDocument.java:980)
> at
> org
> .orbeon
> .oxf
> .xforms
> .XFormsModelSubmission
> .performDefaultAction(XFormsModelSubmission.java:777)
> at
> org
> .orbeon
> .oxf
> .xforms
> .XFormsContainingDocument
> .dispatchEvent(XFormsContainingDocument.java:980)
> at
> org
> .orbeon
> .oxf
> .xforms
> .action.actions.XFormsSendAction.execute(XFormsSendAction.java:45)
> ....
>
> Regards,
> Mike
> --
> View this message in context: http://www.nabble.com/Instance-not-replacing%2C-what-do-I-do-wrong--tp18069325p18073722.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Instance not replacing, what do I do wrong?

Paedagogus
Alex,

I think this is the same problem as the one being reported here:
http://www.nabble.com/XForms-call-to-Web-Service-td18016320.html

I was able to reproduce it without a web service. The full source is in my reply:
http://www.nabble.com/Re%3A-XForms-call-to-Web-Service-p18022972.html


Alexander Zatko wrote
Not having the complete code, here are couple of more guesses. In:

>  <xforms:submission id="list-submission"
>       ref="instance('data-instance')"
>       method="post"
>       serialize="false"
>       resource="list-data"
>       validate="false"
>       replace="instance"
>       xxforms:instance="documents-instance"
>       f:url-type="resource"
>       xxforms:readonly="true"
>   />

Why do you have argument  xxforms:instance="documents-instance" in the  
xforms:submission? Its presence does not make sense to me and also - I  
don't see instance named "documents-instance" in the code you sent  
previously.

Same applies to xxforms:readonly="true" and  f:url-type="resource" -  
what is the purpose for having these in there? I think you should  
simplify your code.

Try this:

<xforms:submission id="list-submission" ref="instance('data-
instance')" resource="list-data" method="post" replace="instance">

A.

On Jun 23, 2008, at 7:12 PM, Mike Ahlers wrote:

>
> Hi Alexander,
>
> Thanks for the feedback, and I think I understand where you're  
> getting at.
> However, it doesn't work. I am receiving a binding exception, with  
> no caused
> by... what else could it be?
>
> As far I can tell I don't have any binding rules at all, not to  
> mention I
> have validate="false"...
>
> 2008-06-23 19:08:06,531 ERROR XFormsServer  - XForms - submission -
> xforms-submit-error throwable: org.orbeon.oxf.common.OXFException:  
> Binding
> exception.
> at
> org
> .orbeon
> .oxf
> .xforms
> .XFormsModelSubmission
> .performDefaultAction(XFormsModelSubmission.java:895)
> at
> org
> .orbeon
> .oxf
> .xforms
> .XFormsContainingDocument
> .dispatchEvent(XFormsContainingDocument.java:980)
> at
> org
> .orbeon
> .oxf
> .xforms
> .XFormsModelSubmission
> .performDefaultAction(XFormsModelSubmission.java:777)
> at
> org
> .orbeon
> .oxf
> .xforms
> .XFormsContainingDocument
> .dispatchEvent(XFormsContainingDocument.java:980)
> at
> org
> .orbeon
> .oxf
> .xforms
> .action.actions.XFormsSendAction.execute(XFormsSendAction.java:45)
> ....
>
> Regards,
> Mike
> --
> View this message in context: http://www.nabble.com/Instance-not-replacing%2C-what-do-I-do-wrong--tp18069325p18073722.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> You receive this message as a subscriber of the ops-users@ow2.org  
> mailing list.
> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> For general help: mailto:sympa@ow2.org?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws



--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Instance not replacing, what do I do wrong?

Mike Ahlers
In reply to this post by Alexander Žaťko
Hi Alexander,

Thanks! Problem solved. I got it working. Don't ask me why I had the wrong instance, obviously it was a wrong copy and paste from an example I saw. The other attributes were also listed there. I remember I tried different permutations, but I believe the real cause/problem was my page-flow where I had an action instead of the view.

Thanks again!
- Mike