You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Jonathan Linczak <li...@hiram.edu> on 2004/08/12 15:47:20 UTC

XSP and Lenya

OK, silly question:  I'm using XSP and ESQL to gather content from a 
database and display it on a page.  I've been doing this successfully 
for a few weeks without issue, but how exactly do I integrate it with 
Lenya? I saw the OSCOM publication had customized menus in Lenya that 
added a new item in the database, and when it was added, it brought you 
back to the main page, where the new item was displayed with the 
others.  Was that XSP or something completely different?

Jon


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


Re: XSP and Lenya

Posted by Andreas Hartmann <an...@apache.org>.
Andreas Hartmann wrote:
[...]
> 
> 
> I think it would make sense to separate the dynamic from the static
> parts of the page. For editing, only the static XML is used. For
> presentation, it is combined with the static part

Sorry, that should read "dynamic part" of course.
-- Andreas

> (either using
> aggregation or CInclude / XInclude).
> 
> This would mean you have two files:
> 
> - dynamic.xsp
> - content.xml
> 
> and a pipeline and some XSLT which combines them and produces the
> appropriate content document including dynamic parts for presentation.
> 
> -- Andreas


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


Re: XSP and Lenya

Posted by Andreas Hartmann <an...@apache.org>.
Jonathan Linczak wrote:

[...]
> 
> OK, I think my question came out wrong... basically, I've created an XSP 
> file that uses ESQL to gather contents from a database.  But, even if it 
> doesn't grab contents of a database, and it's a simple XSP file that 
> displays the current date and time, it's the process of integrating the 
> XSP file itself into Lenya.
> 
> So, for example, I create an XSP file that spits out the current date 
> and time, the only dynamic part of the page, and then everything else on 
> the page is text that I want to edit in the body of the document.  Right 
> now, if I create a page using Lenya, it's a simple XML file that's 
> serialized to HTML or XHTML.  What if there was a way to point Lenya to 
> an XSP file and have the results of the XSP file after processing appear 
> as a page in Lenya that I can manipulate?  So, the dynamic content 
> created won't be edited, but anything within the body of the document 
> can be edited with BXE or Kupu.  Is something like that possible?
> 
> Right now, we are creating our XSP files and creating pipelines for them 
> manually, but there's no way to bring it into Lenya so that the dynamic 
> content is generated on the page, and we still have access to our 
> editable region.  So, we just link to it manually and make all of our 
> stylings for the page manually as well.  Does that make sense?

I think it would make sense to separate the dynamic from the static
parts of the page. For editing, only the static XML is used. For
presentation, it is combined with the static part (either using
aggregation or CInclude / XInclude).

This would mean you have two files:

- dynamic.xsp
- content.xml

and a pipeline and some XSLT which combines them and produces the
appropriate content document including dynamic parts for presentation.

-- Andreas


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


Re: XSP and Lenya

Posted by Andreas Hartmann <an...@apache.org>.
Jonathan Linczak wrote:

> On Aug 13, 2004, at 10:21 AM, Gregor J. Rothfuss wrote:
> 
>> Jonathan Linczak wrote:
>>
>> > org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
>> > org.xml.sax.SAXException: Unknown XInclude element xi:fallback at
>> > unknown location
>> >
>> > I thought xi:fallback was in the specs for XInclude, no?
>>
>> might be a bug in the cocoon xinclude support :)
> 
> 
> 
> Well that's not encouraging... :)  Maybe it's not possible to have an 
> XInclude statement in an XSLT stylesheet?  I'm trying now with CInclude 
> to see if I can get some basic functionality,

In my experience CInclude works very well.

> but can I have a CInclude 
> statement in an XSLT stylesheet either?

Sure, that shouldn't be a problem.

-- Andreas


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


Re: XSP and Lenya

Posted by Jonathan Linczak <li...@hiram.edu>.
On Aug 13, 2004, at 1:36 PM, Jonathan Linczak wrote:

> By the by, I got CInclude working now that I understand it better from 
> Jeremy Aston's book on Cocoon.  I have it working from the actual XML 
> file in the content directory, and it is reading in an XML file.  Next 
> is testing it with XSP, and finally, moving the CInclude to the XSLT 
> stylesheet and bringing it in that way.  If I get it to work, I'll 
> post it here.  Thanks!


