You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Bart van Dijk <Ba...@Unilever.com> on 2005/07/07 10:23:04 UTC
Using custom XML style sheets for exporting
Hi,
I want to use the export function to produce two different websites based on
the same information. The content is more or less the same but the layout
differs. Also, using only CSS is not sufficient. Therefore I was thinking of
using two different XML stylesheets (for example page2xhtml-export1.xsl and
page2xhtml-export2.xsl) but I don't know how to configure the export
function for using different stylesheets. Is it possible to do something
like this?
<task id="export"
class="org.apache.lenya.cms.publishing.StaticHTMLExporter">
<parameter name="export-path" value="work/export/export1"/>
<parameter name="stylesheet" value="page2xhtml-export1.xsl"/>
</task>
<task id="export"
class="org.apache.lenya.cms.publishing.StaticHTMLExporter">
<parameter name="export-path" value="work/export/export2"/>
<parameter name="stylesheet" value="page2xhtml-export2.xsl"/>
</task>
Regards,
Bart
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Using custom XML style sheets for exporting
Posted by so...@gmail.com.
On 7/11/05, Bart van Dijk <Ba...@unilever.com> wrote:
> Thanks! I've already implemented the parameter-selector and this works fine.
> But now I want to export my website to two different directories using two
> different stylesheets and so far I've not mamanged to export pages with
> different stylesheets. Do you also have a solution for this? Do you think
> the cocoon-views method will work?
I looked at your first post. You probably want different task id names.
An "export" is usually a directory crawler. The examples you gave
specify the stylesheet. If that is true, it should bypass the XMAPs,
making cocoon-views and most of what we discussed irrelevant. All you
need is a crawler with a transformer. Crawlers are easy to write in
every OS's commandline/shell/batch language. Just make a list of every
XML file under {pub}/content/live, then loop each one through a
transformer with the output under another directory name. Anybody
know a command line transformer that takes an input file, an XSL file,
and an output filename? Does the export utility have one?
> By the way, there's a lot of useful information on your website! Good job!
Thanks. It's my second brain. I document everything, but I may not
be able to find it if I don't add it to the website. The website
keeps everything organized.
I have not thought about exporting. Our site went live this weekend,
and we are still adding content. The visitor functionality may be
finished; I hope making Flow use i18n was the last hole. Now I am
working on making the CMS GUI usable by human beings.
solprovider
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
RE: Using custom XML style sheets for exporting
Posted by Bart van Dijk <Ba...@Unilever.com>.
Hi Solprovider!
Thanks! I've already implemented the parameter-selector and this works fine.
But now I want to export my website to two different directories using two
different stylesheets and so far I've not mamanged to export pages with
different stylesheets. Do you also have a solution for this? Do you think
the cocoon-views method will work?
By the way, there's a lot of useful information on your website! Good job!
Bart
-----Original Message-----
From: user-return-7564-Bart-van.Dijk=unilever.com@lenya.apache.org
[mailto:user-return-7564-Bart-van.Dijk=unilever.com@lenya.apache.org]On
Behalf Of solprovider@gmail.com
Sent: Friday, July 08, 2005 14:07
To: user@lenya.apache.org
Subject: Re: Using custom XML style sheets for exporting
Cocoon Views are GOTOs in a Sitemap. The page starts processing
normally, then jumps to the <map:view name="otherxsl"> when it hits
the label="otherxsl". See:
http://solprovider.com/lenya/views
Alternate URLs need ?cocoon-view=mystylesheet
Using the parameter selector is demonstrated at:
http://solprovider.com/lenya/multipleold
Alternate URLs need ?xsl=mystylesheet
A generic usecase for multiple stylesheets is at:
http://solprovider.com/lenya/multiple
Alternate URLs need ?lenya.usecase=xsl&xsl=mystylesheet
All three methods work. A View exits the normal pipeline, so you have
to reproduce all the code after the GOTO. The parameter selector
makes a mess in the middle of your pipeline. The usecase does most of
the work in a separate file, so it is the easiest to maintain.
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: Using custom XML style sheets for exporting
Posted by so...@gmail.com.
Cocoon Views are GOTOs in a Sitemap. The page starts processing
normally, then jumps to the <map:view name="otherxsl"> when it hits
the label="otherxsl". See:
http://solprovider.com/lenya/views
Alternate URLs need ?cocoon-view=mystylesheet
Using the parameter selector is demonstrated at:
http://solprovider.com/lenya/multipleold
Alternate URLs need ?xsl=mystylesheet
A generic usecase for multiple stylesheets is at:
http://solprovider.com/lenya/multiple
Alternate URLs need ?lenya.usecase=xsl&xsl=mystylesheet
All three methods work. A View exits the normal pipeline, so you have
to reproduce all the code after the GOTO. The parameter selector
makes a mess in the middle of your pipeline. The usecase does most of
the work in a separate file, so it is the easiest to maintain.
solprovider
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Using custom XML style sheets for exporting
Posted by Michael Wechner <mi...@wyona.com>.
Bart van Dijk wrote:
>Hi Michi!
>
>Thank you, I've tried to implement the code, but I can't get it working.
>Maybe you can help me a little more? Sorry, I'm not a Lenya expert...
>
>
>I've added this parameter in the tasks.xconf:
>
> <parameter name="cocoon-view" value="external"/>
>
>
this parameter needs to be passed to the actual Java class
org.apache.lenya.cms.publishing.StaticHTMLExporter
which means this class would need to be patched/enhanced slightly
by addind the cocoon-view parameter to the URL
>Now I want to add changes in the pipeline that builds the page in
>publication-sitemap.xmap, like this
>
>
I actually meant real cocoon-views:
<map:views>
<map:view from-label ....
HTH
Michi
><map:select type="parameter">
> <map:parameter name="parameter-selector-test" value="{cocoon-view}"/>
> <!-- executes iff the value of cocoon-view equals
> "external" (without quotes) -->
> <map:when test="external">
> <map:transform src="xslt/page2xhtml-external.xsl">
> <map:parameter name="root"
>value="{page-envelope:context-prefix}/{2}/{3}"/>
> <map:parameter name="url" value="{5}"/>
> <map:parameter name="document-id" value="{page-envelope:document-id}"/>
> <map:parameter name="document-type"
>value="{page-envelope:document-type}"/>
> <map:parameter name="language" value="{page-envelope:document-language}"/>
> </map:transform>
> </map:when>
></map:select>
>
>Is this code wrong or am I supposed to move this code to another pipeline?
>
>I hope you can help me,
>Bart
>
>
>-----Original Message-----
>From: user-return-7535-Bart-van.Dijk=unilever.com@lenya.apache.org
>[mailto:user-return-7535-Bart-van.Dijk=unilever.com@lenya.apache.org]On
>Behalf Of Michael Wechner
>Sent: Thursday, July 07, 2005 10:39
>To: user@lenya.apache.org
>Subject: Re: Using custom XML style sheets for exporting
>
>
>Bart van Dijk wrote:
>
>
>
>>Hi,
>>
>>I want to use the export function to produce two different websites based
>>
>>
>on
>
>
>>the same information. The content is more or less the same but the layout
>>differs. Also, using only CSS is not sufficient. Therefore I was thinking
>>
>>
>of
>
>
>>using two different XML stylesheets (for example page2xhtml-export1.xsl and
>>page2xhtml-export2.xsl) but I don't know how to configure the export
>>function for using different stylesheets. Is it possible to do something
>>like this?
>>
>>
>>
>>
>
>I think it makes more sense to enhance it by a cocoon view
>parameter, e.g.
>
><parameter name="cocoon-view" value="export2"/>
>
>whereas the cocoon-view would have to be implemented into
>the sitemap of course.
>
>Makes sense?
>
>Michi
>
>
>
>> <task id="export"
>>class="org.apache.lenya.cms.publishing.StaticHTMLExporter">
>> <parameter name="export-path" value="work/export/export1"/>
>> <parameter name="stylesheet" value="page2xhtml-export1.xsl"/>
>> </task>
>>
>> <task id="export"
>>class="org.apache.lenya.cms.publishing.StaticHTMLExporter">
>> <parameter name="export-path" value="work/export/export2"/>
>> <parameter name="stylesheet" value="page2xhtml-export2.xsl"/>
>> </task>
>>
>>
>>Regards,
>>Bart
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>>For additional commands, e-mail: user-help@lenya.apache.org
>>
>>
>>
>>
>>
>>
>
>
>--
>Michael Wechner
>Wyona - Open Source Content Management - Apache Lenya
>http://www.wyona.com http://lenya.apache.org
>michael.wechner@wyona.com michi@apache.org
>
>
>---------------------------------------------------------------------
>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
>
>
>
>
--
Michael Wechner
Wyona - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
RE: Using custom XML style sheets for exporting
Posted by Bart van Dijk <Ba...@Unilever.com>.
Hi Michi!
Thank you, I've tried to implement the code, but I can't get it working.
Maybe you can help me a little more? Sorry, I'm not a Lenya expert...
I've added this parameter in the tasks.xconf:
<parameter name="cocoon-view" value="external"/>
Now I want to add changes in the pipeline that builds the page in
publication-sitemap.xmap, like this
<map:select type="parameter">
<map:parameter name="parameter-selector-test" value="{cocoon-view}"/>
<!-- executes iff the value of cocoon-view equals
"external" (without quotes) -->
<map:when test="external">
<map:transform src="xslt/page2xhtml-external.xsl">
<map:parameter name="root"
value="{page-envelope:context-prefix}/{2}/{3}"/>
<map:parameter name="url" value="{5}"/>
<map:parameter name="document-id" value="{page-envelope:document-id}"/>
<map:parameter name="document-type"
value="{page-envelope:document-type}"/>
<map:parameter name="language" value="{page-envelope:document-language}"/>
</map:transform>
</map:when>
</map:select>
Is this code wrong or am I supposed to move this code to another pipeline?
I hope you can help me,
Bart
-----Original Message-----
From: user-return-7535-Bart-van.Dijk=unilever.com@lenya.apache.org
[mailto:user-return-7535-Bart-van.Dijk=unilever.com@lenya.apache.org]On
Behalf Of Michael Wechner
Sent: Thursday, July 07, 2005 10:39
To: user@lenya.apache.org
Subject: Re: Using custom XML style sheets for exporting
Bart van Dijk wrote:
>Hi,
>
>I want to use the export function to produce two different websites based
on
>the same information. The content is more or less the same but the layout
>differs. Also, using only CSS is not sufficient. Therefore I was thinking
of
>using two different XML stylesheets (for example page2xhtml-export1.xsl and
>page2xhtml-export2.xsl) but I don't know how to configure the export
>function for using different stylesheets. Is it possible to do something
>like this?
>
>
I think it makes more sense to enhance it by a cocoon view
parameter, e.g.
<parameter name="cocoon-view" value="export2"/>
whereas the cocoon-view would have to be implemented into
the sitemap of course.
Makes sense?
Michi
> <task id="export"
>class="org.apache.lenya.cms.publishing.StaticHTMLExporter">
> <parameter name="export-path" value="work/export/export1"/>
> <parameter name="stylesheet" value="page2xhtml-export1.xsl"/>
> </task>
>
> <task id="export"
>class="org.apache.lenya.cms.publishing.StaticHTMLExporter">
> <parameter name="export-path" value="work/export/export2"/>
> <parameter name="stylesheet" value="page2xhtml-export2.xsl"/>
> </task>
>
>
>Regards,
>Bart
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>For additional commands, e-mail: user-help@lenya.apache.org
>
>
>
>
--
Michael Wechner
Wyona - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
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: Using custom XML style sheets for exporting
Posted by Bart van Dijk <Ba...@Unilever.com>.
Yes, that makes more sense indeed, but I guess there's no standard way of
configuring the export function then? I also couldn't find that much
documentation on the Lenya website about the StaticHTMLExporter. Is there
more to configure instead of only the server-uri, server-port,
publication-id, export-path-prefix, uris and substitute-regexp? And where
can I find more docs on how to export files (if there is)?
Bart
-----Original Message-----
From: user-return-7535-Bart-van.Dijk=unilever.com@lenya.apache.org
[mailto:user-return-7535-Bart-van.Dijk=unilever.com@lenya.apache.org]On
Behalf Of Michael Wechner
Sent: Thursday, July 07, 2005 10:39
To: user@lenya.apache.org
Subject: Re: Using custom XML style sheets for exporting
Bart van Dijk wrote:
>Hi,
>
>I want to use the export function to produce two different websites based
on
>the same information. The content is more or less the same but the layout
>differs. Also, using only CSS is not sufficient. Therefore I was thinking
of
>using two different XML stylesheets (for example page2xhtml-export1.xsl and
>page2xhtml-export2.xsl) but I don't know how to configure the export
>function for using different stylesheets. Is it possible to do something
>like this?
>
>
I think it makes more sense to enhance it by a cocoon view
parameter, e.g.
<parameter name="cocoon-view" value="export2"/>
whereas the cocoon-view would have to be implemented into
the sitemap of course.
Makes sense?
Michi
> <task id="export"
>class="org.apache.lenya.cms.publishing.StaticHTMLExporter">
> <parameter name="export-path" value="work/export/export1"/>
> <parameter name="stylesheet" value="page2xhtml-export1.xsl"/>
> </task>
>
> <task id="export"
>class="org.apache.lenya.cms.publishing.StaticHTMLExporter">
> <parameter name="export-path" value="work/export/export2"/>
> <parameter name="stylesheet" value="page2xhtml-export2.xsl"/>
> </task>
>
>
>Regards,
>Bart
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>For additional commands, e-mail: user-help@lenya.apache.org
>
>
>
>
--
Michael Wechner
Wyona - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
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: Using custom XML style sheets for exporting
Posted by Michael Wechner <mi...@wyona.com>.
Bart van Dijk wrote:
>Hi,
>
>I want to use the export function to produce two different websites based on
>the same information. The content is more or less the same but the layout
>differs. Also, using only CSS is not sufficient. Therefore I was thinking of
>using two different XML stylesheets (for example page2xhtml-export1.xsl and
>page2xhtml-export2.xsl) but I don't know how to configure the export
>function for using different stylesheets. Is it possible to do something
>like this?
>
>
I think it makes more sense to enhance it by a cocoon view
parameter, e.g.
<parameter name="cocoon-view" value="export2"/>
whereas the cocoon-view would have to be implemented into
the sitemap of course.
Makes sense?
Michi
> <task id="export"
>class="org.apache.lenya.cms.publishing.StaticHTMLExporter">
> <parameter name="export-path" value="work/export/export1"/>
> <parameter name="stylesheet" value="page2xhtml-export1.xsl"/>
> </task>
>
> <task id="export"
>class="org.apache.lenya.cms.publishing.StaticHTMLExporter">
> <parameter name="export-path" value="work/export/export2"/>
> <parameter name="stylesheet" value="page2xhtml-export2.xsl"/>
> </task>
>
>
>Regards,
>Bart
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>For additional commands, e-mail: user-help@lenya.apache.org
>
>
>
>
--
Michael Wechner
Wyona - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org