This is not a perfect a solution, but it exists, the forum module
shows an example:
* ForumController (extends PageMVCHandler) is called by posting to a
form. This
** does the business, like replying to a thread etc (by delegating
to ForumManager)
** knows how/where to redirect once done or in case of errors.
* Paragraphs are ActionBasedParagraph, which execute a little piece of
code (see the info.magnolia.module.forum.frontend.action package)
which will make stuff available to the templates (${action.foobar}
would print what the action's getFoobar() method would return). This
is currently only support with freemarker templates and a bit
experimental (i.e subject to change), but it works.
hth,
-g
On Sep 11, 2008, at 10:42 AM, Will Scheidegger wrote:
Dear Magnolians
I'm hoping that someone can tell me "the right way" to access data
that is used in several requests.
Description:
Magnolia features a "pages" mechanism (PageMVCHandler) which is an
easy way for not having to place business logic in the templates.
You can call a page, let it do the work and then display a standard
magnolia page as result depending on the outcome of the work.
Unfortunately this most likely includes two requests:
1. a request which calls the PageMVCHandler page
2. a redirect request to the standard magnolia page
Problem:
If you would like to do a query in the PageMVCHandler and then
display the results in a standard magnolia page you will somehow
need to display the fetched nodes in the second request. But the JCR
session which fetched the nodes is closed after request one. When
you access the nodes in request two, you will get a ton of
Exceptions: javax.jcr.RepositoryException: this session has been
closed.
What would be "the right way" to do this?
Thanks + regards,
will
----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/
----------------------------------------------------------------
----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/
----------------------------------------------------------------