cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jos Snellings <jos.snelli...@upperware.biz>
Subject userconfig for FOP in Cocoon3
Date Tue, 08 May 2012 07:48:41 GMT
Dear cocooners,

We use FOP to generate a PDF publication of a thesaurus. Needing cyrillic &
greek we have to setup
a user configuration. This is not yet foreseen in the current FOPSerializer.
Yesterday Robby and Ivan were so kind to send me a working Cocoon 2.2
configuration.
This morning, there was room to adapt it to C3.

I suggest that we extend FOPSerializer.java a bit, to include an internal
configuration file & resources.:

 public FlopSerializer(String outputFormat, String userConfigurationPath) {
        if (outputFormat == null) {
            throw new IllegalArgumentException("The parameter
'outputFormat' mustn't be null.");
            }

        URL configurationURL = this.getClass().getResource("/COB-INF/" +
userConfigurationPath);

        try {
            DefaultConfigurationBuilder cfgBuilder = new
DefaultConfigurationBuilder();
            Configuration cfg =
cfgBuilder.build(configurationURL.openStream());
            FOP_FACTORY.setUserConfig(cfg);

        this.outputFormat = outputFormat;
    }

This way, we can package our custom configuration and the font in the block
jar.

Kind regards,
Jos Snellings



-- 
The doctrine of human equality reposes on this: that there is no man
really clever who has not found that he is stupid.
        -- Gilbert K. Chesterson

Mime
View raw message