I don't know whether it works, but I presume you tried this:
@InjectObject("infrastructure:context.roleModule")
public abstract RoleModule getRoleModule();
...?
If that doesn't work, the first snippet seems like the way to do it.
P
On Jul 12, 2006, at 5:22 PM, Epstein, Ezra wrote:
The beans are actually available as attributes of the WebContext
(which, in the context of a Portlet is actually an instance of
org.apache.tapestry.portlet.PortletWebContext). So I've figured
out how to get what I want, now I'm looking to automate it.
This works, but is a bit cumbersome:
<snippet file="View.java" status="success">
@InjectObject("infrastructure:context")
public abstract WebContext getWebContext();
public RoleModule getRoleModule() {
return (RoleModule)getWebContext().getAttribute("RoleModule");
}
</snippet>
And this fails:
<snippet file="View.java" status="fail">
@InjectObject("infrastructure:context.getAttribute(\"RoleModule\")")
public abstract RoleModule getRoleModule();
</snippet>
While I'm not surprised by the failing example, I do wonder: what
are the rules for the @InjectObject annotation? Can we use OGNL
(or ognl-like) expressions within its parameter? The docs state
that the value is a "HiveMind object reference". So, rephrasing
the question:
How do I bind the results of something like the ognl expression:
"infrastructure:context.getAttribute('RoleModule')" to an HiveMind
object? What's the hivemodule.xml incantation?
Thanks,
Ezra Epstein
-----Original Message-----
From: Paul Cantrell [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 11, 2006 4:00 PM
To: Tapestry users
Subject: Re: JSF-style bean access (JBoss) via HiveMind ?
I'm not entirely clear exactly what this code is doing, but is
sounds like Tapestry's ASOs (application state objects) are what
you want.
They are container-managed objects scoped to either the app or the
user session.
http://tapestry.apache.org/tapestry4/UsersGuide/state.html
If that doesn't do the trick, perhaps you can describe exactly what
this JSF code does....
Cheers, P
_________________________________________________________________
Piano music podcast: http://inthehands.com Other interesting stuff:
http://innig.net
On Jul 11, 2006, at 2:01 PM, Epstein, Ezra wrote:
We're trying to write some admin/management code for JBoss Portal in
Tapestry. Current code uses JSF. The relevant portion of the
faces-config.xml is:
<managed-bean>
<managed-bean-name>portalobjectmgr</managed-bean-name>
<managed-bean-
class>org.jboss.portal.core.portlet.management.PortalObjectManagerBea
n
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>roleModule</property-name>
<value>#{applicationScope.RoleModule}</value>
</managed-property>
<managed-property>
<property-name>portalObjectContainer</property-name>
<value>#{applicationScope.PortalObjectContainer}</value>
</managed-property>
...
</managed-bean>
I'd like to recreate this via HiveMind but am unclear what to put
into
the hivemodule.xml file. Any pointers to anything remotely related
is/are appreciated.
Thanks,
Ezra Epstein
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]