I got this to work, adding the XSP to a stylesheet and displaying it on 
the page in Lenya.  It's actually very easy to do.  Here's the problem: 
I brought in a simple XSP file that spits out the current date.  When 
refreshing, I would expect that the date would change, but it doesn't, 
which made me realize that caching could be an issue here...  is that 
the case?  I could probably turn off caching, but will that really take 
up a lot of processing?  Or am I missing something else now?

Jon


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


Re: XSP and Lenya

Posted by Jonathan Linczak <li...@hiram.edu>.
On Aug 13, 2004, at 11:19 AM, Jonathan Linczak wrote:
>
> Oh, and I added the pipeline that you gave:
>
> <pipeline>
> 	<map:match pattern="*.txt">
> 		<map:read src="test.txt" mime-type="text/plain"/>
> 	</map:match>
> </pipeline>
>
> and added a test.txt file in the publication root directory.


By the by, I got CInclude working now that I understand it better from 
Jeremy Aston's book on Cocoon.  I have it working from the actual XML 
file in the content directory, and it is reading in an XML file.  Next 
is testing it with XSP, and finally, moving the CInclude to the XSLT 
stylesheet and bringing it in that way.  If I get it to work, I'll post 
it here.  Thanks!

Jon


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


Re: XSP and Lenya

Posted by Jonathan Linczak <li...@hiram.edu>.
On Aug 13, 2004, at 11:13 AM, Jonathan Linczak wrote:

> Unfortunately, it doesn't seem to be working.  Let me lay this out to  
> see if I am missing anything:
>
> 1.  Added the CInclude namespace to the page2xhtml.xsl file in  
> <pub>/xslt/:  xmlns:cinclude="http://apache.org/cocoon/include/1.0"
>
> 2.  Added a simple Cinclude tag after the apply-templates tag for the  
> body, to bring in some text:
>
> 	<cinclude:include src="cocoon:/test.txt"/>
>
> 3.  Created a new text file called test.txt and put it in the  
> <pub>/xslt directory
>
> 4.  Edited the publication-sitemap.xmap by first adding the following  
> component:
>
> 	<map:transformers default="xslt">
> 		<map:transformer name="cinclude"  
> src="org.apache.cocoon.transformation.CIncludeTransformer"/>
> 	</map:transformers>
>
> 5.  Edited the publication-sitemap.xmap file by adding the following  
> transform to the main pipeline (the whole pipeline is displayed  
> below):
>
> 	<map:pipeline>
> 		<!-- /lenyabody-{rendertype}/{publication-id}/{area}/{doctype}/{url}  
> -->
> 		<map:match pattern="lenyabody-*/*/*/*/**">
> 			<map:aggregate element="cmsbody">
> 				<map:part src="cocoon://navigation/{2}/{3}/breadcrumb/{5}.xml"/>
> 				<map:part src="cocoon://navigation/{2}/{3}/tabs/{5}.xml"/>
> 				<map:part src="cocoon://navigation/{2}/{3}/menu/{5}.xml"/>
> 				<map:part src="cocoon://navigation/{2}/{3}/search/{5}.xml"/>
> 				<map:part  
> src="cocoon:/lenya-document-{1}/{3}/{4}/{page-envelope:document- 
> path}"/>
> 			</map:aggregate>
> 			<map:transform src="xslt/page2xhtml.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:transform>
>
> 			<!-- here's where the CIncludeTransformer is used, after the XSLT  
> Transformation -->
> 			<map:transform type="cinclude"/>
> 			<!-- end CInclude -->
>
> 			<map:select type="parameter">
> 				<map:parameter name="parameter-selector-test" value="{1}"/>
> 				<map:when test="view">
> 					<map:transform type="link-rewrite"/>
> 				</map:when>
> 			</map:select>
> 		<map:serialize type="xml"/>
> 		</map:match>
> 	</map:pipeline>
>
> 6.  I go the page, and nothing shows up once again.  I swear it's  
> pointing to the right XSLT stylesheet too!


Oh, and I added the pipeline that you gave:

<pipeline>
	<map:match pattern="*.txt">
		<map:read src="test.txt" mime-type="text/plain"/>
	</map:match>
</pipeline>

and added a test.txt file in the publication root directory.

Jon


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


Re: XSP and Lenya

Posted by Jonathan Linczak <li...@hiram.edu>.
On Aug 13, 2004, at 10:53 AM, Andreas Hartmann wrote:

