Author: chris.laprun(a)jboss.com
Date: 2010-10-12 10:07:09 -0400 (Tue, 12 Oct 2010)
New Revision: 4639
Modified:
components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/container/ContainerPortletInvoker.java
Log:
- GTNPC-33: Created PortletContext.create(String portletApplicationId, String
portletContainerId) method to encapsulate portlet context creation logic.
Modified: components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java
===================================================================
--- components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java 2010-10-12
12:03:15 UTC (rev 4638)
+++ components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java 2010-10-12
14:07:09 UTC (rev 4639)
@@ -132,7 +132,7 @@
/**
* Create a PortletContext based on given id and required state: this method will fail
if state is not valid. Use
- * this method instead of {@link #createPortletContext(String,byte[])} for cases when
a state is expected and the
+ * this method instead of {@link #createPortletContext(String, byte[])} for cases when
a state is expected and the
* creation of the PortletContext should fail if no state was given.
*
* @param id the portlet id
@@ -147,7 +147,7 @@
public static PortletContext createPortletContext(String portletId)
{
- return createPortletContext(portletId, null);
+ return createPortletContext(portletId, (byte[])null);
}
public String getApplicationName()
@@ -159,4 +159,9 @@
{
return portletName;
}
+
+ public static PortletContext createPortletContext(String portletApplicationId, String
containerId)
+ {
+ return PortletContext.createPortletContext(portletApplicationId + SEPARATOR +
containerId);
+ }
}
Modified:
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/container/ContainerPortletInvoker.java
===================================================================
---
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/container/ContainerPortletInvoker.java 2010-10-12
12:03:15 UTC (rev 4638)
+++
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/container/ContainerPortletInvoker.java 2010-10-12
14:07:09 UTC (rev 4639)
@@ -206,8 +206,7 @@
public PortletImpl(PortletContainer container)
{
this.container = container;
- this.context =
PortletContext.createPortletContext(container.getPortletApplication().getId() +
"." + container.getId());
- //this.context =
PortletContext.createPortletContext(container.getPortletApplication().getId().substring(1)
+ "/" + container.getId());
+ this.context =
PortletContext.createPortletContext(container.getPortletApplication().getId(),
container.getId());
}
public PortletContext getContext()
Show replies by date