View | Details | Raw Unified | Return to bug 43769
Collapse All | Expand All

(-)src/pubs/default/sitemap.xmap (-161 / +51 lines)
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>
(-)src/webapp/global-sitemap.xmap (-117 / +26 lines)
Lines 30-52 Link Here
30
      +-->
30
      +-->
31
31
32
  <map:resources>
32
  <map:resources>
33
33
    <map:resource name="style-cms-page">
34
    <map:resource name="style-cms-page">
34
      <map:transform type="i18n">      
35
      <map:transform type="i18n">      
35
        <map:parameter name="locale" value="{request:locale}"/>
36
        <map:parameter name="locale" value="{request:locale}"/>
36
      </map:transform>    
37
      </map:transform>    
38
      <!-- FIXME: it's unfortunate that this page2xhtml.xsl is something entirely different
39
           than the publication's page2xhtml.xsl, and it's not in the same "fallback path"... -->
37
      <map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl"/>
40
      <map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl"/>
38
      <map:transform type="proxy"/>
41
      <map:transform type="proxy"/>
39
      <map:transform src="context://lenya/xslt/util/strip_namespaces.xsl"/>
42
      <map:transform src="context://lenya/xslt/util/strip_namespaces.xsl"/>
40
      <map:transform src="fallback://lenya/modules/prettyprinting/xslt/xml2nicexml.xsl"/>
43
      <map:transform src="fallback://lenya/modules/prettyprinting/xslt/xml2nicexml.xsl"/>
41
    </map:resource>  
44
    </map:resource>  
45
42
    <map:resource name="i18n">
46
    <map:resource name="i18n">
43
      <map:transform type="i18n">
47
      <map:transform type="i18n">
44
        <map:parameter name="locale" value="{request:locale}"/>
48
        <map:parameter name="locale" value="{request:locale}"/>
45
      </map:transform>
49
      </map:transform>
46
    </map:resource>
50
    </map:resource>
51
47
    <map:resource name="proxy-css">
52
    <map:resource name="proxy-css">
48
      <map:act type="resource-exists"
53
      <map:act type="resource-exists" src="{url}.xml">
49
        src="{url}.xml">
50
        <map:generate src="{../url}.xml"/>
54
        <map:generate src="{../url}.xml"/>
51
        <map:transform src="fallback://lenya/resources/css/css.xsl">
55
        <map:transform src="fallback://lenya/resources/css/css.xsl">
52
          <map:parameter name="root" value="/{page-envelope:publication-id}/{page-envelope:area}"/>
56
          <map:parameter name="root" value="/{page-envelope:publication-id}/{page-envelope:area}"/>
Lines 56-61 Link Here
56
      <map:generate type="text" src="{url}.css"/>
60
      <map:generate type="text" src="{url}.css"/>
57
      <map:call resource="prepare-proxy-css"/>
61
      <map:call resource="prepare-proxy-css"/>
58
    </map:resource>
62
    </map:resource>
63
59
    <map:resource name="prepare-proxy-css">
64
    <map:resource name="prepare-proxy-css">
60
      <map:transform type="pattern"
65
      <map:transform type="pattern"
61
        src="fallback://lenya/chaperon/grammars/link.xlex"/>
66
        src="fallback://lenya/chaperon/grammars/link.xlex"/>
Lines 68-122 Link Here
68
    </map:resource>
73
    </map:resource>
69
 </map:resources>
74
 </map:resources>
70
75
71
<!-- =========================== Pipelines ================================= -->
72
73
 <!--+
74
     | Pipelines. The beef. Pipelines specify how the processing of your
75
     | content is done. Usually, a pipeline consists of several fragments
76
     | that specify the generation, transformation, and serialization of
77
     | SAX events.
78
     |
79
     | Processing is done in two steps:
80
     |
81
     | 1) The top level elements are executed in order of appearance until
82
     |    one signals success. These top level elements are usually
83
     |    matchers.
84
     |
85
     |    Other components are called depth-first to determine what
86
     |    fragments make up the processing pipeline. When a component
87
     |    fails, no nested components are called but the next component on