> Jonathan Linczak wrote:
>
>> On Aug 13, 2004, at 10:50 AM, Andreas Hartmann wrote:
>>> Jonathan Linczak wrote:
>>>
>>> [...]
>>>
>>>> I just tried this in CInclude and nothing is working either.  I  
>>>> added the transformer component to the publication-sitemap.xmap,  
>>>> then changed the transformer in the main pipeline to  
>>>> type="cinclude".  I also changed the XSLT file by adding the  
>>>> CInclude namespace and adding the tag:
>>>> <cinclude:include src="cocoon:/test.txt">
>>>
>>>
>>> Did you add a pipeline to deliver this file?
>> If you mean the test.txt file, no.  Stupid question: how does one  
>> write a pipeline for a simple text file?
>
> <map:read src="test.txt" mime-type="text/plain"/>


Unfortunately, it doesn't seem to be working.  Let me lay this out to  
see if I am missing anything:

1.  Added the CInclude namespace to the page2xhtml.xsl file in  
<pub>/xslt/:  xmlns:cinclude="http://apache.org/cocoon/include/1.0"

2.  Added a simple Cinclude tag after the apply-templates tag for the  
body, to bring in some text:

	<cinclude:include src="cocoon:/test.txt"/>

3.  Created a new text file called test.txt and put it in the  
<pub>/xslt directory

4.  Edited the publication-sitemap.xmap by first adding the following  
component:

	<map:transformers default="xslt">
		<map:transformer name="cinclude"  
src="org.apache.cocoon.transformation.CIncludeTransformer"/>
	</map:transformers>

5.  Edited the publication-sitemap.xmap file by adding the following  
transform to the main pipeline (the whole pipeline is displayed below):

	<map:pipeline>
		<!-- /lenyabody-{rendertype}/{publication-id}/{area}/{doctype}/{url}  
-->
		<map:match pattern="lenyabody-*/*/*/*/**">
			<map:aggregate element="cmsbody">
				<map:part src="cocoon://navigation/{2}/{3}/breadcrumb/{5}.xml"/>
				<map:part src="cocoon://navigation/{2}/{3}/tabs/{5}.xml"/>
				<map:part src="cocoon://navigation/{2}/{3}/menu/{5}.xml"/>
				<map:part src="cocoon://navigation/{2}/{3}/search/{5}.xml"/>
				<map:part  
src="cocoon:/lenya-document-{1}/{3}/{4}/{page-envelope:document-path}"/ 
 >
			</map:aggregate>
			<map:transform src="xslt/page2xhtml.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:transform>

			<!-- here's where the CIncludeTransformer is used, after the XSLT  
Transformation -->
			<map:transform type="cinclude"/>
			<!-- end CInclude -->

			<map:select type="parameter">
				<map:parameter name="parameter-selector-test" value="{1}"/>
				<map:when test="view">
					<map:transform type="link-rewrite"/>
				</map:when>
			</map:select>
		<map:serialize type="xml"/>
		</map:match>
	</map:pipeline>

6.  I go the page, and nothing shows up once again.  I swear it's  
pointing to the right XSLT stylesheet too!

Jon


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


Re: XSP and Lenya

Posted by Andreas Hartmann <an...@apache.org>.
Jonathan Linczak wrote:

> On Aug 13, 2004, at 10:50 AM, Andreas Hartmann wrote:
> 
>> Jonathan Linczak wrote:
>>
>> [...]
>>
>>> I just tried this in CInclude and nothing is working either.  I added 
>>> the transformer component to the publication-sitemap.xmap, then 
>>> changed the transformer in the main pipeline to type="cinclude".  I 
>>> also changed the XSLT file by adding the CInclude namespace and 
>>> adding the tag:
>>> <cinclude:include src="cocoon:/test.txt">
>>
>>
>> Did you add a pipeline to deliver this file?
> 
> 
> If you mean the test.txt file, no.  Stupid question: how does one write 
> a pipeline for a simple text file?

<map:read src="test.txt" mime-type="text/plain"/>

-- Andreas


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


Re: XSP and Lenya

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Jonathan Linczak wrote:

