You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Stephen Winnall <st...@vimia.com> on 2006/01/20 12:15:34 UTC

implementing a CSS pipeline

I am trying to implement my company website using Lenya 1.2.4 on  
Linux. I would claim to
understand Cocoon, but I don't know my way around Lenya yet.

I would like to create a different presentation depending on language  
(graphics
with language text), browser (non-compliance with standards), subject  
(different
colours) etc. My approach in Cocoon would be to create a pipeline:

match **/css/company-*-*-*.css

	// {2} = language
	// {3} = subject
	// {4} = browser

	generate .../company.xml
	transform with i18n using parameter {2}
	transform for subject using parameter {3}
	transform for browser if needed using parameter {4}

	serialize as text/css

What I don't understand is where to embed this in Lenya. I assume  
that it needs
to be part of my publication. Should I put it into resources/shared/ 
css? Which
sitemap should I modify? Or should I create a CSS doctype?

Regards
Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: implementing a CSS pipeline

Posted by Stephen Winnall <st...@vimia.com>.
Thanks a lot for this. I'll try it out as soon as I can.

I've decided to get my basic structure up and running in plain ol'  
Cocoon first to
help clarify (and simplify) my thought processes, and migrate the  
result later to Lenya.
I'll give you more feedback later.

Steve

On 23 Jan 2006, at 00:46, solprovider@apache.org wrote:

> On 1/20/06, Stephen Winnall <st...@vimia.com> wrote:
>> I can't find where to the pipeline to do this. I looked at all the
>> sitemaps in the Lenya delivery:
>> I understood that if I were to put my pipeline into one of the
>> sitemaps in lenya/lenya/pubs/default
>> it should work. I created the following pipeline:
>>
>>              <map:match pattern="vimia/css/*-*-*-*.css">
>>                  <!--
>>                  !  {1}  file name
>>                  !  {2}  language (de|en)
>>                  !  {3}  topic ([1..6])
>>                  !  {4}  browser (1=standards compliant, 2=minimal
>> PC, 3=text, 4=PDA, 5=cell phone)
>>                  -->
>>                  <map:generate type="file" src="resources/shared/css/
>> {1}.xcss" />
>>                  <map:transform type="i18n">
>>                      <map:parameter name="locale" value="{2}" />
>>                  </map:transform>
>>                  <map:transform src="resources/shared/css/{1}.xslt">
>>                      <map:parameter name="topic" value="{3}" />
>>                      <map:parameter name="browser" value="{4}" />
>>                  </map:transform>
>>                  <map:serialize mime-type="text/css" />
>>              </map:match>
>>
>> I have tried it in
>> lenya/lenya/pubs/default/publication-sitemap.xmap
>> lenya/lenya/pubs/default/sitemap.xmap
>> However I can't get Lenya to acknowledge its existence. Calls like
>>         http://public/lenya/default/live/css/vimia-de-1-1.css
>> result in the following response:
>>         The requested document does not exist
>>         The requested document '/css/vimia-de-1-1.css' with  
>> document-id '/
>> css/vimia-de-1-1' does not exist.
>>
>> I get the impression that my <map:match pattern="vimia/css/*-*-*-
>> *.css"> is being masked by something
>> higher up the tree.
>
> URL: http://public/lenya/default/live/css/vimia-de-1-1.css
>
> If the "/lenya" is removed by Tomcat, then it is fine.  Otherwise
> global-sitemap.xmap will be send this to lenya/lenya.xmap.  These is
> code there for global CSS, but that is not what you want.  So remove
> it.
>
> When
>   http://public/default/live/css/vimia-de-1-1.css
> reaches pubs/default/publication-sitemap.xmap, the match is:
>   default/live/css/vimia-de-1-1.css
>
> <map:match pattern="vimia/css/*-*-*-*.css">
> will not match that.  Try:
> <map:match pattern="*/*/css/*-*-*-*.css">
> {1} = pubID "default"
> {2} = area "live"
> {3) = "vimia"
> {4} = language "de"
> {5} = "1"
> {6} = "1"
>
> <map:generate type="file" src="resources/shared/css/{1}.xcss" />
> Assuming the "x" was a typo, change it to:
>   <map:generate type="file" src="resources/shared/css/{3}.css"/>
> To get pubs/default/resources/shared/css/vimia.css
>
> Remove any transformation while testing if your pipeline is working.
> Just finish with a serializer.  type="text" is necessary because Lenya
> defaults to type="html".
>
> *** SOLUTION ***
> FILE: {pub}/publication-sitemap.xmap
> <map:match pattern="*/*/css/*-*-*-*.css">
>   <map:generate type="file" src="resources/shared/css/{3}.css"/>
>   <map:serialize type="text" mime-type="text/css"/>
> </map:match>
>
> URL: http://public/default/live/css/vimia-de-1-1.css
> returns
> FILE: {pub}/resources/shared/css/vimia.css
>
> solprovider
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: implementing a CSS pipeline

