From portal-commits at lists.jboss.org Sun Nov 18 13:04:54 2007 Content-Type: multipart/mixed; boundary="===============1441194272672683492==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9010 - in branches/UIServer: core-uiserver and 6 other directories. Date: Sun, 18 Nov 2007 13:04:51 -0500 Message-ID: --===============1441194272672683492== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2007-11-18 13:04:51 -0500 (Sun, 18 Nov 2007) New Revision: 9010 Added: branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentat= ion/server/content/ branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentat= ion/server/content/PresentationContentRendererContext.java branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentat= ion/server/content/portlet/ branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentat= ion/server/content/portlet/PresentationPortalContext.java branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentat= ion/server/content/portlet/PresentationRenderContext.java branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentat= ion/server/content/portlet/PresentationRequestContext.java branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentat= ion/server/content/portlet/PresentationSecurityContext.java branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentat= ion/server/content/portlet/PresentationUserContext.java Modified: branches/UIServer/core-uiserver/build.xml branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentat= ion/server/PresentationServerImpl.java branches/UIServer/core-uiserver/src/resources/presentation-sar/META-INF/= jboss-service.xml branches/UIServer/core/src/main/org/jboss/portal/core/controller/Control= ler.java branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/Reques= tContext.java branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/R= equestContextImpl.java Log: - directly render content in the presentation server using the content inte= gration framework (so it does not use the window render command stuff) - remove server invocation from the presentation request context in order t= o not leak out this API Modified: branches/UIServer/core/src/main/org/jboss/portal/core/controller/= Controller.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/UIServer/core/src/main/org/jboss/portal/core/controller/Contro= ller.java 2007-11-18 17:12:22 UTC (rev 9009) +++ branches/UIServer/core/src/main/org/jboss/portal/core/controller/Contro= ller.java 2007-11-18 18:04:51 UTC (rev 9010) @@ -39,14 +39,12 @@ import org.jboss.portal.core.model.instance.InstanceContainer; import org.jboss.portal.core.model.CustomizationManager; import org.jboss.portal.common.invocation.InterceptorStackFactory; -import org.jboss.portal.common.util.MarkupInfo; import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactor= y; -import org.jboss.portal.jems.as.system.AbstractJBossService; import org.jboss.portal.server.RequestController; import org.jboss.portal.server.ServerInvocation; import org.jboss.portal.server.ServerException; -import org.jboss.portal.web.ServletContextDispatcher; import org.jboss.portal.web.spi.ServletContainerContext; +import org.apache.log4j.Logger; = import javax.servlet.ServletException; import java.io.IOException; @@ -56,10 +54,13 @@ * @author Julien Viet * @version $Revision: 1.1 $ */ -public class Controller extends AbstractJBossService implements RequestCon= troller, ControllerContextFactory +public class Controller implements RequestController, ControllerContextFac= tory { = /** . */ + protected final Logger log =3D Logger.getLogger(getClass()); + + /** . */ protected PageService pageService; = /** . */ Modified: branches/UIServer/core-uiserver/build.xml =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/UIServer/core-uiserver/build.xml 2007-11-18 17:12:22 UTC (rev = 9009) +++ branches/UIServer/core-uiserver/build.xml 2007-11-18 18:04:51 UTC (rev = 9010) @@ -99,7 +99,10 @@ + + + Modified: branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/pr= esentation/server/PresentationServerImpl.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/UIServer/core-uiserver/src/main/org/jboss/portal/core/presenta= tion/server/PresentationServerImpl.java 2007-11-18 17:12:22 UTC (rev 9009) +++ branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presenta= tion/server/PresentationServerImpl.java 2007-11-18 18:04:51 UTC (rev 9010) @@ -28,15 +28,19 @@ import org.jboss.portal.presentation.model.UIWindow; import org.jboss.portal.presentation.model.content.WindowContent; import org.jboss.portal.presentation.model.state.ModelLoader; +import org.jboss.portal.core.controller.ControllerResponse; import org.jboss.portal.core.controller.Controller; -import org.jboss.portal.core.controller.ControllerContext; -import org.jboss.portal.core.controller.ControllerContextFactory; -import org.jboss.portal.core.controller.ControllerResponse; -import org.jboss.portal.core.model.portal.command.render.RenderWindowComma= nd; import org.jboss.portal.core.model.portal.command.response.MarkupResponse; import org.jboss.portal.core.model.portal.PortalObjectId; import org.jboss.portal.core.model.portal.PortalObjectPath; +import org.jboss.portal.core.model.portal.Window; +import org.jboss.portal.core.model.portal.PortalObjectContainer; import org.jboss.portal.core.model.portal.content.WindowRendition; +import org.jboss.portal.core.model.portal.content.ContentRendererRegistry; +import org.jboss.portal.core.model.portal.content.ContentRenderer; +import org.jboss.portal.core.model.portal.content.ContentRendererContext; +import org.jboss.portal.core.model.content.ContentType; +import org.jboss.portal.core.presentation.server.content.PresentationConte= ntRendererContext; = /** * @author Sohil Shah @@ -45,19 +49,25 @@ public class PresentationServerImpl implements PresentationServer { = - - /** . */ - private ControllerContextFactory controllerContextFactory; - /** * = */ - private Processor processor =3D null; + private Processor processor; = /** * = */ - private ModelLoader modelLoader =3D null; + private ModelLoader modelLoader; + + /** + * + */ + private ContentRendererRegistry contentRendererRegistry; + + /** + * + */ + private PortalObjectContainer portalObjectContainer; = /** * = @@ -119,53 +129,63 @@ { this.processor =3D processor; } - = - /** - * = - * @return - */ - public ControllerContextFactory getControllerContextFactory() + + public ContentRendererRegistry getContentRendererRegistry() { - return controllerContextFactory; + return contentRendererRegistry; } = - /** - * = - * @param controllerContextFactory - */ - public void setControllerContextFactory( - ControllerContextFactory controllerContextFactory) + public void setContentRendererRegistry(ContentRendererRegistry contentR= endererRegistry) { - this.controllerContextFactory =3D controllerContextFactory; + this.contentRendererRegistry =3D contentRendererRegistry; } = - public WindowContent render(RequestContext context, UIWindow window) th= rows Exception + public PortalObjectContainer getPortalObjectContainer() { - PortalObjectId windowId =3D PortalObjectId.parse(window.getId(), Por= talObjectPath.CANONICAL_FORMAT); - RenderWindowCommand rwc =3D new RenderWindowCommand(windowId); - ControllerContext ctx =3D this.controllerContextFactory.getControlle= rContext(context.getInvocation()); - WindowRendition rendition =3D rwc.render(ctx); - if (rendition !=3D null) + return portalObjectContainer; + } + + public void setPortalObjectContainer(PortalObjectContainer portalObject= Container) + { + this.portalObjectContainer =3D portalObjectContainer; + } + + public WindowContent render(RequestContext context, UIWindow uiwindow) = throws Exception + { + PortalObjectId windowId =3D PortalObjectId.parse(uiwindow.getId(), P= ortalObjectPath.CANONICAL_FORMAT); + Window window =3D (Window)portalObjectContainer.getObject(windowId); + ContentType contentType =3D window.getContentType(); + ContentRenderer renderer =3D contentRendererRegistry.getRenderer(con= tentType); + + // + if (renderer !=3D null) { + ContentRendererContext rendererContext =3D new PresentationConten= tRendererContext(context, uiwindow, window); + + // + WindowRendition rendition =3D renderer.renderWindow(rendererConte= xt); + + // ControllerResponse response =3D rendition.getControllerResponse(); = - // Null means we skip the window - if (response !=3D null) + // + if (response instanceof MarkupResponse) { - if (response instanceof MarkupResponse) - { - MarkupResponse markupResp =3D (MarkupResponse)response; - return new WindowContent(-1, markupResp.getTitle(), markupR= esp.getContent()); - } - else if (response !=3D null) - { - // It may be an error, handle it - } + MarkupResponse markupResp =3D (MarkupResponse)response; + return new WindowContent(-1, markupResp.getTitle(), markupResp= .getContent()); } + else if (response !=3D null) + { + return new WindowContent(-1, "", "
Response not yet handle= d " + response + "
"); + } + else + { + return new WindowContent(-1, "", "
No response was provide= d
"); + } } - - return null; - = - //return new WindowContent(-1, "MockTitle", "
Mock Content
= "); + else + { + return new WindowContent(-1, "", "
No renderer found for cont= ent type " + contentType + "
"); + } } } Added: branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/prese= ntation/server/content/PresentationContentRendererContext.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/UIServer/core-uiserver/src/main/org/jboss/portal/core/presenta= tion/server/content/PresentationContentRendererContext.java = (rev 0) +++ branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presenta= tion/server/content/PresentationContentRendererContext.java 2007-11-18 18:0= 4:51 UTC (rev 9010) @@ -0,0 +1,109 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.core.presentation.server.content; + +import org.jboss.portal.core.model.portal.content.ContentRendererContext; +import org.jboss.portal.core.model.portal.Window; +import org.jboss.portal.core.model.portal.portlet.WindowContextImpl; +import org.jboss.portal.core.model.portal.navstate.WindowNavigationalState; +import org.jboss.portal.core.presentation.server.content.portlet.Presentat= ionRenderContext; +import org.jboss.portal.core.presentation.server.content.portlet.Presentat= ionRequestContext; +import org.jboss.portal.core.presentation.server.content.portlet.Presentat= ionPortalContext; +import org.jboss.portal.core.presentation.server.content.portlet.Presentat= ionUserContext; +import org.jboss.portal.core.presentation.server.content.portlet.Presentat= ionSecurityContext; +import org.jboss.portal.presentation.model.UIWindow; +import org.jboss.portal.presentation.RequestContext; +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.portlet.invocation.RenderInvocation; +import org.jboss.portal.identity.User; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class PresentationContentRendererContext implements ContentRenderer= Context +{ + + /** . */ + private final RequestContext requestContext; + + /** . */ + private final UIWindow uiwindow; + + /** . */ + private final Window window; + + public PresentationContentRendererContext(RequestContext requestContext= , UIWindow uiwindow, Window window) + { + this.requestContext =3D requestContext; + this.uiwindow =3D uiwindow; + this.window =3D window; + } + + public Window getWindow() + { + return window; + } + + public WindowNavigationalState getNavigationalState() + { + Mode mode =3D uiwindow.getMode(); + if (mode =3D=3D null) + { + mode =3D Mode.VIEW; + } + + // + WindowState windowState =3D uiwindow.getWindowState(); + if (windowState =3D=3D null) + { + windowState =3D WindowState.NORMAL; + } + + // + return new WindowNavigationalState(windowState, mode, null); + } + + public void setNavigationalState(WindowNavigationalState navigationalSt= ate) + { + uiwindow.setWindowState(navigationalState.getWindowState()); + uiwindow.setMode(navigationalState.getMode()); + } + + public User getUser() + { + return null; + } + + public RenderInvocation createRenderInvocation(WindowNavigationalState = navigationalState) + { + RenderInvocation invocation =3D new RenderInvocation(new Presentatio= nRenderContext(navigationalState)); + invocation.setRequestContext(new PresentationRequestContext(requestC= ontext)); + invocation.setWindowContext(new WindowContextImpl(window)); + invocation.setPortalContext(new PresentationPortalContext()); + invocation.setUserContext(new PresentationUserContext()); + invocation.setSecurityContext(new PresentationSecurityContext()); + return invocation; + } +} Added: branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/prese= ntation/server/content/portlet/PresentationPortalContext.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/UIServer/core-uiserver/src/main/org/jboss/portal/core/presenta= tion/server/content/portlet/PresentationPortalContext.java = (rev 0) +++ branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presenta= tion/server/content/portlet/PresentationPortalContext.java 2007-11-18 18:04= :51 UTC (rev 9010) @@ -0,0 +1,76 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.core.presentation.server.content.portlet; + +import org.jboss.portal.portlet.spi.PortalContext; +import org.jboss.portal.common.util.CollectionBuilder; +import org.jboss.portal.WindowState; +import org.jboss.portal.Mode; + +import java.util.Set; +import java.util.Map; +import java.util.Collections; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class PresentationPortalContext implements PortalContext +{ + + /** . */ + private final Set windowStates; + + /** . */ + private final Set modes; + + /** . */ + private final Map props; + + public PresentationPortalContext() + { + windowStates =3D Collections.unmodifiableSet(new CollectionBuilder()= .add(WindowState.MAXIMIZED).add(WindowState.MINIMIZED).add(WindowState.NORM= AL).toHashSet()); + modes =3D Collections.unmodifiableSet(new CollectionBuilder().add(Mo= de.EDIT).add(Mode.HELP).add(Mode.VIEW).toHashSet()); + props =3D Collections.EMPTY_MAP; + } + + public String getInfo() + { + return "JBossPortal/1.0"; + } + + public Set getWindowStates() + { + return windowStates; + } + + public Set getModes() + { + return modes; + } + + public Map getProperties() + { + return props; + } +} Added: branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/prese= ntation/server/content/portlet/PresentationRenderContext.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/UIServer/core-uiserver/src/main/org/jboss/portal/core/presenta= tion/server/content/portlet/PresentationRenderContext.java = (rev 0) +++ branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presenta= tion/server/content/portlet/PresentationRenderContext.java 2007-11-18 18:04= :51 UTC (rev 9010) @@ -0,0 +1,92 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.core.presentation.server.content.portlet; + +import org.jboss.portal.portlet.spi.RenderContext; +import org.jboss.portal.portlet.StateString; +import org.jboss.portal.portlet.PortletURL; +import org.jboss.portal.portlet.invocation.PortletInvocation; +import org.jboss.portal.Mode; +import org.jboss.portal.WindowState; +import org.jboss.portal.core.model.portal.navstate.WindowNavigationalState; +import org.jboss.portal.presentation.model.UIWindow; +import org.jboss.portal.common.util.MarkupInfo; +import org.jboss.portal.common.util.MediaType; +import org.jboss.portal.common.invocation.AbstractInvocationContext; +import org.jboss.portal.common.invocation.resolver.MapAttributeResolver; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class PresentationRenderContext extends AbstractInvocationContext i= mplements RenderContext +{ + + /** . */ + private final WindowNavigationalState navigationalState; + + /** . */ + private final MarkupInfo markupInfo =3D new MarkupInfo(MediaType.HTML, = "UTF-8"); + + public PresentationRenderContext(WindowNavigationalState navigationalSt= ate) + { + this.navigationalState =3D navigationalState; + + // + addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeReso= lver()); + addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolve= r()); + addResolver(PortletInvocation.PRINCIPAL_SCOPE, new MapAttributeResol= ver()); + addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttri= buteResolver()); + addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttr= ibuteResolver()); + } + + public StateString getNavigationalState() + { + return navigationalState.getContentState(); + } + + public Mode getMode() + { + return navigationalState.getMode(); + } + + public WindowState getWindowState() + { + return navigationalState.getWindowState(); + } + + public MarkupInfo getMarkupInfo() + { + return markupInfo; + } + + public String encodeResourceURL(String url) throws IllegalArgumentExcep= tion + { + return "todo"; + } + + public String renderURL(PortletURL portletURL, Boolean wantSecure, Bool= ean wantAuthenticated, boolean relative) + { + return "todo"; + } +} Added: branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/prese= ntation/server/content/portlet/PresentationRequestContext.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/UIServer/core-uiserver/src/main/org/jboss/portal/core/presenta= tion/server/content/portlet/PresentationRequestContext.java = (rev 0) +++ branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presenta= tion/server/content/portlet/PresentationRequestContext.java 2007-11-18 18:0= 4:51 UTC (rev 9010) @@ -0,0 +1,65 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.core.presentation.server.content.portlet; + +import org.jboss.portal.portlet.spi.RequestContext; +import org.jboss.portal.web.spi.ServletContainerContext; +import org.jboss.portal.web.RequestDispatchCallback; + +import javax.servlet.ServletContext; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class PresentationRequestContext implements RequestContext +{ + + /** . */ + private final org.jboss.portal.presentation.RequestContext context; + + public PresentationRequestContext(org.jboss.portal.presentation.Request= Context context) + { + this.context =3D context; + } + + public String getScheme() + { + return "http"; + } + + public String getServerName() + { + return "localhost"; + } + + public int getServerPort() + { + return 8080; + } + + public Object dispatch(ServletContainerContext servletContainerContext,= ServletContext targetServletContext, RequestDispatchCallback callback, Obj= ect handback) throws Exception + { + return context.getDispatcher().include(targetServletContext, callbac= k, handback); + } +} Added: branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/prese= ntation/server/content/portlet/PresentationSecurityContext.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/UIServer/core-uiserver/src/main/org/jboss/portal/core/presenta= tion/server/content/portlet/PresentationSecurityContext.java = (rev 0) +++ branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presenta= tion/server/content/portlet/PresentationSecurityContext.java 2007-11-18 18:= 04:51 UTC (rev 9010) @@ -0,0 +1,64 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.core.presentation.server.content.portlet; + +import org.jboss.portal.portlet.spi.SecurityContext; + +import java.security.Principal; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class PresentationSecurityContext implements SecurityContext +{ + public boolean isSecure() + { + return false; + } + + public boolean isAuthenticated() + { + return false; + } + + public String getAuthType() + { + return null; + } + + public String getRemoteUser() + { + return null; + } + + public Principal getUserPrincipal() + { + return null; + } + + public boolean isUserInRole(String roleName) + { + return false; + } +} Added: branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/prese= ntation/server/content/portlet/PresentationUserContext.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/UIServer/core-uiserver/src/main/org/jboss/portal/core/presenta= tion/server/content/portlet/PresentationUserContext.java = (rev 0) +++ branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presenta= tion/server/content/portlet/PresentationUserContext.java 2007-11-18 18:04:5= 1 UTC (rev 9010) @@ -0,0 +1,58 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.core.presentation.server.content.portlet; + +import org.jboss.portal.portlet.spi.UserContext; + +import java.util.Map; +import java.util.Locale; +import java.util.List; +import java.util.Collections; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class PresentationUserContext implements UserContext +{ + + public String getId() + { + return null; + } + + public Map getInformations() + { + return null; + } + + public Locale getLocale() + { + return Locale.ENGLISH; + } + + public List getLocales() + { + return Collections.singletonList(Locale.ENGLISH); + } +} Modified: branches/UIServer/core-uiserver/src/resources/presentation-sar/ME= TA-INF/jboss-service.xml =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/UIServer/core-uiserver/src/resources/presentation-sar/META-INF= /jboss-service.xml 2007-11-18 17:12:22 UTC (rev 9009) +++ branches/UIServer/core-uiserver/src/resources/presentation-sar/META-INF= /jboss-service.xml 2007-11-18 18:04:51 UTC (rev 9010) @@ -60,7 +60,8 @@ portal:service=3DProcessor portal:container=3DModelLoader - portal:service=3DController + portal:service=3DContentProviderRegistry + portal:container=3DPortalObject portal:service=3DPageService portal:commandFactory=3DDefaultPortal portal:urlFactory=3DDelegating Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation= /RequestContext.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/UIServer/uiserver/src/main/org/jboss/portal/presentation/Reque= stContext.java 2007-11-18 17:12:22 UTC (rev 9009) +++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/Reque= stContext.java 2007-11-18 18:04:51 UTC (rev 9010) @@ -49,16 +49,10 @@ * Returns the root UI context provided by the portal. */ UIContext getUIContext(); - = + /** * = * @return */ - ServerInvocation getInvocation(); - = - /** - * = - * @return - */ ServletContextDispatcher getDispatcher(); } Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation= /impl/RequestContextImpl.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/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/= RequestContextImpl.java 2007-11-18 17:12:22 UTC (rev 9009) +++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/= RequestContextImpl.java 2007-11-18 18:04:51 UTC (rev 9010) @@ -79,14 +79,6 @@ /** * = */ - public ServerInvocation getInvocation() - { - return this.invocation; - } - - /** - * = - */ public ServletContextDispatcher getDispatcher() { return new ServletContextDispatcher(this.invocation.getServerContext= ().getClientRequest(), @@ -101,6 +93,6 @@ */ public String render(ServerAction action) throws IllegalArgumentExcepti= on { = - return null; + return "TODO"; } } --===============1441194272672683492==--