You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by "Heine, Christian (Extern)" <Ch...@gedas.de> on 2002/11/25 10:28:53 UTC
How to get Velocity Context References in VT?
Hi all,
i am try to develop an own Velocity-Portlet based Portal by Jetspeed. Now i
making my first steps in Velocity. For that i've created my first
VelocityPortletAction :
import org.apache.jetspeed.modules.actions.portlets.VelocityPortletAction;
import org.apache.jetspeed.portal.portlets.VelocityPortlet;
import org.apache.turbine.util.RunData;
import org.apache.velocity.context.Context;
public class MyPortletAction
extends VelocityPortletAction
{
public MyPortletAction() {
}
protected void buildNormalContext(VelocityPortlet portlet, Context
context,
RunData data)
{
String text = "Run Portlet run";
context.put("myfoo", text);
context.put("velo", "Halligalli");
//this.doPerform(data, context);
}
}
I've put this action in the following directory :
org.apache.jetspeed.modules.actions.portlets
After the registration for that Portlet in Portlet.xreg i've creat an own
testPortlet.vm
and placed it in the correct directory. (It works because i see a hello
String placed in that VT).
The Problem i have is that i couldn't use the references to the Context like
in that way:
$myfoo, $velo ....
What is my failure? Must i registry my Java Class in the Turbine Ressources?
I've tried that by this way :
tools.request.myVar =
org.apache.jetspeed.modules.actions.portlets.MyPortletAction
But when i do that, jetspeed will not start and throws an torque
Exception...
Thanks for any help in advance,
Christian
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>