cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/poi/java/org/apache/cocoon/serialization HSSFSerializer.java
Date Wed, 02 Apr 2003 04:22:16 GMT
crossley    2003/04/01 20:22:14

  Modified:    src/blocks/poi/java/org/apache/cocoon/serialization
                        HSSFSerializer.java
  Log:
  Use correct mime-type for Excel. Fix whitespace formatting.
  Submitted by: Joerg Heinicke <joerg.heinicke.at.gmx.de>
  Submitted by: Neil Bacon <nbacon.at.pinnaclesoftware.com.au>
  PR: 18164, 18548
  
  Revision  Changes    Path
  1.3       +55 -63    cocoon-2.1/src/blocks/poi/java/org/apache/cocoon/serialization/HSSFSerializer.java
  
  Index: HSSFSerializer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/poi/java/org/apache/cocoon/serialization/HSSFSerializer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HSSFSerializer.java	11 Mar 2003 19:05:09 -0000	1.2
  +++ HSSFSerializer.java	2 Apr 2003 04:22:14 -0000	1.3
  @@ -65,75 +65,67 @@
    * @author   Nicola Ken Barozzi (nicolaken@apache.org)
    * @version CVS $Id$
    */
  -public class HSSFSerializer
  -      extends POIFSSerializer implements Initializable, Configurable
  -{
  -  private ElementProcessorFactory _element_processor_factory;
  -  private final static String _mime_type = "vnd.ms-excel";
  -  String locale;
  -
  -  /**
  -   *  Constructor
  -   */
  -
  -  public HSSFSerializer() {
  -    super();
  -  }
  -
  -  /**
  -   * Initialialize the component. Initialization includes 
  -   * allocating any resources required throughout the 
  -   * components lifecycle.
  -   *
  -   * @exception Exception if an error occurs
  -   */
  -  public void initialize() throws Exception{
  -
  -    _element_processor_factory  = new HSSFElementProcessorFactory(locale);
  -    setupLogger(_element_processor_factory);
  -  }
  +public class HSSFSerializer extends POIFSSerializer implements Initializable, Configurable
{
  +    private ElementProcessorFactory _element_processor_factory;
  +    private final static String _mime_type = "application/vnd.ms-excel";
  +    String locale;
  +
  +    /**
  +     *  Constructor
  +     */
  +    public HSSFSerializer() {
  +        super();
  +    }
  +
  +    /**
  +     * Initialialize the component. Initialization includes allocating any
  +     * resources required throughout the components lifecycle.
  +     *
  +     * @exception Exception if an error occurs
  +     */
  +    public void initialize() throws Exception {
  +        _element_processor_factory = new HSSFElementProcessorFactory(locale);
  +        setupLogger(_element_processor_factory);
  +    }
   
  -  public void configure(Configuration conf) throws ConfigurationException {
  +    public void configure(Configuration conf) throws ConfigurationException {
           Configuration[] parameters = conf.getChildren("parameter");
           for (int i = 0; i < parameters.length; i++) {
               String name = parameters[i].getAttribute("name");
               if (name.trim().equals("locale")) {
  -		locale = parameters[i].getAttribute("value");
  +                locale = parameters[i].getAttribute("value");
               }
           }
  +    }
   
  -  }
  -        
  -  /**
  -   *  get the mime type
  -   *
  -   *@return    vnd.ms-excel
  -   */
  -
  -  public String getMimeType() {
  -    return _mime_type;
  -  }
  -
  -  /**
  -   *  get the ElementProcessorFactory
  -   *
  -   *@return    the ElementProcessorFactory
  -   */
  -
  -  protected ElementProcessorFactory getElementProcessorFactory() {
  -    return _element_processor_factory;
  -  }
  -
  -  /**
  -   *  post-processing for endDocument
  -   */
  -
  -  protected void doLocalPostEndDocument() { }
  -
  -  /**
  -   *  pre-processing for endDocument
  -   */
  -
  -  protected void doLocalPreEndDocument() { }
  +    /**
  +     * get the mime type
  +     *
  +     *@return    application/vnd.ms-excel
  +     */
  +    public String getMimeType() {
  +        return _mime_type;
  +    }
  +
  +    /**
  +     *  get the ElementProcessorFactory
  +     *
  +     *@return    the ElementProcessorFactory
  +     */
  +    protected ElementProcessorFactory getElementProcessorFactory() {
  +        return _element_processor_factory;
  +    }
  +
  +    /**
  +     *  post-processing for endDocument
  +     */
  +    protected void doLocalPostEndDocument() {
  +    }
  +
  +    /**
  +     *  pre-processing for endDocument
  +     */
  +    protected void doLocalPreEndDocument() {
  +    }
   
   }
  
  
  

Mime
View raw message