I'm thinking of how to construct the PortletInstance class, which cleans up our portletConfig and getID problems.
This will be a wrapper that implements the Portlet API, will be what is used in PortletSet, will have references to a Portlet class object, an Entry (psml) and a PortletEntry (registry), and will delegate all the Portlet API to these. Might as well merge in the PortletWrapper stuff recently introduced (I think). There's two views of the PortletInstance; outside and inside. >From the outside, the PortletInstance will be used by callers as a Portlet, and the delegation will work to satisfy the API. When an outside wants the portlet.getID(), the Entry.getId() will end up being called. When the outsider wants the portlet.getContent(), the Portlet.getContent() will end up being called. The inside, though, is what it looks like to the actual Portlet class instance. A Portlet might want to know what its ID is, so will call it's own getID(). Since the wrapper is not a "base class" of the portlet, it will not participate in this getID() call. Instead, likely AbstractPortlet().getID() will be invoked. We can fix AbstractPortlet to play this game, but... How to do so? Without changing the Portlet API, and without changing all the code written to the Portlet API, and without storing anything in each Portlet class object (these have to be read-only, multi-thread safe), how can the AbstractPortlet know about the wrapper? I'm still thinking on this one, but I'd appreciate any advice. There's one good trick which involves storing stuff in a hashtable keyed by the current thread - then folks down the call stack can access the "current" stuff in a thread safe maner without having it passed as parameters. We could store the "current" PortletInstance in this way, and have AbstractPortlet access the "current" PortletInstance to satisfy internal requests... Thanks! - Glenn -------------------------------------------- Glenn R. Golden, Systems Research Programmer University of Michigan School of Information [EMAIL PROTECTED] 734-615-1419 -------------------------------------------- -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