> On Aug 13, 2004, at 10:50 AM, Andreas Hartmann wrote:
> 
>> Jonathan Linczak wrote:
>>
>> [...]
>>
>>> I just tried this in CInclude and nothing is working either.  I added 
>>> the transformer component to the publication-sitemap.xmap, then 
>>> changed the transformer in the main pipeline to type="cinclude".  I 
>>> also changed the XSLT file by adding the CInclude namespace and 
>>> adding the tag:
>>> <cinclude:include src="cocoon:/test.txt">
>>
>>
>> Did you add a pipeline to deliver this file?
> 
> 
> If you mean the test.txt file, no.  Stupid question: how does one write 
> a pipeline for a simple text file?

<map:match pattern="*.txt">
   <map:read type="resource" src="locationtotextfile/{1}.txt"
     mime-type="text/plain">
   </map:read>
</map:match>

-- 
Gregor J. Rothfuss
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                   http://cocoon.apache.org/lenya
gregor.rothfuss@wyona.com                       gregor@apache.org

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


Re: XSP and Lenya

Posted by Jonathan Linczak <li...@hiram.edu>.
On Aug 13, 2004, at 10:50 AM, Andreas Hartmann wrote:

> Jonathan Linczak wrote:
>
> [...]
>
>> I just tried this in CInclude and nothing is working either.  I added 
>> the transformer component to the publication-sitemap.xmap, then 
>> changed the transformer in the main pipeline to type="cinclude".  I 
>> also changed the XSLT file by adding the CInclude namespace and 
>> adding the tag:
>> <cinclude:include src="cocoon:/test.txt">
>
> Did you add a pipeline to deliver this file?

If you mean the test.txt file, no.  Stupid question: how does one write 
a pipeline for a simple text file?

Jon


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


Re: XSP and Lenya

Posted by Andreas Hartmann <an...@apache.org>.
Jonathan Linczak wrote:

[...]

> I just tried this in CInclude and nothing is working either.  I added 
> the transformer component to the publication-sitemap.xmap, then changed 
> the transformer in the main pipeline to type="cinclude".  I also changed 
> the XSLT file by adding the CInclude namespace and adding the tag:
> 
> <cinclude:include src="cocoon:/test.txt">

Did you add a pipeline to deliver this file?

-- Andreas

> 
> I put the test.txt in the root directory of the publication.  I go the 
> page, and once again no content comes out.  This time it's pointing to 
> the right XSLT file too.  :)  Any ideas?
> 
> Jon


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


Re: XSP and Lenya

Posted by Jonathan Linczak <li...@hiram.edu>.
On Aug 13, 2004, at 10:54 AM, Gregor J. Rothfuss wrote:

> Jonathan Linczak wrote:
>
>> On Aug 13, 2004, at 10:45 AM, Gregor J. Rothfuss wrote:
>>> you need a pipeline for it
>> A pipeline for what, the test.txt file, or the page that is being 
>> displayed with the XSLT stylesheet that has the CInclude in it?
>
> a pipeline for the internal cocoon:/test.txt call. also, i just 
> noticed that there is an option for text:
>
> <xi:include parse="text" href="include.txt"/>


Yup, I used that in my original example.  I skimmed the W3C specs on 
XInclude.  :)

Jon


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


Re: XSP and Lenya

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Jonathan Linczak wrote:

> On Aug 13, 2004, at 10:45 AM, Gregor J. Rothfuss wrote:
>> you need a pipeline for it
> 
> A pipeline for what, the test.txt file, or the page that is being 
> displayed with the XSLT stylesheet that has the CInclude in it?

a pipeline for the internal cocoon:/test.txt call. also, i just noticed 
that there is an option for text:

<xi:include parse="text" href="include.txt"/>

http://cocoon.apache.org/2.1/userdocs/transformers/xinclude-transformer.html

-- 
Gregor J. Rothfuss
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                   http://cocoon.apache.org/lenya
gregor.rothfuss@wyona.com                       gregor@apache.org

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


Re: XSP and Lenya

Posted by Jonathan Linczak <li...@hiram.edu>.
On Aug 13, 2004, at 10:45 AM, Gregor J. Rothfuss wrote:

> Jonathan Linczak wrote:
>
> > <cinclude:include src="cocoon:/test.txt">
> >
> > I put the test.txt in the root directory of the publication.  I go 
> the
> > page, and once again no content comes out.  This time it's pointing 
> to
> > the right XSLT file too.  :)  Any ideas?
>
> you need a pipeline for it


A pipeline for what, the test.txt file, or the page that is being 
displayed with the XSLT stylesheet that has the CInclude in it?

Jon


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