88
     |    the same level.
89
     |
90
     | 2) Once it is determined which generator, which transformers and
91
     |    wich serializer is used, these components are executed. During
92
     |    this, the pipeline may not be changed.
93
     |
94
     | You may have as many pipelines in your sitemap as you like.
95
     +-->
96
<map:pipelines>
76
<map:pipelines>
97
77
98
  <map:component-configurations>
78
  <map:component-configurations>
99
    <global-variables>
79
    <global-variables>
100
       <!--+
101
           | Define global parameters here:
102
           |   <skin>my_skin</skin>
103
           |   ...
104
           | You can access them by {global:*name*}, e.g. {global:skin}.
105
           | These values are inherited into sub-sitemaps and can
106
           | be extended there.
107
           +-->
108
      
109
      <!-- pipeline expiration, see http://httpd.apache.org/docs/2.0/mod/mod_expires.html for syntax documentation -->
80
      <!-- pipeline expiration, see http://httpd.apache.org/docs/2.0/mod/mod_expires.html for syntax documentation -->
110
      <pipeline-expiration>now</pipeline-expiration>
81
      <pipeline-expiration>now</pipeline-expiration>
111
      <!--
112
        <pipeline-expiration>access plus 2 hours</pipeline-expiration>
113
      -->
114
    </global-variables>
82
    </global-variables>
115
  </map:component-configurations>
83
  </map:component-configurations>
116
84
117
<!-- =========================== Pipelines ================================= -->
85
<!-- =========================== Pipelines ================================= -->
118
86
119
    <map:pipeline>
87
    <map:pipeline internal-only="true">
120
      <map:match pattern="aggregate-publications">
88
      <map:match pattern="aggregate-publications">
121
        <map:generate type="directory" src="lenya/pubs"/>
89
        <map:generate type="directory" src="lenya/pubs"/>
122
        <map:transform src="lenya/xslt/util/aggregate-publications.xsl"/>
90
        <map:transform src="lenya/xslt/util/aggregate-publications.xsl"/>
Lines 125-152 Link Here
125
      </map:match>
93
      </map:match>
126
    </map:pipeline>
94
    </map:pipeline>
127
95
128
    <!-- ajax -->
96
    <map:pipeline internal-only="false">
129
    <map:pipeline>
130
      <map:match pattern="cforms/ajax/**">
131
        <map:read src="resource://org/apache/cocoon/ajax/resources/{1}"/>
132
      </map:match>
133
    </map:pipeline>   
134
    
135
    <!-- dojo -->
136
    <map:pipeline>
137
      <map:match pattern="cforms/dojo/**">
138
        <map:read src="resource://org/apache/cocoon/dojo/resources/{1}"/>
139
      </map:match>
140
    </map:pipeline> 
141
142
    <!-- cforms -->
143
    <map:pipeline>
144
      <map:match pattern="cforms/forms/**">
145
        <map:read src="resource://org/apache/cocoon/forms/resources/{1}"/>
146
      </map:match>
147
    </map:pipeline>
148
149
    <map:pipeline>
150
      <!-- Lenya GUI -->
97
      <!-- Lenya GUI -->
151
      <map:match pattern="lenya/**">
98
      <map:match pattern="lenya/**">
152
        <map:mount uri-prefix="lenya" src="lenya/lenya.xmap" check-reload="true" reload-method="synchron" pass-through="true"/>
99
        <map:mount uri-prefix="lenya" src="lenya/lenya.xmap" check-reload="true" reload-method="synchron" pass-through="true"/>
Lines 177-204 Link Here
177
        <!-- Disable menu items according to usecase policies -->
124
        <!-- Disable menu items according to usecase policies -->
178
        <map:transform type="usecasemenu"/>
125
        <map:transform type="usecasemenu"/>
179
126
180
<!--
181
   XUL is untested and unsupported.
182
183
        <map:select type="request-parameter">
184
          <map:parameter name="parameter-name" value="uiml"/>
185
          <map:when test="xul">
186
            <map:transform src="fallback://lenya/xslt/menu/menu2xul.xsl">
