Re: How to get the context into a ContextTool

Keats Kirsch <[email protected]>
Newsgroups gmane.comp.java.webmacro.user
Message-ID <[email protected]>
I had developed a way to use "context-aware" functions, but I think the 
concept was rejected in favor of the new AutoContextVariable concept. 

I believe it works something like:

public class ContextManipulator implements ContextAutoLoader {
    public Object get(String name, Context context) throws 
PropertyException {
       return doSomethingWithTheContext(context);
   }
}

I think you configure this as a ContextTool, like:

    ContextTools.Manipulate: com.acme.wm.ContextManipulator

And then access it in the template like:

$Manipulate

Hope this helps.

Keats

marcel.huijkman wrote:

> How to get the context into a ContextTool?
>
> I am playing with a ContextTool, which  does a lot for me, but I
> want to be able to manipulate the context from within my too.
>
> I can do it in a dirty kind of way, by putting the context in
> a var "WM_CONTEXT" into the context.
>
> And if I have to get of set something, I'll do it like this in my 
> template:
> $util.manipulate($WM_CONTEXT);
>
> But I was wandering if there isn't any better, cleaner way to do this?
> Can a ContextTool (that is loaded once) manipulate the exact context
> the end-user is playing with?
>
> - Marcel -
>
> PS. I start working for a java-company next year, so I hope to do more 
> WM.
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now. 
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Webmacro-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/webmacro-user
>



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.