You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by dj...@apache.org on 2009/12/10 07:01:49 UTC
svn commit: r889103 - in /portals/pluto/trunk: ./ pluto-container-api/
pluto-container-driver-api/ pluto-container/ pluto-portal-driver-impl/
pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/
pluto-portal-driver-impl/src/main/...
Author: djencks
Date: Thu Dec 10 06:01:47 2009
New Revision: 889103
URL: http://svn.apache.org/viewvc?rev=889103&view=rev
Log:
PLUTO-585 make pluto work in osgi as blueprint services. (some code still in geronimo). Fix poms. Add some more DI constructors. Abstract away from ServletContext for non-DI configuration. Provide defaults for tooltip ResourceBundle in case osgi can't find the properties file.
Added:
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/ResourceSource.java (with props)
Modified:
portals/pluto/trunk/pluto-container-api/pom.xml
portals/pluto/trunk/pluto-container-driver-api/pom.xml
portals/pluto/trunk/pluto-container/pom.xml
portals/pluto/trunk/pluto-portal-driver-impl/pom.xml
portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java
portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/PropertyConfigServiceImpl.java
portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java
portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java
portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedWindowStateServiceImpl.java
portals/pluto/trunk/pluto-portal-driver/pom.xml
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalStartupListener.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfiguration.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DriverPortletContextImpl.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/DriverConfigurationService.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/ToolTips.java
portals/pluto/trunk/pluto-taglib/pom.xml
portals/pluto/trunk/pom.xml
Modified: portals/pluto/trunk/pluto-container-api/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container-api/pom.xml?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container-api/pom.xml (original)
+++ portals/pluto/trunk/pluto-container-api/pom.xml Thu Dec 10 06:01:47 2009
@@ -49,23 +49,9 @@
<artifactId>ccpp</artifactId>
<scope>provided</scope>
</dependency>
-
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Import-Package>javax.ccpp;resolution:=optional,*</Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
+ </dependencies>
- </build>
<!-- Don't create distribution artifacts -->
<profiles>
Modified: portals/pluto/trunk/pluto-container-driver-api/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container-driver-api/pom.xml?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container-driver-api/pom.xml (original)
+++ portals/pluto/trunk/pluto-container-driver-api/pom.xml Thu Dec 10 06:01:47 2009
@@ -49,7 +49,7 @@
<artifactId>ccpp</artifactId>
<scope>provided</scope>
</dependency>
-
+
<dependency>
<groupId>org.apache.portals.pluto</groupId>
<artifactId>pluto-container-api</artifactId>
@@ -57,20 +57,6 @@
<scope>compile</scope>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Import-Package>javax.ccpp;resolution:=optional,*</Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
-
- </build>
<!-- Don't create distribution artifacts -->
<profiles>
Modified: portals/pluto/trunk/pluto-container/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/pom.xml?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-container/pom.xml (original)
+++ portals/pluto/trunk/pluto-container/pom.xml Thu Dec 10 06:01:47 2009
@@ -156,7 +156,6 @@
org.apache.pluto.container.om.portlet10.impl,
org.apache.pluto.container.util
</Export-Package>
- <Import-Package>javax.ccpp;resolution:=optional,*</Import-Package>
</instructions>
</configuration>
</plugin>
Modified: portals/pluto/trunk/pluto-portal-driver-impl/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/pom.xml?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/pom.xml (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/pom.xml Thu Dec 10 06:01:47 2009
@@ -72,6 +72,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
@@ -147,7 +148,6 @@
org.apache.pluto.driver.services.impl.resource,
org.apache.pluto.driver.url.impl
</Export-Package>
- <Import-Package>javax.ccpp;resolution:=optional,*</Import-Package>
</instructions>
</configuration>
</plugin>
Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java Thu Dec 10 06:01:47 2009
@@ -21,7 +21,6 @@
import javax.portlet.PortletConfig;
import javax.portlet.PortletMode;
-import javax.servlet.ServletContext;
import org.apache.pluto.container.PortletContainerException;
import org.apache.pluto.container.PortletPreferencesService;
@@ -32,6 +31,7 @@
import org.apache.pluto.driver.services.portal.SupportedModesService;
import org.apache.pluto.driver.services.portal.SupportedWindowStateService;
import org.apache.pluto.driver.url.PortalURLParser;
+import org.apache.pluto.driver.container.ResourceSource;
/**
* Encapsulation of the Pluto Driver ResourceConfig.
@@ -42,11 +42,11 @@
public class DriverConfigurationImpl
implements DriverConfiguration {
- private PortalURLParser portalUrlParser;
- private PropertyConfigService propertyService;
- private RenderConfigService renderService;
- private SupportedModesService supportedModesService;
- private SupportedWindowStateService supportedWindowStateService;
+ private final PortalURLParser portalUrlParser;
+ private final PropertyConfigService propertyService;
+ private final RenderConfigService renderService;
+ private final SupportedModesService supportedModesService;
+ private final SupportedWindowStateService supportedWindowStateService;
// Container Services
private PortletPreferencesService portletPreferencesService;
@@ -64,6 +64,27 @@
this.supportedWindowStateService = supportedWindowStateService;
}
+ public void init(ResourceSource context) {
+ this.propertyService.init(context);
+ this.renderService.init(context);
+ this.supportedModesService.init(context);
+ this.supportedWindowStateService.init(context);
+ }
+
+ public void destroy() {
+ if(propertyService != null)
+ propertyService.destroy();
+
+ if(renderService != null)
+ renderService.destroy();
+
+ if (supportedModesService != null)
+ supportedModesService.destroy();
+
+ if (supportedWindowStateService != null)
+ supportedWindowStateService.destroy();
+ }
+
/**
* Standard Getter.
* @return the name of the portal.
@@ -128,27 +149,6 @@
return supportedModesService.isPortletModeSupported(portletId, mode);
}
- public void init(ServletContext context) {
- this.propertyService.init(context);
- this.renderService.init(context);
- this.supportedModesService.init(context);
- this.supportedWindowStateService.init(context);
- }
-
- public void destroy() {
- if(propertyService != null)
- propertyService.destroy();
-
- if(renderService != null)
- renderService.destroy();
-
- if (supportedModesService != null)
- supportedModesService.destroy();
-
- if (supportedWindowStateService != null)
- supportedWindowStateService.destroy();
- }
-
//
// Portal Driver Services
//
@@ -157,10 +157,6 @@
return portalUrlParser;
}
- public void setPortalUrlParser(PortalURLParser portalUrlParser) {
- this.portalUrlParser = portalUrlParser;
- }
-
//
// Container Services
//
Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/PropertyConfigServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/PropertyConfigServiceImpl.java?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/PropertyConfigServiceImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/PropertyConfigServiceImpl.java Thu Dec 10 06:01:47 2009
@@ -19,12 +19,11 @@
import java.io.InputStream;
import java.util.Set;
-import javax.servlet.ServletContext;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.pluto.driver.config.DriverConfigurationException;
import org.apache.pluto.driver.services.portal.PropertyConfigService;
+import org.apache.pluto.driver.container.ResourceSource;
/**
* Default implementation of all of the portal Services.
@@ -45,13 +44,17 @@
}
+ public PropertyConfigServiceImpl(ResourceConfig config) {
+ this.config = config;
+ }
+
/**
* Initialization Lifecycle Method
- * @param ctx
+ * @param resourceSource
*/
- public void init(ServletContext ctx) {
+ public void init(ResourceSource resourceSource) {
try {
- InputStream in = ctx.getResourceAsStream(ResourceConfigReader.CONFIG_FILE);
+ InputStream in = resourceSource.getResourceAsStream(ResourceConfigReader.CONFIG_FILE);
config = ResourceConfigReader.getFactory().parse(in);
}
catch(Exception e) {
Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java Thu Dec 10 06:01:47 2009
@@ -20,12 +20,11 @@
import java.util.List;
import java.util.Set;
-import javax.servlet.ServletContext;
-
import org.apache.pluto.driver.config.DriverConfigurationException;
import org.apache.pluto.driver.services.portal.PageConfig;
import org.apache.pluto.driver.services.portal.RenderConfigService;
import org.apache.pluto.driver.services.portal.admin.RenderConfigAdminService;
+import org.apache.pluto.driver.container.ResourceSource;
/**
* Default implementation of all of the portal Services.
@@ -40,16 +39,23 @@
private ResourceConfig config;
-//
+ public RenderConfigServiceImpl() {
+ }
+
+ public RenderConfigServiceImpl(ResourceConfig config) {
+ this.config = config;
+ }
+
+ //
// Lifecycle Methods
//
/**
* Initialization Lifecycle Method
- * @param ctx
+ * @param resourceSource
*/
- public void init(ServletContext ctx) {
+ public void init(ResourceSource resourceSource) {
try {
- InputStream in = ctx.getResourceAsStream(ResourceConfigReader.CONFIG_FILE);
+ InputStream in = resourceSource.getResourceAsStream(ResourceConfigReader.CONFIG_FILE);
config = ResourceConfigReader.getFactory().parse(in);
}
catch(Exception e) {
Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java Thu Dec 10 06:01:47 2009
@@ -22,7 +22,6 @@
import javax.portlet.PortletConfig;
import javax.portlet.PortletMode;
-import javax.servlet.ServletContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -38,6 +37,7 @@
import org.apache.pluto.driver.services.portal.PortletWindowConfig;
import org.apache.pluto.driver.services.portal.PropertyConfigService;
import org.apache.pluto.driver.services.portal.SupportedModesService;
+import org.apache.pluto.driver.container.ResourceSource;
/**
* Allows clients to determine if a particular PortletMode is supported
@@ -65,9 +65,6 @@
/** PropertyConfig Service used to obtain supported portal modes */
private PropertyConfigService propertyService;
- /** The portal's servletContext **/
- private ServletContext servletContext;
-
private PortletContextService portletContextService;
/**
@@ -75,8 +72,10 @@
*
* @param propertyService the PropertyConfigService
*/
- public SupportedModesServiceImpl(PropertyConfigService propertyService) {
+ public SupportedModesServiceImpl(PropertyConfigService propertyService, PortletContextService portletContextService) {
this.propertyService = propertyService;
+ this.portletContextService = portletContextService;
+ loadPortalModes();
}
// SupportedModesService Implementation -----------------
@@ -153,11 +152,8 @@
LOG.debug("Supported Modes Service destroyed.");
}
- public void init(ServletContext ctx) throws DriverConfigurationException {
- this.servletContext = ctx;
- this.portletContextService = PlutoServices.getServices().getPortletContextService();
- loadPortalModes();
- }
+ public void init(ResourceSource resourceSource) throws DriverConfigurationException {
+ }
/** Populates the supportedPortletModesByPortal set. */
@@ -215,7 +211,7 @@
* Gets all modes supported by a portlet that are defined in the portlet's supports child element
* in portlet.xml.
*
- * @param portlet of interest.
+ * @param portletId of interest.
* @return all portlet modes supported by a portlet.
*/
public Set<PortletMode> getSupportedPortletModes(String portletId) throws PortletContainerException {
Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedWindowStateServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedWindowStateServiceImpl.java?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedWindowStateServiceImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedWindowStateServiceImpl.java Thu Dec 10 06:01:47 2009
@@ -22,7 +22,6 @@
import java.util.Set;
import javax.portlet.WindowState;
-import javax.servlet.ServletContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -35,6 +34,7 @@
import org.apache.pluto.driver.services.portal.PortletWindowConfig;
import org.apache.pluto.driver.services.portal.PropertyConfigService;
import org.apache.pluto.driver.services.portal.SupportedWindowStateService;
+import org.apache.pluto.driver.container.ResourceSource;
public class SupportedWindowStateServiceImpl implements
SupportedWindowStateService
@@ -44,11 +44,6 @@
private static final Logger LOG = LoggerFactory.getLogger(SupportedWindowStateServiceImpl.class);
/**
- * Servlet context used to get a handle on the portlet container
- */
- private ServletContext servletContext = null;
-
- /**
* PropertyConfigService is injected by Spring. We
* use it to obtain the window states that the portal
* supports. It is protected only so that the unit
@@ -86,14 +81,38 @@
JSR168_WINDOW_STATES.add(WindowState.NORMAL);
}
- private SupportedWindowStateServiceImpl()
- {
- // this impl requires a PropertyConfigService on construction.
- }
-
public SupportedWindowStateServiceImpl( PropertyConfigService propertyService )
{
this.propertyService = propertyService;
+ LOG.debug( "Initializing SupportedWindowStateService... " );
+
+ portalSupportedWindowStates = propertyService.getSupportedWindowStates();
+ if ( LOG.isDebugEnabled() )
+ {
+ StringBuffer msg = new StringBuffer();
+
+ if ( portalSupportedWindowStates != null )
+ {
+ msg.append( "Portal supports [" + portalSupportedWindowStates.size() + "] window states. ");
+ for ( Iterator i = portalSupportedWindowStates.iterator(); i.hasNext(); )
+ {
+ msg.append( "[" + i.next() + "]" );
+ if ( i.hasNext() )
+ {
+ msg.append(", ");
+ }
+ }
+ LOG.debug(msg.toString());
+ }
+ }
+
+ if ( portalSupportedWindowStates == null )
+ {
+ final String msg = "Portal supported window states is null!";
+ LOG.error( msg );
+ throw new DriverConfigurationException( msg );
+ }
+ LOG.debug( "SupportedWindowStateService initialized." );
}
public boolean isWindowStateSupported(String portletId, String state)
@@ -185,52 +204,14 @@
return false;
}
- public void destroy() throws DriverConfigurationException
+ private PortletRegistryService getPortletRegistryService()
{
- LOG.debug( "Destroying SupportedWindowStateService... " );
- portletRegistry = null;
- propertyService = null;
- portalSupportedWindowStates = null;
- LOG.debug( "SupportedWindowStateService destroyed." );
+ return PlutoServices.getServices().getPortletRegistryService();
}
- public void init(ServletContext ctx) throws DriverConfigurationException
- {
- LOG.debug( "Initializing SupportedWindowStateService... " );
-
- servletContext = ctx;
-
- portalSupportedWindowStates = propertyService.getSupportedWindowStates();
- if ( LOG.isDebugEnabled() )
- {
- StringBuffer msg = new StringBuffer();
-
- if ( portalSupportedWindowStates != null )
- {
- msg.append( "Portal supports [" + portalSupportedWindowStates.size() + "] window states. ");
- for ( Iterator i = portalSupportedWindowStates.iterator(); i.hasNext(); )
- {
- msg.append( "[" + i.next() + "]" );
- if ( i.hasNext() )
- {
- msg.append(", ");
- }
- }
- LOG.debug(msg.toString());
- }
- }
-
- if ( portalSupportedWindowStates == null )
- {
- final String msg = "Portal supported window states is null!";
- LOG.error( msg );
- throw new DriverConfigurationException( msg );
- }
- LOG.debug( "SupportedWindowStateService initialized." );
+ public void init(ResourceSource resourceSource) throws DriverConfigurationException {
}
- private PortletRegistryService getPortletRegistryService()
- {
- return PlutoServices.getServices().getPortletRegistryService();
+ public void destroy() throws DriverConfigurationException {
}
}
Modified: portals/pluto/trunk/pluto-portal-driver/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/pom.xml?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/pom.xml (original)
+++ portals/pluto/trunk/pluto-portal-driver/pom.xml Thu Dec 10 06:01:47 2009
@@ -67,7 +67,6 @@
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
</dependency>
- <!-- CCPP Libraries -->
<dependency>
<groupId>javax.ccpp</groupId>
<artifactId>ccpp</artifactId>
@@ -163,8 +162,7 @@
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
- <Import-Package>javax.ccpp;resolution:=optional,
- org.springframework.web.context;resolution:=optional,
+ <Import-Package>org.springframework.web.context;resolution:=optional,
*
</Import-Package>
</instructions>
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalStartupListener.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalStartupListener.java?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalStartupListener.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalStartupListener.java Thu Dec 10 06:01:47 2009
@@ -16,12 +16,11 @@
*/
package org.apache.pluto.driver;
+import java.io.InputStream;
+
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.pluto.container.PortletContainer;
import org.apache.pluto.container.PortletContainerException;
import org.apache.pluto.container.driver.PortalDriverServices;
@@ -29,7 +28,9 @@
import org.apache.pluto.driver.config.AdminConfiguration;
import org.apache.pluto.driver.config.DriverConfiguration;
import org.apache.pluto.driver.config.DriverConfigurationException;
-import org.apache.pluto.driver.container.PortalDriverServicesImpl;
+import org.apache.pluto.driver.container.ResourceSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
/**
@@ -93,7 +94,7 @@
public void contextInitialized(ServletContextEvent event) {
LOG.info("Starting up Pluto Portal Driver. . .");
- ServletContext servletContext = event.getServletContext();
+ final ServletContext servletContext = event.getServletContext();
WebApplicationContext springContext = null;
@@ -111,7 +112,11 @@
DriverConfiguration driverConfiguration = (DriverConfiguration)
springContext.getBean("DriverConfiguration");
- driverConfiguration.init(servletContext);
+ driverConfiguration.init(new ResourceSource() {
+ public InputStream getResourceAsStream(String resourceName) {
+ return servletContext.getResourceAsStream(resourceName);
+ }
+ });
LOG.debug(" [1b] Registering DriverConfiguration. . .");
servletContext.setAttribute(DRIVER_CONFIG_KEY, driverConfiguration);
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfiguration.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfiguration.java?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfiguration.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfiguration.java Thu Dec 10 06:01:47 2009
@@ -28,6 +28,7 @@
import org.apache.pluto.driver.services.portal.PageConfig;
import org.apache.pluto.driver.services.portal.RenderConfigService;
import org.apache.pluto.driver.url.PortalURLParser;
+import org.apache.pluto.driver.container.ResourceSource;
/**
* Interface defining a means for retrieving driver services
@@ -52,7 +53,7 @@
* @throws DriverConfigurationException when an error occurs during startup.
* @param context
*/
- void init(ServletContext context) throws DriverConfigurationException;
+ void init(ResourceSource context) throws DriverConfigurationException;
/**
* Shutdown method used to remove the driver
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DriverPortletContextImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DriverPortletContextImpl.java?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DriverPortletContextImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DriverPortletContextImpl.java Thu Dec 10 06:01:47 2009
@@ -41,7 +41,7 @@
/**
* Constructs an instance.
* @param servletContext the servlet context in which we are contained.
- * @param portletAppDD the portlet application descriptor.
+ * @param portletApp the portlet application descriptor.
*/
public DriverPortletContextImpl(ServletContext servletContext,
PortletApplicationDefinition portletApp,
Added: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/ResourceSource.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/ResourceSource.java?rev=889103&view=auto
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/ResourceSource.java (added)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/ResourceSource.java Thu Dec 10 06:01:47 2009
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.pluto.driver.container;
+
+import java.io.InputStream;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface ResourceSource {
+
+ InputStream getResourceAsStream(String resourceName);
+
+}
Propchange: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/ResourceSource.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/ResourceSource.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/ResourceSource.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/DriverConfigurationService.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/DriverConfigurationService.java?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/DriverConfigurationService.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/DriverConfigurationService.java Thu Dec 10 06:01:47 2009
@@ -16,9 +16,8 @@
*/
package org.apache.pluto.driver.services.portal;
-import javax.servlet.ServletContext;
-
import org.apache.pluto.driver.config.DriverConfigurationException;
+import org.apache.pluto.driver.container.ResourceSource;
/**
* Abstract interface defining lifecycle methods for
@@ -34,11 +33,10 @@
* resources from the context and instantiate any required
* services.
*
- * @param ctx the Portal's servlet context in which the
- * service will be executing.
+ * @param resourceSource
*
*/
- void init(ServletContext ctx) throws DriverConfigurationException;
+ void init(ResourceSource resourceSource) throws DriverConfigurationException;
/**
* Destroy the service, notifying it of shutdown.
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/ToolTips.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/ToolTips.java?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/ToolTips.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/ToolTips.java Thu Dec 10 06:01:47 2009
@@ -18,6 +18,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
+import java.util.ListResourceBundle;
import javax.portlet.PortletMode;
import javax.portlet.WindowState;
@@ -33,7 +34,30 @@
*/
class ToolTips
{
- private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("ToolTips");
+ private static final ResourceBundle BUNDLE;
+ static {
+ ResourceBundle bundle;
+ try {
+ bundle = ResourceBundle.getBundle("ToolTips");
+ } catch (MissingResourceException e) {
+ bundle = new ListResourceBundle() {
+ protected Object[][] getContents() {
+ return new Object[][] {
+ {"tooltip.windowstate.maximized", "Maximize"},
+ {"tooltip.windowstate.minimized", "Minimize"},
+ {"tooltip.windowstate.normal", "Restore"},
+
+ {"tooltip.mode.view", "View"},
+ {"tooltip.mode.help", "Help"},
+ {"tooltip.mode.edit", "Edit"},
+
+ {"tooltip.css.classname", "tooltip"},
+ };
+ }
+ };
+ }
+ BUNDLE = bundle;
+ }
private static final Logger LOG = LoggerFactory.getLogger(ToolTips.class);
static final ToolTips MAXIMIZE = new ToolTips(BUNDLE.getString("tooltip.windowstate.maximized"));
Modified: portals/pluto/trunk/pluto-taglib/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-taglib/pom.xml?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-taglib/pom.xml (original)
+++ portals/pluto/trunk/pluto-taglib/pom.xml Thu Dec 10 06:01:47 2009
@@ -54,6 +54,21 @@
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Import-Package>javax.el,
+ *
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
<!-- Don't create distribution artifacts -->
<profiles>
<profile>
Modified: portals/pluto/trunk/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pom.xml?rev=889103&r1=889102&r2=889103&view=diff
==============================================================================
--- portals/pluto/trunk/pom.xml (original)
+++ portals/pluto/trunk/pom.xml Thu Dec 10 06:01:47 2009
@@ -189,7 +189,14 @@
<roles>
<role>Java Developer</role>
</roles>
- </developer>
+ </developer>
+
+ <developer>
+ <name>David Jencks</name>
+ <id>djencks</id>
+ <email>djencks#aT#apache.d0t.org</email>
+ <timezone>-7</timezone>
+ </developer>
</developers>