187
              <map:parameter name="publicationid" value="{1}"/>
188
              <map:parameter name="area" value="{2}"/>
189
              <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
190
              <map:parameter name="documentid" value="{page-envelope:document-uuid}"/>
191
              <map:parameter name="userid" value="{access-control:user-id}"/>
192
              <map:parameter name="servertime" value="{date-i18n:currentDate}"/>
193
              <map:parameter name="workflowstate" value="{workflow:state}"/>
194
              <map:parameter name="islive" value="{workflow:variable.is_live}"/>
195
              <map:parameter name="usecase" value="{request-param:lenya.usecase}"/>
196
              <map:parameter name="tabGroup" value="{usecase:tabGroup:{request-param:lenya.usecase}}"/>
197
              <map:parameter name="newMessages" value="{inbox:newMessageCount}"/>
198
            </map:transform>
199
          </map:when>
200
          <map:otherwise>
201
-->
202
            <map:transform src="fallback://lenya/xslt/menu/menubar2xhtml.xsl">
127
            <map:transform src="fallback://lenya/xslt/menu/menubar2xhtml.xsl">
203
              <map:parameter name="publicationid" value="{1}"/>
128
              <map:parameter name="publicationid" value="{1}"/>
204
              <map:parameter name="area" value="{2}"/>
129
              <map:parameter name="area" value="{2}"/>
Lines 212-252 Link Here
212
              <map:parameter name="tabGroup" value="{usecase:tabGroup:{request-param:lenya.usecase}}"/>
137
              <map:parameter name="tabGroup" value="{usecase:tabGroup:{request-param:lenya.usecase}}"/>
213
              <map:parameter name="newMessages" value="{inbox:newMessageCount}"/>
138
              <map:parameter name="newMessages" value="{inbox:newMessageCount}"/>
214
            </map:transform>
139
            </map:transform>
215
<!--
216
          </map:otherwise>
217
        </map:select>
218
-->
219
        <map:call resource="i18n"/>
140
        <map:call resource="i18n"/>
220
        
141
        
221
        <!-- Generate the meta-stylesheet -->
222
<!--
223
  XUL is untested and unsupported
224
        <map:select type="request-parameter">
225
          <map:parameter name="parameter-name" value="uiml"/>
226
          <map:when test="xul">
227
            <map:transform src="fallback://lenya/xslt/menu/menu2xsltwithxul.xsl">
228
              <map:parameter name="publicationid" value="{1}"/>
229
              <map:parameter name="area" value="{2}"/>
230
              <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
231
            </map:transform>
232
          </map:when>
233
          <map:otherwise>
234
-->
235
            <map:transform src="fallback://lenya/xslt/menu/menu2xslt.xsl">
142
            <map:transform src="fallback://lenya/xslt/menu/menu2xslt.xsl">
236
              <map:parameter name="publicationid" value="{1}"/>
143
              <map:parameter name="publicationid" value="{1}"/>
237
              <map:parameter name="area" value="{2}"/>
144
              <map:parameter name="area" value="{2}"/>
238
              <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
145
              <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
239
            </map:transform>
146
            </map:transform>
240
<!-- 
147
241
          </map:otherwise>
242
        </map:select>
243
-->
244
        <map:serialize type="xml"/>
148
        <map:serialize type="xml"/>
245
      </map:match>
149
      </map:match>
246
      
150
      
247
    </map:pipeline>
151
    </map:pipeline>
152
153
248
      <!-- menus -->
154
      <!-- menus -->
249
    <map:pipeline>  
155
    <map:pipeline internal-only="true">  
156
250
      <!-- menu-xml/modules -->
157
      <!-- menu-xml/modules -->
251
      <!-- menu-xml/modules/{pub-id}/{area}.xml -->
158
      <!-- menu-xml/modules/{pub-id}/{area}.xml -->
252
      <map:match pattern="menu-xml/modules/*/*.xml">
159
      <map:match pattern="menu-xml/modules/*/*.xml">
Lines 257-265 Link Here
257
        <map:transform type="xinclude"/>
