[Osr-101] Re: [Yulup] CSS support?

Thomas Comiotto comiotto at rcfmedia.ch
Tue Jan 30 10:33:00 CET 2007


Hi Michi,


The unizh publication uses it. You might want to checkout the  
corresponding code.

Below the relevant text parts taken from http://neutron.wyona.org/ 
osr-101.xhtml. Here's a short explanation - I'm sure we can find  
better terms to coin the issue.

Many CMS systems do content aggregation before doing the  
document2xhtml transformation step, so the corresponding stylesheets  
are coded with respect to the aggregated document, not the actual  
"document source".

Other systems do an document2xhtml transform and then further  
aggregate the resulting xhtml with xhtml-snippets representing menus,  
headers etc. A prominent example for this is Zope/Silva.

To allow for reuse of existing document styles (xslt or css) and at  
the same time providing users with true WYSIWYG editing Neutron needs  
a way of telling the client if and how the document source has to be  
aggregated before/after applying stylesheets. The client might  
support that szenario or not. Yulup currently supports content  
aggregation _before applying a xslt stylesheet (because that's what  
the University of Zuerich needs:).

I am a bit unhappy with the term "view template" that I introduced  
once for that. I'd rather use the term "client side content  
aggregation" (but note that the aggregation refered to here is only  
relevant for the view!). Currently "view templates" use xinclude  
directives to mark insert points of aggregated content.

On the other hand one could also use the notion of "document  
bindings" (along the lines of XBL 2.0). BUT: shadow content is  
ignored for document processing like xslt transforms by spec I think.  
For CSS styling XBL 2.0 would be just fine.


Bests
Thomas







===

Document parts needed for WYSIWYG-editing but resulting form server  
side processing such as headers, menus, footers etc. are provided to  
the client-side application by declaring a view template. View  
templates contain xi:include directives for inclusion of editable  
resources. A view template typically consist of custom data  
surrounding xi:include directives that reference static and therfore  
editable resources. Styling directives given in the introspection  
file are ment to be applied to the view template (if present) after  
the xi:include directives contained have been resolved by the client  
side application.
Example - View Template

<page>
   <head>
     <title>A document title</title>
   </head>
   <menu>
     <item uri="index.html"/>
     <item uri="hello.html" selected="selected"/>
   </menu>
   <content>
     <xi:include href="hello.xml"/>
   </content>
</page>

Example - Declaring a View Template in a Introspection File

<introspection>
   <edit>
     <open url="hello.xml"/>
     <style mode="xslt" url="page.xsl">
       <template url="hello-template.xml"/>
     </style>
   </edit>
</introspection>

View templates can be shared between multiple resources. This is  
needed in situations where a processed resource consists of several  
otherwise unrelated resources - for instance a xml-based resource  
being transformed to a single html page after having aggregated a  
couple of rss-feeds. A view template is considered a shared template  
if the template directives of individual resources listed in the  
introspection file point to the same view template. Shared view  
templates need to include all relevant resources by providing  
xi:include directives for all those resources.
Example - shared View template

<page>
   <head>
     <title>A document containinig a rss feed</title>
   </head>
   <menu>
     <item uri="index.html"/>
     <item uri="hello.html" selected="selected"/>
   </menu>
   <sidebar>
     <xi:include href="feed.xml"/>
   </sidebar>
   <content>
     <xi:include href="hello.xml"/>
   </content>
</page>

Example - sharing a View template

<introspection>
   <edit>
     <open url="hello.xml"/>
     <style mode="xslt" url="page.xsl">
       <template url="hellotemplate.xml"/>
     </style>
   </edit>
   <edit>
     <open url="feed.xml"/>
     <style>
       <template url="hellotemplate.xml"/>
     </style>
   </edit>
</introspection>















On Jan 30, 2007, at 9:57 AM, Michael Wechner wrote:

> Thomas Comiotto wrote:
>
>> Hi all,
>>
>>>>>>
>>>>>> The basic problem is that the document source itself doesn't
>>>>>> contain the CSS reference. I guess this applies to various CMS
>>>>>> due to the separation between content and layout.
>>>>>>
>>
>>
>> I think this can be easily solved by aggregating view specific   
>> content on the client side, aka "style templates" (covered in the   
>> spec somewhere
>
>
> you mean the original draft, right? Can you send a pointer to the  
> section where this is being described or resend how you think it  
> should be done?
>
>> - btw I think we should rename that feature to   "content  
>> aggregation"). The lenya 1.2 Neutron implementation has  support  
>> for this.
>
>
> Is there a URL within Lenya 1.2 where this can be tested (e.g.  
> default publication)?
>
> Thanks
>
> Michi
>
>> Yulup (at least the WYSIWYG XSLT view) too.
>>
>> Bests,
>> Thomas
>>
>>
>>
>
>
> -- 
> Michael Wechner
> Wyona      -   Open Source Content Management   -    Apache Lenya
> http://www.wyona.com                      http://lenya.apache.org
> michael.wechner at wyona.com                        michi at apache.org
> +41 44 272 91 61
>
>




More information about the Osr-101 mailing list