Login  Register

Re: Re: Re: Re: Re: Re: From java servlet to orbeon context

Posted by Bart Ottenkamp on Jul 26, 2009; 8:21pm
URL: https://discuss.orbeon.com/From-java-servlet-to-orbeon-context-tp44958p44972.html

Hai Alex,
thanks for the answers. I'm past my release date now, so I skipped some functionality and have some more time now to get things rights.
I included some comments/questions in below conversation... they're in red

On Wed, Jul 22, 2009 at 12:36 AM, Alessandro Vernet <[hidden email]> wrote:

Bart,


bartottenkamp wrote:
>
> 1.
> Did you have a look at what I mailed you what's in my java code, page-flow
> and .xpl? You might see a thing missing or something done wrong...
> This is what is returned to the client from the java code I mailed you:
>
> <?xml version="1.0" encoding="utf-8"?><xxf:event-response
> xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
>><xxf:dynamic-state>pers:784A27F5-359A-CFA7-F395-2C0DFFDB57FB</xxf:dynamic-state><xxf:action><xxf:control-values
> /></xxf:action></xxf:event-response>
>
> so this indeed seems empy and I guess the logging of XFormsServer is
> therefore correct:
>
> WARN  XFormsServer  - XForms - submission - instance replacement did not
> take place upon successful response because no body was provided.
> Submission: mail-submission
>

Not quite. There are 2 distinct requests:

* The Ajax request made from the browser to the server and its response.
This is what you see in Firebug, and is "internal" to Orbeon Forms.
* The submission done from the server to your service. That is the
submission that contains the data you are interested it. If you get a
nightly build and set the XFormsModelSubmission to log at the debug level
(see: http://wiki.orbeon.com/forms/doc/developer-guide/xforms-logging), you
can see what is sent to your service, and what comes back. This is what we
are interested in.

So in addition to testing this with nightly build, I recommend you add
XFormsModelSubmission in debug mode to you log4j.xml and see what is sent
and received by the service. Also add a debug on the output of the pipeline
to see what is returned by the pipeline.

I'll do that. Didn't have time yet. I understand the difference in the submission and the ajax request, but am still wondering; the result of the service should be passed to the ajax call and be visible in the response on that Ajax call? Anyway, I'll see what the debugging results are..


bartottenkamp wrote:
>
> 2.
> Can you maybe point me to an example of what I want; a submit that 'goes'
> to
> java and returns the result? Like 'success' or 'failure'... There should
> be
> one or two I think...?
>

Using the Java processor there is generic-init-database.xpl in the examples,
but it doesn't return any data.

No, to bad. I found that one alright. But you don't plan to include (or already have waiting somewhere) an example that really dows give you back a response? I figure that a lot of people want their submission to result in a message from the server that indicates whether things went right or wrong..


bartottenkamp wrote:
>
> 3.
> I also asked you this question:
> - trying to call some orbeon functionallity in my own java code to turn
> the
> complete node into a stripped one that only has the relevant nodes.. You
> do
> this somewhere in orbeon code, don't you? Can I call this code? Since I
> have
> the context available?
> Do you know an answer to this one?
>

What do you mean by stripped node? I assume you have a DOM in Java, from
which you want to remove node; which one?

What I really mean is this:
I'm building forms that have a lot of question-answer functionality and lead the customer through different possible flows to come to the end. In these forms, with submission at the end, I'm very much interested in which flow the customer took. This is of course done with relevances in bindings. Now, if I use the submission functionallity and I point the submission to a custom processor, that processor receives the 'stripped' model. I mean, the complete model is posted, but the nodes that are not relevant (due to binding and user input in the form) are already stripped and gone from the xml my custom processor receives... You see what I mean? I'm wondering where that 'magic' happens... If I can call the code that does the trick myself, then I could use the xxforms:call-xpl() again, because in that case I can strip the node myself.. and I can get messages from my processors back to the browser that way...


bartottenkamp wrote:
>
> 4.
> Back to my problem with popup blocking:
> I' m always working with FF3 and IE8 and everything works fine there, but
> if
> I use IE6 en IE7, popup blocking is in the way and if I then choose to
> allow
> popups, the pdf is NOT downloaded AND the form is refreshed and all data
> id
> gone...
> My quess my first question is; doesn't ring this a bell somewhere with
> you?
> Am I the only one with this problem as you know?
>

You're not. And the only reliable way I know to do this, at the HTML level,
is to have in the page a simple link  ... Download PDF . If you have the
file you want to serve in a node (base64 or URI to temporary file), you can
use an <xforms:output ref="file1" appearance="xxforms:download">. You'll
find an example of this in output-download.xhtml, and more documentation on:

http://www.orbeon.com/ops/doc/reference-xforms-extensions#xxforms-download-appearance

OK, I understand. To make this a serious option though, the customer should not have to 'click twice'. This means temporarily saving the file and then download it should be possible as a result of just one user click. I'll go figur eout how to do that...

Alex

-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet
--
View this message in context: http://www.nabble.com/From-java-servlet-to-orbeon-context-tp24479768p24597044.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