164
        <map:transform type="xinclude"/>
258
        <map:serialize type="xml"/>
165
        <map:serialize type="xml"/>
259
      </map:match>
166
      </map:match>
260
    </map:pipeline>
261
167
262
    <map:pipeline>
263
      <!-- menu-xml/module/{area}/{module-id}.xml -->
168
      <!-- menu-xml/module/{area}/{module-id}.xml -->
264
      <map:match pattern="menu-xml/module/*/*.xml">
169
      <map:match pattern="menu-xml/module/*/*.xml">
265
        <map:select type="resource-exists">
170
        <map:select type="resource-exists">
Lines 354-362 Link Here
354
     <map:match type="usecase" pattern="*">
259
     <map:match type="usecase" pattern="*">
355
       <map:mount uri-prefix="" src="lenya/usecase.xmap" check-reload="true" reload-method="synchron"/>
260
       <map:mount uri-prefix="" src="lenya/usecase.xmap" check-reload="true" reload-method="synchron"/>
356
     </map:match>
261
     </map:match>
357
     
262
358
   </map:pipeline>
263
   </map:pipeline>
359
   
264
360
   <map:pipeline>
265
   <map:pipeline>
361
      <map:match pattern="index.html">
266
      <map:match pattern="index.html">
362
        <map:aggregate element="aggregation-wrapper" label="aggregate">
267
        <map:aggregate element="aggregation-wrapper" label="aggregate">
Lines 420-426 Link Here
420
          <map:part src="lenya/pubs/{1}/config/publication.xml"/>
325
          <map:part src="lenya/pubs/{1}/config/publication.xml"/>
421
        </map:aggregate>
326
        </map:aggregate>
422
        <map:transform src="lenya/xslt/util/introduction.xsl"/>
327
        <map:transform src="lenya/xslt/util/introduction.xsl"/>
423
        <map:call resource="style-cms-page"/>
424
        <map:serialize />
328
        <map:serialize />
425
      </map:match>
329
      </map:match>
426
     
330
     
Lines 433-439 Link Here
433
      </map:match>
337
      </map:match>
434
    </map:pipeline>
338
    </map:pipeline>
435
    
339
    
436
    <map:pipeline>
340
    <map:pipeline type="profile-noncaching">
437
      
341
      
438
      <!-- Resources -->
342
      <!-- Resources -->
439
      
343
      
Lines 468-486 Link Here
468
           <map:generate type="jx" src="lenya/content/exception/publication-does-not-exist.jx">
372
           <map:generate type="jx" src="lenya/content/exception/publication-does-not-exist.jx">
469
             <map:parameter name="publicationId" value="{1}"/>
373
             <map:parameter name="publicationId" value="{1}"/>
470
           </map:generate>
374
           </map:generate>
471
           <map:transform type="i18n">
375
           <map:call resource="i18n"/>
472
             <map:parameter name="locale" value="{request:locale}"></map:parameter>
473
           </map:transform>
474
           <map:call resource="style-cms-page"/>
376
           <map:call resource="style-cms-page"/>
475
           <map:serialize status-code="404" />
377
           <map:serialize status-code="404" />
476
         </map:when>
378
         </map:when>
477
         <map:otherwise>
379
         <map:otherwise>
380
<!--
478
           <map:mount uri-prefix="{1}" src="{fallback:sitemap.xmap}" check-reload="true" reload-method="synchron"/>
381
           <map:mount uri-prefix="{1}" src="{fallback:sitemap.xmap}" check-reload="true" reload-method="synchron"/>
382
-->
383
           <map:generate src="cocoon:/{1}/{2}"/>
384
           <map:call resource="style-cms-page"/>
385
 
386
           <map:serialize type="xhtml"/>
479
         </map:otherwise>
387
         </map:otherwise>
480
       </map:select>
388
       </map:select>
481
     </map:match>
389
     </map:match>
482
   </map:pipeline>
483
390
391
       </map:pipeline>
392
484
</map:pipelines>
393
</map:pipelines>
485
394
486
</map:sitemap>
395
</map:sitemap>

Return to bug 43769