You should use the JCR API and the Magnolia utility classes.

Magnolia has a context object that's always available, it holds information 
about the request being handled such as the servlet request and response 
objects, the node being rendered (page, area, or component), the main content 
node (always the page) and so on. Access it using 
info.magnolia.context.MgnlContext.

You'd get the currently rendered node (page, area, or component) using 
MgnlContext.getAggregationState().getCurrentContentNode().

But you rarely need to do that since Blossom can give you the node as an 
argument directly to your controller method. For example:

@RequestMapping("/youtube")
public String render(Node node, ModelMap model) throws RepositoryException {
    model.put("videoId", node.getProperty("videoId").getString());
    return "components/youtube.jsp";
}

There's a number of convenient utility methods on these classes that should 
come in handy:

info.magnolia.jcr.util.NodeUtil
info.magnolia.jcr.util.PropertyUtil
info.magnolia.jcr.util.SessionUtil
info.magnolia.jcr.util.NodeTypes

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=48299db8-cfcf-4685-99b2-3285c5361fca


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to