org.apache.jetspeed.decoration
Class DecorationFactoryImpl

java.lang.Object
  extended by org.apache.jetspeed.decoration.DecorationFactoryImpl
All Implemented Interfaces:
org.apache.jetspeed.decoration.DecorationFactory, org.springframework.web.context.ServletContextAware

public class DecorationFactoryImpl
extends Object
implements org.apache.jetspeed.decoration.DecorationFactory, org.springframework.web.context.ServletContextAware

Author:
Scott T. Weaver, Steve Milek
See Also:
DecorationFactory

Field Summary
private  org.apache.jetspeed.cache.JetspeedCache decorationConfigurationCache
          cache to hold decoration Properties objects
private  org.apache.jetspeed.util.Path decorationsPath
           
private  String defaultDesktopLayoutDecoration
           
private  String defaultDesktopPortletDecoration
           
private  Set desktopLayoutDecorationsDir
           
private  Set desktopLayoutDecorationsList
           
private  Set desktopPortletDecorationsDir
           
private  Set desktopPortletDecorationsList
           
private  Set layoutDecorationsDir
           
private  Set layoutDecorationsList
           
private  org.apache.jetspeed.util.Path layoutDecorationsPath
           
private  String layoutDecorationsPathStr
           
private  Map layoutDecoratorProperties
           
private static org.apache.commons.logging.Log log
           
private  Set portletDecorationsDir
           
private  Set portletDecorationsList
           
private  org.apache.jetspeed.util.Path portletDecorationsPath
           
private  String portletDecorationsPathStr
           
private  Map portletDecoratorProperties
           
private  org.apache.jetspeed.components.portletregistry.PortletRegistry registry
           
private  javax.servlet.ServletContext servletContext
           
private  org.apache.jetspeed.decoration.ResourceValidator validator
           
 
Fields inherited from interface org.apache.jetspeed.decoration.DecorationFactory
DEFAULT_NESTED_LAYOUT_PORTLET_DECORATOR
 
Constructor Summary
DecorationFactoryImpl(org.apache.jetspeed.components.portletregistry.PortletRegistry registry, String decorationsPath, org.apache.jetspeed.decoration.ResourceValidator validator, org.apache.jetspeed.cache.JetspeedCache decorationConfigurationCache)
           
DecorationFactoryImpl(String decorationsPath, org.apache.jetspeed.decoration.ResourceValidator validator)
           
DecorationFactoryImpl(String decorationsPath, org.apache.jetspeed.decoration.ResourceValidator validator, org.apache.jetspeed.cache.JetspeedCache decorationConfigurationCache)
           
 
Method Summary
 void clearCache(org.apache.jetspeed.request.RequestContext requestContext)
           
private  org.apache.jetspeed.util.Path createClientPath(String name, org.apache.jetspeed.util.Path basePath, org.apache.jetspeed.request.RequestContext requestContext, String decorationType)
           
protected  org.apache.jetspeed.util.Path createClientPath(String name, org.apache.jetspeed.request.RequestContext requestContext, String decorationType)
          Creates a org.apache.jetspeed.util.Path object based off of the user's client browser and locale.
protected  org.apache.jetspeed.util.Path getBasePath(String decorationType)
           
protected  org.apache.jetspeed.util.Path getBasePath(String name, String decorationType)
           
protected  Properties getCachedConfiguration(String name, String type)
           
protected  String getCachedConfigurationKey(String type, String name)
           
 Properties getConfiguration(String name, String type)
          Gets the configuration (decorator.properties) object for the decoration.
 org.apache.jetspeed.decoration.Decoration getDecoration(org.apache.jetspeed.om.page.Page page, org.apache.jetspeed.om.page.Fragment fragment, org.apache.jetspeed.request.RequestContext requestContext)
           
protected  org.apache.jetspeed.cache.JetspeedCache getDecorationConfigurationCache()
           
protected  String getDefaultDecorationName(org.apache.jetspeed.om.page.Fragment fragment, org.apache.jetspeed.om.page.Page page)
          Returns a the default decoration name for the specific Fragment type.
 String getDefaultDesktopLayoutDecoration()
           
 String getDefaultDesktopPortletDecoration()
           
 Set getDesktopPageDecorations(org.apache.jetspeed.request.RequestContext request)
          Get the portal-wide list of available desktop page decorations.
 Set getDesktopPortletDecorations(org.apache.jetspeed.request.RequestContext request)
          Get the portal-wide list of desktop portlet decorations.
 org.apache.jetspeed.decoration.LayoutDecoration getLayoutDecoration(String name, org.apache.jetspeed.request.RequestContext requestContext)
           
protected  org.apache.jetspeed.util.Path getLayoutDecorationBasePath(String name)
           
 String getLayoutDecorationsBasePath()
           
 List getLayouts(org.apache.jetspeed.request.RequestContext request)
          Get the portal-wide list of available layouts.
protected  Set getListing(Set rawList, String propsFile)
           
 Set getPageDecorations(org.apache.jetspeed.request.RequestContext request)
          Get the portal-wide list of page decorations.
 org.apache.jetspeed.decoration.PortletDecoration getPortletDecoration(String name, org.apache.jetspeed.request.RequestContext requestContext)
           
