Jaap van der Molen said:
> I have the following problem with the ToolboxContext: the class extends
> VelocityContext, yet doesn't implement any of the methods in the class
> hierarchy.

not quite true, but close enough.

> The collection of ToolInfo objects is stored in a private Map on the
> ToolboxContext,
> meaning the super-class methods like getKeys(), etc. do not return a
> correct result.

no.  the ToolInfo instances are stored in the ToolboxManager as either a group
of Maps (ServletToolboxManager) or single Map (default in XMLToolboxManager).
the ToolboxManager creates a ToolboxContext from a separate Map of actual tool
instances.

> Similar for ChainedContext.  If I create a ChainedContext using an existing
> VelocityContext, the getKeys() method returns 0 (zero), while the
> VelocityContext does contain elements.

the ChainedContext ctor feeds the Context you gave it to super(null, ctx)
(i.e. VelocityContext(Map, Context) ).  VelocityContext.getKeys() will not
check the specified context for keys.  it only checks the Map.  i don't know
why that is.

> Is there a specific reason for this? Or should I go for a bug report?
>
> Background: I am trying to get the tools available in the vm's of an
> existing web
> application (Roller - http://www.rollerweblogger.org). I have to work with
an
> existing VelocityContext object that I can't simply replace by a
> ChainedContext.

hmm.  well, i'd be happy to help you figure out a way to do this.  frankly,
i've never quite understood the purpose of ToolboxContext or it's design.  it
always seemed like a pointless exercise, but since it hasn't actually caused a
problem yet, i haven't bothered to mess with it.

i've also had hesitations about the current, lone ChainedContext constructor
(and a few other parts of its implementation).  i've been meaning to take a
look at improving these things at some point.  so, while i won't have much
free development time in the next 2-3 weeks, i'd be happy to at least start
discussing ways we could improve this and hopefully make it work for you.

Nathan Bubna
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to