Bug 42457 - [PATCH] remove meta-stylesheet weirdness from src/webapp/lenya/config/sitemap/pipelines.xmap
Summary: [PATCH] remove meta-stylesheet weirdness from src/webapp/lenya/config/sitemap...
Status: NEW
Alias: None
Product: Lenya
Classification: Unclassified
Component: Miscellaneous (show other bugs)
Version: 2.0
Hardware: Other other
: P2 normal
Target Milestone: 2.0.1
Assignee: Lenya Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-19 05:26 UTC by J
Modified: 2007-08-02 14:30 UTC (History)
0 users



Attachments
gets rid of the lenya-screen.xsl stuff altogether (6.10 KB, patch)
2007-05-19 06:09 UTC, J
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description J 2007-05-19 05:26:10 UTC
 
Comment 1 J 2007-05-19 05:38:51 UTC
look at this snippet:

<!-- Lenya GUI screen -->
<map:match pattern="lenya-screen.xsl">
  <map:generate src="fallback://lenya/xslt/util/page2xhtml.xsl"/>
  <map:transform src="lenya/xslt/util/page2xslt.xsl">
    <map:parameter name="contextprefix" value="{request:contextPath}"/>
  </map:transform>
  <map:serialize type="xml"/>
</map:match>

page2xhtml.xsl is a stylesheet that renders a page:page to xhtml.
page2xslt.xsl is an identity stylesheet with one exception:
it matches <xsl:param name="contextprefix"/>, and replaces it with <xsl:param
name="contextprefix" select="$contextprefix"/>.

can i suggest a new bug severity level "howler"?

i don't know what the original intention of this was, but i can't think of
anything that could possibly justify such a baroque extravaganza :P

unless i'm very much mistaken, this whole shebang could be replaced by
  <map:transform  src="fallback://lenya/xslt/util/page2xhtml.xsl"/>
    <map:parameter name="contextprefix" value="{request:contextPath}"/>
  </map:transform>
wherever src="cocoon://lenya-screen.xsl" is used...
Comment 2 J 2007-05-19 06:09:28 UTC
Created attachment 20219 [details]
gets rid of the lenya-screen.xsl stuff altogether

removes lenya-screen.xsl from pipelines.xmap, and replaces all occurences by
direct calls to webapp/lenya/xslt/util/page2xhtml.xsl.
Comment 3 J 2007-05-19 06:12:50 UTC
please review. this patch should not go in before 1.4, as it does not address a
bug and might break stuff for users.

now we have two remaining ways of styling a cms page: a direct call to
webapp/lenya/util/page2xhtml.xsl, and a call to a local resource
"style-cms-page" that is declared in many sitemaps (redundantly). this resource
additionally does an 1i8n transform and strips namespace nodes.

the best solution would be to figure out a way to build a global resource
(currently, you can't use resources defined in other sitemaps unfortunately),
and to use that everywhere.
Comment 4 Andreas Hartmann 2007-05-22 00:17:49 UTC
(In reply to comment #1)

[...]

> unless i'm very much mistaken, this whole shebang could be replaced by
>   <map:transform  src="fallback://lenya/xslt/util/page2xhtml.xsl"/>
>     <map:parameter name="contextprefix" value="{request:contextPath}"/>
>   </map:transform>
> wherever src="cocoon://lenya-screen.xsl" is used...

That approach doesn't scale well. Whenever you change the parameter set of the
page2xhtml.xsl stylesheet, you'd have to update each call to the stylesheet.
Comment 5 Thorsten Scherler 2007-07-16 02:03:36 UTC
Renaming Lenya 1.4 to 2.0
Comment 6 J 2007-08-02 14:30:55 UTC
just as a todo note: this issue could be resolved if we introduced one global
post-processing chain for documentes requested via publication urls. it would
also get rid of the style-cms-page resource which is being duplicated all over
the place. implies that publications must serialize to xml and the global
sitemap must do the post-processing. wdyt?