Author: julien(a)jboss.com
Date: 2008-04-13 19:11:33 -0400 (Sun, 13 Apr 2008)
New Revision: 10562
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/portlet.xml
branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-basic-samples-war/WEB-INF/default-object.xml
branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/CoreConstants.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/Controller.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPageNavigationalState.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPortletControllerContext.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerStateControllerContext.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowActionCommand.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowResourceCommand.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokeWindowCommand.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/content/ContentRendererContext.java
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
integrated content provider rendering using public navigational render parameters
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/CoreConstants.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/CoreConstants.java 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/CoreConstants.java 2008-04-13
23:11:33 UTC (rev 10562)
@@ -22,6 +22,8 @@
******************************************************************************/
package org.jboss.portal.core;
+import javax.xml.namespace.QName;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
@@ -51,4 +53,10 @@
public static final String PORTAL_SERVLET_PATH =
"jboss.portal.servlet_path";
}
}
+
+ /** The namespace for JBoss Portal content integration framework. */
+ public static final String JBOSS_PORTAL_CONTENT_NAMESPACE =
"urn:jboss:portal:content";
+
+ public static final QName JBOSS_PORTAL_CONTENT_URI = new
QName(JBOSS_PORTAL_CONTENT_NAMESPACE, "uri");
+
}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/Controller.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/Controller.java 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/Controller.java 2008-04-13
23:11:33 UTC (rev 10562)
@@ -38,6 +38,7 @@
import org.jboss.portal.core.model.portal.PortalObjectContainer;
import org.jboss.portal.core.model.portal.content.ContentRendererRegistry;
import org.jboss.portal.core.model.portal.control.page.PageControlPolicy;
+import org.jboss.portal.core.impl.model.content.InternalContentProviderRegistry;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
import org.jboss.portal.server.RequestController;
@@ -89,6 +90,19 @@
/** . */
protected PageControlPolicy pageControlPolicy;
+ /** . */
+ protected InternalContentProviderRegistry contentProviderRegistry;
+
+ public InternalContentProviderRegistry getContentProviderRegistry()
+ {
+ return contentProviderRegistry;
+ }
+
+ public void setContentProviderRegistry(InternalContentProviderRegistry
contentProviderRegistry)
+ {
+ this.contentProviderRegistry = contentProviderRegistry;
+ }
+
public ContentRendererRegistry getContentRendererRegistry()
{
return contentRendererRegistry;
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2008-04-13
23:11:33 UTC (rev 10562)
@@ -30,6 +30,7 @@
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.core.controller.ControllerResponse;
import org.jboss.portal.core.controller.portlet.ControllerPortletControllerContext;
+import org.jboss.portal.core.controller.portlet.ControllerPageNavigationalState;
import org.jboss.portal.core.controller.handler.AjaxResponse;
import org.jboss.portal.core.controller.handler.CommandForward;
import org.jboss.portal.core.controller.handler.HandlerResponse;
@@ -283,8 +284,8 @@
WindowContextFactory wcf = new WindowContextFactory(controllerContext);
//
- PortletControllerContext portletControllerContext = new
ControllerPortletControllerContext(controllerContext, page);
- PageNavigationalState pageNavigationalState =
portletControllerContext.getStateControllerContext().createPageNavigationalState(true);
+ ControllerPortletControllerContext portletControllerContext = new
ControllerPortletControllerContext(controllerContext, page);
+ ControllerPageNavigationalState pageNavigationalState =
portletControllerContext.getStateControllerContext().createPageNavigationalState(true);
//
for (Iterator i = refreshedWindows.iterator(); i.hasNext() &&
!fullRefresh;)
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPageNavigationalState.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPageNavigationalState.java 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPageNavigationalState.java 2008-04-13
23:11:33 UTC (rev 10562)
@@ -147,7 +147,6 @@
}
}
-
public Set<String> getWindowIds()
{
return controllerContext.getWindowNames();
@@ -243,6 +242,26 @@
return null;
}
+ public String getPublicNavigationalParameterId(String windowName, QName name)
+ {
+ PortletInfo info = controllerContext.getPortletInfo(windowName);
+
+ //
+ if (info != null)
+ {
+ for (ParameterInfo parameterInfo : info.getNavigation().getPublicParameters())
+ {
+ if (parameterInfo.getName().equals(name))
+ {
+ return parameterInfo.getId();
+ }
+ }
+ }
+
+ //
+ return null;
+ }
+
public void setPublicNavigationalState(String windowName, Map<String, String[]>
update)
{
if (!mutable)
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPortletControllerContext.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPortletControllerContext.java 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerPortletControllerContext.java 2008-04-13
23:11:33 UTC (rev 10562)
@@ -25,7 +25,6 @@
import org.jboss.portal.portlet.controller.PortletControllerContext;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
import org.jboss.portal.portlet.controller.state.PageNavigationalState;
-import org.jboss.portal.portlet.controller.state.StateControllerContext;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
@@ -38,13 +37,15 @@
import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.content.Content;
+import org.jboss.portal.core.model.content.spi.ContentProvider;
import org.jboss.portal.core.model.instance.InstanceContainer;
import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.impl.model.content.portlet.PortletContent;
+import org.jboss.portal.core.impl.model.content.InternalContentProviderRegistry;
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.core.controller.ControllerCommand;
import org.jboss.portal.core.navstate.NavigationalStateContext;
-import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.Mode;
import javax.servlet.http.Cookie;
import java.util.List;
@@ -98,28 +99,33 @@
Content content = window.getContent();
//
+ String instanceId;
if (content instanceof PortletContent)
{
PortletContent portletContent = (PortletContent)content;
+ instanceId = portletContent.getInstanceRef();
+ }
+ else
+ {
+ InternalContentProviderRegistry registry =
controllerContext.getController().getContentProviderRegistry();
+ ContentProvider provider =
registry.getContentProvider(window.getContentType());
+ instanceId = provider.getPortletInfo().getPortletName(Mode.VIEW);
+ }
- //
- String instanceRef = portletContent.getInstanceRef();
- Instance instance = instanceContainer.getDefinition(instanceRef);
-
- //
- if (instance != null)
+ //
+ Instance instance = instanceContainer.getDefinition(instanceId);
+ if (instance != null)
+ {
+ try
{
- try
- {
- Portlet portlet = instance.getPortlet();
- infos.put(window.getName(), portlet.getInfo());
- instances.put(window.getName(), instance);
- windows.put(window.getName(), window);
- }
- catch (PortletInvokerException ignore)
- {
- }
+ Portlet portlet = instance.getPortlet();
+ infos.put(window.getName(), portlet.getInfo());
+ instances.put(window.getName(), instance);
+ windows.put(window.getName(), window);
}
+ catch (PortletInvokerException ignore)
+ {
+ }
}
}
@@ -214,7 +220,7 @@
return eventControllerContext;
}
- public StateControllerContext getStateControllerContext()
+ public ControllerStateControllerContext getStateControllerContext()
{
return stateControllerContext;
}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerStateControllerContext.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerStateControllerContext.java 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerStateControllerContext.java 2008-04-13
23:11:33 UTC (rev 10562)
@@ -55,7 +55,7 @@
return new
ControllerPageNavigationalState((ControllerPageNavigationalState)pageNavigationalState,
mutable);
}
- public PageNavigationalState createPageNavigationalState(boolean mutable)
+ public ControllerPageNavigationalState createPageNavigationalState(boolean mutable)
{
return new ControllerPageNavigationalState(navigationalStateContext,
controllerContext, mutable);
}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2008-04-13
23:11:33 UTC (rev 10562)
@@ -181,7 +181,6 @@
if (windowNS == null)
{
windowNS = new WindowNavigationalState(null, window.getInitialMode(),
window.getInitialWindowState());
- rendererContext.setNavigationalState(windowNS);
}
//
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java 2008-04-13
23:11:33 UTC (rev 10562)
@@ -23,7 +23,9 @@
package org.jboss.portal.core.impl.model.content.generic;
import org.jboss.portal.Mode;
+import org.jboss.portal.identity.User;
import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.core.impl.model.content.InternalContentProvider;
import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.core.model.content.ContentType;
@@ -38,11 +40,19 @@
import org.jboss.portal.core.model.portal.command.response.MarkupResponse;
import org.jboss.portal.core.model.portal.content.WindowRendition;
import org.jboss.portal.core.model.portal.content.ContentRendererContext;
-import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.core.CoreConstants;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.info.NavigationInfo;
+import org.jboss.portal.portlet.info.ParameterInfo;
+import org.apache.log4j.Logger;
-import java.util.Iterator;
+import javax.xml.namespace.QName;
import java.util.Map;
+import java.util.Collections;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -52,6 +62,9 @@
{
/** . */
+ private static final Logger log =
Logger.getLogger(InternalGenericContentProvider.class);
+
+ /** . */
protected InstanceContainer instanceContainer;
/** . */
@@ -149,13 +162,12 @@
{
}
- public WindowRendition renderWindow(ContentRendererContext rendererContext)
+ public WindowRendition renderWindow(final ContentRendererContext rendererContext)
{
Window window = rendererContext.getWindow();
- PortalObjectId windowId = window.getId();
// No content
- Content content = window.getContent();
+ final Content content = window.getContent();
if (content == null)
{
return null;
@@ -178,6 +190,7 @@
// }
//
+/*
if (navigationalState == null)
{
ParametersStateString state = ParametersStateString.create();
@@ -194,17 +207,86 @@
String uri = content.getURI();
state.setValue("uri", uri);
+ rendererContext
+
// Julien : to redo!!!!
//
rendererContext.setNavigationalState(WindowNavigationalState.bilto(navigationalState,
null, null, state));
}
+*/
+ ContentRendererContext rendererContext2 = new ContentRendererContext()
+ {
+ public Window getWindow()
+ {
+ return rendererContext.getWindow();
+ }
+
+ public WindowNavigationalState getNavigationalState()
+ {
+ return rendererContext.getNavigationalState();
+ }
+
+ public Map<String, String[]> getPublicNavigationalState()
+ {
+ return rendererContext.getPublicNavigationalState();
+ }
+
+ public User getUser()
+ {
+ return rendererContext.getUser();
+ }
+
+ public RenderInvocation createRenderInvocation(WindowNavigationalState
navigationalState)
+ {
+ RenderInvocation invocation =
rendererContext.createRenderInvocation(navigationalState);
+
+ //
+ if (invocation.getPublicNavigationalState() == null)
+ {
+
+ String id = null;
+
+ try
+ {
+ Instance instance = getPortletInstance(rendererContext);
+ Portlet portlet = instance.getPortlet();
+ PortletInfo portletInfo = portlet.getInfo();
+ NavigationInfo navigationInfo = portletInfo.getNavigation();
+
+ // todo : remove me when there is a getParameter(String id);
+ for (ParameterInfo parameterInfo :
navigationInfo.getPublicParameters())
+ {
+ if
(parameterInfo.getName().equals(CoreConstants.JBOSS_PORTAL_CONTENT_URI))
+ {
+ id = parameterInfo.getId();
+ }
+ }
+ }
+ catch (PortletInvokerException e)
+ {
+ log.error("Cannot read portlet instance public navigational
info", e);
+ }
+
+ //
+ if (id != null)
+ {
+ ParameterMap tmp = ParameterMap.wrap(Collections.singletonMap(id, new
String[]{content.getURI()}));
+ invocation.setPublicNavigationalState(tmp);
+ }
+ }
+
+ //
+ return invocation;
+ }
+ };
+
//
- WindowRendition rendition = super.renderWindow(rendererContext);
+ WindowRendition rendition = super.renderWindow(rendererContext2);
//
if (rendition != null && rendition.getControllerResponse() instanceof
MarkupResponse && !getDecorateContent())
{
- Map props = rendition.getProperties();
+ Map<String, String> props = rendition.getProperties();
if (props.get("theme.windowRendererId") == null)
{
props.put("theme.windowRendererId", "emptyRenderer");
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowActionCommand.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowActionCommand.java 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowActionCommand.java 2008-04-13
23:11:33 UTC (rev 10562)
@@ -34,6 +34,7 @@
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.identity.User;
import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.controller.request.PortletActionRequest;
import org.jboss.portal.portlet.controller.request.ContainerRequest;
import org.jboss.portal.portlet.controller.state.PageNavigationalState;
@@ -129,7 +130,7 @@
return context.getController().getCustomizationManager().getInstance(window,
user);
}
- protected ContainerRequest createPortletRequest(PageNavigationalState pageNS,
WindowNavigationalState windowNS)
+ protected ContainerRequest createPortletRequest(PortletInfo portletInfo,
PageNavigationalState pageNS, WindowNavigationalState windowNS)
{
return new PortletActionRequest(
window.getName(),
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java 2008-04-13
23:11:33 UTC (rev 10562)
@@ -27,14 +27,9 @@
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.core.controller.command.info.CommandInfo;
import org.jboss.portal.core.controller.command.info.ActionCommandInfo;
-import org.jboss.portal.core.controller.NoSuchResourceException;
import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.instance.Instance;
-import org.jboss.portal.core.impl.model.content.portlet.PortletContent;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.ParametersStateString;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.info.NavigationInfo;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.ParameterInfo;
import org.jboss.portal.portlet.controller.request.PortletRenderRequest;
@@ -61,9 +56,6 @@
/** . */
private static final CommandInfo info = new ActionCommandInfo(true);
- /** . */
- protected NavigationInfo navigationInfo;
-
public InvokePortletWindowRenderCommand(
PortalObjectId windowId,
Mode mode,
@@ -88,32 +80,10 @@
return info;
}
- public void acquireResources() throws NoSuchResourceException
+ protected ContainerRequest createPortletRequest(
+ PortletInfo portletInfo, PageNavigationalState pageNS,
+ WindowNavigationalState windowNS)
{
- super.acquireResources();
-
- //
- try
- {
- PortletContent portletContent = (PortletContent)window.getContent();
- Instance instance =
context.getController().getInstanceContainer().getDefinition(portletContent.getInstanceRef());
- PortletInfo info = instance.getPortlet().getInfo();
- navigationInfo = info.getNavigation();
- }
- catch (PortletInvokerException e)
- {
- log.error("Not able to get portlet meta data for window " + targetId,
e);
-
- //
- if (target == null)
- {
- throw new NoSuchResourceException(targetId.toString());
- }
- }
- }
-
- protected ContainerRequest createPortletRequest(PageNavigationalState pageNS,
WindowNavigationalState windowNS)
- {
Mode newMode = null;
WindowState newWindowState = null;
StateString newNavigationalState = null;
@@ -152,7 +122,7 @@
ParameterMap parameters = navigationalParameters.getParameters();
//
- for (ParameterInfo parameterInfo : navigationInfo.getPublicParameters())
+ for (ParameterInfo parameterInfo :
portletInfo.getNavigation().getPublicParameters())
{
String key = parameterInfo.getId();
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowResourceCommand.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowResourceCommand.java 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowResourceCommand.java 2008-04-13
23:11:33 UTC (rev 10562)
@@ -32,6 +32,7 @@
import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
import org.jboss.portal.portlet.cache.CacheLevel;
import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.info.PortletInfo;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
@@ -97,7 +98,7 @@
return info;
}
- protected ContainerRequest createPortletRequest(PageNavigationalState pageNS,
WindowNavigationalState windowNS)
+ protected ContainerRequest createPortletRequest(PortletInfo portletInfo,
PageNavigationalState pageNS, WindowNavigationalState windowNS)
{
PortletResourceRequest.Scope scope;
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokeWindowCommand.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokeWindowCommand.java 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokeWindowCommand.java 2008-04-13
23:11:33 UTC (rev 10562)
@@ -30,6 +30,7 @@
import org.jboss.portal.portlet.controller.response.PortletResponse;
import org.jboss.portal.portlet.controller.response.ResourceResponse;
import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.command.WindowCommand;
import org.jboss.portal.core.model.portal.command.response.UpdatePageResponse;
@@ -51,7 +52,10 @@
super(windowId);
}
- protected abstract ContainerRequest createPortletRequest(PageNavigationalState pageNS,
WindowNavigationalState windowNS);
+ protected abstract ContainerRequest createPortletRequest(
+ PortletInfo portletInfo,
+ PageNavigationalState pageNS,
+ WindowNavigationalState windowNS);
public ControllerResponse execute() throws ControllerException
{
@@ -68,8 +72,10 @@
//
WindowNavigationalState windowNS =
pageNS.getWindowNavigationalState(window.getName());
+ PortletInfo portletInfo = cpcc.getPortletInfo(window.getName());
+
//
- ContainerRequest containerRequest = createPortletRequest(pageNS, windowNS);
+ ContainerRequest containerRequest = createPortletRequest(portletInfo, pageNS,
windowNS);
//
PortletController controller = new PortletController();
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java 2008-04-13
23:11:33 UTC (rev 10562)
@@ -148,7 +148,7 @@
//
ControllerPortletControllerContext portletControllerContext = new
ControllerPortletControllerContext(context, page);
- PageNavigationalState pageNavigationalState =
portletControllerContext.getStateControllerContext().createPageNavigationalState(true);
+ ControllerPageNavigationalState pageNavigationalState =
portletControllerContext.getStateControllerContext().createPageNavigationalState(true);
// Determine theme
if (personalizable)
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java 2008-04-13
23:11:33 UTC (rev 10562)
@@ -28,6 +28,7 @@
import org.jboss.portal.core.controller.command.info.CommandInfo;
import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
import org.jboss.portal.core.controller.portlet.PortletInvocationFactory;
+import org.jboss.portal.core.controller.portlet.ControllerPageNavigationalState;
import org.jboss.portal.core.model.content.ContentType;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.command.WindowCommand;
@@ -41,6 +42,7 @@
import org.jboss.portal.portlet.controller.state.PageNavigationalState;
import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import javax.xml.namespace.QName;
import java.util.Map;
/**
@@ -57,9 +59,9 @@
private WindowRendition rendition;
/** . */
- private PageNavigationalState pageNavigationalState;
+ private ControllerPageNavigationalState pageNavigationalState;
- public RenderWindowCommand(PageNavigationalState pageNavigationalState, PortalObjectId
windowId) throws IllegalArgumentException
+ public RenderWindowCommand(ControllerPageNavigationalState pageNavigationalState,
PortalObjectId windowId) throws IllegalArgumentException
{
super(windowId);
@@ -119,13 +121,6 @@
return pageNavigationalState.getWindowNavigationalState(window.getName());
}
- public void setNavigationalState(WindowNavigationalState navigationalState)
- {
- pageNavigationalState.setWindowNavigationalState(window.getName(),
navigationalState);
-
- // probably call flush
- }
-
public User getUser()
{
return context.getUser();
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/content/ContentRendererContext.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/content/ContentRendererContext.java 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/content/ContentRendererContext.java 2008-04-13
23:11:33 UTC (rev 10562)
@@ -27,6 +27,7 @@
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.controller.state.WindowNavigationalState;
+import javax.xml.namespace.QName;
import java.util.Map;
/**
@@ -42,8 +43,6 @@
WindowNavigationalState getNavigationalState();
- void setNavigationalState(WindowNavigationalState navigationalState);
-
Map<String, String[]> getPublicNavigationalState();
User getUser();
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2008-04-13
23:11:33 UTC (rev 10562)
@@ -923,28 +923,17 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<depends optional-attribute-name="PageService"
proxy-type="attribute">portal:service=PageService</depends>
- <depends optional-attribute-name="CommandFactory"
proxy-type="attribute">portal:commandFactory=DefaultPortal
- </depends>
+ <depends optional-attribute-name="CommandFactory"
proxy-type="attribute">portal:commandFactory=DefaultPortal</depends>
<depends optional-attribute-name="URLFactory"
proxy-type="attribute">portal:urlFactory=Delegating</depends>
- <depends optional-attribute-name="StackFactory"
proxy-type="attribute">
- portal:service=InterceptorStackFactory,type=Command
- </depends>
- <depends optional-attribute-name="PortalObjectContainer"
proxy-type="attribute">portal:container=PortalObject
- </depends>
+ <depends optional-attribute-name="StackFactory"
proxy-type="attribute">portal:service=InterceptorStackFactory,type=Command</depends>
+ <depends optional-attribute-name="PortalObjectContainer"
proxy-type="attribute">portal:container=PortalObject</depends>
<depends optional-attribute-name="InstanceContainer"
proxy-type="attribute">portal:container=Instance</depends>
- <depends optional-attribute-name="PortalAuthorizationManagerFactory"
proxy-type="attribute">
- portal:service=PortalAuthorizationManagerFactory
- </depends>
- <depends optional-attribute-name="CustomizationManager"
proxy-type="attribute">portal:service=CustomizationManager
- </depends>
- <depends optional-attribute-name="ContentRendererRegistry"
proxy-type="attribute">
- portal:service=ContentProviderRegistry
- </depends>
- <depends optional-attribute-name="ResponseHandler"
proxy-type="attribute">
- portal:service=ResponseHandler,type=Selector
- </depends>
- <depends optional-attribute-name="PageControlPolicy"
proxy-type="attribute">portal:service=ControlPolicy,type=Page
- </depends>
+ <depends optional-attribute-name="PortalAuthorizationManagerFactory"
proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
+ <depends optional-attribute-name="CustomizationManager"
proxy-type="attribute">portal:service=CustomizationManager</depends>
+ <depends optional-attribute-name="ContentRendererRegistry"
proxy-type="attribute">portal:service=ContentProviderRegistry</depends>
+ <depends optional-attribute-name="ResponseHandler"
proxy-type="attribute">portal:service=ResponseHandler,type=Selector</depends>
+ <depends optional-attribute-name="PageControlPolicy"
proxy-type="attribute">portal:service=ControlPolicy,type=Page</depends>
+ <depends optional-attribute-name="ContentProviderRegistry"
proxy-type="attribute">portal:service=ContentProviderRegistry</depends>
</mbean>
<!-- The controller factory -->
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/portlet.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/portlet.xml 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/portlet.xml 2008-04-13
23:11:33 UTC (rev 10562)
@@ -28,19 +28,6 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
version="2.0">
- <filter>
- <filter-name>JBoss Portlet Filter</filter-name>
-
<filter-class>org.jboss.portlet.filter.JBossPortletFilter</filter-class>
- <lifecycle>ACTION_PHASE</lifecycle>
- <lifecycle>RENDER_PHASE</lifecycle>
- </filter>
-
- <filter-mapping>
- <filter-name>JBoss Portlet Filter</filter-name>
- <portlet-name>CMSPortlet</portlet-name>
- <portlet-name>CMSAdminPortlet</portlet-name>
- </filter-mapping>
-
<portlet>
<description>Content Management System Portlet</description>
<portlet-name>CMSPortlet</portlet-name>
@@ -65,7 +52,9 @@
<value>/default/index.html</value>
</preference>
</portlet-preferences>
+
<supported-public-render-parameter>uri</supported-public-render-parameter>
</portlet>
+
<portlet>
<description>Administration Portlet for CMS</description>
<portlet-name>CMSAdminPortlet</portlet-name>
@@ -103,4 +92,22 @@
</portlet-info>
</portlet-->
+ <filter>
+ <filter-name>JBoss Portlet Filter</filter-name>
+
<filter-class>org.jboss.portlet.filter.JBossPortletFilter</filter-class>
+ <lifecycle>ACTION_PHASE</lifecycle>
+ <lifecycle>RENDER_PHASE</lifecycle>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>JBoss Portlet Filter</filter-name>
+ <portlet-name>CMSPortlet</portlet-name>
+ <portlet-name>CMSAdminPortlet</portlet-name>
+ </filter-mapping>
+
+ <public-render-parameter>
+ <identifier>uri</identifier>
+ <qname xmlns:c="urn:jboss:portal:content">c:uri</qname>
+ </public-render-parameter>
+
</portlet-app>
Modified:
branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-basic-samples-war/WEB-INF/default-object.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-basic-samples-war/WEB-INF/default-object.xml 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-basic-samples-war/WEB-INF/default-object.xml 2008-04-13
23:11:33 UTC (rev 10562)
@@ -344,6 +344,18 @@
<height>1</height>
</window>
</page>
+ <page>
+ <page-name>file system content</page-name>
+ <window>
+ <window-name>FSWindow</window-name>
+ <content>
+ <content-type>filesystem</content-type>
+ <content-uri>/dir1/bar.txt</content-uri>
+ </content>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ </page>
</page>
</deployment>
<deployment>
Modified:
branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml 2008-04-13
23:05:46 UTC (rev 10561)
+++
branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml 2008-04-13
23:11:33 UTC (rev 10562)
@@ -310,6 +310,7 @@
<title>File Portlet</title>
<keywords>sample,test</keywords>
</portlet-info>
+
<supported-public-render-parameter>uri</supported-public-render-parameter>
</portlet>
<portlet>
<description>File Upload Portlet</description>
@@ -413,6 +414,11 @@
<identifier>juu</identifier>
</public-render-parameter>
+ <public-render-parameter>
+ <identifier>uri</identifier>
+ <qname xmlns:c="urn:jboss:portal:content">c:uri</qname>
+ </public-render-parameter>
+
<!--
<custom-portlet-mode>
<name>ADMIN</name>