You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2004/03/19 14:59:22 UTC

cvs commit: cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/configuration HandlerConfiguration.java ApplicationConfiguration.java

cziegeler    2004/03/19 05:59:22

  Modified:    src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/user
                        UserHandler.java RequestState.java
               src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context
                        AuthenticationContext.java
               src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components
                        DefaultHandlerManager.java
                        DefaultAuthenticationManager.java
               src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/generation
                        ConfigurationGenerator.java
               src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/configuration
                        HandlerConfiguration.java
                        ApplicationConfiguration.java
  Log:
  Remove unused parameters etc.
  
  Revision  Changes    Path
  1.11      +2 -3      cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/user/UserHandler.java
  
  Index: UserHandler.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/user/UserHandler.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- UserHandler.java	5 Mar 2004 13:01:41 -0000	1.10
  +++ UserHandler.java	19 Mar 2004 13:59:21 -0000	1.11
  @@ -62,8 +62,7 @@
       /**
        * Are all application contexts already loaded?
        */
  -    public boolean getApplicationsLoaded()
  -    throws ProcessingException {
  +    public boolean getApplicationsLoaded() {
           if ( this.handler.getApplications().isEmpty() ) {
               return true;
           } else {
  
  
  
  1.7       +2 -3      cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/user/RequestState.java
  
  Index: RequestState.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/user/RequestState.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RequestState.java	5 Mar 2004 13:01:41 -0000	1.6
  +++ RequestState.java	19 Mar 2004 13:59:21 -0000	1.7
  @@ -81,8 +81,7 @@
       /**
        * Get the configuration if available
        */
  -    public Configuration getModuleConfiguration(String name)
  -    throws ProcessingException  {
  +    public Configuration getModuleConfiguration(String name) {
           Configuration conf = null;
   
           if (this.handler != null && this.application != null) {
  
  
  
  1.16      +15 -43    cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.java
  
  Index: AuthenticationContext.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- AuthenticationContext.java	5 Mar 2004 13:01:41 -0000	1.15
  +++ AuthenticationContext.java	19 Mar 2004 13:59:22 -0000	1.16
  @@ -464,36 +464,26 @@
               // load all: first authentication then application
               this.loadAuthenticationXML("/authentication",
                                          parameters,
  -                                       objectModel,
  -                                       resolver,
  -                                       manager);
  +                                       resolver);
               if (applicationName != null) {
                   this.loadApplicationXML("/",
                                           parameters,
  -                                        objectModel,
  -                                        resolver,
  -                                        manager);
  +                                        resolver);
               }
   
           } else if (path.startsWith("/authentication") ) {
               this.loadAuthenticationXML(path,
                                          parameters,
  -                                       objectModel,
  -                                       resolver,
  -                                       manager);
  +                                       resolver);
   
           } else if (path.equals("/application") && applicationName != null) {
               this.loadApplicationXML("/",
                                       parameters,
  -                                    objectModel,
  -                                    resolver,
  -                                    manager);
  +                                    resolver);
           } else if (path.startsWith("/application/") && applicationName != null) {
               this.loadApplicationXML(path.substring(12), // start path with '/'
                                       parameters,
  -                                    objectModel,
  -                                    resolver,
  -                                    manager);
  +                                    resolver);
           } else {
               throw new ProcessingException("loadXML: Path is not valid: " + path);
           }
  @@ -518,36 +508,26 @@
               // save all: first authentication then application
               this.saveAuthenticationXML("/authentication",
                                          parameters,
  -                                       objectModel,
  -                                       resolver,
  -                                       manager);
  +                                       resolver);
               if (applicationName != null) {
                   this.saveApplicationXML("/",
                                           parameters,
  -                                        objectModel,
  -                                        resolver,
  -                                        manager);
  +                                        resolver);
               }
   
           } else if (path.startsWith("/authentication") ) {
               this.saveAuthenticationXML(path,
                                          parameters,
  -                                       objectModel,
  -                                       resolver,
  -                                       manager);
  +                                       resolver);
   
           } else if (path.equals("/application") && applicationName != null) {
               this.saveApplicationXML("/",
                                       parameters,
  -                                    objectModel,
  -                                    resolver,
  -                                    manager);
  +                                    resolver);
           } else if (path.startsWith("/application/") && applicationName != null) {
               this.saveApplicationXML(path.substring(12), // start path with '/'
                                       parameters,
  -                                    objectModel,
  -                                    resolver,
  -                                    manager);
  +                                    resolver);
           } else {
               throw new ProcessingException("saveXML: Path is not valid: " + path);
           }
  @@ -567,9 +547,7 @@
        */
       private void saveAuthenticationXML(String             path,
                                          SourceParameters parameters,
  -                                       Map                objectModel,
  -                                       SourceResolver     resolver,
  -                                       ServiceManager   manager)
  +                                       SourceResolver     resolver)
       throws ProcessingException {
           String authSaveResource = this.handler.getHandlerConfiguration().getSaveResource();
           SourceParameters authSaveResourceParameters = this.handler.getHandlerConfiguration().getSaveResourceParameters();
  @@ -607,9 +585,7 @@
        */
       private void loadAuthenticationXML(String             path,
                                          SourceParameters parameters,
  -                                       Map                objectModel,
  -                                       SourceResolver     resolver,
  -                                       ServiceManager   manager)
  +                                       SourceResolver     resolver)
       throws ProcessingException {
           String authLoadResource = this.handler.getHandlerConfiguration().getLoadResource();
           SourceParameters authLoadResourceParameters = this.handler.getHandlerConfiguration().getLoadResourceParameters();
  @@ -646,9 +622,7 @@
        */
       private void loadApplicationXML(String             path,
                                       SourceParameters parameters,
  -                                    Map                objectModel,
  -                                    SourceResolver     resolver,
  -                                    ServiceManager   manager)
  +                                    SourceResolver     resolver)
       throws ProcessingException {
           final String applicationName = this.getState().getApplicationName();
   
  @@ -686,9 +660,7 @@
        */
       private void saveApplicationXML(String path,
                                       SourceParameters parameters,
  -                                    Map                objectModel,
  -                                    SourceResolver     resolver,
  -                                    ServiceManager   manager)
  +                                    SourceResolver     resolver)
       throws ProcessingException {
           final String applicationName = this.getState().getApplicationName();
           final ApplicationConfiguration conf = (ApplicationConfiguration)this.handler.getHandlerConfiguration().getApplications().get( applicationName );
  
  
  
  1.6       +13 -21    cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultHandlerManager.java
  
  Index: DefaultHandlerManager.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultHandlerManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultHandlerManager.java	5 Mar 2004 13:01:40 -0000	1.5
  +++ DefaultHandlerManager.java	19 Mar 2004 13:59:22 -0000	1.6
  @@ -26,7 +26,6 @@
   import org.apache.cocoon.components.SitemapConfigurationHolder;
   import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration;
  -import org.apache.excalibur.source.SourceResolver;
   
   
   /**
  @@ -40,24 +39,22 @@
       /**
        * Get the current handler configuration
        */
  -    static public Map prepareHandlerConfiguration(SourceResolver resolver,
  -                                                       Map            objectModel,
  -                                                       SitemapConfigurationHolder holder)
  +    static public Map prepareHandlerConfiguration(Map            objectModel,
  +                                                  SitemapConfigurationHolder holder)
       throws ConfigurationException {
           Map configs = (Map)holder.getPreparedConfiguration();
           if ( null == configs ) {
               ChainedConfiguration chainedConfig = holder.getConfiguration();
  -            configs = prepare( resolver, objectModel, holder, chainedConfig );
  +            configs = prepare( objectModel, holder, chainedConfig );
           }
           return configs;
       }
       /**
        * Prepare the handler configuration
        */
  -    static private Map prepare(SourceResolver resolver,
  -                                 Map            objectModel,
  -                                 SitemapConfigurationHolder holder,
  -                                 ChainedConfiguration conf) 
  +    static private Map prepare( Map            objectModel,
  +                                SitemapConfigurationHolder holder,
  +                                ChainedConfiguration conf) 
       throws ConfigurationException {
           // test for handlers
           boolean found = false;
  @@ -73,7 +70,7 @@
           Map values = null;
           final ChainedConfiguration parent = conf.getParent();
           if ( null != parent ) {
  -            values = prepare( resolver, objectModel, holder, parent );
  +            values = prepare( objectModel, holder, parent );
               if ( found ) {
                   values = new HashMap( values );
               }
  @@ -91,7 +88,7 @@
                       throw new ConfigurationException("Handler names must be unique: " + name);
                   }
   
  -                addHandler( resolver, objectModel, handlers[i], values );
  +                addHandler( objectModel, handlers[i], values );
               }
           }
           holder.setPreparedConfiguration( conf, values );
  @@ -102,10 +99,9 @@
       /**
        * Add one handler configuration
        */
  -    static private void addHandler(SourceResolver resolver,
  -                                     Map            objectModel,
  -                                     Configuration  configuration,
  -                                     Map            values)
  +    static private void addHandler(Map            objectModel,
  +                                   Configuration  configuration,
  +                                   Map            values)
       throws ConfigurationException {
           // get handler name
           final String name = configuration.getAttribute("name");
  @@ -114,12 +110,8 @@
           HandlerConfiguration currentHandler = new HandlerConfiguration(name);
   
           try {
  -            currentHandler.configure(resolver, ObjectModelHelper.getRequest(objectModel), configuration);
  +            currentHandler.configure(ObjectModelHelper.getRequest(objectModel), configuration);
           } catch (ProcessingException se) {
  -            throw new ConfigurationException("Exception during configuration of handler: " + name, se);
  -        } catch (org.xml.sax.SAXException se) {
  -            throw new ConfigurationException("Exception during configuration of handler: " + name, se);
  -        } catch (java.io.IOException se) {
               throw new ConfigurationException("Exception during configuration of handler: " + name, se);
           }
           values.put( name, currentHandler );
  
  
  
  1.24      +2 -10     cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java
  
  Index: DefaultAuthenticationManager.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- DefaultAuthenticationManager.java	5 Mar 2004 13:01:40 -0000	1.23
  +++ DefaultAuthenticationManager.java	19 Mar 2004 13:59:22 -0000	1.24
  @@ -116,19 +116,11 @@
       throws ProcessingException {
           Map configs = (Map) this.holder.getPreparedConfiguration();
           if ( null == configs ) {
  -            // prepare the configs
  -            SourceResolver resolver = null;
               try {       
  -                resolver = (SourceResolver) this.manager.lookup( SourceResolver.ROLE );
  -                configs = DefaultHandlerManager.prepareHandlerConfiguration(resolver, 
  -                                                                            ContextHelper.getObjectModel(this.context), 
  +                configs = DefaultHandlerManager.prepareHandlerConfiguration(ContextHelper.getObjectModel(this.context), 
                                                                               this.holder);
  -            } catch (ServiceException se) {
  -                throw new ProcessingException("Unable to lookup source resolver.", se);
               } catch (ConfigurationException ce) {
                   throw new ProcessingException("Configuration error.", ce);
  -            } finally {
  -                this.manager.release( resolver );
               }
           }
           return configs;
  
  
  
  1.9       +2 -2      cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/generation/ConfigurationGenerator.java
  
  Index: ConfigurationGenerator.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/generation/ConfigurationGenerator.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ConfigurationGenerator.java	17 Mar 2004 12:09:52 -0000	1.8
  +++ ConfigurationGenerator.java	19 Mar 2004 13:59:22 -0000	1.9
  @@ -742,7 +742,7 @@
        */
       public UserManagementHandler(Configuration   conf,
                                     String          appName)
  -    throws ProcessingException, SAXException, IOException, ConfigurationException {
  +    throws ConfigurationException {
           Configuration child;
           
           this.applicationName = appName;
  
  
  
  1.6       +4 -8      cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/configuration/HandlerConfiguration.java
  
  Index: HandlerConfiguration.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/configuration/HandlerConfiguration.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- HandlerConfiguration.java	5 Mar 2004 13:01:40 -0000	1.5
  +++ HandlerConfiguration.java	19 Mar 2004 13:59:22 -0000	1.6
  @@ -15,7 +15,6 @@
    */
   package org.apache.cocoon.webapps.authentication.configuration;
   
  -import java.io.IOException;
   import java.util.HashMap;
   import java.util.Hashtable;
   import java.util.Map;
  @@ -26,8 +25,6 @@
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.webapps.authentication.components.PipelineAuthenticator;
   import org.apache.excalibur.source.SourceParameters;
  -import org.apache.excalibur.source.SourceResolver;
  -import org.xml.sax.SAXException;
   
   /**
    * The authentication Handler.
  @@ -91,10 +88,9 @@
       /**
        * Configure
        */
  -    public void configure(SourceResolver resolver,
  -                          Request        request,
  +    public void configure(Request        request,
                             Configuration  conf)
  -    throws ProcessingException, SAXException, IOException, ConfigurationException {
  +    throws ProcessingException, ConfigurationException {
           // get login (required)
           Configuration child = conf.getChild("redirect-to", false);
           if (child == null)
  @@ -170,7 +166,7 @@
                       this.applications.put(appName, apphandler);
   
                       // configure
  -                    apphandler.configure(resolver, appconf);
  +                    apphandler.configure(appconf);
                   }
               }
           }
  
  
  
  1.4       +3 -6      cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/configuration/ApplicationConfiguration.java
  
  Index: ApplicationConfiguration.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/configuration/ApplicationConfiguration.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ApplicationConfiguration.java	5 Mar 2004 13:01:40 -0000	1.3
  +++ ApplicationConfiguration.java	19 Mar 2004 13:59:22 -0000	1.4
  @@ -15,7 +15,6 @@
    */
   package org.apache.cocoon.webapps.authentication.configuration;
   
  -import java.io.IOException;
   import java.util.HashMap;
   import java.util.Map;
   
  @@ -23,8 +22,6 @@
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.cocoon.ProcessingException;
   import org.apache.excalibur.source.SourceParameters;
  -import org.apache.excalibur.source.SourceResolver;
  -import org.xml.sax.SAXException;
   
   /**
    * This object stores information about an application configuration
  @@ -81,8 +78,8 @@
       /**
        * Configure an application
        */
  -    public void configure(SourceResolver resolver, Configuration appconf)
  -    throws ProcessingException, SAXException, IOException, ConfigurationException {
  +    public void configure(Configuration appconf)
  +    throws ConfigurationException {
           Configuration child = null;
   
           // test for loadondemand attribute