Posted by so...@apache.org.
On 1/20/06, Stephen Winnall <st...@vimia.com> wrote:
> I can't find where to the pipeline to do this. I looked at all the
> sitemaps in the Lenya delivery:
> I understood that if I were to put my pipeline into one of the
> sitemaps in lenya/lenya/pubs/default
> it should work. I created the following pipeline:
>
>              <map:match pattern="vimia/css/*-*-*-*.css">
>                  <!--
>                  !  {1}  file name
>                  !  {2}  language (de|en)
>                  !  {3}  topic ([1..6])
>                  !  {4}  browser (1=standards compliant, 2=minimal
> PC, 3=text, 4=PDA, 5=cell phone)
>                  -->
>                  <map:generate type="file" src="resources/shared/css/
> {1}.xcss" />
>                  <map:transform type="i18n">
>                      <map:parameter name="locale" value="{2}" />
>                  </map:transform>
>                  <map:transform src="resources/shared/css/{1}.xslt">
>                      <map:parameter name="topic" value="{3}" />
>                      <map:parameter name="browser" value="{4}" />
>                  </map:transform>
>                  <map:serialize mime-type="text/css" />
>              </map:match>
>
> I have tried it in
> lenya/lenya/pubs/default/publication-sitemap.xmap
> lenya/lenya/pubs/default/sitemap.xmap
> However I can't get Lenya to acknowledge its existence. Calls like
>         http://public/lenya/default/live/css/vimia-de-1-1.css
> result in the following response:
>         The requested document does not exist
>         The requested document '/css/vimia-de-1-1.css' with document-id '/
> css/vimia-de-1-1' does not exist.
>
> I get the impression that my <map:match pattern="vimia/css/*-*-*-
> *.css"> is being masked by something
> higher up the tree.

URL: http://public/lenya/default/live/css/vimia-de-1-1.css

If the "/lenya" is removed by Tomcat, then it is fine.  Otherwise
global-sitemap.xmap will be send this to lenya/lenya.xmap.  These is
code there for global CSS, but that is not what you want.  So remove
it.

When
  http://public/default/live/css/vimia-de-1-1.css
reaches pubs/default/publication-sitemap.xmap, the match is:
  default/live/css/vimia-de-1-1.css

<map:match pattern="vimia/css/*-*-*-*.css">
will not match that.  Try:
<map:match pattern="*/*/css/*-*-*-*.css">
{1} = pubID "default"
{2} = area "live"
{3) = "vimia"
{4} = language "de"
{5} = "1"
{6} = "1"

<map:generate type="file" src="resources/shared/css/{1}.xcss" />
Assuming the "x" was a typo, change it to:
  <map:generate type="file" src="resources/shared/css/{3}.css"/>
To get pubs/default/resources/shared/css/vimia.css

Remove any transformation while testing if your pipeline is working. 
Just finish with a serializer.  type="text" is necessary because Lenya
defaults to type="html".

*** SOLUTION ***
FILE: {pub}/publication-sitemap.xmap
<map:match pattern="*/*/css/*-*-*-*.css">
  <map:generate type="file" src="resources/shared/css/{3}.css"/>
  <map:serialize type="text" mime-type="text/css"/>
</map:match>

URL: http://public/default/live/css/vimia-de-1-1.css
returns
FILE: {pub}/resources/shared/css/vimia.css

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: implementing a CSS pipeline

Posted by Stephen Winnall <st...@vimia.com>.
I can't find where to the pipeline to do this. I looked at all the  
sitemaps in the Lenya delivery:

lenya/lenya/lucene.xmap
lenya/lenya/xopus.xmap
lenya/lenya/resources.xmap
lenya/lenya/lenya.xmap
lenya/lenya/info.xmap
lenya/lenya/i18n.xmap
lenya/lenya/import.xmap
lenya/lenya/pubs/blog/usecase-create.xmap
lenya/lenya/pubs/blog/atomapi.xmap
lenya/lenya/pubs/blog/webdav.xmap
lenya/lenya/pubs/blog/parameter-doctype.xmap
lenya/lenya/pubs/blog/menus.xmap
lenya/lenya/pubs/blog/sitemap.xmap
lenya/lenya/pubs/default/usecase-bxeng.xmap
lenya/lenya/pubs/default/parameter-doctype.xmap
lenya/lenya/pubs/default/publication-sitemap.xmap
lenya/lenya/pubs/default/menus.xmap
lenya/lenya/pubs/default/usecase-search.xmap
lenya/lenya/pubs/default/sitemap.xmap
lenya/lenya/pubs/default/doctypes.xmap
lenya/lenya/resources-shared.xmap
lenya/lenya/admin.xmap
lenya/lenya/navigation.xmap
lenya/lenya/usecase.xmap
lenya/lenya/usecases/edit/usecase-edit.xmap
lenya/lenya/usecases/1formedit/usecase-1formedit.xmap
lenya/lenya/usecases/kupu/usecase-kupu.xmap
lenya/lenya/scheduler.xmap
lenya/._sitemap.xmap
lenya/global-sitemap.xmap
lenya/test-suite/sitemap.xmap
lenya/sitemap.xmap

