A basic example...

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

A basic example...

Rodrigo Ojeda
Hi group:

For several days I have tried to develop a simple application:

- A page that has several fields to fill with text info and an upload
field to upload a file (my tests were based on a jpg image file)
- A response xhtml page that displays the text info and the image
uploaded.

I followed the upload control example. I could get the text info through
the instance with XInclude in the response page model.

My model is:
<xforms:model>
        <xforms:instance>
                <data xmlns="">
                        <data1/>
                        <data2/>
                        <data3/>
                        <file xmlns="" filename=""...>
                </data>
        </xforms:instance>
        <xforms:bind nodeset="file" type="xs:anyURI"/>
</xforms:model>
xforms:submission id="main-submission" method="post"
action="/test/page2"/>

I tried with base64Binary, the model in upload example processors (it
contains url-generator and http-serializer processors) and <xi:include
href="input:data"/>. I tried many many alternatives but I cannot display
the image D:

Some kind soul can explain me how can I do that?

I know the question it's very noob and I apologize for wasting your time
in something so simple.

Regards!

--
Don't try to bend the spoon, that's impossible. Instead, only try to
realize the truth.
-What truth?-
There is no spoon.
-There is no spoon?-
Then you'll see that it's not the spoon that bends, it is only yourself.




--
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: A basic example...

Alessandro Vernet
Administrator
On 6/8/07, Rodrigo Ojeda <[hidden email]> wrote:
> Hi group:
>
> For several days I have tried to develop a simple application:
>
> - A page that has several fields to fill with text info and an upload
> field to upload a file (my tests were based on a jpg image file)
> - A response xhtml page that displays the text info and the image
> uploaded.

Let's first get something out of the way: when you use xs:anyURI, it
means the file will be available to the service or page that receives
the instance, but it will be removed after that request is processed.
In your case:

1) End users fill the form on page 1
2) They click on the submit button
3) Page 2 is generate with the link to the image
4) The browser makes a request to that link to get the image

One way to deal with this is when you generate page 2 to go read the
image stored at the URL specified in the instance, copy that image
somewhere (say in a database, or directory) assigning it some unique
ID (say 123). Then in the HTML you generate a link to a service like
/image?id=123, where /image runs an XPL which loads the image with ID
123 from wherever you stored it earlier.

And BTW, this is really good question. We should create an example
that shows how this can be done.

I hope this helps.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: A basic example...

Rodrigo Ojeda
Thanks Alex.

Now, I'm working on an attach button =D

On Sat, 2007-06-09 at 18:08 +0200, Alessandro Vernet wrote:

> On 6/8/07, Rodrigo Ojeda <[hidden email]> wrote:
> > Hi group:
> >
> > For several days I have tried to develop a simple application:
> >
> > - A page that has several fields to fill with text info and an upload
> > field to upload a file (my tests were based on a jpg image file)
> > - A response xhtml page that displays the text info and the image
> > uploaded.
>
> Let's first get something out of the way: when you use xs:anyURI, it
> means the file will be available to the service or page that receives
> the instance, but it will be removed after that request is processed.
> In your case:
>
> 1) End users fill the form on page 1
> 2) They click on the submit button
> 3) Page 2 is generate with the link to the image
> 4) The browser makes a request to that link to get the image
>
> One way to deal with this is when you generate page 2 to go read the
> image stored at the URL specified in the instance, copy that image
> somewhere (say in a database, or directory) assigning it some unique
> ID (say 123). Then in the HTML you generate a link to a service like
> /image?id=123, where /image runs an XPL which loads the image with ID
> 123 from wherever you stored it earlier.
>
> And BTW, this is really good question. We should create an example
> that shows how this can be done.
>
> I hope this helps.
>
> Alex
> plain text document attachment (message-footer.txt)
> --
> 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
--
Don't try to bend the spoon, that's impossible. Instead, only try to
realize the truth.
-What truth?-
There is no spoon.
-There is no spoon?-
Then you'll see that it's not the spoon that bends, it is only yourself.




--
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: A basic example...

Rodrigo Ojeda
The odyssey continues... =D

I attached mi basic app so you can look and give me some comments (and
laugh (or cry maybe XD))

It's the basic form with an upload file field.

I tried 2 options of playing with the code:

- Write the file on disk (with its original name)(success =D) and return
to the view and keeping the original data writed by the user and the
file selected(xforms-upload example style) with an "attach button"
and... failed.
- Write the file on disk and go to the next page... a simple xpl that
spits the content of the data passed through the pipelines (having the
mozilla xforms add-on) and... failed

then...

I'm loosing something in the way... D:

If you can give me some tips about submission, instance replacements and
passing the instances and the data through the pipes I will be very
grateful.

Regards.

On Thu, 2007-06-14 at 10:06 -0400, Rodrigo Ojeda wrote:

