taylor 2004/11/08 16:42:29 Modified: fusion/src/java/org/apache/jetspeed/fusion/portal/portlets JetspeedFusionPortlet.java fusion/src/java/org/apache/jetspeed/fusion/modules/actions FusionAccessController.java fusion/src/java/org/apache/jetspeed/fusion/util/template FusionJetspeedLink.java Log: more sync'ing up of Fusion with new nav state the nav state is still not sync'ing up correctly, needs a little more work what is working now: * actions * prefs * doView called only once CVS: ---------------------------------------------------------------------- CVS: PR: CVS: If this change addresses a PR in the problem report tracking CVS: database, then enter the PR number(s) here. CVS: Obtained from: CVS: If this change has been taken from another system, such as NCSA, CVS: then name the system in this line, otherwise delete it. CVS: Submitted by: CVS: If this code has been contributed to Apache by someone else; i.e., CVS: they sent us a patch or a new module, then include their name/email CVS: address here. If this is your work then delete this line. CVS: Reviewed by: CVS: If we are doing pre-commit code reviews and someone else has CVS: reviewed your changes, include their name(s) here. CVS: If you have not had it reviewed then delete this line. Revision Changes Path 1.10 +17 -3 jakarta-jetspeed/fusion/src/java/org/apache/jetspeed/fusion/portal/portlets/JetspeedFusionPortlet.java Index: JetspeedFusionPortlet.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed/fusion/src/java/org/apache/jetspeed/fusion/portal/portlets/JetspeedFusionPortlet.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- JetspeedFusionPortlet.java 8 Nov 2004 17:26:13 -0000 1.9 +++ JetspeedFusionPortlet.java 9 Nov 2004 00:42:29 -0000 1.10 @@ -246,6 +246,7 @@ return new JetspeedClearElement(result); } + public MutableNavigationalState getNavigationalState(JetspeedRunData data) { @@ -266,6 +267,7 @@ PortletInstance instance) { MutableNavigationalState nav = getNavigationalState(data); + RequestContext context = (RequestContext) data.getRequest().getAttribute(FUSION_NAV_STATE); if (null == nav) { return; @@ -280,6 +282,7 @@ if (isMinimized(data)) { nav.setState(window, WindowState.MINIMIZED); + nav.sync(context); return; } @@ -289,47 +292,58 @@ if (targeted && action.equals(J1_HELP_ACTION)) { nav.setMode(window, PortletMode.HELP); + nav.sync(context); return; } if (targeted && action.equals(J1_RESTORE_ACTION)) { nav.setMode(window, PortletMode.VIEW); nav.setState(window, WindowState.NORMAL); + nav.sync(context); return; } if (targeted && action.equals(J1_EDIT_ACTION)) { nav.setMode(window, PortletMode.EDIT); + nav.sync(context); return; } - /* + boolean syncRequired = false; + switch (mode) { case JetspeedRunData.NORMAL: if (!mode2.equals(PortletMode.VIEW)) { nav.setMode(window, PortletMode.VIEW); + syncRequired = true; } if (!state.equals(WindowState.NORMAL)) { nav.setState(window, WindowState.NORMAL); + syncRequired = true; } break; case JetspeedRunData.MAXIMIZE: if (!state.equals(WindowState.MAXIMIZED)) { nav.setState(window, WindowState.MAXIMIZED); + syncRequired = true; } break; case JetspeedRunData.CUSTOMIZE: if (!mode2.equals(PortletMode.EDIT)) { nav.setMode(window, PortletMode.EDIT); + syncRequired = true; } break; } - */ + if (syncRequired) + { + nav.sync(context); + } } public boolean providesCustomization() 1.6 +20 -16 jakarta-jetspeed/fusion/src/java/org/apache/jetspeed/fusion/modules/actions/FusionAccessController.java Index: FusionAccessController.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed/fusion/src/java/org/apache/jetspeed/fusion/modules/actions/FusionAccessController.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- FusionAccessController.java 8 Nov 2004 05:20:45 -0000 1.5 +++ FusionAccessController.java 9 Nov 2004 00:42:29 -0000 1.6 @@ -70,6 +70,7 @@ */ public void doPerform( RunData data ) throws Exception { + boolean throwit = false; try { super.doPerform(data); @@ -109,6 +110,8 @@ //if (state.) //String state[] = nav.parsePortalParameter(request, "_ns"); // TODO don't hard code //if (state != null) + context.setAttribute(PortalReservedParameters.PIPELINE, PortalReservedParameters.ACTION_PIPELINE); + engine.service(context); PortalURL url = context.getPortalURL(); if (url != null) @@ -117,22 +120,21 @@ PortletWindow actionWindow = state.getPortletWindowOfAction(); if (actionWindow != null) { - context.setAttribute(PortalReservedParameters.PIPELINE, PortalReservedParameters.ACTION_PIPELINE); - engine.service(context); - } - - String windowId = actionWindow.getId().toString(); - //String windowId = nav.getWindowIdFromKey(state[0]); - //System.out.println("got token = " + state[0]+ ", window id = " + windowId + ", action = " + state[1]); - Portlets portlets = ((JetspeedRunData)data).getProfile().getDocument().getPortlets(); - //traverse(portlets, windowId, state[1], (JetspeedRunData)data); - String windowState = state.getState(actionWindow).toString(); - if (windowState == null) - { - windowState = ""; - } - traverse(portlets, windowId, windowState, (JetspeedRunData)data); + String windowId = actionWindow.getId().toString(); + //String windowId = nav.getWindowIdFromKey(state[0]); + //System.out.println("got token = " + state[0]+ ", window id = " + windowId + ", action = " + state[1]); + Portlets portlets = ((JetspeedRunData)data).getProfile().getDocument().getPortlets(); + //traverse(portlets, windowId, state[1], (JetspeedRunData)data); + String windowState = state.getState(actionWindow).toString(); + if (windowState == null) + { + windowState = ""; + } + traverse(portlets, windowId, windowState, (JetspeedRunData)data); + throwit = true; + } } + } catch (Throwable t) { @@ -145,6 +147,8 @@ { contextComponent.release(context); } + if (throwit) + throw new Exception("redirecting"); } } 1.4 +6 -16 jakarta-jetspeed/fusion/src/java/org/apache/jetspeed/fusion/util/template/FusionJetspeedLink.java Index: FusionJetspeedLink.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed/fusion/src/java/org/apache/jetspeed/fusion/util/template/FusionJetspeedLink.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- FusionJetspeedLink.java 8 Nov 2004 05:20:45 -0000 1.3 +++ FusionJetspeedLink.java 9 Nov 2004 00:42:29 -0000 1.4 @@ -15,17 +15,12 @@ */ package org.apache.jetspeed.fusion.util.template; -import java.util.Iterator; -import java.util.Map; - -import org.apache.jetspeed.container.state.NavigationalState; -import org.apache.jetspeed.container.state.impl.JetspeedNavigationalStateComponent; +import org.apache.jetspeed.container.state.MutableNavigationalState; import org.apache.jetspeed.container.url.PortalURL; import org.apache.jetspeed.fusion.portal.portlets.JetspeedFusionPortlet; import org.apache.jetspeed.request.RequestContext; import org.apache.jetspeed.services.logging.JetspeedLogFactoryService; import org.apache.jetspeed.services.logging.JetspeedLogger; -import org.apache.jetspeed.services.rundata.JetspeedRunData; import org.apache.jetspeed.util.template.BaseJetspeedLink; import org.apache.jetspeed.util.template.JetspeedLink; import org.apache.turbine.services.pull.ApplicationTool; @@ -86,16 +81,12 @@ //NavigationalState state = getNavigationalState(this.rundata); RequestContext context = (RequestContext) this.rundata.getRequest().getAttribute(JetspeedFusionPortlet.FUSION_NAV_STATE); - - // PortalURL url = context.getPortalURL(); - // url.getNavigationalState().getParameterNames(); -/* - if (context != null) + /* + if (context != null) { PortalURL url = context.getPortalURL(); - url.getNavigationalState().get - PortalControlParameter pcp = url.getControlParameters(); - Map stateful = pcp.getStateFullControlParameter(); + MutableNavigationalState state = (MutableNavigationalState)url.getNavigationalState(); + state. Iterator params = stateful.entrySet().iterator(); while (params.hasNext()) { @@ -104,7 +95,6 @@ uri.addPathInfo(entry.getKey().toString(), entry.getValue()); } } - return uri; */ return uri; }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]