You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by on 2004/05/06 04:31:54 UTC

how to get velocity context from a Request pull tool?

In Turbine-2.3, how would you get velocity context within a Request pull tool?
i.e., in my request pull tool, I need to do something like:
	Context ctx = whichClass.getTemplateContext(data)

thanks in advance!

richard


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: how to get velocity context from a Request pull tool?

Posted by Daniel <da...@yorku.ca>.
Hi,

import org.apache.turbine.services.velocity.TurbineVelocity;
...
Context context = TurbineVelocity.getContext(runData);

Your pull tool's init(Object o) method would be passed a runData object
that you pass to the method above.

Regards,
Daniel

On Wed, 5 May 2004, it was written:

> In Turbine-2.3, how would you get velocity context within a Request pull tool?
> i.e., in my request pull tool, I need to do something like:
> 	Context ctx = whichClass.getTemplateContext(data)
>
> thanks in advance!
>
> richard
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: how to get velocity context from a Request pull tool?

Posted by Richard Han <rh...@totalcarepharmacy.com>.
I'll reply my own question:
	use
org.apache.turbine.services.velocity.TurbineVelocity.getContext(data)

cheers

On Wed, 2004-05-05 at 20:31, an unknown sender wrote:
> In Turbine-2.3, how would you get velocity context within a Request pull tool?
> i.e., in my request pull tool, I need to do something like:
> 	Context ctx = whichClass.getTemplateContext(data)
> 
> thanks in advance!
> 
> richard
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: how to get velocity context from a Request pull tool?

Posted by Jeffery Painter <pa...@kiasoft.com>.
If you are looking at an action class or screen class where the Context is 
pushed through on the backend, you can access your pull tools by
taking the pull tool from the context object.

import com.mycompany.tools.PullTool;


	PullTool pTool = (PullTool) context.get("toolReference");

you can then manipulate your pull tool on the backend until your needs are 
met. then you will want to place your pull tool (now updated) back into
the context so that it's changes are not lost...

	context.put("toolReference", pTool);

I think this is what you were asking... if not please let us know.

Jeffery Painter


On Wed, 5 May 2004, it was written:

> In Turbine-2.3, how would you get velocity context within a Request pull tool?
> i.e., in my request pull tool, I need to do something like:
> 	Context ctx = whichClass.getTemplateContext(data)
> 
> thanks in advance!
> 
> richard
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org