Re: XSP and Lenya

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Jonathan Linczak wrote:

 > <cinclude:include src="cocoon:/test.txt">
 >
 > I put the test.txt in the root directory of the publication.  I go the
 > page, and once again no content comes out.  This time it's pointing to
 > the right XSLT file too.  :)  Any ideas?

you need a pipeline for it

-- 
Gregor J. Rothfuss
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                   http://cocoon.apache.org/lenya
gregor.rothfuss@wyona.com                       gregor@apache.org

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


Re: XSP and Lenya

Posted by Jonathan Linczak <li...@hiram.edu>.
On Aug 13, 2004, at 10:31 AM, Jonathan Linczak wrote:

> On Aug 13, 2004, at 10:21 AM, Gregor J. Rothfuss wrote:
>
>> Jonathan Linczak wrote:
>>
>> > org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
>> > org.xml.sax.SAXException: Unknown XInclude element xi:fallback at
>> > unknown location
>> >
>> > I thought xi:fallback was in the specs for XInclude, no?
>>
>> might be a bug in the cocoon xinclude support :)
>
>
> Well that's not encouraging... :)  Maybe it's not possible to have an 
> XInclude statement in an XSLT stylesheet?  I'm trying now with 
> CInclude to see if I can get some basic functionality, but can I have 
> a CInclude statement in an XSLT stylesheet either?

I just tried this in CInclude and nothing is working either.  I added 
the transformer component to the publication-sitemap.xmap, then changed 
the transformer in the main pipeline to type="cinclude".  I also 
changed the XSLT file by adding the CInclude namespace and adding the 
tag:

<cinclude:include src="cocoon:/test.txt">

I put the test.txt in the root directory of the publication.  I go the 
page, and once again no content comes out.  This time it's pointing to 
the right XSLT file too.  :)  Any ideas?

Jon


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


Re: XSP and Lenya

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Jonathan Linczak wrote:

 > Well that's not encouraging... :)  Maybe it's not possible to have an
 > XInclude statement in an XSLT stylesheet?  I'm trying now with CInclude
 > to see if I can get some basic functionality, but can I have a CInclude
 > statement in an XSLT stylesheet either?


it is possible, i am using it (with the cocoon protocol but without the 
fallback)

-- 
Gregor J. Rothfuss
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                   http://cocoon.apache.org/lenya
gregor.rothfuss@wyona.com                       gregor@apache.org

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


Re: XSP and Lenya

Posted by Jean Pierre LeJacq <jp...@quoininc.com>.
On Fri, 13 Aug 2004, Jonathan Linczak wrote:

> On Aug 13, 2004, at 10:21 AM, Gregor J. Rothfuss wrote:
>
> > Jonathan Linczak wrote:
> >
> > > org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
> > > org.xml.sax.SAXException: Unknown XInclude element xi:fallback at
> > > unknown location
> > >
> > > I thought xi:fallback was in the specs for XInclude, no?
> >
> > might be a bug in the cocoon xinclude support :)
>
>
> Well that's not encouraging... :)  Maybe it's not possible to have an
> XInclude statement in an XSLT stylesheet?  I'm trying now with CInclude
> to see if I can get some basic functionality, but can I have a CInclude
> statement in an XSLT stylesheet either?

You may have settled on cinclude but just to give you a data point,
I'm using xinclude extensively with good results.  If you decide to
pursue xinclude, let me know and I'll help out.

-- 
JP



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


Re: XSP and Lenya

Posted by Jonathan Linczak <li...@hiram.edu>.
On Aug 13, 2004, at 10:21 AM, Gregor J. Rothfuss wrote:

> Jonathan Linczak wrote:
>
> > org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
> > org.xml.sax.SAXException: Unknown XInclude element xi:fallback at
> > unknown location
> >
> > I thought xi:fallback was in the specs for XInclude, no?
>
> might be a bug in the cocoon xinclude support :)


Well that's not encouraging... :)  Maybe it's not possible to have an 
XInclude statement in an XSLT stylesheet?  I'm trying now with CInclude 
to see if I can get some basic functionality, but can I have a CInclude 
statement in an XSLT stylesheet either?

Jon


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


Re: XSP and Lenya

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Jonathan Linczak wrote:

 > org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
 > org.xml.sax.SAXException: Unknown XInclude element xi:fallback at
 > unknown location
 >
 > I thought xi:fallback was in the specs for XInclude, no?

might be a bug in the cocoon xinclude support :)

