I am using quite the same environment as you do...javaflow, jxtemplates,
some custom generators.
Looking around I found no application object, too, but :-) maybe the
this concept might help:
Create a "standalone" cocoon independent class, that is responsible for
building your items cache. If you implement this class as a singleton it
would just act like a application object. I don't think that you need
much synchronizing, so it should be no performance issue.. it would
behave like the logger.
This class could either recieve events from your database, or a
"administration trigger reload webpage", or poll the database every 50
hits for new items...
I don't know how fit you are in java, but that it is not really hard to
implement, and I think it should work... although I am not really a java
guru yet :-).
HTH,
tom
footh schrieb:
I still can't seem to find any information on an
equivalent solution for an application-scope object.
I've switched to JavaFlow and JX templates now. Would
a class variable in a JavaFlow be considered as an
application-scope variable, if I had the flow run
through every page?
The problem I'm trying to solve is, I have a list X
items (which very gradually increases, maybe a couple
a week). On each page click in my site, I want to
randomly grab a few of them to display to the user.
In JSP, I implemented this by storing all the items in
an application object, which was essentially a vector
of the items, and randomly grabbed a few from this
vector on each page click. In this situation, if the
number of items increased, I would need to restart the
container to initialize the vector with the new
amount. But, I wouldn't have to hit the database on
every click.
I wonder if there is a better way to do this in
Cocoon. I envision having a custom tag, say
<featured_items/> which would be replaced with XML
data on the randomly chosen items and then formatted
in an XSL transformation.
I am having trouble figuring out the logistics of
doing this. Can anyone offer some advice?
Regards,
JF
--- footh <[EMAIL PROTECTED]> wrote:
I've looked through a lot of documentation but I
can't
seem to find any information on this.
How does one set and/or access an application-scope
or
session-scope java object within the cocoon
framework
- either in an XSP page, a logicsheet or in a
pipeline. I've found lots of information on
accessing
simple session attributes but nothing on an object.
And I haven't found any information on the
application-scope.
A link to a resource would be just as welcome as an
explanation as I am more than happy to read
documentation.
Regards,
JF
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]