Eduardo Millán wrote:
Quoting joern turner <joern.turner-S0/GAf8tV78@xxxxxxxxxxxxxxxx>:
Eduardo Millán wrote:
Talking about ServletAdapter and processMultiPartRequest:
Should the file sent with the upload control be saved into the *uploadDir*
directory set at Servlet initialization parameters? Or only establish the
encoded data into the instance? We can do anything suitable to our needs.
i think it should depend on the datatype of the bound node.
from 8.1.6 The upload Element:
"Implementation Requirements: For anyURI data binding:
*
When bound to an instance data node of type xsd:anyURI (or a type
derived by restriction thereof), on activation upload places a URI in
the content of the node.
For security reasons, the XForms Processor must not dereference
the URI bound to this form control without explicit user permission.
Note:
Implementors note that upload must associate the binary content,
mediatype, and filename with that URI for 11.4 Serialization as
multipart/related and 11.5 Serialization as multipart/form-data
serialization."
my proposal would be: when we've got a anyURI type for the bound node,
we'll put the (file) URI into that node *and* save the data to
uploaddir. for the other datatyes (base64,hexBinary) we store the data
directly as part of the intance data.
From Servlet adapter you cannot find out which datatype the bounded control
owns. I see that getModelBinding() in BoundElement is protected and can't
figure out how to get it.
why not move this decision into the updateControlValue() method itself?
would need a bit of refactoring but surely the better place to do it.
i've just moved that updateControlValue (the normal version) out of
ServletAdapter so that is hasn't to deal with Chiba internals like
BoundElement.
Other issue, what happens with Upload.setValue() when the user specifies
a Single Node Binding, e.g. using *ref* attributes instead *bind* ones?
I've modified Upload.java to throw a XFormsException in that case, cause
don't know if there is a way out.
i think this is right at the moment. discussed this issue today with Uli
and we came to the conclusion that this is another problem in the spec.
- the upload example shows a ref-attribute to bind the upload. but on
the other side the spec states that nodes bound to upload have to be of
type anyURI, base64 or hexBinary. but UI-bindings do not have any
datatype at all (or in best case default to string). it's obvious to me
that a upload has to have one of the mentioned types, otherwise
processing is not possible.
to be correct we should check for the datatype of the BoundElement
before doing the upload.
Joern
Regards.
Joern
Cheers.
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|