saving to a file

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

saving to a file

Richard Braman
Message
would this code work in ops?
<xforms:submission action="file://tmp/file.xml" method="put" id="submit"/>
 
 

Richard Braman
[hidden email]
561.748.4002 (voice)

http://www.taxcodesoftware.org
Free Open Source Tax Software

 


--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: saving to a file

Alessandro  Vernet
Administrator
On 2/13/06, Richard Braman <[hidden email]> wrote:
> would this code work in ops?
> <xforms:submission action="file://tmp/file.xml" method="put" id="submit"/>

Richard,

You're right, this won't work. Instead you should have in action a URL
which in page-flow.xml is mapped to XPL file. And the XPL file can
save its "instance" input to a file with the file serializer.

Note that this is also the most portable way to do this from the
XForms perspective, as using the method above will work even if you
use another XForms engine, say an XForms engine that runs in the
browser. If you use a file:// URL with an XForms engine that run in
the browser, you might end up with a temporary file on your end-user's
machine (or more likely a security violation).

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

RE: saving to a file

Richard Braman
How would an XPL file work on a client side Xforms Engine?  The code
<xforms:submission action="file://tmp/file.xml" method="put"
id="submit"/>
Is from Micah's Essentials book.


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
Alessandro Vernet
Sent: Tuesday, February 14, 2006 3:54 AM
To: [hidden email]
Subject: Re: [ops-users] saving to a file


On 2/13/06, Richard Braman <[hidden email]> wrote:
> would this code work in ops?
> <xforms:submission action="file://tmp/file.xml" method="put"
> id="submit"/>

Richard,

You're right, this won't work. Instead you should have in action a URL
which in page-flow.xml is mapped to XPL file. And the XPL file can save
its "instance" input to a file with the file serializer.

Note that this is also the most portable way to do this from the XForms
perspective, as using the method above will work even if you use another
XForms engine, say an XForms engine that runs in the browser. If you use
a file:// URL with an XForms engine that run in the browser, you might
end up with a temporary file on your end-user's machine (or more likely
a security violation).

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/





--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: saving to a file

Erik Bruchez
Administrator
Richard Braman wrote:
 > How would an XPL file work on a client side Xforms Engine?

I wouldn't.

 > The code <xforms:submission action="file://tmp/file.xml"
 > method="put" id="submit"/> Is from Micah's Essentials book.

Note that supporting the "file:" protocol is not mandatory in XForms,
just recommended ("should").

The reason we do not support this is that there is no satisfying way
to tell a web browser, with JavaScript, to obtain and save a file on
disk. If you have a native XForms engine, sure, it can do that (and
will probably have to ask you for a confirmation).

The best way to work around this is to do a submission to the server
with a "GET" and replace="all", or to use an xforms:load. To get
there, you must ensure the information you want to save as a file is
available on the server. This is how the "DMV Forms" example provides
the XML and PDF versions of the file.

-Erik

 > -----Original Message-----
 > From: [hidden email] [mailto:[hidden email]] On Behalf Of
 > Alessandro Vernet
 > Sent: Tuesday, February 14, 2006 3:54 AM
 > To: [hidden email]
 > Subject: Re: [ops-users] saving to a file
 >
 >
 > On 2/13/06, Richard Braman <[hidden email]> wrote:
 >> would this code work in ops?
 >> <xforms:submission action="file://tmp/file.xml" method="put"
 >> id="submit"/>
 >
 > Richard,
 >
 > You're right, this won't work. Instead you should have in action a URL
 > which in page-flow.xml is mapped to XPL file. And the XPL file can save
 > its "instance" input to a file with the file serializer.
 >
 > Note that this is also the most portable way to do this from the XForms
 > perspective, as using the method above will work even if you use another
 > XForms engine, say an XForms engine that runs in the browser. If you use
 > a file:// URL with an XForms engine that run in the browser, you might
 > end up with a temporary file on your end-user's machine (or more likely
 > a security violation).
 >
 > Alex
 > --
 > Blog (XML, Web apps, Open Source):
 > http://www.orbeon.com/blog/




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws