com.googlecode.fascinator.portal.services
Class PortalModule

java.lang.Object
  extended by com.googlecode.fascinator.portal.services.PortalModule

public class PortalModule
extends Object

A Tapestry Module which controls service instantiation and configuration.

Wiki Link

https://fascinator.usq.edu.au/trac/wiki/Fascinator/Documents/Portal/JavaCore#TapestryServices

Author:
Oliver Lucido

Constructor Summary
PortalModule()
           
 
Method Summary
static void bind(org.apache.tapestry5.ioc.ServiceBinder binder)
          Use the ServiceBinder to bind Tapestry Service implementations to their interfaces.
static AccessControlManager buildAccessManager()
          Instantiate and return the Manager object for Access Control plugins.
static AuthManager buildAuthManager()
          Instantiate and return the Manager object for Authentication plugins.
static DatabaseServices buildDatabaseServices(org.apache.tapestry5.ioc.services.RegistryShutdownHub hub)
          Instantiate and return the DatabaseService, making sure Tapestry notifies the Service at system shutdown.
static DynamicPageCache buildDynamicPageCache(PortalManager portalManager, VelocityService velocityService, ScriptingServices scriptingServices, org.apache.tapestry5.ioc.services.RegistryShutdownHub hub)
           
static HouseKeepingManager buildHouseKeepingManager(org.apache.tapestry5.ioc.services.RegistryShutdownHub hub)
          Instantiate and return the House Keeper, making sure Tapestry notifies the Service at system shutdown.
static Indexer buildIndexer()
          Instantiate and return an Indexer plugin.
static RolesManager buildRoleManager()
          Instantiate and return the Manager object for security Roles plugins.
static Storage buildStorage()
          Instantiate and return a Storage plugin.
static void contributeAlias(org.apache.tapestry5.ioc.Configuration<org.apache.tapestry5.services.AliasContribution<org.apache.tapestry5.services.URLEncoder>> configuration)
          Modify the Tapestry URL encoding/decoding to ensure URLs are left exactly as received before they reach our code.
static void contributeApplicationStateManager(org.apache.tapestry5.ioc.MappedConfiguration<Class<?>,org.apache.tapestry5.services.ApplicationStateContribution> configuration)
          Modify the configuration of the ApplicationStateManager Tapestry service.
static void contributeResponseCompressionAnalyzer(org.apache.tapestry5.ioc.Configuration<String> configuration)
          Modify the configuration of the ResponseCompressionAnalyzer Tapestry service.
static void contributeURLRewriter(org.apache.tapestry5.ioc.OrderedConfiguration<org.apache.tapestry5.urlrewriter.URLRewriterRule> configuration, org.apache.tapestry5.services.RequestGlobals requestGlobals, org.apache.tapestry5.services.URLEncoder urlEncoder)
          Ensure Tapestry routes all URLs to our Dispatch object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortalModule

public PortalModule()
Method Detail

bind

public static void bind(org.apache.tapestry5.ioc.ServiceBinder binder)
Use the ServiceBinder to bind Tapestry Service implementations to their interfaces.

Parameters:
binder - : Tapestry service binder

buildDynamicPageCache

public static DynamicPageCache buildDynamicPageCache(PortalManager portalManager,
                                                     VelocityService velocityService,
                                                     ScriptingServices scriptingServices,
                                                     org.apache.tapestry5.ioc.services.RegistryShutdownHub hub)

buildDatabaseServices

public static DatabaseServices buildDatabaseServices(org.apache.tapestry5.ioc.services.RegistryShutdownHub hub)
Instantiate and return the DatabaseService, making sure Tapestry notifies the Service at system shutdown.

Parameters:
hub - : Tapestry shutdown hub
Returns:
DatabaseServices : The Database Tapestry Service

buildHouseKeepingManager

public static HouseKeepingManager buildHouseKeepingManager(org.apache.tapestry5.ioc.services.RegistryShutdownHub hub)
Instantiate and return the House Keeper, making sure Tapestry notifies the Service at system shutdown.

Parameters:
hub - : Tapestry shutdown hub
Returns:
HouseKeepingManager : The House Keeping Service

buildAccessManager

public static AccessControlManager buildAccessManager()
Instantiate and return the Manager object for Access Control plugins.

Returns:
AccessControlManager : The Access Control Manager

buildAuthManager

public static AuthManager buildAuthManager()
Instantiate and return the Manager object for Authentication plugins.

Returns:
AuthManager : The Authentication Manager

buildIndexer

public static Indexer buildIndexer()
Instantiate and return an Indexer plugin.

Returns:
Indexer : An Indexer plugin

buildRoleManager

public static RolesManager buildRoleManager()
Instantiate and return the Manager object for security Roles plugins.

Returns:
RolesManager : The Roles Manager

buildStorage

public static Storage buildStorage()
Instantiate and return a Storage plugin.

Returns:
Storage : A Storage plugin

contributeResponseCompressionAnalyzer

public static void contributeResponseCompressionAnalyzer(org.apache.tapestry5.ioc.Configuration<String> configuration)
Modify the configuration of the ResponseCompressionAnalyzer Tapestry service. The service is responsible for deciding which MIME type should be automatically GZIP'd on the way back to the client. Adding formats to this configuration will exclude them from compression

Parameters:
configuration: - Unordered configuration from Tapestry

contributeApplicationStateManager

public static void contributeApplicationStateManager(org.apache.tapestry5.ioc.MappedConfiguration<Class<?>,org.apache.tapestry5.services.ApplicationStateContribution> configuration)
Modify the configuration of the ApplicationStateManager Tapestry service. We want it to use our JsonSessionState object for session data.

Parameters:
configuration: - Configuration from Tapestry

contributeAlias

public static void contributeAlias(org.apache.tapestry5.ioc.Configuration<org.apache.tapestry5.services.AliasContribution<org.apache.tapestry5.services.URLEncoder>> configuration)
Modify the Tapestry URL encoding/decoding to ensure URLs are left exactly as received before they reach our code.

Parameters:
configuration: - Configuration from Tapestry

contributeURLRewriter

public static void contributeURLRewriter(org.apache.tapestry5.ioc.OrderedConfiguration<org.apache.tapestry5.urlrewriter.URLRewriterRule> configuration,
                                         @Inject
                                         org.apache.tapestry5.services.RequestGlobals requestGlobals,
                                         @Inject
                                         org.apache.tapestry5.services.URLEncoder urlEncoder)
Ensure Tapestry routes all URLs to our Dispatch object. The sole except is 'asset*' URLs which Tapestry will handle, although we don't use at this time

Parameters:
configuration: - Configuration from Tapestry
requestGlobals: - Request information
urlEncoder: - The URL encoder


Copyright © 2009-2012. All Rights Reserved.