cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcu...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/fop/java/org/apache/cocoon/serialization FOPSerializer.java
Date Thu, 26 Feb 2004 21:13:24 GMT
tcurdt      2004/02/26 13:13:24

  Modified:    src/blocks/fop/java/org/apache/cocoon/serialization
                        FOPSerializer.java
  Log:
  added a new way to pass configuration parameters to the renderer
  
  Revision  Changes    Path
  1.9       +21 -1     cocoon-2.1/src/blocks/fop/java/org/apache/cocoon/serialization/FOPSerializer.java
  
  Index: FOPSerializer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/fop/java/org/apache/cocoon/serialization/FOPSerializer.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FOPSerializer.java	7 Feb 2004 13:18:16 -0000	1.8
  +++ FOPSerializer.java	26 Feb 2004 21:13:24 -0000	1.9
  @@ -54,6 +54,8 @@
   import java.io.OutputStream;
   import java.io.Serializable;
   import java.net.MalformedURLException;
  +import java.util.Map;
  +import java.util.HashMap;
   
   import org.apache.avalon.framework.CascadingRuntimeException;
   import org.apache.avalon.framework.configuration.Configurable;
  @@ -239,6 +241,24 @@
                   "Could not autodetect renderer for FOPSerializer and "
                   + "no renderer was specified in the sitemap configuration."
               );
  +        }
  +
  +        Configuration confRenderer = conf.getChild("renderer-config");
  +        if (confRenderer != null) {
  +            parameters = confRenderer.getChildren("parameter");
  +            if (parameters.length > 0) {
  +                Map rendererOptions = new HashMap(); 
  +                for (int i = 0; i < parameters.length; i++) {
  +                    String name = parameters[i].getAttribute("name");
  +                    String value = parameters[i].getAttribute("value");
  +                
  +                    if (getLogger().isDebugEnabled()) {
  +                    	getLogger().debug("renderer " + String.valueOf(name) + " = " + String.valueOf(value));
  +                    }
  +                    rendererOptions.put(name,value);
  +                }
  +                this.renderer.setOptions(rendererOptions);
  +            }
           }
       }
   
  
  
  

Mime
View raw message