Login  Register

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

Posted by Bart Ottenkamp on Jul 17, 2009; 10:11pm
URL: https://discuss.orbeon.com/From-java-servlet-to-orbeon-context-tp44958p44962.html

Hai Alex,

thanks again. This indeed seems to solve the loosing of data in the form thing. And if you say this is the way, then I'll do it this way. Thanks. Now I only have to figure out how my customers handle popup blocking..

But.... here comes the next thing to figure out:
Now I also want to add a link to mail the PDF (as an attachment). With that functionallity I want the form to stay the same, meaning on the same case of a switch for instance, and I want a message on the screen with the result of the mail process....

I can get this behaviour with:

<xforms:setvalue value = "xxforms:call-xpl('oxf:/apps/e-formulieren/forms/xpl/mail.xpl', 'data', instance('form-instance')/formcontent, 'data')" ref = "instance('result-instance')/success"/>

But, this will submit the complete node 'instance('form-instance')/formcontent' instead of only the relevant parts in this tree (specified in the bindings). In other words, I loose the orbeon submit functionallity.

So, how to solve this?
I thought of:
- 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?
- Using <xforms:submission anyway with replace="instance" and instance="result"...

I guess (hope) the latter is possible, but I get the message:
"XFormsServer  - XForms - submission - instance replacement did not take place upon successful response because no body was provided. Submission: mail-submission"

these are parts from my form:
            <xforms:instance id = "result-instance">
                <root>
                    <result/>
                    <failure/>
                    <success/>
                </root>
            </xforms:instance>
and
            <xforms:submission
                id = "mail-submission"
                ref = "instance('form-instance')/formcontent"
                xxforms:show-progress = "false"
                method = "post"
                action = "/e-formulieren/mail"
replace="instance"
instance="result-instance">
            </xforms:submission>

and in code I return a Document of form
<root>
                    <result/>
</root>

Can you help (again)?


On Fri, Jul 17, 2009 at 1:43 AM, Alessandro Vernet <[hidden email]> wrote:

Bart,


bartottenkamp wrote:
>
> Since you answereed me this quick though, here comes the next one.... :-):
> To go short (cutting come corners), this is what I want:
> I have my own java code to generate PDF documents (all generic, using
> IText
> and FOP, creatng Pdf document for all kinds of forms). Now, what I want is
> to be able to click on a link in an xforms form to generate this PDF (thus
> basically activate my 'Pdf code, but that is the easy part...), present it
> and NOT LOOSE the information filled in in the form by the user. The user
> should be presented a pdf and if hitting the back button, the form should
> be
> presented as it was before...
> Of course I tried a couple of things, starting with simply putting the
> generated pdf on the outputstream of a response from a servlet.. and this
> worked, also with hiitting the back button, but I was working in FireFox 3
> or IE 8... working with IE 7 or earlyer and hitting the back button gets
> me
> back to the page BEFORE the xform I opened..! And I loose all information
> on
> the screen when hiiting the forward button...
>

One way is to open the PDF in an new window. If you do this with an
<xforms:submission replace="all"/>, add an xxforms:target="_blank"
attribute.

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-tp24479768p24526328.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