Re: [Xsltforms-support] applet-based local save/load using file://
Brought to you by:
alain-couthures
From: COUTHURES A. <ala...@ag...> - 2011-03-05 11:24:44
|
Hi André, The message you obtained comes from an older version than Beta3 which was indeed released on 2011-02-27. Please check the first line in the xsltforms.js file. Thanks! -Alain Le 04/03/2011 19:19, Andre Cusson a écrit : > Hi Alain, > > Using RC3 from 2011-02-27, I tried getting the applet-based saving and > loading but I must have missed something as I am getting this message > when I either try to load or save: > > XSLTForms Submission > --------------------------- > > file:// > > file:// is not supported for security reasons. > > Contents copied instead in clipboard if possible > and displayed by the browser. > > > In the model, I used > > <xf:submission id="save" method="put" replace="none" action="file://"> > <xf:message level="modeless" ev:event="xforms-submit-error">Submit > error.</xf:message> > </xf:submission> > <xf:submission id="load" method="get" serialization="none" > replace="instance" action="file://"> > <xf:message level="modeless" ev:event="xforms-submit-error">Submit > error.</xf:message> > </xf:submission> > > and in the form I have: > > <xf:submit submission="save"> > <xf:label>Save to local disk</xf:label> > </xf:submit> > <xf:submit submission="load"> > <xf:label>Restore from local disk</xf:label> > </xf:submit> > > > What must I be doing wrong this time :)? > > Thank you. > > Rgards, > Andre > > > > > Hello, > > I have added"file://" support in submission allowing users to save and > restore data instances on local disk with regular files. > > This is based on a Java applet. There are some integrated security > restrictions such as forbidden file extensions (.exe,...) and maximum > size (100 Mo). BOM is not yet supported. > > Each time, a Java file dialog is displayed to allow the user to select > the folder and to enter the file shortname. This dialog is initialized > with the path after"file://", if any. > > I have tested this successfully on Windows with FireFox, IE and Chrome > (there were some errors before accepting the applet, maybe wait > instructions (1 or 2 seconds) might help...) but it doesn't work yet > with Opera. Please find my test case below. > > Thank you for your feedbacks! > > -Alain > ------------------------------------------------------------------------ > <?xml version="1.0" encoding="UTF-8"?> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:xf="http://www.w3.org/2002/xforms"> > <head> > <title>Address Form</title> > <xf:model> > <xf:instance> > <Address xmlns=""> > <LocationStreetFullText/> > <LocationCityName/> > <LocationStateName/> > <LocationPostalID/> > </Address> > </xf:instance> > <xf:submission id="save" method="put" replace="none" action="file://"> > <xf:message level="modeless" ev:event="xforms-submit-error">Submit > error.</xf:message> > </xf:submission> > <xf:submission id="load" method="get" serialization="none" > replace="instance" action="file://"> > <xf:message level="modeless" ev:event="xforms-submit-error">Submit > error.</xf:message> > </xf:submission> > </xf:model> > </head> > <body> > <xf:group ref="/Address"> > <fieldset> > <legend>Mailing Address</legend> > <xf:input ref="LocationStreetFullText"> > <xf:label>Street:</xf:label> > </xf:input> > <br/> > <xf:input ref="LocationCityName"> > <xf:label>City:</xf:label> > </xf:input> > <br/> > <xf:input ref="LocationStateName"> > <xf:label>State:</xf:label> > </xf:input> > <br/> > <xf:input ref="LocationPostalID"> > <xf:label>Postal Code:</xf:label> > </xf:input> > </fieldset> > </xf:group> > <xf:submit submission="save"> > <xf:label>Save to local disk</xf:label> > </xf:submit> > <xf:submit submission="load"> > <xf:label>Restore from local disk</xf:label> > </xf:submit> > </body> > </html> > > |