Hi All,
I'm fairly new to cocoon and was hoping that someone might be able to
show me the way. I want to be able to use sessions to load/reload/preload
query results pages on demand. The idea sort of works like a page table
in an operating system. I'll use a scenario to describe what I'd like to
happen.
A user fills in a form which indicates that they want to search for
"rocky mountains". Upon submission of the form, the url that is built
matches a cocoon pipeline which refers to a xsp to generate content.
The pipeline also enforces pagination with parameters for number of
items per page and the current page to view. In the xsp, if the query
already exists in the session then we should reuse the results already
generated and stored if possible. If the query is new the results are
generated and added to the session. The idea here is to not recompute
query results when a user decides to view a second, third, or even fifth
page of results. We'll limit the amount of information stored in the
session to 5 pages (originally consecutive) of ten items each for each
query. I'd like to be able to replace pages of results in the session on
a least-recently-used scheme.
My issue is being able to find a cocoon solution to my problem. The
most convenient way to store the results would be in an xml document in a
format such as:
<queries>
<query query=_body:_rocky mountains__>
<page num=_1_ pages=_19_>
<item/>
</page>
</query>
</queries>
So that I can use XPath to validate how much processing is required for
the query and then retrieve the relevant parts of the document. As far as
I can tell, the session Transformer
(http://cocoon.apache.org/2.1/userdocs/session.html) is the only session
related structure which will do this for me. However, I'm not sure how I
could use this to efficiently determine the least amount of processing
that is to be done and then do it. Any suggestions would be appreciated.
I've also been looking at logicsheets session
(http://cocoon.apache.org/2.1/userdocs/logicsheets/session.html) which
appears to be extremely easy to use ( session.getAttribute(),
session.setAttribute() ) but doesn't allow for the xml structure that I
want to be able to match or retrieve.
Ideally I'd like to take a little bit from both of these methods and
have a session buffet. Any advice would be greatly appreciated.
Thanks,
Tricia
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]