Author: thomas.heute(a)jboss.com
Date: 2007-10-10 06:35:18 -0400 (Wed, 10 Oct 2007)
New Revision: 8581
Modified:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
Log:
- PortletApplicationContext gets access to the webapp context
- Info Metadata gets access to the portletApplicationContext
Modified:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationContext.java 2007-10-10
09:14:51 UTC (rev 8580)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationContext.java 2007-10-10
10:35:18 UTC (rev 8581)
@@ -42,6 +42,13 @@
ServletContext getServletContext();
/**
+ * Returns the context path of the web application
+ *
+ * @return the context path
+ */
+ String getContextPath();
+
+ /**
* Return the classloader.
*
* @return the classloader
Modified:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2007-10-10
09:14:51 UTC (rev 8580)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2007-10-10
10:35:18 UTC (rev 8581)
@@ -71,6 +71,9 @@
/** . */
private PortletApplicationRegistrationContext registrationContext;
+
+ /** . */
+ private String contextPath;
public PortletApplicationContextImpl(
PortletApplicationRegistry registry,
@@ -79,7 +82,8 @@
PortletApplicationMetaData portletAppMD,
JBossApplicationMetaData jbossAppMD,
ServletContext servletContext,
- ClassLoader classLoader)
+ ClassLoader classLoader,
+ String contextPath)
{
this.registry = registry;
this.portletAPIFactory = portletAPIFactory;
@@ -88,6 +92,7 @@
this.jbossAppMD = jbossAppMD;
this.servletContext = servletContext;
this.classLoader = classLoader;
+ this.contextPath = contextPath;
}
public PortletApplicationImpl getPortletApplication()
@@ -189,6 +194,11 @@
return servletContext;
}
+ public String getContextPath()
+ {
+ return contextPath;
+ }
+
public ClassLoader getClassLoader()
{
return classLoader;
Modified:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2007-10-10
09:14:51 UTC (rev 8580)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2007-10-10
10:35:18 UTC (rev 8581)
@@ -220,7 +220,7 @@
bundleMgr);
// Create meta data
- PortletInfo info = application.getPortletInfoFactory().createPortletInfo(metaData,
jbossMetaData, bundleMgr);
+ PortletInfo info =
application.getPortletInfoFactory().createPortletInfo(application.getContext(), metaData,
jbossMetaData, bundleMgr);
// Finally initialize the porlet instance
try
Modified:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java 2007-10-10
09:14:51 UTC (rev 8580)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java 2007-10-10
10:35:18 UTC (rev 8581)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168;
+import org.jboss.portal.portlet.container.PortletApplicationContext;
import org.jboss.portal.portlet.impl.jsr168.spi.PortletInfoFactory;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
@@ -35,8 +36,8 @@
*/
public class PortletInfoFactoryImpl implements PortletInfoFactory
{
- public PortletInfo createPortletInfo(PortletMetaData portletMD, JBossPortletMetaData
jbossPortletMD, ResourceBundleManager resourceBundleManager)
+ public PortletInfo createPortletInfo(PortletApplicationContext
portletApplicationContext, PortletMetaData portletMD, JBossPortletMetaData jbossPortletMD,
ResourceBundleManager resourceBundleManager)
{
- return new ContainerPortletInfo(portletMD, jbossPortletMD, resourceBundleManager);
+ return new ContainerPortletInfo(portletApplicationContext, portletMD,
jbossPortletMD, resourceBundleManager);
}
}
Modified:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2007-10-10
09:14:51 UTC (rev 8580)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2007-10-10
10:35:18 UTC (rev 8581)
@@ -32,10 +32,10 @@
import org.jboss.portal.portlet.impl.jsr168.PortletRequestAttributes;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPreferencesInfo;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.spi.RequestContext;
import org.jboss.portal.portlet.spi.SecurityContext;
import org.jboss.portal.portlet.spi.UserContext;
+import org.jboss.portal.portlet.spi.WindowContext;
import org.jboss.portal.portlet.state.PropertyContext;
import javax.portlet.PortalContext;
@@ -75,7 +75,7 @@
protected UserContext userContext;
protected SecurityContext securityContext;
protected RequestContext requestContext;
- protected InstanceContext instanceContext;
+ protected WindowContext windowContext;
protected PortletPreferences preferences;
protected PortletContainerImpl container;
protected HttpServletRequest dreq;
@@ -96,7 +96,7 @@
this.userContext = invocation.getUserContext();
this.securityContext = invocation.getSecurityContext();
this.requestContext = invocation.getRequestContext();
- this.instanceContext = invocation.getInstanceContext();
+ this.windowContext = invocation.getWindowContext();
this.container =
(PortletContainerImpl)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER);
this.dreq = invocation.getDispatchedRequest();
this.portalContext = new PortalContextImpl(invocation.getPortalContext());
@@ -393,7 +393,7 @@
PortletApplicationImpl portletApp =
(PortletApplicationImpl)container.getApplication();
psession = new PortletSessionImpl(
hsession,
- instanceContext.getId(),
+ windowContext.getId(),
portletApp.getPortletContext());
}
else if (psession == null)
@@ -407,7 +407,7 @@
PortletApplicationImpl portletApp =
(PortletApplicationImpl)container.getApplication();
psession = new PortletSessionImpl(
hsession,
- instanceContext.getId(),
+ windowContext.getId(),
portletApp.getPortletContext());
}
}
Modified:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java 2007-10-10
09:14:51 UTC (rev 8580)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java 2007-10-10
10:35:18 UTC (rev 8581)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.impl.jsr168.info;
import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.portlet.container.PortletApplicationContext;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
import org.jboss.portal.portlet.info.CacheInfo;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
@@ -52,6 +53,7 @@
private Boolean remotable;
public ContainerPortletInfo(
+ PortletApplicationContext portletApplicationContext,
PortletMetaData portletMD,
JBossPortletMetaData jbossPortletMD,
ResourceBundleManager bundleMgr)
Modified:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java 2007-10-10
09:14:51 UTC (rev 8580)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java 2007-10-10
10:35:18 UTC (rev 8581)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.spi;
+import org.jboss.portal.portlet.container.PortletApplicationContext;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
@@ -45,6 +46,7 @@
* @return the runtime portlet meta data
*/
PortletInfo createPortletInfo(
+ PortletApplicationContext portletApplicationContext,
PortletMetaData portletMD,
JBossPortletMetaData jbossPortletMD,
ResourceBundleManager resourceBundleManager);
Modified:
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
===================================================================
---
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2007-10-10
09:14:51 UTC (rev 8580)
+++
modules/portlet/trunk/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2007-10-10
10:35:18 UTC (rev 8581)
@@ -250,4 +250,9 @@
{
throw new NotYetImplemented();
}
+
+ public String getContextPath()
+ {
+ throw new NotYetImplemented();
+ }
}