cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 15431] - [i18n] making XMLResourceBundle cocoon-izable
Date Tue, 17 Dec 2002 08:45:48 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15431>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15431

[i18n] making XMLResourceBundle cocoon-izable

michael.gerzabek@gmx.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|Blocker                     |Enhancement



------- Additional Comments From michael.gerzabek@gmx.net  2002-12-17 08:45 -------
I used the diff tool for my first time and just followed the steps outlined
at the cocoon how-to. Anyway my enhancements take place at the method between
the Begin/ End Cocoonize:

    /**
     * Load the DOM tree, based on the file name.
     *
     * @param fileName          name of the XML source file
     * @return the DOM tree
     * @exception IOException   if an IO error occurs while reading the file
     * @exception ParserConfigurationException if no parser is configured
     * @exception SAXException  if an error occurs while parsing the file
     */
    protected synchronized Document loadResourceBundle(String fileName)
        throws IOException, ParserConfigurationException, SAXException {

        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        // Begin Cocoonize
        // FIXME: Is this the best way to check the format?!
        Source source = null;
        SourceResolver resolver = null;            
        try {
            resolver = (SourceResolver) manager.lookup( SourceResolver.ROLE );
            source = resolver.resolveURI( fileName );
            return builder.parse( new InputSource( source.getInputStream() ));
        }
        catch (Exception x) {
            logger.warn("XMLREsourceBundle: No excalibur-source " + fileName, 
x);
        }
        finally {
            resolver.release( source );
            manager.release( resolver );
        }
        // End Cocoonize
        return builder.parse(fileName);
    }

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message