Saving session data to file system

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

Saving session data to file system

s.thwaites
Hello,
My application maintains a history of user interactions by storing XML in the
session using the scopegenerator/serializer to store and retrieve the information.

At the point of exit(logoff) I wish to simply save the session history to the
file system (filename is the sessionId). To do this I use scope
generator/serializer to retreive/store the xml I require from the session and
connect this to the file serializer, I grab the sessionId from the request and
use this as the file name.

In doing so I receive the error, 'Root element must contain an xsi:type attribute'

Do I need to use the URL serializer with the <url/> in its config to point to an
xpl that generates the xml to be saved or do I need to simply use an xslt to add
an xsi:type to the root element of the xml to be saved. Or I am completely on
the wrong track here.

I would be grateful for any advice.

Regards,
Steve.





--
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 session data to file system

Erik Bruchez
Administrator
Stephen Thwaites wrote:

> Hello,
> My application maintains a history of user interactions by storing XML in the
> session using the scopegenerator/serializer to store and retrieve the information.
>
> At the point of exit(logoff) I wish to simply save the session history to the
> file system (filename is the sessionId). To do this I use scope
> generator/serializer to retreive/store the xml I require from the session and
> connect this to the file serializer, I grab the sessionId from the request and
> use this as the file name.
>
> In doing so I receive the error, 'Root element must contain an xsi:type attribute'
>
> Do I need to use the URL serializer with the <url/> in its config to point to an
> xpl that generates the xml to be saved or do I need to simply use an xslt to add
> an xsi:type to the root element of the xml to be saved. Or I am completely on
> the wrong track here.
>
> I would be grateful for any advice.
Steve, the File serializer only supports "text" and "binary" formats,
which explains your error:

   http://www.orbeon.com/ops/doc/reference-formats

To fix your issue, use the XML converter just before the File serializer.

-Erik




--
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 session data to file system

s.thwaites
Thanks Erik,
This is clear and I the problem is solved.

Further I notice that the file serializer does not create a directory if it does
not already exist. Is there a facility in the framework to dynamically create a
directory on the file system?

Regards,
Steve.

Quoting Erik Bruchez <[hidden email]>:

> Stephen Thwaites wrote:
> > Hello,
> > My application maintains a history of user interactions by storing XML in
> the
> > session using the scopegenerator/serializer to store and retrieve the
> information.
> >
> > At the point of exit(logoff) I wish to simply save the session history to
> the
> > file system (filename is the sessionId). To do this I use scope
> > generator/serializer to retreive/store the xml I require from the session
> and
> > connect this to the file serializer, I grab the sessionId from the request
> and
> > use this as the file name.
> >
> > In doing so I receive the error, 'Root element must contain an xsi:type
> attribute'
> >
> > Do I need to use the URL serializer with the <url/> in its config to point
> to an
> > xpl that generates the xml to be saved or do I need to simply use an xslt
> to add
> > an xsi:type to the root element of the xml to be saved. Or I am completely
> on
> > the wrong track here.
> >
> > I would be grateful for any advice.
>
> Steve, the File serializer only supports "text" and "binary" formats,
> which explains your error:
>
>    http://www.orbeon.com/ops/doc/reference-formats
>
> To fix your issue, use the XML converter just before the File serializer.
>
> -Erik
>
>
>





--
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 session data to file system

Erik Bruchez
Administrator
Stephen Thwaites wrote:
> Thanks Erik,
> This is clear and I the problem is solved.

Good!

> Further I notice that the file serializer does not create a directory if it does
> not already exist. Is there a facility in the framework to dynamically create a
> directory on the file system?

At this point, there is no such facility, but you could implement it
easily with the Java processor.

-Erik



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