Lines 34-54
Link Here
|
34 |
<map:transformers default="xslt"> |
34 |
<map:transformers default="xslt"> |
35 |
<map:transformer name="metaData" logger="lenya.sitemap.transformer.metaData" src="org.apache.lenya.cms.cocoon.transformation.MetaDataTransformer"/> |
35 |
<map:transformer name="metaData" logger="lenya.sitemap.transformer.metaData" src="org.apache.lenya.cms.cocoon.transformation.MetaDataTransformer"/> |
36 |
</map:transformers> |
36 |
</map:transformers> |
37 |
<map:serializers default="xhtml"> |
37 |
<map:serializers default="xml"> |
38 |
<map:serializer logger="sitemap.serializer.links" name="links" src="org.apache.lenya.cms.cocoon.serialization.LinkSerializer"/> |
38 |
<map:serializer logger="sitemap.serializer.links" name="links" src="org.apache.lenya.cms.cocoon.serialization.LinkSerializer"/> |
39 |
</map:serializers> |
39 |
</map:serializers> |
40 |
</map:components> |
40 |
</map:components> |
41 |
|
41 |
|
42 |
<map:views> |
42 |
<map:views> |
43 |
<!-- ============ cruft removal project: ================ |
|
|
44 |
|
45 |
this view's from-label does not exist. |
46 |
|
47 |
<map:view from-label="aggregation" name="aggregation"> |
48 |
<map:serialize type="xml"/> |
49 |
</map:view> |
50 |
|
51 |
--> |
52 |
<map:view from-position="last" name="links"> |
43 |
<map:view from-position="last" name="links"> |
53 |
<map:serialize type="links" /> |
44 |
<map:serialize type="links" /> |
54 |
</map:view> |
45 |
</map:view> |
Lines 56-76
Link Here
|
56 |
|
47 |
|
57 |
<!-- =========================== Resources ================================= --> |
48 |
<!-- =========================== Resources ================================= --> |
58 |
|
49 |
|
59 |
<!-- |
|
|
60 |
FIXME: This seems to be unused... |
61 |
|
62 |
<map:resources> |
63 |
<map:resource name="style-cms-page"> |
64 |
<map:transform type="i18n"> |
65 |
<map:parameter name="locale" value="{request:locale}"/> |
66 |
</map:transform> |
67 |
<map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl"/> |
68 |
<map:transform src="context://lenya/xslt/util/strip_namespaces.xsl"/> |
69 |
<map:transform type="proxy"/> |
70 |
</map:resource> |
71 |
</map:resources> |
72 |
--> |
73 |
|
74 |
<map:pipelines> |
50 |
<map:pipelines> |
75 |
|
51 |
|
76 |
<!-- FIXME: the location of Lenya's cache should either be a global convention |
52 |
<!-- FIXME: the location of Lenya's cache should either be a global convention |
Lines 81-89
Link Here
|
81 |
</global-variables> |
57 |
</global-variables> |
82 |
</map:component-configurations> |
58 |
</map:component-configurations> |
83 |
|
59 |
|
84 |
|
|
|
85 |
|
86 |
|
87 |
<!-- This pipeline handles helper requests and metadata, not the actual publication documents --> |
60 |
<!-- This pipeline handles helper requests and metadata, not the actual publication documents --> |
88 |
<map:pipeline> |
61 |
<map:pipeline> |
89 |
|
62 |
|
Lines 110-131
Link Here
|
110 |
</map:select> |
83 |
</map:select> |
111 |
</map:match> |
84 |
</map:match> |
112 |
|
85 |
|
113 |
<!-- |
|
|
114 |
FIXME: the whole webdav shebang should be handled by the webdav module sitemap. |
115 |
--> |
116 |
<!-- catch webdav GET requests. --> |
117 |
<map:match pattern="*/webdav**"> |
118 |
<map:mount uri-prefix="{1}/" src="{fallback:lenya/modules/webdav/sitemap.xmap}" check-reload="true" reload-method="synchron"/> |
119 |
</map:match> |
120 |
|
121 |
<!-- catch PUT requests (used by webdav clients) --> |
122 |
<map:select type="request-method"> |
123 |
<!-- many client editors like to PUT changes --> |
124 |
<map:when test="PUT"> |
125 |
<map:mount uri-prefix="" src="{fallback:lenya/modules/webdav/sitemap.xmap}" check-reload="true" reload-method="synchron"/> |
126 |
</map:when> |
127 |
</map:select> |
128 |
|
129 |
<!-- FIXME: this should be merged with the getDoctypeXSLT/* matcher below. currently, it is necessary |
86 |
<!-- FIXME: this should be merged with the getDoctypeXSLT/* matcher below. currently, it is necessary |
130 |
so that "getDoctypeXSLT/" requests do not get eaten by the **/ matcher below. |
87 |
so that "getDoctypeXSLT/" requests do not get eaten by the **/ matcher below. |
131 |
Plus it should be moved to an internal-only pipeline. |
88 |
Plus it should be moved to an internal-only pipeline. |
Lines 141-147
Link Here
|
141 |
a cocoon:/ URI? An apache httpd server will not send a HTTP redirect when a directory is requested, but |
98 |
a cocoon:/ URI? An apache httpd server will not send a HTTP redirect when a directory is requested, but |
142 |
serve the index.html file implicitly IIRC. --> |
99 |
serve the index.html file implicitly IIRC. --> |
143 |
<map:match pattern="**/"> |
100 |
<map:match pattern="**/"> |
144 |
<map:redirect-to uri="index.html"/> |
101 |
<map:generate src="context://lenya/xslt/util/strip_namespaces.xsl"/> |
145 |
</map:match> |
102 |
</map:match> |
146 |
|
103 |
|
147 |
</map:pipeline> |
104 |
</map:pipeline> |
Lines 149-179
Link Here
|
149 |
|
106 |
|
150 |
<map:pipeline type="caching"> |
107 |
<map:pipeline type="caching"> |
151 |
|
108 |
|
152 |
<!-- RSS formatting. |
109 |
|
153 |
FIXME: this should be handled by an RSS feed module! |
110 |
<!-- {1:pub}/{2:area}/{3:path} --> |
154 |
--> |
111 |
<map:match pattern="document-content/*/*/**"> |
155 |
<map:match pattern="**.rss"> |
|
|
156 |
<map:generate src="{resource-type:format-rss}"/> |
157 |
<map:serialize type="xml"/> |
158 |
</map:match> |
159 |
|
160 |
<!-- FIXME: either this should be moved into a metadata module, or at least we need to establish |
161 |
some standard for magic extra suffixes and stick to it. |
162 |
Here we use .html.meta, bxe uses .bxe.html. |
163 |
--> |
164 |
<map:match pattern="*/**.html.meta"> |
165 |
<map:generate type="lenyaMetaData" src="lenya-document:{page-envelope:document-uuid},area={1}"/> |
166 |
<map:serialize type="xml"/> |
167 |
</map:match> |
168 |
<map:match pattern="**meta"> |
169 |
<map:generate type="lenyaMetaData" src="lenya-document:{request-param:uuid},lang={request-param:lang},pubid={request-param:pubid},area={request-param:area}"/> |
170 |
<map:serialize type="xml"/> |
171 |
</map:match> |
172 |
|
173 |
<!-- {1:rendertype}/{2:pub}/{3:area}/{4:path} --> |
174 |
<map:match pattern="document-content/*/*/*/**"> |
175 |
<map:act type="language-exists"> |
112 |
<map:act type="language-exists"> |
176 |
<map:generate src="{resource-type:format-xhtml}?rendertype={../1}"/> |
113 |
<map:generate src="{resource-type:format-xhtml}"/> |
177 |
<map:serialize type="xml"/> |
114 |
<map:serialize type="xml"/> |
178 |
</map:act> |
115 |
</map:act> |
179 |
<!-- if the action fails (i.e. the document does not exist), create a nice error page. --> |
116 |
<!-- if the action fails (i.e. the document does not exist), create a nice error page. --> |
Lines 181-210
Link Here
|
181 |
<map:transform src="fallback://lenya/xslt/exception/document-does-not-exist.xsl"> |
118 |
<map:transform src="fallback://lenya/xslt/exception/document-does-not-exist.xsl"> |
182 |
<map:parameter name="requestUrl" value="{request:requestURI}"/> |
119 |
<map:parameter name="requestUrl" value="{request:requestURI}"/> |
183 |
<map:parameter name="contextPath" value="{request:contextPath}"/> |
120 |
<map:parameter name="contextPath" value="{request:contextPath}"/> |
184 |
<map:parameter name="pub" value="{2}"/> |
121 |
<map:parameter name="pub" value="{1}"/> |
185 |
<map:parameter name="path" value="/{4}"/> |
122 |
<map:parameter name="path" value="/{3}"/> |
186 |
<map:parameter name="area" value="{3}"/> |
123 |
<map:parameter name="area" value="{2}"/> |
187 |
</map:transform> |
124 |
</map:transform> |
188 |
<map:transform type="i18n"> |
|
|
189 |
<map:parameter name="locale" value="{page-envelope:language}"/> |
190 |
</map:transform> |
191 |
<map:serialize type="xml"/> |
125 |
<map:serialize type="xml"/> |
192 |
</map:match> |
126 |
</map:match> |
193 |
|
127 |
|
194 |
<!-- |
128 |
<!-- |
195 |
This matcher aggregates the Lenya page: breadcrumbs, tabs, menu etc. and the actual document content. |
129 |
This matcher aggregates the Lenya page: breadcrumbs, tabs, menu etc. and the actual document content. |
196 |
/lenyabody-raw-{1:rendertype}/{2:publication-id}/{3:area}/{4:doctype}/{5:default-language}/{6:language}/{7:path} |
130 |
/lenyabody-raw/{1:publication-id}/{2:area}/{3:doctype}/{4:default-language}/{5:language}/{6:path} |
197 |
--> |
131 |
--> |
198 |
<map:match pattern="lenyabody-raw-*/*/*/*/*/*/**"> |
132 |
<map:match pattern="lenyabody-raw/*/*/*/*/*/**"> |
199 |
<map:aggregate element="cmsbody"> |
133 |
<map:aggregate element="cmsbody"> |
200 |
<map:part src="cocoon://modules/sitetree/breadcrumb/{2}/{3}/{5}/{6}/{7}.xml"/> |
134 |
<map:part src="cocoon://modules/sitetree/breadcrumb/{1}/{2}/{4}/{5}/{6}.xml"/> |
201 |
<map:part src="cocoon://modules/sitetree/tabs/{2}/{3}/{5}/{6}/{7}.xml"/> |
135 |
<map:part src="cocoon://modules/sitetree/tabs/{1}/{2}/{4}/{5}/{6}.xml"/> |
202 |
<map:part src="cocoon://modules/sitetree/menu/{2}/{3}/{5}/{6}/{7}.xml"/> |
136 |
<map:part src="cocoon://modules/sitetree/menu/{1}/{2}/{4}/{5}/{6}.xml"/> |
203 |
<map:part src="cocoon://modules/sitetree/search/{2}/{3}/{5}/{6}/{7}.xml"/> |
137 |
<map:part src="cocoon://modules/sitetree/search/{1}/{2}/{4}/{5}/{6}.xml"/> |
204 |
<map:part src="cocoon://modules/languageselector/text-none/flagsize-13"/> |
138 |
<map:part src="cocoon://modules/languageselector/text-none/flagsize-13"/> |
205 |
<map:part src="cocoon:/document-content/{1}/{2}/{3}/{7}"/> |
139 |
<map:part src="cocoon:/document-content/{1}/{2}/{6}"/> |
206 |
</map:aggregate> |
140 |
</map:aggregate> |
207 |
<map:serialize type="xml"/> |
141 |
<map:serialize/> |
208 |
</map:match> |
142 |
</map:match> |
209 |
|
143 |
|
210 |
<!-- |
144 |
<!-- |
Lines 223-229
Link Here
|
223 |
<map:generate src="fallback://xslt/page2xhtml.xsl"/> |
157 |
<map:generate src="fallback://xslt/page2xhtml.xsl"/> |
224 |
</map:otherwise> |
158 |
</map:otherwise> |
225 |
</map:select> |
159 |
</map:select> |
226 |
<map:serialize type="xml"/> |
160 |
<map:serialize/> |
227 |
</map:match> |
161 |
</map:match> |
228 |
|
162 |
|
229 |
</map:pipeline> |
163 |
</map:pipeline> |
Lines 235-252
Link Here
|
235 |
This matcher takes the raw aggregated page content and applies SVG rendering and a doctype-specific |
169 |
This matcher takes the raw aggregated page content and applies SVG rendering and a doctype-specific |
236 |
XSL transformation. It makes some meta information available to the XSLT, and demonstrates the use |
170 |
XSL transformation. It makes some meta information available to the XSLT, and demonstrates the use |
237 |
of the LenyaMetaDataTransformer (see below). |
171 |
of the LenyaMetaDataTransformer (see below). |
238 |
/lenyabody-{1:rendertype}/{2:publication-id}/{3:area}/{4:doctype}/{5:path} |
172 |
/lenyabody/{1:publication-id}/{2:area}/{3:doctype}/{4:path} |
239 |
--> |
173 |
--> |
240 |
<map:match pattern="lenyabody-*/*/*/*/**"> |
174 |
<map:match pattern="lenyabody/*/*/*/**"> |
241 |
<map:generate src="cocoon:/lenyabody-raw-{1}/{2}/{3}/{4}/{page-envelope:default-language}/{page-envelope:document-language}/{5}"/> |
175 |
<map:generate src="cocoon:/lenyabody-raw/{1}/{2}/{3}/{page-envelope:default-language}/{page-envelope:document-language}/{4}"/> |
242 |
<map:transform src="fallback://lenya/modules/svg/xslt/image2svg.xsl"/> |
176 |
<map:transform src="fallback://lenya/modules/svg/xslt/image2svg.xsl"/> |
243 |
<map:transform src="cocoon:/getDoctypeXSLT/{4}"> |
177 |
<map:transform src="cocoon:/getDoctypeXSLT/{3}"> |
244 |
<map:parameter name="root" value="/{2}/{3}"/> |
178 |
<map:parameter name="root" value="/{1}/{2}"/> |
245 |
<map:parameter name="publication-id" value="{2}"/> |
179 |
<map:parameter name="publication-id" value="{1}"/> |
246 |
<map:parameter name="area" value="{3}"/> |
180 |
<map:parameter name="area" value="{2}"/> |
247 |
<map:parameter name="url" value="{page-envelope:document-url}"/> |
181 |
<map:parameter name="url" value="{page-envelope:document-url}"/> |
248 |
<map:parameter name="document-path" value="{page-envelope:document-path}"/> |
182 |
<map:parameter name="document-path" value="{page-envelope:document-path}"/> |
249 |
<map:parameter name="document-type" value="{4}"/> |
183 |
<map:parameter name="document-type" value="{3}"/> |
250 |
<map:parameter name="language" value="{page-envelope:document-language}"/> |
184 |
<map:parameter name="language" value="{page-envelope:document-language}"/> |
251 |
<map:parameter name="contextprefix" value="{request:contextPath}"/> |
185 |
<map:parameter name="contextprefix" value="{request:contextPath}"/> |
252 |
<map:parameter name="lastPublishedUser" value="{access-control:user-name:{workflow:lastUser.publish}}"/> |
186 |
<map:parameter name="lastPublishedUser" value="{access-control:user-name:{workflow:lastUser.publish}}"/> |
Lines 277-282
Link Here
|
277 |
|
211 |
|
278 |
Otherwise it will return the value as characters. |
212 |
Otherwise it will return the value as characters. |
279 |
--> |
213 |
--> |
|
|
214 |
<!-- |
280 |
<map:transform type="metaData"> |
215 |
<map:transform type="metaData"> |
281 |
<map:parameter name='pubid' value='{page-envelope:publication-id}'/> |
216 |
<map:parameter name='pubid' value='{page-envelope:publication-id}'/> |
282 |
<map:parameter name='area' value='{page-envelope:area}'/> |
217 |
<map:parameter name='area' value='{page-envelope:area}'/> |
Lines 285-291
Link Here
|
285 |
<map:parameter name="locale" value="{page-envelope:language}"/> |
220 |
<map:parameter name="locale" value="{page-envelope:language}"/> |
286 |
</map:transform> |
221 |
</map:transform> |
287 |
<map:transform type="uuid2url"/> |
222 |
<map:transform type="uuid2url"/> |
288 |
<map:serialize type="xml"/> |
223 |
--> |
|
|
224 |
<map:serialize/> |
289 |
</map:match> |
225 |
</map:match> |
290 |
|
226 |
|
291 |
</map:pipeline> |
227 |
</map:pipeline> |
Lines 295-312
Link Here
|
295 |
request. It then aggregates the lenya menu (for the given area) and |
231 |
request. It then aggregates the lenya menu (for the given area) and |
296 |
the lenya body, the actual document. --> |
232 |
the lenya body, the actual document. --> |
297 |
<map:pipeline> |
233 |
<map:pipeline> |
298 |
|
|
|
299 |
<!-- |
234 |
<!-- |
300 |
FIXME: this is a BXE-specific hack that should be handled by BXE's module sitemap. The publication |
|
|
301 |
should not be concerned with BXE-specific pre-processing of documents. |
302 |
--> |
303 |
<map:match pattern="**.bxe.html"> |
304 |
<map:generate src="cocoon:/lenyabody-edit/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/> |
305 |
<map:transform type="proxy"/> |
306 |
<map:serialize type="xml"/> |
307 |
</map:match> |
308 |
|
309 |
<!-- |
310 |
Finally: this matcher handles requests for publication documents. |
235 |
Finally: this matcher handles requests for publication documents. |
311 |
/{1:area}/{2:document-path}.html |
236 |
/{1:area}/{2:document-path}.html |
312 |
--> |
237 |
--> |
Lines 316-335
Link Here
|
316 |
The default publication does not have content by default. This check provides the user with a dialog |
241 |
The default publication does not have content by default. This check provides the user with a dialog |
317 |
to import example content. It's not needed for production systems. |
242 |
to import example content. It's not needed for production systems. |
318 |
--> |
243 |
--> |
|
|
244 |
<!-- |
319 |
<map:select type="resource-exists"> |
245 |
<map:select type="resource-exists"> |
320 |
<map:when test="lenya://lenya/pubs/{page-envelope:publication-id}/content/authoring/sitetree.xml"/> |
246 |
<map:when test="lenya://lenya/pubs/{page-envelope:publication-id}/content/authoring/sitetree.xml"/> |
321 |
<map:otherwise> |
247 |
<map:otherwise> |
322 |
<map:redirect-to uri="{request:requestUri}?lenya.usecase=export.importExampleContent"/> |
248 |
<map:redirect-to uri="{request:requestUri}?lenya.usecase=export.importExampleContent"/> |
323 |
</map:otherwise> |
249 |
</map:otherwise> |
324 |
</map:select> |
250 |
</map:select> |
325 |
|
251 |
--> |
326 |
<!-- If the requested language version of the document exists, we set a last-modified header. --> |
252 |
<!-- If the requested language version of the document exists, we set a last-modified header. --> |
327 |
<map:act type="language-exists"> |
253 |
<map:act type="language-exists"> |
328 |
<map:act type="set-header"> |
254 |
<map:act type="set-header"> |
329 |
<map:parameter name="Last-Modified" value="{date-iso8601-rfc822:{page-envelope:document-lastmodified}}" /> |
255 |
<map:parameter name="Last-Modified" value="{date-iso8601-rfc822:{page-envelope:document-lastmodified}}" /> |
330 |
</map:act> |
256 |
</map:act> |
331 |
</map:act> |
257 |
</map:act> |
332 |
|
|
|
333 |
<!-- |
258 |
<!-- |
334 |
HEAD requests shouldn't have all the xslt overhead, all the user wants is the HTTP header information. |
259 |
HEAD requests shouldn't have all the xslt overhead, all the user wants is the HTTP header information. |
335 |
So the actual content generation is bypassed. |
260 |
So the actual content generation is bypassed. |
Lines 339-388
Link Here
|
339 |
<map:generate src="context://lenya/content/util/empty.xml" /> |
264 |
<map:generate src="context://lenya/content/util/empty.xml" /> |
340 |
<map:serialize type="xhtml"/> |
265 |
<map:serialize type="xhtml"/> |
341 |
</map:when> |
266 |
</map:when> |
342 |
</map:select> |
267 |
</map:select> |
343 |
|
268 |
|
344 |
<!-- |
|
|
345 |
Lenya provides its own caching mechanism. There is a source writing transformer that will store rendered pages |
346 |
in {global:cache-dir}. Hence we should first check for every request if a cached version already exists, before |
347 |
starting the actual rendering process. |
348 |
NOTE: the cache is disabled by default. That means it has seen very little testing. And it does not do proper cache |
349 |
invalidation, so it's probably only useful as a quick performance hack on a mostly static site. |
350 |
--> |
351 |
<!-- do we have this request in the cache? --> |
352 |
<map:select type="resource-exists"> |
353 |
<map:when test="context:/lenya/pubs/{page-envelope:publication-id}/{global:cache-dir}/{1}/{2}.htmlDISABLED"> |
354 |
<!-- YES. Just read it from the cache and be done: --> |
355 |
<map:read src="context:/lenya/pubs/{page-envelope:publication-id}/{global:cache-dir}/{1}/{2}.html" mime-type="text/html"/> |
356 |
</map:when> |
357 |
<!-- No. Generate the page and write it to the cache. --> |
358 |
<map:otherwise> |
359 |
<!-- |
360 |
FIXME: the "rendertype" parameter is a hack for BXE and should be handled by the bxe module. |
361 |
Moreover, it doesn't make much sense to cache documents in the authoring area that are about to be edited anyway. |
362 |
--> |
363 |
<map:select type="parameter"> |
364 |
<map:parameter name="parameter-selector-test" value="{request-param:rendertype}"/> |
365 |
<map:when test="edit"> |
366 |
<!-- put the bxe_xpath attribute into the page --> |
367 |
<map:generate src="cocoon:/lenyabody-edit/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/> |
368 |
</map:when> |
369 |
<map:otherwise> |
370 |
<!-- sane page w/o hacks --> |
371 |
<map:generate src="cocoon:/lenyabody-view/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/> |
372 |
</map:otherwise> |
373 |
</map:select> |
374 |
|
269 |
|
375 |
<!-- Menu generation --> |
270 |
|
|
|
271 |
<!-- Live area doesn't get a menu, all others do: --> |
376 |
<map:select type="parameter"> |
272 |
<map:select type="parameter"> |
377 |
<!-- you remember that {1} is the area, right? --> |
273 |
<!-- you remember that {1} is the area, right? --> |
378 |
<map:parameter name="parameter-selector-test" value="{1}"/> |
274 |
<map:parameter name="parameter-selector-test" value="{1}"/> |
379 |
<map:when test="live"> |
275 |
<map:when test="live"> |
380 |
<!-- do nothing for live --> |
276 |
<map:generate src="cocoon:/lenyabody/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/> |
381 |
</map:when> |
277 |
</map:when> |
382 |
<map:otherwise> |
278 |
<map:otherwise> |
383 |
<!-- for all other areas, we want a GUI menu (handled by global-sitemap.xmap --> |
279 |
<!-- for all other areas, we want a GUI menu (handled by global-sitemap.xmap --> |
384 |
<!-- FIXME: the ?doctype parameter doesn't seem to be used (see global-sitemap.xmap). --> |
280 |
<!-- FIXME: the ?doctype parameter doesn't seem to be used (see global-sitemap.xmap). --> |
385 |
<map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{1}/{2}.xml?doctype={page-envelope:document-type}"/> |
281 |
<map:generate src="cocoon:/lenyabody/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/> |
|
|
282 |
<map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{1}/{2}.xml"/> |
386 |
<!-- |
283 |
<!-- |
387 |
external broken link reporting (pretty much untested) |
284 |
external broken link reporting (pretty much untested) |
388 |
TODO: External Links checking should be optional on a document by document basis. |
285 |
TODO: External Links checking should be optional on a document by document basis. |
Lines 399-421
Link Here
|
399 |
strip xhtml namespace prefix to ensure compatibility with non-XML conformant browsers |
296 |
strip xhtml namespace prefix to ensure compatibility with non-XML conformant browsers |
400 |
workaround to avoid empty script, style and textarea tags (firefox chokes on those) |
297 |
workaround to avoid empty script, style and textarea tags (firefox chokes on those) |
401 |
--> |
298 |
--> |
|
|
299 |
<!-- |
402 |
<map:transform src="fallback://lenya/xslt/util/strip_namespaces.xsl"/> |
300 |
<map:transform src="fallback://lenya/xslt/util/strip_namespaces.xsl"/> |
|
|
301 |
--> |
403 |
|
302 |
|
404 |
|
|
|
405 |
<!-- Cache writing --> |
406 |
<map:select type="parameter"> |
303 |
<map:select type="parameter"> |
407 |
<map:parameter name="parameter-selector-test" value="{1}"/> |
304 |
<map:parameter name="parameter-selector-test" value="{1}"/> |
408 |
<!-- for live area: --> |
305 |
<!-- for live area: --> |
409 |
<map:when test="live"> |
306 |
<map:when test="live"> |
410 |
<!-- prepare content for source writing transformer --> |
|
|
411 |
<map:transform src="fallback://lenya/xslt/authoring/edit/addSourceTags.xsl"> |
412 |
<map:parameter name="source" value="context:/lenya/pubs/{page-envelope:publication-id}/{global:cache-dir}/{1}/{2}.html"/> |
413 |
</map:transform> |
414 |
<map:transform type="write-source"> |
415 |
<map:parameter name="serializer" value="xhtml"/> |
416 |
</map:transform> |
417 |
<!-- remove the source writing transformer cruft again before serving the page --> |
418 |
<map:transform src="fallback://lenya/xslt/authoring/edit/removeSourceTags.xsl"/> |
419 |
<!-- set cache expiration header according to resource type configuration (<expires/>) --> |
307 |
<!-- set cache expiration header according to resource type configuration (<expires/>) --> |
420 |
<map:act type="set-header"> |
308 |
<map:act type="set-header"> |
421 |
<map:parameter name="Expires" value="{date-iso8601-rfc822:{doc-info:{page-envelope:publication-id}:{page-envelope:area}:{page-envelope:document-uuid}:{page-envelope:document-language}:expires}}"/> |
309 |
<map:parameter name="Expires" value="{date-iso8601-rfc822:{doc-info:{page-envelope:publication-id}:{page-envelope:area}:{page-envelope:document-uuid}:{page-envelope:document-language}:expires}}"/> |
Lines 435-456
Link Here
|
435 |
NOTE: you may want to disable this in production for performance reasons, |
323 |
NOTE: you may want to disable this in production for performance reasons, |
436 |
but it's on by default in the default publication to make the generated code |
324 |
but it's on by default in the default publication to make the generated code |
437 |
easier to work with for new users. --> |
325 |
easier to work with for new users. --> |
438 |
<map:transform src="fallback://lenya/modules/prettyprinting/xslt/xml2nicexml.xsl"/> |
326 |
<!-- |
439 |
|
327 |
<map:transform src="fallback://lenya/modules/prettyprinting/xslt/xml2nicexml.xsl"/> |
|
|
328 |
--> |
440 |
<!-- the proxy transformer handles proxy-related URL rewriting --> |
329 |
<!-- the proxy transformer handles proxy-related URL rewriting --> |
|
|
330 |
<!-- |
441 |
<map:transform type="proxy"/> |
331 |
<map:transform type="proxy"/> |
442 |
|
332 |
--> |
443 |
<map:act type="language-exists"> |
333 |
<map:act type="language-exists"> |
444 |
<map:serialize type="xhtml"/> |
334 |
<map:serialize/> |
445 |
</map:act> |
335 |
</map:act> |
446 |
<!-- |
336 |
<!-- |
447 |
When the requested document does not exist, we generate a nice error page. |
337 |
When the requested document does not exist, we generate a nice error page. |
448 |
Still, it's not what the user wants, so make sure we send a 404 "not found". |
338 |
Still, it's not what the user wants, so make sure we send a 404 "not found". |
449 |
--> |
339 |
--> |
450 |
<map:serialize type="xhtml" status-code="404"/> |
340 |
<map:serialize type="xhtml" status-code="404"/> |
451 |
</map:otherwise> |
341 |
|
452 |
</map:select> |
|
|
453 |
|
454 |
</map:match> |
342 |
</map:match> |
455 |
|
343 |
|
456 |
</map:pipeline> |
344 |
</map:pipeline> |
Lines 479-494
Link Here
|
479 |
If the action above fails (e.g. the document does not exist), call into the lenyabody pipeline. |
367 |
If the action above fails (e.g. the document does not exist), call into the lenyabody pipeline. |
480 |
It will generate a nice document-does-not-exist page for us. |
368 |
It will generate a nice document-does-not-exist page for us. |
481 |
--> |
369 |
--> |
482 |
<map:generate src="cocoon:/lenyabody-view/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/> |
370 |
<map:generate src="cocoon:/lenyabody/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/> |
483 |
<map:select type="parameter"> |
371 |
<map:select type="parameter"> |
484 |
<map:parameter name="parameter-selector-test" value="{1}"/> |
372 |
<map:parameter name="parameter-selector-test" value="{1}"/> |
485 |
<map:when test="live"/> |
373 |
<map:when test="live"/> |
486 |
<map:otherwise> |
374 |
<map:otherwise> |
487 |
<map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{1}/{2}?doctype={page-envelope:document-type}"/> |
375 |
<map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{1}/{2}/?doctype={page-envelope:document-type}"/> |
488 |
</map:otherwise> |
376 |
</map:otherwise> |
489 |
</map:select> |
377 |
</map:select> |
|
|
378 |
<!-- |
490 |
<map:transform src="fallback://lenya/xslt/util/strip_namespaces.xsl"/> |
379 |
<map:transform src="fallback://lenya/xslt/util/strip_namespaces.xsl"/> |
491 |
<map:transform type="proxy"/> |
380 |
<map:transform type="proxy"/> |
|
|
381 |
--> |
492 |
<map:serialize type="xhtml" status-code="404"/> |
382 |
<map:serialize type="xhtml" status-code="404"/> |
493 |
|
383 |
|
494 |
</map:match> |
384 |
</map:match> |