1 |
+-------------------------------------------------------+ |
2 |
| How to : Install SDX2 over an existing Cocoon | |
3 |
| [ using sdx-cocoon target in the ant build ] | |
4 |
+-------------------------------------------------------+ |
5 |
|
6 |
|
7 |
Table of contents |
8 |
|
9 |
I - Get and prepare the files |
10 |
II - Install the files |
11 |
IIi - Modify the Cocoon configuration |
12 |
|
13 |
|
14 |
I - Get and prepare the files |
15 |
----------------------------- |
16 |
|
17 |
You need to download the source distribution of SDX 2.3 or more recent. This |
18 |
distribution is available from the main Web site for SDX: |
19 |
http://adnx.org/sdx/ |
20 |
|
21 |
Once you have this distribution, unpack it, open a command line window and |
22 |
execute either of these commands: |
23 |
|
24 |
build sdx-cocoon-zip |
25 |
|
26 |
or |
27 |
|
28 |
build sdx-cocoon-tgz |
29 |
|
30 |
The first one will prepare a ZIP archive of relevant files, and the second one |
31 |
will prepare a tar/gz archive. |
32 |
|
33 |
II - Install the files |
34 |
---------------------- |
35 |
|
36 |
The previous action will give you an archive of relevant files. This archive |
37 |
will be in the build directory of your distribution. |
38 |
|
39 |
You need to unpack this archive in the directory where Cocoon is installed. |
40 |
|
41 |
Afterwards, delete the old lucene jar file (should be lucene-1.3-final.jar with |
42 |
cocoon 2.1.5), located in the /WEB-INF/lib/ directory. |
43 |
|
44 |
The correct lucene jar are the cocoon-block and the patched one provided with |
45 |
SDX. |
46 |
|
47 |
|
48 |
III - Modify the Cocoon configuration |
49 |
------------------------------------- |
50 |
|
51 |
There are 3 configuration files to edit, they are located in the /WEB-INF/ |
52 |
directory of your Cocoon installation directory: |
53 |
- cocoon.xconf |
54 |
- logkit.xconf |
55 |
- web.xml |
56 |
|
57 |
We have provided example configuration files from the SDX distributions. They |
58 |
are named cocoon.xconf.sdx, logkit.xconf.sdx and web.xml.sdx. You may either |
59 |
apply the following modifications to your Cocoon configuration files or start |
60 |
from the ones provided with SDX and modify them. |
61 |
|
62 |
Changes to cocoon.xconf: |
63 |
|
64 |
1- Add these two elements just after the root tag: |
65 |
|
66 |
<sdx-framework role="fr.gouv.culture.sdx.framework.Framework" |
67 |
class="fr.gouv.culture.sdx.framework.FrameworkImpl" logger="sdx.framework"/> |
68 |
|
69 |
<oai role="fr.gouv.culture.oai.OAIComponent" |
70 |
class="fr.gouv.culture.oai.OAIComponentImpl" logger="oai"/> |
71 |
|
72 |
|
73 |
2- Find this block (entity resolution): |
74 |
|
75 |
<entity-resolver logger="core.resolver"> |
76 |
<parameter name="catalog" value="WEB-INF/entities/catalog"/> |
77 |
<parameter name="verbosity" value="1"/> |
78 |
</entity-resolver> |
79 |
|
80 |
And replace it with: |
81 |
|
82 |
<sdx-entity-resolver role="org.apache.excalibur.xml.EntityResolver" |
83 |
class="fr.gouv.culture.sdx.resolver.entity.SDXResolver" |
84 |
logger="sdx.framework.SDXResolver"> |
85 |
<parameter name="verbosity" value="1"/> |
86 |
</sdx-entity-resolver> |
87 |
|
88 |
|
89 |
3- Find the following line: |
90 |
|
91 |
<xslt-processor logger="core.xslt-processor"> |
92 |
|
93 |
And replace it with : |
94 |
|
95 |
<xslt-processor logger="core.xslt-processor" pool-grow="2" pool-min="8" |
96 |
pool-max="32"> |
97 |
|
98 |
|
99 |
4- Bellow this line: |
100 |
|
101 |
<target-language name="java"> |
102 |
|
103 |
Add the following element: |
104 |
|
105 |
<builtin-logicsheet> |
106 |
<parameter name="prefix" value="sdx"/> |
107 |
<parameter name="uri" value="http://www.culture.gouv.fr/ns/sdx/sdx"/> |
108 |
<parameter name="href" value="resource://fr/gouv/culture/sdx/logicsheet/sdx.xsl"/> |
109 |
</builtin-logicsheet> |
110 |
|
111 |
|
112 |
Changes to logkit.xconf: |
113 |
|
114 |
|
115 |
1- In the <targets> section, add the following blocks: |
116 |
|
117 |
<cocoon id="sdx"> |
118 |
<filename>${context-root}/WEB-INF/logs/sdx.log</filename> |
119 |
<format type="cocoon">%7.7{priority} %{time} [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n%{throwable}</format> |
120 |
<append>false</append> |
121 |
</cocoon> |
122 |
|
123 |
<priority-filter id="sdxError" log-level="ERROR"> |
124 |
<cocoon> |
125 |
<filename>${context-root}/WEB-INF/logs/sdxError.log</filename> |
126 |
<format type="cocoon">%7.7{priority} %{time} [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n%{throwable}</format> |
127 |
<append>false</append> |
128 |
</cocoon> |
129 |
</priority-filter> |
130 |
|
131 |
<cocoon id="oai"> |
132 |
<filename>${context-root}/WEB-INF/logs/oai.log</filename> |
133 |
<format type="cocoon">%7.7{priority} %{time} [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n%{throwable}</format> |
134 |
<append>false</append> |
135 |
</cocoon> |
136 |
|
137 |
<priority-filter id="oaiError" log-level="ERROR"> |
138 |
<cocoon> |
139 |
<filename>${context-root}/WEB-INF/logs/oaiError.log</filename> |
140 |
<format type="cocoon">%7.7{priority} %{time} [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n%{throwable}</format> |
141 |
<append>false</append> |
142 |
</cocoon> |
143 |
</priority-filter> |
144 |
|
145 |
|
146 |
2- In the <categories> section, add the following blocks : |
147 |
|
148 |
<category name="sdx" log-level="ERROR"> |
149 |
<category name="sdx.framework" log-level="ERROR"/> |
150 |
<category name="sdx.rdbms" log-level="ERROR"/> |
151 |
<log-target id-ref="sdx"/> |
152 |
<log-target id-ref="sdxError"/> |
153 |
</category> |
154 |
|
155 |
<category name="oai" log-level="ERROR"> |
156 |
<category name="oai" log-level="ERROR"/> |
157 |
<log-target id-ref="oai"/> |
158 |
<log-target id-ref="oaiError"/> |
159 |
</category> |
160 |
|
161 |
|
162 |
Changes to web.xml: |
163 |
|
164 |
1- Find this block : |
165 |
|
166 |
<init-param> |
167 |
<param-name>enable-uploads</param-name> |
168 |
<param-value>false</param-value> |
169 |
</init-param> |
170 |
|
171 |
And set the value to "true": |
172 |
|
173 |
<init-param> |
174 |
<param-name>enable-uploads</param-name> |
175 |
<param-value>true</param-value> |
176 |
</init-param> |
177 |
|
178 |
|
179 |
2- Search for this block : |
180 |
|
181 |
<!-- |
182 |
Specify maximum allowed size of the upload. Defaults to 10 Mb. |
183 |
|
184 |
<init-param> |
185 |
<param-name>upload-max-size</param-name> |
186 |
<param-value>10000000</param-value> |
187 |
</init-param> |
188 |
--> |
189 |
|
190 |
And uncomment it to set a useful value: |
191 |
|
192 |
<!-- |
193 |
Specify maximum allowed size of the upload. Defaults to 10 Mb. |
194 |
--> |
195 |
<init-param> |
196 |
<param-name>upload-max-size</param-name> |
197 |
<param-value>25000000</param-value> |
198 |
</init-param> |
199 |
|
200 |
|
201 |
3- Find the following two blocks about the encoding : |
202 |
|
203 |
<!-- |
204 |
Set encoding used by the container. If not set the ISO-8859-1 encoding |
205 |
will be assumed. |
206 |
--> |
207 |
<!-- |
208 |
<init-param> |
209 |
<param-name>container-encoding</param-name> |
210 |
<param-value>utf-8</param-value> |
211 |
</init-param> |
212 |
--> |
213 |
|
214 |
<!-- |
215 |
Set form encoding. This will be the character set used to decode request |
216 |
parameters. If not set the ISO-8859-1 encoding will be assumed. |
217 |
--> |
218 |
<!-- |
219 |
<init-param> |
220 |
<param-name>form-encoding</param-name> |
221 |
<param-value>utf-8</param-value> |
222 |
</init-param> |
223 |
--> |
224 |
|
225 |
And uncomment them: |
226 |
|
227 |
<!-- |
228 |
Set encoding used by the container. If not set the ISO-8859-1 encoding |
229 |
will be assumed. |
230 |
--> |
231 |
<init-param> |
232 |
<param-name>container-encoding</param-name> |
233 |
<param-value>utf-8</param-value> |
234 |
</init-param> |
235 |
|
236 |
<!-- |
237 |
Set form encoding. This will be the character set used to decode request |
238 |
parameters. If not set the ISO-8859-1 encoding will be assumed. |
239 |
--> |
240 |
<init-param> |
241 |
<param-name>form-encoding</param-name> |
242 |
<param-value>utf-8</param-value> |
243 |
</init-param> |
244 |
|