org.apache.lenya.cms.ac
Class PublicationAccessControllerResolver

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.lenya.ac.impl.AbstractAccessControllerResolver
          extended by org.apache.lenya.cms.ac.PublicationAccessControllerResolver
All Implemented Interfaces:
org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.thread.ThreadSafe, org.apache.lenya.ac.AccessControllerResolver

public class PublicationAccessControllerResolver
extends AbstractAccessControllerResolver
implements org.apache.avalon.framework.activity.Initializable

Resolves the access controller according to the access-control.xml file of a publication.


Field Summary
protected static java.lang.String AC_CONFIGURATION_FILE
           
protected static java.lang.String TYPE_ATTRIBUTE
           
 
Fields inherited from class org.apache.lenya.ac.impl.AbstractAccessControllerResolver
CAPACITY, manager
 
Fields inherited from interface org.apache.lenya.ac.AccessControllerResolver
DEFAULT_RESOLVER, ROLE
 
Constructor Summary
PublicationAccessControllerResolver()
           
 
Method Summary
 org.apache.lenya.ac.AccessController doResolveAccessController(java.lang.String webappUrl)
          The actual resolving method.
protected  java.lang.Object generateCacheKey(java.lang.String webappUrl, org.apache.excalibur.source.SourceResolver resolver)
          This implementation uses the publication ID in combination with the context path as cache key.
 org.apache.avalon.framework.configuration.Configuration getConfiguration(org.apache.lenya.cms.publication.Publication publication)
          Retrieves access control configuration of a specific publication.
protected  java.io.File getContext()
          Returns the servlet context.
protected  org.apache.lenya.cms.publication.Publication getPublication(java.lang.String webappUrl)
          Returns the publication for the webapp URL or null if the URL is not included in a publication.
 void initialize()
           
 org.apache.lenya.ac.AccessController resolveAccessController(org.apache.lenya.cms.publication.Publication publication, java.lang.String url)
          Resolves an access controller for a certain URL within a publication.
 
Methods inherited from class org.apache.lenya.ac.impl.AbstractAccessControllerResolver
getCache, getManager, release, resolveAccessController, service
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AC_CONFIGURATION_FILE

protected static final java.lang.String AC_CONFIGURATION_FILE

TYPE_ATTRIBUTE

protected static final java.lang.String TYPE_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

PublicationAccessControllerResolver

public PublicationAccessControllerResolver()
Method Detail

generateCacheKey

protected java.lang.Object generateCacheKey(java.lang.String webappUrl,
                                            org.apache.excalibur.source.SourceResolver resolver)
                                     throws org.apache.lenya.ac.AccessControlException
This implementation uses the publication ID in combination with the context path as cache key.

Overrides:
generateCacheKey in class AbstractAccessControllerResolver
Parameters:
webappUrl - The webapp URL.
resolver - The source resolver.
Returns:
An object.
Throws:
org.apache.lenya.ac.AccessControlException - when something went wrong.
See Also:
AbstractAccessControllerResolver.generateCacheKey(java.lang.String, org.apache.excalibur.source.SourceResolver)

doResolveAccessController

public org.apache.lenya.ac.AccessController doResolveAccessController(java.lang.String webappUrl)
                                                               throws org.apache.lenya.ac.AccessControlException
Description copied from class: AbstractAccessControllerResolver
The actual resolving method.

Specified by:
doResolveAccessController in class AbstractAccessControllerResolver
Parameters:
webappUrl - The URL within the web application.
Returns:
An access controller.
Throws:
org.apache.lenya.ac.AccessControlException - when something went wrong.
See Also:
AbstractAccessControllerResolver.doResolveAccessController(java.lang.String)

getPublication

protected org.apache.lenya.cms.publication.Publication getPublication(java.lang.String webappUrl)
                                                               throws org.apache.lenya.ac.AccessControlException
Returns the publication for the webapp URL or null if the URL is not included in a publication.

Parameters:
webappUrl - The webapp URL.
Returns:
A publication.
Throws:
org.apache.lenya.ac.AccessControlException - when something went wrong.

getContext

protected java.io.File getContext()
Returns the servlet context.

Returns:
A file.

getConfiguration

public org.apache.avalon.framework.configuration.Configuration getConfiguration(org.apache.lenya.cms.publication.Publication publication)
                                                                         throws org.apache.lenya.ac.AccessControlException
Retrieves access control configuration of a specific publication.

Parameters:
publication - The publication.
Returns:
Configuration
Throws:
org.apache.lenya.ac.AccessControlException - when something went wrong.

resolveAccessController

public org.apache.lenya.ac.AccessController resolveAccessController(org.apache.lenya.cms.publication.Publication publication,
                                                                    java.lang.String url)
                                                             throws org.apache.lenya.ac.AccessControlException
Resolves an access controller for a certain URL within a publication.

Parameters:
publication - The publication.
url - The url within the publication.
Returns:
An access controller.
Throws:
org.apache.lenya.ac.AccessControlException - when something went wrong.

initialize

public void initialize()
                throws java.lang.Exception
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable
Throws:
java.lang.Exception
See Also:
Initializable.initialize()


Copyright $ Apache Software Foundation. All Rights Reserved.