You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "J.Pietschmann" <j3...@yahoo.de> on 2006/02/08 22:00:06 UTC

Re: [Xmlgraphics-fop Wiki] Update of "ApiDesign" by JeremiasMaerki

> === Remaining in FOUserAgent ===
...
>  * PDF!EncryptionParams


I'd like to fold these into a more generic Properties object holding
stuff to be passed to the renderers (i.e. the character encoding for
the text renderer). Does this sound sensible?

J.Pietschmann

Re: [Xmlgraphics-fop Wiki] Update of "ApiDesign" by JeremiasMaerki

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Jeremias Maerki wrote:
> I've addressed your concern and deprecated the use of
> PDFEncryptionParams in FOUserAgent (D15).

Darn quick reaction. I'm impressed!

> You proposed using a Properties object. The problem I see here is that
> non-String values cannot be used whereas with the existing renderer
> options Map this is possible.

No problem. I just had a vague memory that properties can automatically
convert strings into boolean values.

J.Pietschmann

Re: [Xmlgraphics-fop Wiki] Update of "ApiDesign" by JeremiasMaerki

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I've addressed your concern and deprecated the use of
PDFEncryptionParams in FOUserAgent (D15). The encryption parameters can
now be set through the already existing RendererOptions Map on
FOUserAgent. The parameters can either be set separately or as
PDFEncryptionParams (I prefer to use the latter).

If anyone has time to implement the generic renderer options to the CLI,
he/she is welcome to do that.

You proposed using a Properties object. The problem I see here is that
non-String values cannot be used whereas with the existing renderer
options Map this is possible. Using a Map can be particularly useful in
cases where you need to pass, for example, a ContentHandler or a
PrinterJob object to the renderer. Obviously, some of the renderers will
still need to be extended to allow for such things but the way is free
and I already see the need for that. It is nicer/cleaner to use the
renderer options instead of having to instantiate and setting up the
Renderer yourself for particular situations.

Fetching parameter values from the configuration file is also already
solved by the configure() methods in the Renderers. These methods just
need to be extended to retrieve the desired values.

On 15.02.2006 10:37:10 Jeremias Maerki wrote:
> Ah, from that perspective, it makes sense. Thanks for taking the time to
> explain. I agree that having renderer-dependent settings/objects in the
> user agent is actually not the best idea. I will see what I can do about
> that and report back later.
> 
> On 14.02.2006 21:15:50 J.Pietschmann wrote:
> > Sorry for the delay.
> > 
> > Jeremias Maerki wrote:
> > > Do you mean something like setOutputProperty(name, value) in the JAXP
> > > Transformer?
> > 
> > No, rather something like setParam(name,value), but on the renderer.
> > 
> > > Note that PDF encryption parameters are specific to a rendering run
> > > while the character encoding is probably more of a
> > > environmental/factory-level config value.
> > 
> > After some thinking, I'd say I mean a mechanism for setting or
> > overwriting configuration values from the command line.
> > Something like
> >    fop -fo foo.fo -pdf foo.pdf -r noprint=yes -r filters=''
> > (oops, convoluted example), and the name/value pairs after the -r
> > switch would be passed to the renderer by whatever means, for example
> > by mangling the configuration or, as I tried to suggest, as a Properties
> > object.
> > 
> > I'm bothered with having a very renderer specific data class in the
> > UserAgent, and no obvious way to pass command line values to the
> > renderer.
> > BTW: encryption options like noprint should as well be configurable,
> > and there are arguments that even the user password for encryption
> > could benefit from being read from the XML configuration data.
> > 
> > J.Pietschmann
> 
> 
> 
> Jeremias Maerki



Jeremias Maerki


Re: [Xmlgraphics-fop Wiki] Update of "ApiDesign" by JeremiasMaerki

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Ah, from that perspective, it makes sense. Thanks for taking the time to
explain. I agree that having renderer-dependent settings/objects in the
user agent is actually not the best idea. I will see what I can do about
that and report back later.

On 14.02.2006 21:15:50 J.Pietschmann wrote:
> Sorry for the delay.
> 
> Jeremias Maerki wrote:
> > Do you mean something like setOutputProperty(name, value) in the JAXP
> > Transformer?
> 
> No, rather something like setParam(name,value), but on the renderer.
> 
> > Note that PDF encryption parameters are specific to a rendering run
> > while the character encoding is probably more of a
> > environmental/factory-level config value.
> 
> After some thinking, I'd say I mean a mechanism for setting or
> overwriting configuration values from the command line.
> Something like
>    fop -fo foo.fo -pdf foo.pdf -r noprint=yes -r filters=''
> (oops, convoluted example), and the name/value pairs after the -r
> switch would be passed to the renderer by whatever means, for example
> by mangling the configuration or, as I tried to suggest, as a Properties
> object.
> 
> I'm bothered with having a very renderer specific data class in the
> UserAgent, and no obvious way to pass command line values to the
> renderer.
> BTW: encryption options like noprint should as well be configurable,
> and there are arguments that even the user password for encryption
> could benefit from being read from the XML configuration data.
> 
> J.Pietschmann



Jeremias Maerki


Re: [Xmlgraphics-fop Wiki] Update of "ApiDesign" by JeremiasMaerki

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Sorry for the delay.

Jeremias Maerki wrote:
> Do you mean something like setOutputProperty(name, value) in the JAXP
> Transformer?

No, rather something like setParam(name,value), but on the renderer.

> Note that PDF encryption parameters are specific to a rendering run
> while the character encoding is probably more of a
> environmental/factory-level config value.

After some thinking, I'd say I mean a mechanism for setting or
overwriting configuration values from the command line.
Something like
   fop -fo foo.fo -pdf foo.pdf -r noprint=yes -r filters=''
(oops, convoluted example), and the name/value pairs after the -r
switch would be passed to the renderer by whatever means, for example
by mangling the configuration or, as I tried to suggest, as a Properties
object.

I'm bothered with having a very renderer specific data class in the
UserAgent, and no obvious way to pass command line values to the
renderer.
BTW: encryption options like noprint should as well be configurable,
and there are arguments that even the user password for encryption
could benefit from being read from the XML configuration data.

J.Pietschmann

Re: [Xmlgraphics-fop Wiki] Update of "ApiDesign" by JeremiasMaerki

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Do you mean something like setOutputProperty(name, value) in the JAXP
Transformer?

Note that PDF encryption parameters are specific to a rendering run
while the character encoding is probably more of a
environmental/factory-level config value. After all, that value can
already be configured through the XML configuration today. That means
that you might have to design such a generic property thingy for both
levels.

How would you envision that to look like? Can you provide a few lines of
Java with 2 or 3 examples?

On 08.02.2006 22:00:06 J.Pietschmann wrote:
> > === Remaining in FOUserAgent ===
> ...
> >  * PDF!EncryptionParams
> 
> 
> I'd like to fold these into a more generic Properties object holding
> stuff to be passed to the renderers (i.e. the character encoding for
> the text renderer). Does this sound sensible?
> 
> J.Pietschmann



Jeremias Maerki