You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Rolando Isidoro <rl...@uninova.pt> on 2005/07/28 21:02:35 UTC
Integrating external data into Lenya
Hello, I've successfully managed to integrate external data into a Lenya
publication. Nevertheless I'm not very pleased with the current
solution, since my goal is to present the data fully integrated with the
page layout, keeping the menus, tabs (everything as defined in
page2xhtml.xsl) and by now I'm just able to take the XML from the
external source and present it separately after performing a XSL
transformation.
Currently I have the following code under publication-sitemap.xmap:
<map:match pattern="**/staff/asg/profile">
<map:generate
src="http://localhost/cwis/SPT--OAI.php?verb=ListRecords&metadataPrefix=oai_dc&set=Creator:Adolfo%20Steiger"/>
<map:transform src="xslt/OAI2xhtml.xsl"/>
<map:serialize type="html"/>
</map:match>
Somedays ago I looked into solprovider's webpage and came across some
relevant data in http://solprovider.com/lenya/external. Still I'm not
able to reach the desired result, just below is shown my latest try:
<!-- Match every document with URI terminating with the string
profile || The 2nd * refers to the ID of each staff child node -->
<map:match pattern="**/staff/*/profile">
<map:aggregate element="cmsbody">
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/breadcrumb/index.xml"/>
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/tabs/index.xml"/>
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/menu/index.xml"/>
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/search/index.xml"/>
<map:part src="cocoon:/staff-{2}"/>
</map:aggregate>
<map:transform src="xslt/page2xhtml.xsl"/>
<map:serialize type="xml"/>
</map:match>
<!-- Match for each staff child node ID existent -->
<map:match pattern="staff-asg">
<map:generate
src="http://localhost/cwis/SPT--OAI.php?verb=ListRecords&metadataPrefix=oai_dc&set=Creator:Adolfo%20Steiger"/>
<map:transform src="xslt/OAI2xhtml.xsl"/>
<map:serialize type="html"/>
</map:match>
I thought this would get data from the data source, transform it with
OAI2xhtml.xsl and aggregate it with the remainder of the cmsbody parts
and then transforming it with page2xhtml.xsl; instead it shows only the
cmsbody parts with a weird presentation, as if the XSL are not being
found or correctly used.
Can someone help with this issue?
Thanks in advance, regards,
Rolando
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Integrating external data into Lenya
Posted by Victoria Vitaver <vi...@tt.com.au>.
Rolando Isidoro wrote:
> Hello, I've successfully managed to integrate external data into a Lenya
> publication. Nevertheless I'm not very pleased with the current
> solution, since my goal is to present the data fully integrated with the
> page layout, keeping the menus, tabs (everything as defined in
> page2xhtml.xsl) and by now I'm just able to take the XML from the
> external source and present it separately after performing a XSL
> transformation.
>
> Currently I have the following code under publication-sitemap.xmap:
>
> <map:match pattern="**/staff/asg/profile">
> <map:generate
> src="http://localhost/cwis/SPT--OAI.php?verb=ListRecords&metadataPrefix=oai_dc&set=Creator:Adolfo%20Steiger"/>
>
> <map:transform src="xslt/OAI2xhtml.xsl"/>
> <map:serialize type="html"/>
> </map:match>
>
> Somedays ago I looked into solprovider's webpage and came across some
> relevant data in http://solprovider.com/lenya/external. Still I'm not
> able to reach the desired result, just below is shown my latest try:
>
>
> <!-- Match every document with URI terminating with the string
> profile || The 2nd * refers to the ID of each staff child node -->
>
> <map:match pattern="**/staff/*/profile">
> <map:aggregate element="cmsbody">
> <map:part
> src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/breadcrumb/index.xml"/>
>
> <map:part
> src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/tabs/index.xml"/>
>
> <map:part
> src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/menu/index.xml"/>
>
> <map:part
> src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/search/index.xml"/>
>
> <map:part src="cocoon:/staff-{2}"/>
> </map:aggregate>
> <map:transform src="xslt/page2xhtml.xsl"/>
> <map:serialize type="xml"/>
> </map:match>
>
> <!-- Match for each staff child node ID existent -->
> <map:match pattern="staff-asg">
> <map:generate
> src="http://localhost/cwis/SPT--OAI.php?verb=ListRecords&metadataPrefix=oai_dc&set=Creator:Adolfo%20Steiger"/>
>
> <map:transform src="xslt/OAI2xhtml.xsl"/>
> <map:serialize type="html"/>
> </map:match>
>
> I thought this would get data from the data source, transform it with
> OAI2xhtml.xsl and aggregate it with the remainder of the cmsbody parts
> and then transforming it with page2xhtml.xsl; instead it shows only the
> cmsbody parts with a weird presentation, as if the XSL are not being
> found or correctly used.
>
> Can someone help with this issue?
Just make sure that whatever you are generating agrees with page2xhtml.xsl
Ie. make sure that you enclose what you want to appear in
div tags whose id="body"
and correctly declare the xhtml namespace: xmlns:xhtml="http://www.w3.org/1999/xhtml inside your <xsl:stylesheet ../> tags
Vica
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Integrating external data into Lenya
Posted by Victoria Vitaver <vi...@tt.com.au>.
>>(Depending on your code, it may be "xhtml:div[" rather than "div[".)
> With all this changes made I still can't manage to get the desired
> result. I can detect 2 things not working correctly:
> - the <div id="details-or-link"/> isn't rendering neither the link
> string if a staff member page or the details in a profile staff member page
Ok.. if that is the case, ie empty where your 'div id="blah"' should be picking up stuff, chances are your namespaces are wrong make sure that you define the div to be in the xhtml namespace ...
one way to tell where the problem is is to comment out the transformation bit of the pipeline and see if you get all the text that you expect.
IF yes then refer to my first point, if no then its not your div's and the problem is much earlier on
Vica
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Integrating external data into Lenya
Posted by so...@gmail.com.
You need to include the i18n transformation. See:
http://solprovider.com/lenya/i18nxmap
That caused the issues with only using the default langauge, and the
missing copyright (which is blank because it does not have default
text.) I thought the devs added i18n to the default pub for 1.2.4.
Maybe they forgot to add it to 1.4?
> - the content in the <div id="body"> isn't being correctly displayed
You are not stripping the namespaces. The tags in the body are all
prefaced "xhtml:". It would be nice if the HTML Serializer handled
that. You need:
<map:transform src="../../xslt/util/strip_namespaces.xsl"/>
> - the links in the menus and tabs are incorrect, they all have
> /staff/???/, for instance:
> http://gris.uninova.pt:8080/lenya/gris/live/staff/asg/index.html
> instead of http://gris.uninova.pt:8080/lenya/gris/live/index.html
The menus are linking to "about.html" and "staff.html". They need to
have an initial slash: "/about.html". This is weird; maybe it is a
1.4 bug? The devs were working on the sitetree implementation. (That
is why you should not develop with an unreleased version when you are
new. And why I am not upgrading; I already fixed or worked around the
bugs in 1.2.2.)
To fix, try adding a slash to menu.xsl and tabs.xsl:
<a href="/{@href}">
Learn to read HTML source code. It is required to debug websites.
solprovider
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Integrating external data into Lenya
Posted by Rolando Isidoro <rl...@uninova.pt>.
Hi, first things first, I would like to express my gratitude for all the
patience and time everyone has spent helping me. I've worked several
hours around the whole integration process today before sending this
mail, I'm beginning to feel a little frustration for not being able to
get it right.
I've managed to update the publication at
http://gris.uninova.pt:8080/lenya/gris/live/, so it now reflects the
last changes I've performed.
I would like to try solving smaller problems each time, maybe this way
it will be easier to reach the goal. For now I would be very satisfied
if I was able to reproduce the document at
http://gris.uninova.pt:8080/lenya/gris/live/staff/asg.html or
http://gris.uninova.pt:8080/lenya/gris/live/staff/asg_en.html (depending
on the selected language) when accessing
http://gris.uninova.pt:8080/lenya/gris/live/staff/asg/profile.
This is the current match used for a profile link in a staff document:
<map:match pattern="**/staff/*/profile*">
<map:aggregate element="cmsbody">
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/breadcrumb/index.xml"/>
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/tabs/index.xml"/>
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/menu/index.xml"/>
<map:part
src="cocoon:/lenya-document-view/live/profile/staff/{2}/index_{page-envelope:document-language}.xml"/>
</map:aggregate>
<map:transform src="xslt/page2xhtml-profile.xsl">
<map:parameter name="document-id"
value="{page-envelope:document-id}"/>
<map:parameter name="document-type" value="profile"/>
<map:parameter name="language"
value="{page-envelope:document-language}"/>
<map:parameter name="root"
value="{page-envelope:context-prefix}/gris/live"/>
</map:transform>
<map:serialize type="html"/>
</map:match>
Looking at the publication using a profile link in a staff document,
you'll see the result I'm getting, which is similar to the desired
except for the following:
- the language displayed is the default instead of the current selected one
- the links in the menus and tabs are incorrect, they all have
/staff/???/, for instance:
http://gris.uninova.pt:8080/lenya/gris/live/staff/asg/index.html
instead of http://gris.uninova.pt:8080/lenya/gris/live/index.html
- the content in the <div id="body"> isn't being correctly displayed
- the copyright div isn't being displayed at all; the code for this div
is the same in page2xhtml-profile.xsl as in page2xhtml.xsl which is:
<div id="copyright">
<i18n:translate>
<i18n:text i18n:key="copyright"/>
</i18n:translate>
</div>
By the way, solprovider thank you for the i18n tip.
Thank you once again, regards,
Rolando
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Integrating external data into Lenya
Posted by so...@gmail.com.
On 7/31/05, Rolando Isidoro <rl...@uninova.pt> wrote:
> Where you want the link or details, put:
> <div id="details-or-link"/>
> This way, from what I can figure out, I'll have to insert <div
> id="details-or-link"/> in each index_*.xml for every staff member, right?
No. Updating many content files is too much work for me. I would
have put the DIV into the XSL. It belongs in page2xhtml-profile.xsl
> Add a template to fill the correct details:
> <xsl:template match="div[@id = 'details-or-link']">
> <xsl:choose>
> <xsl:when test="div[@id = 'details']">
> <xsl:apply-templates select="div[@id = 'details']"/>
> </xsl:when>
> <xsl:otherwise>
> Click <a href="/staff/{$empname}/details">here</a> for a
> more detailed profile
> </xsl:otherwise>
> </xsl:choose>
>
> (Depending on your code, it may be "xhtml:div[" rather than "div[".)
>
> This template goes in page2xhtml-profile.xml?
> With all this changes made I still can't manage to get the desired result.
> I can detect 2 things not working correctly:
> - the <div id="details-or-link"/> isn't rendering neither the link string
> if a staff member page or the details in a profile staff member page
Yes.
I mentioned (and you even copied the comment) your XSL might require
"xhtml:div". Try it in the "when test" and/or in the apply-templates.
You probably need it both places. (Victoria already teased you about
missing my comment and not trying that.)
> Here a small issue appears, I'm using two different strings for the link,
> one in PT and other one in EN, which means I'll have to pass <map:parameter
> name="language" value="{page-envelope:document-language}"/>
> in the pipeline into page2xhtml-profile.xsl and the XSL must have <xsl:param
> name="language"/>, so I can later distinguish which language the page is
> written in and display the right string for it, right? I've introduced the
> following block of code under page2xhtml-profile.xsl and neither the links
> or the details div are showing up:
Have you read about i18n? It handles language translation easily.
<i18n:translate>
<i18n:text i18n:key="profile-details-click"/>
<i18n:param><xsl:value-of select="$staff-id"/></i18n:param>
</i18n:translate>
Add these lines.
FILE: /lenya/resources/i18n/msui.xml
<message key="profile-details-click">Click <a
href="/staff/{0}/profile">here</a> for a more detailed
profile.</message>
FILE: /lenya/resources/i18n/cmsui_pt.xml
<message key="profile-details-click">Clique <a
href="/staff/{0}/profile">aqui</a> para um perfil mais
detalhado.</message>
I just added a new page to my website:
http://solprovider.com/lenya/i18nvariables
You should read the earlier pages if you have not used i18n yet. This
project just became much easier.
> - if I access a page using an URL terminating with staff/.../profile I
> can't return the content of the respective staff/... document.
> This line is commented because Lenya tries to retrieve the document
> with ID staff/.../profile which doesn't exist; how can I remove the profile
> suffix from the document ID, so it will retrieve the correct
> document?
> <!-- <map:part
> src="cocoon:/lenya-document-view/live/profile/staff/{2}"/>
> -->
You are trying to match this pipeline:
<map:match pattern="lenya-document-*/*/*/**.xml">
So you need to add the extension:
<map:part src="cocoon:/lenya-document-view/live/profile/staff/{2}.xml"/>
solprovider
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Integrating external data into Lenya
Posted by Rolando Isidoro <rl...@uninova.pt>.
Let me start by apologizing for the length of this message, it might
become somewhat confusing.
I forgot to mention in previous occasions that every regular staff
document is a custom resource type called "profile". I've created
profile2xhtml.xsl and page2xhtml-profile.xsl as instructed in
http://lenya.apache.org/1_2_x/how-to/custom_resourcetype.html.
>The question is how you want this to happen. Does the original page use standard Lenya URLs? Does the "details" page only show when using the "staff" pipeline? Or do they both use the same URL? It is easiest if the URLs are different so you create separate pipelines:
>http://yourserver/xxx/staff/empname/profile
>http://yourserver/xxx/staff/empname/details
>
I use two distinct URLs, for the common profile I use the 1st (standard Lenya URL) and the 2nd for the one with external data integration:
http://gris.uninova.pt:8080/lenya/gris/live/staff/asg/
http://gris.uninova.pt:8080/lenya/gris/live/staff/asg/profile
You can visit these URLs to get a clearer idea, as they are available online, but be aware that this publication hasn't been updated with the changes I've been performing.
>Make certain OAI2xhtml.xsl wraps the table in a <div id="details">.
>Then page2xhtml-staffdetails.xsl replaces the link with the details DIV.
>
Done, as mentioned before your page2xhtml-staffdetails.xsl is named
page2xhtml-profile.xsl.
>You should pass empname from the pipeline so you can use it in the link:
><map:transform src="xslt/page2xhtml-staffdetails.xsl">
><map:parameter name="empname" value="{2}"/>
></map:transform>
>
>The XSL needs to set it:
><xsl:param name="empname">
>
Done. I've also passed some other parameters that are needed to present
the rest of the data correctly under page2xhtml-profile.xsl:
<map:transform src="xslt/page2xhtml-profile.xsl">
<map:parameter name="document-id" value="{page-envelope:document-id}"/>
<map:parameter name="document-type" value="profile"/> *<-- hardcoded
because value="{page-envelope:document-type}" returned an error*
<map:parameter name="language"
value="{page-envelope:document-language}"/>
<map:parameter name="root"
value="{page-envelope:context-prefix}/gris/live"/> *<-- hardcoded
because the matching doesn't return {publication-id} and {area}*
<map:parameter name="staff_id" value="{2}"/>
</map:transform>
>Where you want the link or details, put:
><div id="details-or-link"/>
>
This way, from what I can figure out, I'll have to insert <div
id="details-or-link"/> in each index_*.xml for every staff member, right?
Did that.
>Add a template to fill the correct details:
><xsl:template match="div[@id = 'details-or-link']">
><xsl:choose>
> <xsl:when test="div[@id = 'details']">
> <xsl:apply-templates select="div[@id = 'details']"/>
> </xsl:when>
> <xsl:otherwise>
> Click <a href="/staff/{$empname}/details">here</a> for a more detailed profile
> </xsl:otherwise>
></xsl:choose>
>
>(Depending on your code, it may be "xhtml:div[" rather than "div[".)
>
This template goes in page2xhtml-profile.xml?
Here a small issue appears, I'm using two different strings for the
link, one in PT and other one in EN, which means I'll have to pass
<map:parameter name="language"
value="{page-envelope:document-language}"/> in the pipeline into
page2xhtml-profile.xsl and the XSL must have <xsl:param
name="language"/>, so I can later distinguish which language the page is
written in and display the right string for it, right? I've introduced
the following block of code under page2xhtml-profile.xsl and neither the
links or the details div are showing up:
<xsl:template match="xhtml:div[@id='details-or-link']">
<xsl:choose>
<xsl:when test="div[@id='details']">
<xsl:apply-templates select="div[@id='details']"/>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$language='en'">
Click <a href="/staff/{$staff-id}/profile">here</a> for
a more detailed profile.
</xsl:if>
<xsl:otherwise>
Clique <a href="/staff/{$staff-id}/profile">aqui</a>
para um perfil mais detalhado.
</xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
>Now create your 2 pipelines:
><map:match pattern="**/staff/*/profile*">
>Does not aggregate with the external data pipeline. Since the details
>DIV is missing, it shows the link.
>
><map:match pattern="**/staff/*/details*">
>Aggregate the external data pipeline. Since it has the details DIV,
>that is copied into the document.
>
I've created the 2 pipelines as you suggested, this is how they look:
<map:pipeline>
<map:match pattern="lenyabody-*/*/*/staff/*">
<map:aggregate element="cmsbody">
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/breadcrumb/index.xml"/>
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/tabs/index.xml"/>
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/menu/index.xml"/>
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/search/index.xml"/>
<map:part
src="cocoon:/lenya-document-{1}/{3}/{4}/{page-envelope:document-path}"/>
</map:aggregate>
<map:transform src="xslt/page2xhtml-profile.xsl">
<map:parameter name="document-id"
value="{page-envelope:document-id}"/>
<map:parameter name="document-type" value="profile"/>
<map:parameter name="language"
value="{page-envelope:document-language}"/>
<map:parameter name="root"
value="{page-envelope:context-prefix}/gris/live"/>
<map:parameter name="url" value="{2}"/>
</map:transform>
<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="html"/>
</map:match>
</map:pipeline>
<map:pipeline>
<!-- /lenyabody-{rendertype}/{publication-id}/{area}/{doctype}/{url} -->
<map:match pattern="**/staff/*/profile">
<map:aggregate element="cmsbody">
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/breadcrumb/index.xml"/>
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/tabs/index.xml"/>
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/menu/index.xml"/>
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/search/index.xml"/>
* This line is commented because Lenya tries to retrieve the document
with ID staff/.../profile which doesn't exist; how can I remove the
profile suffix from the document ID, so it will retrieve the
correct document?
* <!-- <map:part
src="cocoon:/lenya-document-view/live/profile/staff/{2}"/> -->
<map:part src="cocoon:/staff-{2}"/>
</map:aggregate>
<map:transform src="xslt/page2xhtml-profile.xsl">
<map:parameter name="document-id"
value="{page-envelope:document-id}"/>
<map:parameter name="document-type" value="profile"/>
<map:parameter name="language"
value="{page-envelope:document-language}"/>
<map:parameter name="root"
value="{page-envelope:context-prefix}/gris/live"/>
<map:parameter name="staff_id" value="{2}"/>
</map:transform>
<map:serialize type="html"/>
</map:match>
<map:match pattern="staff-*">
<map:select type="parameter">
<map:parameter name="parameter-selector-test" value="{1}"/>
<map:when test="asg">
<map:generate
src="http://rolando.serrado.net/cwis/SPT--OAI.php?verb=ListRecords&metadataPrefix=oai_dc&set=Creator:Adolfo%20Steiger"/>
</map:when>
<map:when test="ca">
<map:generate
src="http://rolando.serrado.net/cwis/SPT--OAI.php?verb=ListRecords&metadataPrefix=oai_dc&set=Creator:Carlos%20Agostinho"/>
</map:when>
....
</map:select>
<map:transform src="xslt/OAI2xhtml.xsl"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
With all this changes made I still can't manage to get the desired
result. I can detect 2 things not working correctly:
- the <div id="details-or-link"/> isn't rendering neither the link
string if a staff member page or the details in a profile staff member page
- if I access a page using an URL terminating with staff/.../profile I
can't return the content of the respective staff/... document.
Thanks for all the help, regards,
Rolando
Re: Integrating external data into Lenya
Posted by so...@gmail.com.
On 7/29/05, Rolando Isidoro <rl...@uninova.pt> wrote:
> >Each entry pipeline must return HTML. Pipelines used internally (such
> >as called using <map:part>) should serialize XML. You have them
> >reversed.
> This means I should switch <map:serialize type="xml"/> and
> <map:serialize type="html"/> so it looks like the code listed below
> <map:match pattern="**/staff/*/profile">
> <map:aggregate element="cmsbody">
> <map:part
> src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/breadcrumb/index.xml"/>
>
> <map:part
> src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/tabs/index.xml"/>
>
> <map:part
> src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/menu/index.xml"/>
>
> <map:part
> src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/search/index.xml"/>
>
> <map:part src="cocoon:/staff-{2}"/>
> </map:aggregate>
> <map:transform src="xslt/page2xhtml.xsl"/>
> <map:serialize type="*html*"/>
> </map:match>
>
> <!-- Match for each staff child node ID existent -->
> <map:match pattern="staff-asg">
> <map:generate
> src="http://localhost/cwis/SPT--OAI.php?verb=ListRecords&metadataPrefix=oai_dc&set=Creator:Adolfo%20Steiger"/>
>
> <map:transform src="xslt/OAI2xhtml.xsl"/>
> <map:serialize type="*xml*"/>
> </map:match>
>
> so that the inner pipeline returns xml and the main one returns html.
>
> I've performed this change and the result remained the same. Any idea why?
Did you clear the cache and restart Lenya? (I do not see anything
writing to the cache, but maybe there is more code?) Lenya caches
things erratically. I have a common.xsl which is imported by many XSL
files, and changes sometimes will not appear until Lenya is restarted,
even in a non-caching pipeline.
Please tell me the stars around *html* and *xml* are not in
production. (If so, the serializer would use the default, which is
probably xml.)
---
Tracing the pipeline:
The URL is like:
http://yourserver/xxx/staff/empname/profile
It uses the first match and aggregates the navigation with:
cocoon:/staff-empname
"empname" must be "asg" for your test, since you hardcoded the second
pipeline. Now we assume it was so we hit the second pipeline. It
gets the hardcoded page, does a transform, then passes back XML.
The first pipeline takes all the XML, does a transform, then returns HTML.
As long as your page2xhtml.xsl produces something close to HTML, this
should work fine.
solprovider
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Integrating external data into Lenya
Posted by Rolando Isidoro <rl...@uninova.pt>.
>Check your <map:serialize type="xml"/> and <map:serialize type="html"/>.
>
>The former produces "only the cmsbody parts with a weird presentation,
>as if the XSL are not being found or correctly used." The latter
>displays HTML.
>
>Each entry pipeline must return HTML. Pipelines used internally (such
>as called using <map:part>) should serialize XML. You have them
>reversed.
>
This means I should switch <map:serialize type="xml"/> and
<map:serialize type="html"/> so it looks like the code listed below
<map:match pattern="**/staff/*/profile">
<map:aggregate element="cmsbody">
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/breadcrumb/index.xml"/>
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/tabs/index.xml"/>
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/menu/index.xml"/>
<map:part
src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/search/index.xml"/>
<map:part src="cocoon:/staff-{2}"/>
</map:aggregate>
<map:transform src="xslt/page2xhtml.xsl"/>
<map:serialize type="*html*"/>
</map:match>
<!-- Match for each staff child node ID existent -->
<map:match pattern="staff-asg">
<map:generate
src="http://localhost/cwis/SPT--OAI.php?verb=ListRecords&metadataPrefix=oai_dc&set=Creator:Adolfo%20Steiger"/>
<map:transform src="xslt/OAI2xhtml.xsl"/>
<map:serialize type="*xml*"/>
</map:match>
so that the inner pipeline returns xml and the main one returns html.
I've performed this change and the result remained the same. Any idea why?
Thanks for the reply, regards,
Rolando
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Integrating external data into Lenya
Posted by so...@gmail.com.
On 7/28/05, Rolando Isidoro <rl...@uninova.pt> wrote:
> Somedays ago I looked into solprovider's webpage and came across some
> relevant data in http://solprovider.com/lenya/external. Still I'm not
> able to reach the desired result, just below is shown my latest try:
> <!-- Match every document with URI terminating with the string
> profile || The 2nd * refers to the ID of each staff child node -->
>
> <map:match pattern="**/staff/*/profile">
> <map:aggregate element="cmsbody">
> <map:part
> src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/breadcrumb/index.xml"/>
> <map:part
> src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/tabs/index.xml"/>
> <map:part
> src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/menu/index.xml"/>
> <map:part
> src="cocoon://navigation/{page-envelope:publication-id}/{page-envelope:area}/search/index.xml"/>
> <map:part src="cocoon:/staff-{2}"/>
> </map:aggregate>
> <map:transform src="xslt/page2xhtml.xsl"/>
> <map:serialize type="xml"/>
> </map:match>
>
> <!-- Match for each staff child node ID existent -->
> <map:match pattern="staff-asg">
> <map:generate
> src="http://localhost/cwis/SPT--OAI.php?verb=ListRecords&metadataPrefix=oai_dc&set=Creator:Adolfo%20Steiger"/>
> <map:transform src="xslt/OAI2xhtml.xsl"/>
> <map:serialize type="html"/>
> </map:match>
>
> I thought this would get data from the data source, transform it with
> OAI2xhtml.xsl and aggregate it with the remainder of the cmsbody parts
> and then transforming it with page2xhtml.xsl; instead it shows only the
> cmsbody parts with a weird presentation, as if the XSL are not being
> found or correctly used.
Check your <map:serialize type="xml"/> and <map:serialize type="html"/>.
The former produces "only the cmsbody parts with a weird presentation,
as if the XSL are not being found or correctly used." The latter
displays HTML.
Each entry pipeline must return HTML. Pipelines used internally (such
as called using <map:part>) should serialize XML. You have them
reversed.
solprovider
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org