-- 
Gregor J. Rothfuss
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                   http://cocoon.apache.org/lenya
gregor.rothfuss@wyona.com                       gregor@apache.org

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


Re: XSP and Lenya

Posted by Jonathan Linczak <li...@hiram.edu>.
On Aug 13, 2004, at 10:04 AM, Gregor J. Rothfuss wrote:

> Jonathan Linczak wrote:
>
> > 2.  Added a simple Xinclude tag after the apply-templates tag for the
> > body, to bring in some text:
> >
> >     <xi:include parse="text" href="test.txt">
> >         <xi:fallback>Include did not work!</xi:fallback>
> >     </xi:include>
>
> not sure about the href here. that would resolve relative to what? i'd 
> suggest a cocoon:/test.txt

Well, part of my problem was I forgot to change the pipeline to point 
to the proper stylesheet, so now I get the following error:

org.apache.cocoon.ProcessingException: Failed to execute pipeline.: 
org.xml.sax.SAXException: Unknown XInclude element xi:fallback at 
unknown location

I thought xi:fallback was in the specs for XInclude, no?

Jon

Re: XSP and Lenya

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Jonathan Linczak wrote:

 > 2.  Added a simple Xinclude tag after the apply-templates tag for the
 > body, to bring in some text:
 >
 >     <xi:include parse="text" href="test.txt">
 >         <xi:fallback>Include did not work!</xi:fallback>
 >     </xi:include>

not sure about the href here. that would resolve relative to what? i'd 
suggest a cocoon:/test.txt

 > 3.  Created a new text file called test.txt and put it in the
 > <pub>/xslt directory

it may be resolved relative to the sitemap, not sure.

the rest looks good.

-- 
Gregor J. Rothfuss
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                   http://cocoon.apache.org/lenya
gregor.rothfuss@wyona.com                       gregor@apache.org

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


Re: XSP and Lenya

Posted by Andreas Hartmann <an...@apache.org>.
Jonathan Linczak wrote:

[...]

> 1.  Added the XInclude namespace to the page2xhtml.xsl file in  
> <pub>/xslt/:  xmlns:xi="http://www.w3.org/2001/XInclude"
> 
> 2.  Added a simple Xinclude tag after the apply-templates tag for the  
> body, to bring in some text:
> 
>     <xi:include parse="text" href="test.txt">
>         <xi:fallback>Include did not work!</xi:fallback>
>     </xi:include>
> 
> 3.  Created a new text file called test.txt and put it in the  
> <pub>/xslt directory

This doesn't look quite right - the link URL is resolved by the
XIncludeTransformer, not by the XSLT processor, so I don't
think the XLink is resolved relatively to the <pub>/xslt
directory.

But apart from that, no idea - do the logfiles say something
(when set to DEBUG)?

-- Andreas

> 
> 4.  Edited the publication-sitemap.xmap by first adding the following  
> component:
> 
>     <map:transformers default="xslt">
>         <map:transformer name="xinclude"  
> src="org.apache.cocoon.transformation.XIncludeTransformer"/>
>     </map:transformers>
> 
> 5.  Edited the publication-sitemap.xmap file by adding the following  
> transform to the main pipeline (the whole pipeline is displayed below):
> 
>     <map:pipeline>
>         <!-- 
> /lenyabody-{rendertype}/{publication-id}/{area}/{doctype}/{url}  -->
>         <map:match pattern="lenyabody-*/*/*/*/**">
>             <map:aggregate element="cmsbody">
>                 <map:part 
> src="cocoon://navigation/{2}/{3}/breadcrumb/{5}.xml"/>
>                 <map:part src="cocoon://navigation/{2}/{3}/tabs/{5}.xml"/>
>                 <map:part src="cocoon://navigation/{2}/{3}/menu/{5}.xml"/>
>                 <map:part 
> src="cocoon://navigation/{2}/{3}/search/{5}.xml"/>
>                 <map:part  
> src="cocoon:/lenya-document-{1}/{3}/{4}/{page-envelope:document-path}"/ >
>             </map:aggregate>
>             <map:transform src="xslt/page2xhtml.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:transform>
>             <map:transform type="xinclude"/>
>             <map:select type="parameter">
>                 <map:parameter name="parameter-selector-test" value="{1}"/>
>                 <map:when test="view">
>                     <map:transform type="link-rewrite"/>
>                 </map:when>
>             </map:select>
>         <map:serialize type="xml"/>
>         </map:match>
>     </map:pipeline>
> 
> 6.  I go the page, and nothing shows up, not even the fallback text, so  
> I must be configuring something wrong?
> 
> Jon


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


