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/presentation/server/content/
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/PresentationContentRendererContext.java
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/portlet/
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationPortalContext.java
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationRenderContext.java
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationRequestContext.java
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationSecurityContext.java
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationUserContext.java
Modified:
branches/UIServer/core-uiserver/build.xml
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/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/Controller.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/RequestContext.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/RequestContextImpl.java
Log:
- directly render content in the presentation server using the content integration
framework (so it does not use the window render command stuff)
- remove server invocation from the presentation request context in order to not leak out
this API
Modified:
branches/UIServer/core/src/main/org/jboss/portal/core/controller/Controller.java
===================================================================
---
branches/UIServer/core/src/main/org/jboss/portal/core/controller/Controller.java 2007-11-18
17:12:22 UTC (rev 9009)
+++
branches/UIServer/core/src/main/org/jboss/portal/core/controller/Controller.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.PortalAuthorizationManagerFactory;
-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 <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class Controller extends AbstractJBossService implements RequestController,
ControllerContextFactory
+public class Controller implements RequestController, ControllerContextFactory
{
/** . */
+ protected final Logger log = Logger.getLogger(getClass());
+
+ /** . */
protected PageService pageService;
/** . */
Modified: branches/UIServer/core-uiserver/build.xml
===================================================================
--- 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 @@
<call target="configure-modules"/>
<path id="dependentmodule.classpath">
<path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portlet-api.classpath"/>
+ <path refid="jboss.portal-portlet.classpath"/>
<path refid="jboss.portal-web.classpath"/>
+ <path refid="jboss.portal-identity.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
<path refid="jboss.portal-test.classpath"/>
<path refid="jboss.portal-server.classpath"/>
Modified:
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java
===================================================================
---
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java 2007-11-18
17:12:22 UTC (rev 9009)
+++
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/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.RenderWindowCommand;
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.PresentationContentRendererContext;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
@@ -45,19 +49,25 @@
public class PresentationServerImpl implements PresentationServer
{
-
- /** . */
- private ControllerContextFactory controllerContextFactory;
-
/**
*
*/
- private Processor processor = null;
+ private Processor processor;
/**
*
*/
- private ModelLoader modelLoader = null;
+ private ModelLoader modelLoader;
+
+ /**
+ *
+ */
+ private ContentRendererRegistry contentRendererRegistry;
+
+ /**
+ *
+ */
+ private PortalObjectContainer portalObjectContainer;
/**
*
@@ -119,53 +129,63 @@
{
this.processor = processor;
}
-
- /**
- *
- * @return
- */
- public ControllerContextFactory getControllerContextFactory()
+
+ public ContentRendererRegistry getContentRendererRegistry()
{
- return controllerContextFactory;
+ return contentRendererRegistry;
}
- /**
- *
- * @param controllerContextFactory
- */
- public void setControllerContextFactory(
- ControllerContextFactory controllerContextFactory)
+ public void setContentRendererRegistry(ContentRendererRegistry
contentRendererRegistry)
{
- this.controllerContextFactory = controllerContextFactory;
+ this.contentRendererRegistry = contentRendererRegistry;
}
- public WindowContent render(RequestContext context, UIWindow window) throws Exception
+ public PortalObjectContainer getPortalObjectContainer()
{
- PortalObjectId windowId = PortalObjectId.parse(window.getId(),
PortalObjectPath.CANONICAL_FORMAT);
- RenderWindowCommand rwc = new RenderWindowCommand(windowId);
- ControllerContext ctx =
this.controllerContextFactory.getControllerContext(context.getInvocation());
- WindowRendition rendition = rwc.render(ctx);
- if (rendition != null)
+ return portalObjectContainer;
+ }
+
+ public void setPortalObjectContainer(PortalObjectContainer portalObjectContainer)
+ {
+ this.portalObjectContainer = portalObjectContainer;
+ }
+
+ public WindowContent render(RequestContext context, UIWindow uiwindow) throws
Exception
+ {
+ PortalObjectId windowId = PortalObjectId.parse(uiwindow.getId(),
PortalObjectPath.CANONICAL_FORMAT);
+ Window window = (Window)portalObjectContainer.getObject(windowId);
+ ContentType contentType = window.getContentType();
+ ContentRenderer renderer = contentRendererRegistry.getRenderer(contentType);
+
+ //
+ if (renderer != null)
{
+ ContentRendererContext rendererContext = new
PresentationContentRendererContext(context, uiwindow, window);
+
+ //
+ WindowRendition rendition = renderer.renderWindow(rendererContext);
+
+ //
ControllerResponse response = rendition.getControllerResponse();
- // Null means we skip the window
- if (response != null)
+ //
+ if (response instanceof MarkupResponse)
{
- if (response instanceof MarkupResponse)
- {
- MarkupResponse markupResp = (MarkupResponse)response;
- return new WindowContent(-1, markupResp.getTitle(),
markupResp.getContent());
- }
- else if (response != null)
- {
- // It may be an error, handle it
- }
+ MarkupResponse markupResp = (MarkupResponse)response;
+ return new WindowContent(-1, markupResp.getTitle(),
markupResp.getContent());
}
+ else if (response != null)
+ {
+ return new WindowContent(-1, "", "<div>Response not yet
handled " + response + "</div>");
+ }
+ else
+ {
+ return new WindowContent(-1, "", "<div>No response was
provided</div>");
+ }
}
-
- return null;
-
- //return new WindowContent(-1, "MockTitle", "<div>Mock
Content</div>");
+ else
+ {
+ return new WindowContent(-1, "", "<div>No renderer found
for content type " + contentType + "</div>");
+ }
}
}
Added:
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/PresentationContentRendererContext.java
===================================================================
---
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/PresentationContentRendererContext.java
(rev 0)
+++
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/PresentationContentRendererContext.java 2007-11-18
18:04: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.PresentationRenderContext;
+import
org.jboss.portal.core.presentation.server.content.portlet.PresentationRequestContext;
+import
org.jboss.portal.core.presentation.server.content.portlet.PresentationPortalContext;
+import
org.jboss.portal.core.presentation.server.content.portlet.PresentationUserContext;
+import
org.jboss.portal.core.presentation.server.content.portlet.PresentationSecurityContext;
+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 <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PresentationContentRendererContext implements ContentRendererContext
+{
+
+ /** . */
+ private final RequestContext requestContext;
+
+ /** . */
+ private final UIWindow uiwindow;
+
+ /** . */
+ private final Window window;
+
+ public PresentationContentRendererContext(RequestContext requestContext, UIWindow
uiwindow, Window window)
+ {
+ this.requestContext = requestContext;
+ this.uiwindow = uiwindow;
+ this.window = window;
+ }
+
+ public Window getWindow()
+ {
+ return window;
+ }
+
+ public WindowNavigationalState getNavigationalState()
+ {
+ Mode mode = uiwindow.getMode();
+ if (mode == null)
+ {
+ mode = Mode.VIEW;
+ }
+
+ //
+ WindowState windowState = uiwindow.getWindowState();
+ if (windowState == null)
+ {
+ windowState = WindowState.NORMAL;
+ }
+
+ //
+ return new WindowNavigationalState(windowState, mode, null);
+ }
+
+ public void setNavigationalState(WindowNavigationalState navigationalState)
+ {
+ uiwindow.setWindowState(navigationalState.getWindowState());
+ uiwindow.setMode(navigationalState.getMode());
+ }
+
+ public User getUser()
+ {
+ return null;
+ }
+
+ public RenderInvocation createRenderInvocation(WindowNavigationalState
navigationalState)
+ {
+ RenderInvocation invocation = new RenderInvocation(new
PresentationRenderContext(navigationalState));
+ invocation.setRequestContext(new PresentationRequestContext(requestContext));
+ 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/presentation/server/content/portlet/PresentationPortalContext.java
===================================================================
---
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationPortalContext.java
(rev 0)
+++
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/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 <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PresentationPortalContext implements PortalContext
+{
+
+ /** . */
+ private final Set windowStates;
+
+ /** . */
+ private final Set modes;
+
+ /** . */
+ private final Map props;
+
+ public PresentationPortalContext()
+ {
+ windowStates = Collections.unmodifiableSet(new
CollectionBuilder().add(WindowState.MAXIMIZED).add(WindowState.MINIMIZED).add(WindowState.NORMAL).toHashSet());
+ modes = Collections.unmodifiableSet(new
CollectionBuilder().add(Mode.EDIT).add(Mode.HELP).add(Mode.VIEW).toHashSet());
+ props = 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/presentation/server/content/portlet/PresentationRenderContext.java
===================================================================
---
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationRenderContext.java
(rev 0)
+++
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/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 <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PresentationRenderContext extends AbstractInvocationContext implements
RenderContext
+{
+
+ /** . */
+ private final WindowNavigationalState navigationalState;
+
+ /** . */
+ private final MarkupInfo markupInfo = new MarkupInfo(MediaType.HTML,
"UTF-8");
+
+ public PresentationRenderContext(WindowNavigationalState navigationalState)
+ {
+ this.navigationalState = navigationalState;
+
+ //
+ addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
+ addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolver());
+ addResolver(PortletInvocation.PRINCIPAL_SCOPE, new MapAttributeResolver());
+ addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new
MapAttributeResolver());
+ addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new
MapAttributeResolver());
+ }
+
+ 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 IllegalArgumentException
+ {
+ return "todo";
+ }
+
+ public String renderURL(PortletURL portletURL, Boolean wantSecure, Boolean
wantAuthenticated, boolean relative)
+ {
+ return "todo";
+ }
+}
Added:
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationRequestContext.java
===================================================================
---
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationRequestContext.java
(rev 0)
+++
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationRequestContext.java 2007-11-18
18:04: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 <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PresentationRequestContext implements RequestContext
+{
+
+ /** . */
+ private final org.jboss.portal.presentation.RequestContext context;
+
+ public PresentationRequestContext(org.jboss.portal.presentation.RequestContext
context)
+ {
+ this.context = 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, Object handback) throws Exception
+ {
+ return context.getDispatcher().include(targetServletContext, callback, handback);
+ }
+}
Added:
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationSecurityContext.java
===================================================================
---
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationSecurityContext.java
(rev 0)
+++
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/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 <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @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/presentation/server/content/portlet/PresentationUserContext.java
===================================================================
---
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationUserContext.java
(rev 0)
+++
branches/UIServer/core-uiserver/src/main/org/jboss/portal/core/presentation/server/content/portlet/PresentationUserContext.java 2007-11-18
18:04:51 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 <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @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/META-INF/jboss-service.xml
===================================================================
---
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 @@
<xmbean/>
<depends optional-attribute-name="Processor"
proxy-type="attribute">portal:service=Processor</depends>
<depends optional-attribute-name="ModelLoader"
proxy-type="attribute">portal:container=ModelLoader</depends>
- <depends optional-attribute-name="ControllerContextFactory"
proxy-type="attribute">portal:service=Controller</depends>
+ <depends optional-attribute-name="ContentRendererRegistry"
proxy-type="attribute">portal:service=ContentProviderRegistry</depends>
+ <depends optional-attribute-name="PortalObjectContainer"
proxy-type="attribute">portal:container=PortalObject</depends>
<depends>portal:service=PageService</depends>
<depends>portal:commandFactory=DefaultPortal</depends>
<depends>portal:urlFactory=Delegating</depends>
Modified:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/RequestContext.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/RequestContext.java 2007-11-18
17:12:22 UTC (rev 9009)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/RequestContext.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
===================================================================
---
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 IllegalArgumentException
{
- return null;
+ return "TODO";
}
}