I understood that if I were to put my pipeline into one of the  
sitemaps in lenya/lenya/pubs/default
it should work. I created the following pipeline:

             <map:match pattern="vimia/css/*-*-*-*.css">
                 <!--
                 !  {1}  file name
                 !  {2}  language (de|en)
                 !  {3}  topic ([1..6])
                 !  {4}  browser (1=standards compliant, 2=minimal  
PC, 3=text, 4=PDA, 5=cell phone)
                 -->
                 <map:generate type="file" src="resources/shared/css/ 
{1}.xcss" />
                 <map:transform type="i18n">
                     <map:parameter name="locale" value="{2}" />
                 </map:transform>
                 <map:transform src="resources/shared/css/{1}.xslt">
                     <map:parameter name="topic" value="{3}" />
                     <map:parameter name="browser" value="{4}" />
                 </map:transform>
                 <map:serialize mime-type="text/css" />
             </map:match>

I have tried it in

lenya/lenya/pubs/default/publication-sitemap.xmap
lenya/lenya/pubs/default/sitemap.xmap

and also in a sub-sitemap I mounted under lenya/lenya/pubs/default.
However I can't get Lenya to acknowledge its existence. Calls like

	http://public/lenya/default/live/css/vimia-de-1-1.css

result in the following response:

	The requested document does not exist
	The requested document '/css/vimia-de-1-1.css' with document-id '/ 
css/vimia-de-1-1' does not exist.

I get the impression that my <map:match pattern="vimia/css/*-*-*- 
*.css"> is being masked by something
higher up the tree.

I thought I understood Cocoon, but I realise now that writing your  
own and using someone else's stuff
are rather different :-)

Can anyone give me a bit of guidance please?

Steve

On 20 Jan 2006, at 14:14, Andreas Hartmann wrote:

> Stephen Winnall wrote:
>> I am trying to implement my company website using Lenya 1.2.4 on  
>> Linux. I would claim to
>> understand Cocoon, but I don't know my way around Lenya yet.
>> I would like to create a different presentation depending on  
>> language (graphics
>> with language text), browser (non-compliance with standards),  
>> subject (different
>> colours) etc. My approach in Cocoon would be to create a pipeline:
>> match **/css/company-*-*-*.css
>>     // {2} = language
>>     // {3} = subject
>>     // {4} = browser
>>     generate .../company.xml
>>     transform with i18n using parameter {2}
>>     transform for subject using parameter {3}
>>     transform for browser if needed using parameter {4}
>>     serialize as text/css
>> What I don't understand is where to embed this in Lenya. I assume  
>> that it needs
>> to be part of my publication.
>
> Yes, certainly.
>
>> Should I put it into resources/shared/css?
>
> That's what I usually do. I add a pipeline to the main sitemap (or  
> create
> an extra sitemap for such resources), and put the XSLT and the
> CSS XML in the resources/shared/css directory.
>
> IMO Lenya should provide a sophisticated mechanism to support this
> functionality. There is already a pipeline for dynamic CSS generation
> in resources.xmap and resources-shared.xmap, but it doesn't allow
> custom parameters yet.
>
> -- Andreas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: implementing a CSS pipeline

Posted by Andreas Hartmann <an...@apache.org>.
Stephen Winnall wrote:
> I am trying to implement my company website using Lenya 1.2.4 on Linux. 
> I would claim to
> understand Cocoon, but I don't know my way around Lenya yet.
> 
> I would like to create a different presentation depending on language 
> (graphics
> with language text), browser (non-compliance with standards), subject 
> (different
> colours) etc. My approach in Cocoon would be to create a pipeline:
> 
> match **/css/company-*-*-*.css
> 
>     // {2} = language
>     // {3} = subject
>     // {4} = browser
> 
>     generate .../company.xml
>     transform with i18n using parameter {2}
>     transform for subject using parameter {3}
>     transform for browser if needed using parameter {4}
> 
>     serialize as text/css
> 
> What I don't understand is where to embed this in Lenya. I assume that 
> it needs
> to be part of my publication.

Yes, certainly.

> Should I put it into resources/shared/css? 

That's what I usually do. I add a pipeline to the main sitemap (or create
an extra sitemap for such resources), and put the XSLT and the
CSS XML in the resources/shared/css directory.

IMO Lenya should provide a sophisticated mechanism to support this
functionality. There is already a pipeline for dynamic CSS generation
in resources.xmap and resources-shared.xmap, but it doesn't allow
custom parameters yet.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org