Re: XSP and Lenya

Posted by Jonathan Linczak <li...@hiram.edu>.
On Aug 12, 2004, at 2:50 PM, Gregor J. Rothfuss wrote:

> Jonathan Linczak wrote:
>
> > Right now, we are creating our XSP files and creating pipelines for  
> them
> > manually, but there's no way to bring it into Lenya so that the  
> dynamic
> > content is generated on the page, and we still have access to our
> > editable region.  So, we just link to it manually and make all of our
> > stylings for the page manually as well.  Does that make sense?
>
> you could use either
>
> map:aggregate to aggregate your content with the xsp pipeline
>
> or xi:include href=cocoon:/yourpipeline> in the content and then  
> transform using the cinclude or xinclude transformer.


Well, let's take a step back for a second.  I can't seem to get an  
XInclude statement to even work at the moment.  This is what I have  
done.  Is there something I'm missing?

1.  Added the XInclude namespace to the page2xhtml.xsl file in  
<pub>/xslt/:  xmlns:xi="http://www.w3.org/2001/XInclude"

2.  Added a simple Xinclude tag after the apply-templates tag for the  
body, to bring in some text:

	<xi:include parse="text" href="test.txt">
		<xi:fallback>Include did not work!</xi:fallback>
	</xi:include>

3.  Created a new text file called test.txt and put it in the  
<pub>/xslt directory

4.  Edited the publication-sitemap.xmap by first adding the following  
component:

	<map:transformers default="xslt">
		<map:transformer name="xinclude"  
src="org.apache.cocoon.transformation.XIncludeTransformer"/>
	</map:transformers>

5.  Edited the publication-sitemap.xmap file by adding the following  
transform to the main pipeline (the whole pipeline is displayed below):

	<map:pipeline>
		<!-- /lenyabody-{rendertype}/{publication-id}/{area}/{doctype}/{url}  
-->
		<map:match pattern="lenyabody-*/*/*/*/**">
			<map:aggregate element="cmsbody">
				<map:part src="cocoon://navigation/{2}/{3}/breadcrumb/{5}.xml"/>
				<map:part src="cocoon://navigation/{2}/{3}/tabs/{5}.xml"/>
				<map:part src="cocoon://navigation/{2}/{3}/menu/{5}.xml"/>
				<map:part src="cocoon://navigation/{2}/{3}/search/{5}.xml"/>
				<map:part  
src="cocoon:/lenya-document-{1}/{3}/{4}/{page-envelope:document-path}"/ 
 >
			</map:aggregate>
			<map:transform src="xslt/page2xhtml.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:transform>
			<map:transform type="xinclude"/>
			<map:select type="parameter">
				<map:parameter name="parameter-selector-test" value="{1}"/>
				<map:when test="view">
					<map:transform type="link-rewrite"/>
				</map:when>
			</map:select>
		<map:serialize type="xml"/>
		</map:match>
	</map:pipeline>

6.  I go the page, and nothing shows up, not even the fallback text, so  
I must be configuring something wrong?

Jon


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


Re: XSP and Lenya

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Jean Pierre LeJacq wrote:

 > Does it maintain session information?  So for example, if you're
 > composing a page in the authoring view, do the user credentials get
 > passed on?

its an internal pipeline call so it doesnt have a session iiuc


-- 
Gregor J. Rothfuss
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                   http://cocoon.apache.org/lenya
gregor.rothfuss@wyona.com                       gregor@apache.org

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


Re: XSP and Lenya

Posted by Jean Pierre LeJacq <jp...@quoininc.com>.
On Thu, 12 Aug 2004, Gregor J. Rothfuss wrote:

> Jean Pierre LeJacq wrote:
>
>  > Kind of off track, but does the xinclude transformer really support
>  > the cocoon protocol?  It would be excellent if it did.
>
> yes it does. i am using it in a project.

Does it maintain session information?  So for example, if you're
composing a page in the authoring view, do the user credentials get
passed on?

-- 
JP



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


Re: XSP and Lenya

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Jean Pierre LeJacq wrote:

 > Kind of off track, but does the xinclude transformer really support
 > the cocoon protocol?  It would be excellent if it did.

yes it does. i am using it in a project.


