blob: 0e857836a8dcf33e15f4929b39e301628e986763 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
<?xml version="1.0" encoding="utf-8"?>
<!--
* Copyright 2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<!-- $Id$ -->
<!--
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"docbookx.dtd">
-->
<chapter>
<title>Configuration</title>
<para>Configuration is based on the <literal>Configurable</literal>
and <literal>Configuration</literal> interfaces of
<literal>avalon</literal>:
<screen>
org.apache.avalon.framework.configuration.Configurable
org.apache.avalon.framework.configuration.Configuration
</screen>
A type that implements <literal>Configurable</literal> can be
configured by calling its method <literal>configure(Configuration
configuration)</literal>, where the argument is the
<literal>Configuration</literal> object that holds the user
configuration settings. It can also be configured by calling the
static method <literal>ContainerUtil.configure(object, cfg)</literal>
of the class
<screen>
ContainerUtil = org.apache.avalon.framework.container.ContainerUtil
</screen>
This method checks if <literal>object</literal> implements
<literal>Configurable</literal>. If not, no configuration is
attempted.</para>
<para>The following classes implement <literal>Configurable</literal>:
<itemizedlist spacing="compact">
<listitem>
<para><literal>render.AbstractRenderer</literal> and its
subclasses (all renderers). Only
<literal>render.pdf.PDFRenderer</literal> and
<literal>render.ps.PSRenderer</literal> have meaningful
implementations of the <literal>configure</literal> method. The
command line module configures each renderer from the user
configuration file with the subconfiguration
<literal>renderers/renderer[@mime=$mimetype]</literal>.</para>
</listitem>
<listitem>
<para><literal>svg.PDFTranscoder</literal></para>
</listitem>
<listitem>
<para><literal>svg.PDFDocumentGraphics2D</literal>. This class
is configured by <literal>svg.PDFTranscoder</literal> via
<literal>ContainerUtil.configure(graphics, this.cfg)</literal>.
</para>
</listitem>
</itemizedlist></para>
<para>In addition <literal>render.ps.AbstractPSTranscoder</literal>
has a member <literal>Configuration cfg</literal>. It configures
graphics via <literal>ContainerUtil.configure(graphics,
this.cfg)</literal>. The graphics are of type
<literal>render.ps.AbstractPSDocumentGraphics2D</literal>, which does
not implement <literal>Configurable</literal>, so that no
configuration takes place.</para>
<para><literal>render.pdf.PDFRenderer</literal> and
<literal>svg.PDFDocumentGraphics2D</literal> both call
<literal>fonts.FontSetup.buildFontListFromConfiguration(cfg)</literal>
and
<literal>pdf.PDFFilterList.buildFilterMapFromConfiguration(cfg)</literal>.</para>
<para>Configuration info is used by: <itemizedlist spacing="compact">
<listitem>
<para><literal>fonts.FontSetup.buildFontListFromConfiguration(cfg)</literal>. It
uses <literal>fonts/font/font-triplet</literal> from the renderer
subconfiguration.</para>
</listitem>
<listitem>
<para><literal>pdf.PDFFilterList.buildFilterMapFromConfiguration(cfg)</literal>. It
uses <literal>filterList/value</literal> from the renderer
subconfiguration</para>
</listitem>
<listitem>
<para><literal>render.ps.PSRenderer.configure(cfg)</literal>. It
uses <literal>auto-rotate-landscape</literal> as a Boolean.
</para>
</listitem>
</itemizedlist></para>
</chapter>
|