From portal-commits at lists.jboss.org Wed Nov 28 09:06:21 2007 Content-Type: multipart/mixed; boundary="===============1193876184245184785==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9166 - in branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl: model and 1 other directory. Date: Wed, 28 Nov 2007 09:06:20 -0500 Message-ID: --===============1193876184245184785== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2007-11-28 09:06:19 -0500 (Wed, 28 Nov 2007) New Revision: 9166 Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/impl/PresentationContextImpl.java branches/presentation/presentation/src/main/org/jboss/portal/presentatio= n/impl/model/UIObjectImpl.java Log: - in the presentation context, only store the nav state context and content= state context in the session Modified: branches/presentation/presentation/src/main/org/jboss/portal/pres= entation/impl/PresentationContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/impl/PresentationContextImpl.java 2007-11-28 14:00:49 UTC (rev 9165) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/impl/PresentationContextImpl.java 2007-11-28 14:06:19 UTC (rev 9166) @@ -28,6 +28,8 @@ import org.jboss.portal.presentation.impl.model.state.navigational.Navigat= ionalStateContextImpl; import org.jboss.portal.presentation.model.UIContext; import org.jboss.portal.presentation.model.UIObject; +import org.jboss.portal.presentation.model.state.content.ContentStateConte= xt; +import org.jboss.portal.presentation.model.state.navigational.Navigational= StateContext; import org.jboss.portal.presentation.protocol.LinkActivation; import org.jboss.portal.presentation.protocol.ServerAction; import org.jboss.portal.presentation.protocol.UIObjectAction; @@ -45,7 +47,7 @@ = /** * @author Sohil Shah - * + * @author Julien Viet */ public class PresentationContextImpl implements PresentationContext { @@ -55,36 +57,44 @@ = /** . */ private PresentationServer presentationServer =3D null; + + /** . */ + private UIContextImpl root; = - /** - * = - * @param invocation - */ public PresentationContextImpl(PresentationServer presentationServer, S= erverInvocation invocation) { this.invocation =3D invocation; this.presentationServer =3D presentationServer; } = - /** - * = - * @return - */ public UIContext getUIContext() - { = - HttpSession session =3D this.invocation.getServerContext().getClient= Request().getSession(); + { + if (root =3D=3D null) + { + HttpSession session =3D this.invocation.getServerContext().getCli= entRequest().getSession(); = + // + NavigationalStateContext nsc =3D (NavigationalStateContext)sessio= n.getAttribute("nsc"); + if (nsc =3D=3D null) + { + nsc =3D new NavigationalStateContextImpl(); + session.setAttribute("nsc", nsc); + } = - UIContext uiContext =3D (UIContext)session.getAttribute("uicontext"); + // + ContentStateContext csc =3D (ContentStateContext)session.getAttri= bute("csc"); + if (csc =3D=3D null) + { + csc =3D new ContentStateContextImpl(); + session.setAttribute("csc", csc); + } = + // + root =3D new UIContextImpl(presentationServer.getStructuralStateM= anager(), nsc, csc); + } = - if(uiContext =3D=3D null) - { - uiContext =3D new UIContextImpl(this.presentationServer.getStruct= uralStateManager(), new NavigationalStateContextImpl(), new ContentStateCon= textImpl()); - session.setAttribute("uicontext", uiContext); - } - = - return uiContext; + // + return root; } = /** Modified: branches/presentation/presentation/src/main/org/jboss/portal/pres= entation/impl/model/UIObjectImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/impl/model/UIObjectImpl.java 2007-11-28 14:00:49 UTC (rev 9165) +++ branches/presentation/presentation/src/main/org/jboss/portal/presentati= on/impl/model/UIObjectImpl.java 2007-11-28 14:06:19 UTC (rev 9166) @@ -34,6 +34,7 @@ = /** * @author Sohil Shah + * @author Julien Viet * */ public abstract class UIObjectImpl implements UIObject, Serializable --===============1193876184245184785==--