raphael 01/07/03 10:39:41
Modified: src/java/org/apache/jetspeed/modules/actions/portlets
CustomizeSetAction.java VelocityPortletAction.java
Log:
[fix] improve ActionEvent processing flow (still some work to do on that)
Revision Changes Path
1.3 +1 -3
jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/CustomizeSetAction.java
Index: CustomizeSetAction.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/CustomizeSetAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CustomizeSetAction.java 2001/06/25 10:53:37 1.2
+++ CustomizeSetAction.java 2001/07/03 17:39:29 1.3
@@ -99,9 +99,7 @@
{
// we should first retrieve the portlet to customize
PortletSet set = (PortletSet)rundata.getSession().getAttribute("customize");
-
- context.put("action", "portlets.CustomizeSetAction");
-
+
if (set==null) return;
// retrieve the portlet parameters
1.5 +30 -6
jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/VelocityPortletAction.java
Index: VelocityPortletAction.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/VelocityPortletAction.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- VelocityPortletAction.java 2001/07/03 16:20:36 1.4
+++ VelocityPortletAction.java 2001/07/03 17:39:31 1.5
@@ -91,14 +91,38 @@
protected void perform( RunData rundata )
throws Exception
{
- try
+ // first try to see if there are some events registered for this
+ // action...
+ Context context = getContext(rundata);
+ if ((context!=null)&&(rundata.getParameters().getString("action")!=null))
{
- executeEvents(rundata, getContext(rundata) );
- }
- catch (NoSuchMethodException e)
+ // if context is already defined and Actions defined, events
+ // have already been processed, call doPerform
+ Log.debug("Action detected with action + context");
+ doPerform(rundata, context);
+ }
+ else
{
- // no event selected
- doPerform(rundata, getContext(rundata));
+ // if context is null, create a new one
+ if (context==null)
+ {
+ Log.debug("Action: building action context");
+ context = TurbineVelocity.getContext();
+
rundata.getTemplateInfo().setTemplateContext("VelocityActionContext",context);
+ }
+
+ try
+ {
+ // process implicit ActionEvent invocation
+ Log.debug("Action: try executing events");
+ executeEvents(rundata, context);
+ }
+ catch (NoSuchMethodException e)
+ {
+ // no event selected, process normal context generation
+ Log.debug("Action: calling doPerform");
+ doPerform(rundata, context);
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]