> Thanks Alex.
>
> Now, I'm working on an attach button =D
>
> On Sat, 2007-06-09 at 18:08 +0200, Alessandro Vernet wrote:
> > On 6/8/07, Rodrigo Ojeda <[hidden email]> wrote:
> > > Hi group:
> > >
> > > For several days I have tried to develop a simple application:
> > >
> > > - A page that has several fields to fill with text info and an upload
> > > field to upload a file (my tests were based on a jpg image file)
> > > - A response xhtml page that displays the text info and the image
> > > uploaded.
> >
> > Let's first get something out of the way: when you use xs:anyURI, it
> > means the file will be available to the service or page that receives
> > the instance, but it will be removed after that request is processed.
> > In your case:
> >
> > 1) End users fill the form on page 1
> > 2) They click on the submit button
> > 3) Page 2 is generate with the link to the image
> > 4) The browser makes a request to that link to get the image
> >
> > One way to deal with this is when you generate page 2 to go read the
> > image stored at the URL specified in the instance, copy that image
> > somewhere (say in a database, or directory) assigning it some unique
> > ID (say 123). Then in the HTML you generate a link to a service like
> > /image?id=123, where /image runs an XPL which loads the image with ID
> > 123 from wherever you stored it earlier.
> >
> > And BTW, this is really good question. We should create an example
> > that shows how this can be done.
> >
> > I hope this helps.
> >
> > Alex
> > plain text document attachment (message-footer.txt)
> > --
> > 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
> plain text document attachment (message-footer.txt)
> --
> 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
--
Don't try to bend the spoon, that's impossible. Instead, only try to
realize the truth.
-What truth?-
There is no spoon.
-There is no spoon?-
Then you'll see that it's not the spoon that bends, it is only yourself.


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

view.xhtml (2K) Download Attachment
page-flow.xml (578 bytes) Download Attachment
read-uri.xpl (1K) Download Attachment
curriculum_form.css (719 bytes) Download Attachment
areyousure.xpl (442 bytes) Download Attachment
file-writing.xpl (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: A basic example...

Rodrigo Ojeda
This is a parcial auto-response XD

I'm sending the instance through the <action><result...
transform="oxf:xslt"> and chewing it with an identity processor =3

But any elegant suggestion is welcome

Regards!

On Tue, 2007-06-19 at 19:40 -0400, Rodrigo Ojeda wrote:

> The odyssey continues... =D
>
> I attached mi basic app so you can look and give me some comments (and
> laugh (or cry maybe XD))
>
> It's the basic form with an upload file field.
>
> I tried 2 options of playing with the code:
>
> - Write the file on disk (with its original name)(success =D) and return
> to the view and keeping the original data writed by the user and the
> file selected(xforms-upload example style) with an "attach button"
> and... failed.
> - Write the file on disk and go to the next page... a simple xpl that
> spits the content of the data passed through the pipelines (having the
> mozilla xforms add-on) and... failed
>
> then...
>
> I'm loosing something in the way... D:
>
> If you can give me some tips about submission, instance replacements and
> passing the instances and the data through the pipes I will be very
> grateful.
>
> Regards.
>
> On Thu, 2007-06-14 at 10:06 -0400, Rodrigo Ojeda wrote:
> > Thanks Alex.
> >
> > Now, I'm working on an attach button =D
> >
> > On Sat, 2007-06-09 at 18:08 +0200, Alessandro Vernet wrote:
> > > On 6/8/07, Rodrigo Ojeda <[hidden email]> wrote:
> > > > Hi group:
> > > >
> > > > For several days I have tried to develop a simple application:
> > > >
> > > > - A page that has several fields to fill with text info and an upload
> > > > field to upload a file (my tests were based on a jpg image file)
> > > > - A response xhtml page that displays the text info and the image
> > > > uploaded.
> > >
> > > Let's first get something out of the way: when you use xs:anyURI, it
> > > means the file will be available to the service or page that receives
> > > the instance, but it will be removed after that request is processed.
> > > In your case:
> > >
> > > 1) End users fill the form on page 1
> > > 2) They click on the submit button
> > > 3) Page 2 is generate with the link to the image
> > > 4) The browser makes a request to that link to get the image
> > >
> > > One way to deal with this is when you generate page 2 to go read the
> > > image stored at the URL specified in the instance, copy that image
> > > somewhere (say in a database, or directory) assigning it some unique
> > > ID (say 123). Then in the HTML you generate a link to a service like
> > > /image?id=123, where /image runs an XPL which loads the image with ID
> > > 123 from wherever you stored it earlier.
> > >
> > > And BTW, this is really good question. We should create an example
> > > that shows how this can be done.
> > >
> > > I hope this helps.
> > >
> > > Alex
> > > plain text document attachment (message-footer.txt)
> > > --
> > > 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
> > plain text document attachment (message-footer.txt)
> > --
> > 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
> plain text document attachment (message-footer.txt)
> --
> 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
--
Don't try to bend the spoon, that's impossible. Instead, only try to
realize the truth.
-What truth?-
There is no spoon.
-There is no spoon?-
Then you'll see that it's not the spoon that bends, it is only yourself.




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