cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/generation ServerPagesGenerator.java
Date Tue, 05 Feb 2002 14:55:45 GMT
vgritsenko    02/02/05 06:55:45

  Modified:    src/java/org/apache/cocoon/generation
                        ServerPagesGenerator.java
  Log:
  Make ServerPagesGenerator parameterizable;
  markup-language and programming-language parameters looked up from component configuration.
  
  Revision  Changes    Path
  1.9       +11 -12    xml-cocoon2/src/java/org/apache/cocoon/generation/ServerPagesGenerator.java
  
  Index: ServerPagesGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/ServerPagesGenerator.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ServerPagesGenerator.java	4 Feb 2002 13:15:04 -0000	1.8
  +++ ServerPagesGenerator.java	5 Feb 2002 14:55:45 -0000	1.9
  @@ -62,6 +62,7 @@
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.logger.Loggable;
  +import org.apache.avalon.framework.parameters.Parameterizable;
   import org.apache.avalon.framework.parameters.Parameters;
   
   import org.apache.cocoon.ProcessingException;
  @@ -106,10 +107,10 @@
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
  - * @version CVS $Id: ServerPagesGenerator.java,v 1.8 2002/02/04 13:15:04 cziegeler Exp
$
  + * @version CVS $Id: ServerPagesGenerator.java,v 1.9 2002/02/05 14:55:45 vgritsenko Exp
$
    */
   public class ServerPagesGenerator extends ServletGenerator
  -  implements Recyclable, Disposable, Cacheable, Configurable
  +  implements Parameterizable, Recyclable, Disposable, Cacheable, Configurable
   {
       /**
        * The sitemap-defined server pages program generator
  @@ -147,6 +148,13 @@
           }
       }
   
  +    public void parameterize (Parameters parameters) {
  +        this.markupLanguage = parameters.getParameter(
  +            "markup-language", DEFAULT_MARKUP_LANGUAGE);
  +        this.programmingLanguage = parameters.getParameter(
  +            "programming-language", DEFAULT_PROGRAMMING_LANGUAGE);
  +    }
  +
       /**
        * Generates the unique key.
        * This key must be unique inside the space of this component.
  @@ -202,15 +210,6 @@
           super.setup(resolver, objectModel, src, par);
           this.inputSource = this.resolver.resolve(super.source);
   
  -        if (this.markupLanguage == null) {
  -            this.markupLanguage = this.parameters.getParameter(
  -              "markup-language", DEFAULT_MARKUP_LANGUAGE
  -            );
  -            this.programmingLanguage = this.parameters.getParameter(
  -              "programming-language", DEFAULT_PROGRAMMING_LANGUAGE
  -            );
  -        }
  -
           try {
               generator = (XSPGenerator) programGenerator.load(
                   this.manager, super.source, this.markupLanguage,
  @@ -218,7 +217,7 @@
           } catch (ProcessingException e) {
               throw e;
           } catch (Exception e) {
  -            getLogger().warn("ServerPagesGenerator.generate()", e);
  +            getLogger().warn("setup()", e);
               throw new ProcessingException(e.getMessage(), e);
           } catch (NoClassDefFoundError e) {
               getLogger().warn("Failed to load class: " + e);
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message