com.caucho.portal.generic
Class GenericPortal

java.lang.Object
  extended by com.caucho.portal.generic.GenericPortal
All Implemented Interfaces:
Portal

public class GenericPortal
extends java.lang.Object
implements Portal

A Portal implementation with default values.


Field Summary
static java.util.logging.Logger log
           
 
Constructor Summary
GenericPortal()
           
 
Method Summary
 BufferFactory getBufferFactory()
           
 Cache getCache()
          XXX: caching not currently implemented
 PortalContext getPortalContext()
           
 java.lang.String getPortalInfo()
          
 PreferencesStore getPreferencesStore()
          Return a PreferencesStore for a connection.
 java.lang.String getProperty(java.lang.String name)
          
 java.util.Enumeration getPropertyNames()
          
 java.lang.String getReservedNamespace()
          The reserved namespace is used to mark parameters that have special meaning to the portal.
 java.util.Enumeration getSupportedPortletModes()
          
 java.util.Enumeration getSupportedWindowStates()
          
 java.util.Set<java.lang.String> getUserAttributeNames()
          Return a Set of all user attributes names that this portlet uses, null if all user attributes available from the portal should be made available.
 UserAttributeStore getUserAttributeStore()
          Return a UserAttributeStore.
 boolean isPortletModeAllowed(PortletRequest portletRequest, PortletMode portletMode)
          Return true if the PortletMode is allowed.
 boolean isWindowStateAllowed(PortletRequest portletRequest, WindowState windowState)
          Return true if the WindowState is allowed.
 void setBufferFactory(BufferFactory bufferFactory)
          The default is an instance of BufferFactoryImpl.
 void setCache(Cache cache)
          Caching is currently unimplemented, attempting to set this value will cause an exception to be thrown.
 void setPortalInfo(java.lang.String portalInfo)
          Set the value to be returned by getPortalInfo(), the default is "GenericPortal/1.0".
 void setPreferencesStore(PreferencesStore preferencesStore)
          Set the #PreferencesStore, obtained once for each connection and then used to obtain a preferences store for each namespace as needed.
 void setProperty(java.lang.String name, java.lang.String value)
          Set a portal property that is available with getProperty(java.lang.String).
 void setReservedNamespace(java.lang.String reservedNamespace)
          Set the reserved namespace, the default is "__".
 void setSupportedPortletModes(java.util.Set<PortletMode> portletModes)
          Set the supported portlet modes.
 void setSupportedWindowStates(java.util.Set<WindowState> windowStates)
          Set the supported window states.
 void setUserAttributeNames(java.util.Set<java.lang.String> userAttributeNames)
          Set the user attribute names that the portlet can use, the default is to allow all user attributes to be visible to the portlet.
 void setUserAttributeStore(UserAttributeStore userAttributeStore)
          Set the #UserAttributeStore, obtained once for each connection and then used to obtain user attributes as needed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final java.util.logging.Logger log
Constructor Detail

GenericPortal

public GenericPortal()
Method Detail

getPortalContext

public PortalContext getPortalContext()
Specified by:
getPortalContext in interface Portal

setPortalInfo

public void setPortalInfo(java.lang.String portalInfo)
Set the value to be returned by getPortalInfo(), the default is "GenericPortal/1.0".


getPortalInfo

public java.lang.String getPortalInfo()


setReservedNamespace

public void setReservedNamespace(java.lang.String reservedNamespace)
Set the reserved namespace, the default is "__".


getReservedNamespace

public java.lang.String getReservedNamespace()
The reserved namespace is used to mark parameters that have special meaning to the portal. The specification suggests "javax.portal.", which is rather long so the default is ususally "__".

Specified by:
getReservedNamespace in interface Portal

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
Set a portal property that is available with getProperty(java.lang.String).


getProperty

public java.lang.String getProperty(java.lang.String name)


getPropertyNames

public java.util.Enumeration getPropertyNames()


setSupportedPortletModes

public void setSupportedPortletModes(java.util.Set<PortletMode> portletModes)
Set the supported portlet modes. If this method is not called then then isPortletModeAllowed(PortletRequest, PortletMode) will always return true (all portlet modes are allowed) but getSupportedPortletModes() will return an empty enumeration.


getSupportedPortletModes

public java.util.Enumeration getSupportedPortletModes()


isPortletModeAllowed

public boolean isPortletModeAllowed(PortletRequest portletRequest,
                                    PortletMode portletMode)
Return true if the PortletMode is allowed. portletRequest.getResponseContentType() can be used if the allowed portlet modes depends on the mime type of the response.

Specified by:
isPortletModeAllowed in interface Portal

setSupportedWindowStates

public void setSupportedWindowStates(java.util.Set<WindowState> windowStates)
Set the supported window states. If this method is never called and no window states are specified, then isWindowStateAllowed(PortletRequest, WindowState) will always return true (all window states are allowed) but getSupportedWindowStates() will return an empty enumeration.


getSupportedWindowStates

public java.util.Enumeration getSupportedWindowStates()


isWindowStateAllowed

public boolean isWindowStateAllowed(PortletRequest portletRequest,
                                    WindowState windowState)
Return true if the WindowState is allowed. portletRequest.getResponseContentType() can be used if the allowed portlet modes depends on the mime type of the response.

Specified by:
isWindowStateAllowed in interface Portal

setPreferencesStore

public void setPreferencesStore(PreferencesStore preferencesStore)
Set the #PreferencesStore, obtained once for each connection and then used to obtain a preferences store for each namespace as needed. The default is an instance of #SessionPreferencesStore.


getPreferencesStore

public PreferencesStore getPreferencesStore()
Return a PreferencesStore for a connection. The store is obtained once for each connection and used throughout the course of the connection to obtain a javax.portlet.PortletPreferences for each namespace.

Specified by:
getPreferencesStore in interface Portal

setUserAttributeNames

public void setUserAttributeNames(java.util.Set<java.lang.String> userAttributeNames)
Set the user attribute names that the portlet can use, the default is to allow all user attributes to be visible to the portlet.


getUserAttributeNames

public java.util.Set<java.lang.String> getUserAttributeNames()
Return a Set of all user attributes names that this portlet uses, null if all user attributes available from the portal should be made available.

Specified by:
getUserAttributeNames in interface Portal

setUserAttributeStore

public void setUserAttributeStore(UserAttributeStore userAttributeStore)
Set the #UserAttributeStore, obtained once for each connection and then used to obtain user attributes as needed. The default is null, which means that no user attributes are available.


getUserAttributeStore

public UserAttributeStore getUserAttributeStore()
Return a UserAttributeStore. The store is obtained once for each connection if needed.

Specified by:
getUserAttributeStore in interface Portal

setCache

public void setCache(Cache cache)
Caching is currently unimplemented, attempting to set this value will cause an exception to be thrown.


getCache

public Cache getCache()
XXX: caching not currently implemented

Specified by:
getCache in interface Portal
Returns:
null to disable caching

setBufferFactory

public void setBufferFactory(BufferFactory bufferFactory)
The default is an instance of BufferFactoryImpl.


getBufferFactory

public BufferFactory getBufferFactory()
Specified by:
getBufferFactory in interface Portal
Returns:
null to disable buffering