protected  org.apache.jetspeed.util.Path getPortletDecorationBasePath(String name)
           
 Set getPortletDecorations(org.apache.jetspeed.request.RequestContext request)
          Get the portal-wide list of portlet decorations.
 String getPortletDecorationsBasePath()
           
 org.apache.jetspeed.decoration.ResourceValidator getResourceValidator()
           
 org.apache.jetspeed.decoration.Theme getTheme(org.apache.jetspeed.om.page.Page page, org.apache.jetspeed.request.RequestContext requestContext)
           
 boolean isDesktopEnabled(org.apache.jetspeed.request.RequestContext requestContext)
           
protected  void setCachedConfiguration(String name, String type, Properties props)
           
 void setDefaultDesktopLayoutDecoration(String newOne)
           
 void setDefaultDesktopPortletDecoration(String newOne)
           
 void setServletContext(javax.servlet.ServletContext servletContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

decorationsPath

private final org.apache.jetspeed.util.Path decorationsPath

portletDecorationsPath

private final org.apache.jetspeed.util.Path portletDecorationsPath

layoutDecorationsPath

private final org.apache.jetspeed.util.Path layoutDecorationsPath

portletDecorationsPathStr

private final String portletDecorationsPathStr

layoutDecorationsPathStr

private final String layoutDecorationsPathStr

validator

private final org.apache.jetspeed.decoration.ResourceValidator validator

registry

private final org.apache.jetspeed.components.portletregistry.PortletRegistry registry

decorationConfigurationCache

private org.apache.jetspeed.cache.JetspeedCache decorationConfigurationCache
cache to hold decoration Properties objects


servletContext

private javax.servlet.ServletContext servletContext

defaultDesktopLayoutDecoration

private String defaultDesktopLayoutDecoration

defaultDesktopPortletDecoration

private String defaultDesktopPortletDecoration

layoutDecorationsDir

private Set layoutDecorationsDir

portletDecorationsDir

private Set portletDecorationsDir

desktopLayoutDecorationsDir

private Set desktopLayoutDecorationsDir

desktopPortletDecorationsDir

private Set desktopPortletDecorationsDir

layoutDecorationsList

private Set layoutDecorationsList

portletDecorationsList

private Set portletDecorationsList

desktopLayoutDecorationsList

private Set desktopLayoutDecorationsList

desktopPortletDecorationsList

private Set desktopPortletDecorationsList

portletDecoratorProperties

private Map portletDecoratorProperties

layoutDecoratorProperties

private Map layoutDecoratorProperties
Constructor Detail

DecorationFactoryImpl

public DecorationFactoryImpl(String decorationsPath,
                             org.apache.jetspeed.decoration.ResourceValidator validator)

DecorationFactoryImpl

public DecorationFactoryImpl(String decorationsPath,
                             org.apache.jetspeed.decoration.ResourceValidator validator,
                             org.apache.jetspeed.cache.JetspeedCache decorationConfigurationCache)

DecorationFactoryImpl

public DecorationFactoryImpl(org.apache.jetspeed.components.portletregistry.PortletRegistry registry,
                             String decorationsPath,
                             org.apache.jetspeed.decoration.ResourceValidator validator,
                             org.apache.jetspeed.cache.JetspeedCache decorationConfigurationCache)
Method Detail

getResourceValidator

public org.apache.jetspeed.decoration.ResourceValidator getResourceValidator()

getDecorationConfigurationCache

protected org.apache.jetspeed.cache.JetspeedCache getDecorationConfigurationCache()

getTheme

public org.apache.jetspeed.decoration.Theme getTheme(org.apache.jetspeed.om.page.Page page,
                                                     org.apache.jetspeed.request.RequestContext requestContext)
Specified by:
getTheme in interface org.apache.jetspeed.decoration.DecorationFactory

getDecoration

public org.apache.jetspeed.decoration.Decoration getDecoration(org.apache.jetspeed.om.page.Page page,
                                                               org.apache.jetspeed.om.page.Fragment fragment,
                                                               org.apache.jetspeed.request.RequestContext requestContext)
Specified by:
getDecoration in interface org.apache.jetspeed.decoration.DecorationFactory

getPortletDecoration

public org.apache.jetspeed.decoration.PortletDecoration getPortletDecoration(String name,
                                                                             org.apache.jetspeed.request.RequestContext requestContext)
Specified by:
getPortletDecoration in interface org.apache.jetspeed.decoration.DecorationFactory

getLayoutDecoration

public org.apache.jetspeed.decoration.LayoutDecoration getLayoutDecoration(String name,
                                                                           org.apache.jetspeed.request.RequestContext requestContext)
Specified by:
getLayoutDecoration in interface org.apache.jetspeed.decoration.DecorationFactory

isDesktopEnabled

public boolean isDesktopEnabled(org.apache.jetspeed.request.RequestContext requestContext)
Specified by:
isDesktopEnabled in interface org.apache.jetspeed.decoration.DecorationFactory

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Specified by:
setServletContext in interface org.springframework.web.context.ServletContextAware

getCachedConfiguration

protected Properties getCachedConfiguration(String name,
                                            String type)

setCachedConfiguration

protected void setCachedConfiguration(String name,
                                      String type,
                                      Properties props)

getCachedConfigurationKey

protected String getCachedConfigurationKey(String type,
                                           String name)

getConfiguration

public Properties getConfiguration(String name,
                                   String type)
Gets the configuration (decorator.properties) object for the decoration.

Parameters:
name - Name of the Decoration.
Returns:
java.util.Properties representing the configuration object.

createClientPath

protected org.apache.jetspeed.util.Path createClientPath(String name,
                                                         org.apache.jetspeed.request.RequestContext requestContext,
                                                         String decorationType)
Creates a org.apache.jetspeed.util.Path object based off of the user's client browser and locale.

Parameters:
name - Decroator's name
requestContext - Current portal request.
decorationType - Type of decoration, either layout or portlet
Returns:
See Also:
Path, RequestContext

createClientPath

private org.apache.jetspeed.util.Path createClientPath(String name,
                                                       org.apache.jetspeed.util.Path basePath,
                                                       org.apache.jetspeed.request.RequestContext requestContext,
                                                       String decorationType)

getDefaultDecorationName

protected String getDefaultDecorationName(org.apache.jetspeed.om.page.Fragment fragment,
                                          org.apache.jetspeed.om.page.Page page)
Returns a the default decoration name for the specific Fragment type.

Parameters:
fragment - Fragment whose default decroation has been requested
page - Page this fragment belongs to.
Returns:
Default decorator name.
See Also:
Page, Fragment

clearCache

public void clearCache(org.apache.jetspeed.request.RequestContext requestContext)
Specified by:
clearCache in interface org.apache.jetspeed.decoration.DecorationFactory

getBasePath

protected org.apache.jetspeed.util.Path getBasePath(String decorationType)

getBasePath

protected org.apache.jetspeed.util.Path getBasePath(String name,
                                                    String decorationType)

getLayoutDecorationBasePath

protected org.apache.jetspeed.util.Path getLayoutDecorationBasePath(String name)

getPortletDecorationBasePath

protected org.apache.jetspeed.util.Path getPortletDecorationBasePath(String name)

getLayoutDecorationsBasePath

public String getLayoutDecorationsBasePath()
Specified by:
getLayoutDecorationsBasePath in interface org.apache.jetspeed.decoration.DecorationFactory

getPortletDecorationsBasePath

public String getPortletDecorationsBasePath()
Specified by:
getPortletDecorationsBasePath in interface org.apache.jetspeed.decoration.DecorationFactory

getPageDecorations

public Set getPageDecorations(org.apache.jetspeed.request.RequestContext request)
Get the portal-wide list of page decorations.

Specified by:
getPageDecorations in interface org.apache.jetspeed.decoration.DecorationFactory
Returns:
A list of page decorations of type Decoration

getDesktopPageDecorations

public Set getDesktopPageDecorations(org.apache.jetspeed.request.RequestContext request)
Get the portal-wide list of available desktop page decorations.

Specified by:
getDesktopPageDecorations in interface org.apache.jetspeed.decoration.DecorationFactory
Returns:
A list of desktop skins of type String

getPortletDecorations

public Set getPortletDecorations(org.apache.jetspeed.request.RequestContext request)
Get the portal-wide list of portlet decorations.

Specified by:
getPortletDecorations in interface org.apache.jetspeed.decoration.DecorationFactory
Returns:
A list of portlet decorations of type String

getDesktopPortletDecorations

public Set getDesktopPortletDecorations(org.apache.jetspeed.request.RequestContext request)
Get the portal-wide list of desktop portlet decorations.

Specified by:
getDesktopPortletDecorations in interface org.apache.jetspeed.decoration.DecorationFactory
Returns:
A list of portlet decorations of type String

getLayouts

public List getLayouts(org.apache.jetspeed.request.RequestContext request)
Get the portal-wide list of available layouts.

Specified by:
getLayouts in interface org.apache.jetspeed.decoration.DecorationFactory
Returns:
A list of layout portlets of type PortletDefinitionComposite

getListing

protected Set getListing(Set rawList,
                         String propsFile)

getDefaultDesktopLayoutDecoration

public String getDefaultDesktopLayoutDecoration()
Specified by:
getDefaultDesktopLayoutDecoration in interface org.apache.jetspeed.decoration.DecorationFactory

setDefaultDesktopLayoutDecoration

public void setDefaultDesktopLayoutDecoration(String newOne)
Specified by:
setDefaultDesktopLayoutDecoration in interface org.apache.jetspeed.decoration.DecorationFactory

getDefaultDesktopPortletDecoration

public String getDefaultDesktopPortletDecoration()
Specified by:
getDefaultDesktopPortletDecoration in interface org.apache.jetspeed.decoration.DecorationFactory

setDefaultDesktopPortletDecoration

public void setDefaultDesktopPortletDecoration(String newOne)
Specified by:
setDefaultDesktopPortletDecoration in interface org.apache.jetspeed.decoration.DecorationFactory


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.