-- 
Gregor J. Rothfuss
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                   http://cocoon.apache.org/lenya
gregor.rothfuss@wyona.com                       gregor@apache.org

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


Re: XSP and Lenya

Posted by Jean Pierre LeJacq <jp...@quoininc.com>.
On Thu, 12 Aug 2004, Gregor J. Rothfuss wrote:

> map:aggregate to aggregate your content with the xsp pipeline
>
> or xi:include href=cocoon:/yourpipeline> in the content and then
> transform using the cinclude or xinclude transformer.

Kind of off track, but does the xinclude transformer really support
the cocoon protocol?  It would be excellent if it did.

-- 
JP



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


Re: XSP and Lenya

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Jonathan Linczak wrote:

 > Right now, we are creating our XSP files and creating pipelines for them
 > manually, but there's no way to bring it into Lenya so that the dynamic
 > content is generated on the page, and we still have access to our
 > editable region.  So, we just link to it manually and make all of our
 > stylings for the page manually as well.  Does that make sense?

you could use either

map:aggregate to aggregate your content with the xsp pipeline

or xi:include href=cocoon:/yourpipeline> in the content and then 
transform using the cinclude or xinclude transformer.

if you get it to work, can you add it to the wiki?

-- 
Gregor J. Rothfuss
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                   http://cocoon.apache.org/lenya
gregor.rothfuss@wyona.com                       gregor@apache.org

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


Re: XSP and Lenya

Posted by Jonathan Linczak <li...@hiram.edu>.
On Aug 12, 2004, at 9:56 AM, Andreas Hartmann wrote:

> Jonathan Linczak wrote:
>
>> OK, silly question:  I'm using XSP and ESQL to gather content from a 
>> database and display it on a page.  I've been doing this successfully 
>> for a few weeks without issue, but how exactly do I integrate it with 
>> Lenya?
>
> AFAIK there is no "How-To" to achieve this. Lenya 1.2 is not designed
> to read contents from a database. You will have to implement the
> integration on your own. Reading from the database shouldn't be a
> problem, but using a database as a content repository will be quite
> difficult.
>
> Anyway, I don't think it makes sense to setup a generic database
> integration or to write documentation about this, because a major
> point in the Lenya 1.4 roadmap is the integration of a repository
> layer.

OK, I think my question came out wrong... basically, I've created an 
XSP file that uses ESQL to gather contents from a database.  But, even 
if it doesn't grab contents of a database, and it's a simple XSP file 
that displays the current date and time, it's the process of 
integrating the XSP file itself into Lenya.

So, for example, I create an XSP file that spits out the current date 
and time, the only dynamic part of the page, and then everything else 
on the page is text that I want to edit in the body of the document.  
Right now, if I create a page using Lenya, it's a simple XML file 
that's serialized to HTML or XHTML.  What if there was a way to point 
Lenya to an XSP file and have the results of the XSP file after 
processing appear as a page in Lenya that I can manipulate?  So, the 
dynamic content created won't be edited, but anything within the body 
of the document can be edited with BXE or Kupu.  Is something like that 
possible?

Right now, we are creating our XSP files and creating pipelines for 
them manually, but there's no way to bring it into Lenya so that the 
dynamic content is generated on the page, and we still have access to 
our editable region.  So, we just link to it manually and make all of 
our stylings for the page manually as well.  Does that make sense?

Jon


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


Re: XSP and Lenya

Posted by Andreas Hartmann <an...@apache.org>.
Jonathan Linczak wrote:

> OK, silly question:  I'm using XSP and ESQL to gather content from a 
> database and display it on a page.  I've been doing this successfully 
> for a few weeks without issue, but how exactly do I integrate it with 
> Lenya?

AFAIK there is no "How-To" to achieve this. Lenya 1.2 is not designed
to read contents from a database. You will have to implement the
integration on your own. Reading from the database shouldn't be a
problem, but using a database as a content repository will be quite
difficult.

Anyway, I don't think it makes sense to setup a generic database
integration or to write documentation about this, because a major
point in the Lenya 1.4 roadmap is the integration of a repository
layer.

> I saw the OSCOM publication had customized menus in Lenya that 
> added a new item in the database, and when it was added, it brought you 
> back to the main page, where the new item was displayed with the 
> others.  Was that XSP or something completely different?

I don't think the OSCOM publication uses a database, but rather
manipulates XML files.

-- Andreas


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