You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Nunez Steve <st...@yahoo.com> on 2007/07/20 07:49:39 UTC

Simple, application specific processing pipeline.

Following up on my own message, I can think of an
additional use case for Lenya that does not involve
navigational elements being added by the foo2xhtml.xsl
stylesheet: machine readable content.

One of the applications that we'd like to use Lenya
for is to maintain content that will be read by
machine using XML-RPC.

In this use case, the 'live' site will simply be the
XML files. We will also use parameterized URL access
to render the pages for humans by use of stylesheet.
In  this case the stylesheet for the human readable
version will not contain any navigation widgets
because the machine readable XML won't have that
information.

Any pointers to a simple example of the pipeline,
without any Lenua elements or processing in it would
be very helpful.

Regards,
    - Steve



--- Nunez Steve <st...@yahoo.com> wrote:

> Lenya Users (and Andreas),
> 
> I think I see the problem here. It appears that
> Lenya,
> at least in the default configuration, is placing
> the
> navigation elements into the XHTML via the XSLT.
> Looking at the included stylesheet, page2xhtml, the
> 'structure' of the page is constructed with a table
> to
> place the various navigation elements in the
> required
> locations.
> 
> This is one common way of structuring HTML pages,
> but
> not the only way. If you look at the source code for
> the Illation website, you'll see that there is *no*
> structure in the XHTML -- all of the positioning and
> layout of navigational elements is done with CSS.
> 
> Has anyone else used Lenya in a configuration where
> the  entire page layout is controlled by CSS?
> 
> As a more practical question, how exactly can we
> remove all of the default Lenya publication XSLT
> from
> the pipeline, and implement only a single
> transformation?
> 
> E.g.
> 
> XML --XSLT--> XHTML Strict ----> Browser (using CSS)
> 
> Regards,
>     - Steve Nunez
> 
> --- Andreas Hartmann <an...@apache.org> wrote:
> 
> > If you really want to use your XSLTs as they are,
> > you can remove the
> > pipelines you mentioned above and put your XSLTs
> in
> > your publication.
> > 
> > But this is not the way Lenya was designed to be
> > used.
> > I'd recommend that you use the navigation
> framework
> > to generate your
> > navigation elements (in the case of the illation
> > website that would
> > be the horizontal menus at the top of the page and
> > the "Products" menus
> > at the right hand side of the page) and use the
> > XSLTs in the publication
> > to assemble the page.
>  
> 
> 
> 
>        
>
____________________________________________________________________________________
> Boardwalk for $500? In 2007? Ha! Play Monopoly Here
> and Now (it's updated for today's economy) at Yahoo!
> Games.
>
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow
>  
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@lenya.apache.org
> For additional commands, e-mail:
> user-help@lenya.apache.org
> 
> 



       
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/

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


Re: New Resource Type Presentation

Posted by Andreas Hartmann <an...@apache.org>.
Nunez Steve schrieb:
> Hello Lenya Users,
> 
> According to the documentation found at:
> 
> http://lenya.apache.org/docs/2_0_x/reference/resource-types.html#Formats
> 
> the presentation of a new resource is modified as
> follows:
> 
> Presentation
> To make your resources available as HTTP pages, you
> have to add the appropriate pipelines and XSLT
> stylesheets. In general, there are no restrictions.
> 
> If you derive your publication from the default
> publication, the pipelines have to be placed in
> <publication>/doctypes.xmap. The stylesheets are
> located in <publication>/xslt/ and are named
> <resource-type>2xhtml.xsl (e.g., profile2xhtml.xsl).
> The stylesheet is supposed to generate a valid XHTML
> fragment (in the XHTML namespace) with <div id="body">
> as the document element.
> 
> However there is no <publication>/doctypes.xmap in the
> default publication of the branch I just checked out
> today. 

The documentation was outdated. I updated it:

<quote>

The pipelines have to be placed in $MODULE_HOME/sitemap.xmap. The
stylesheets are typically located in $MODULE_HOME/xslt/ and named
{resource-type}2{format}.xsl  (e.g., profile2xhtml.xsl).

In the case of the xhtml format, the stylesheet is supposed to generate
a valid XHTML document (in the XHTML namespace). The output of other
formats depends on the purpose of the respective format.

</quote>

Thanks for reporting!

-- Andreas

-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch


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


Re: Resource Type Formats

Posted by Andreas Hartmann <an...@apache.org>.
Andreas Hartmann schrieb:
> Nunez Steve schrieb:
>> Hello Lenya Users,
>>
>> Following the suggestions of Andreas, I've created a
>> custom resource type and, using the default
>> publication templet, am able to display the contents
>> in the body (cmsbody?) of the default templet.
>>
>> As mentioned in previous messages, because the styling
>> for this site is done entirely in CSS, including the
>> navigation elements, I'm trying to remove the
>> navigational elements that are added by
>> page2xhtml.xsl, with the goal of having my page render
>> in the space just below the Lenya "File Edit Workflow
>> ..." menus.
>>
>> It appears that what I may need is a Resource Type
>> Format (please correct me if this is wrong), which is
>> described here:
>>
>> http://lenya.apache.org/docs/2_0_x/reference/resource-types.html#Formats
>>
>> This page states:
>>
>> "A resource type provides a set of formats to provide
>> different ways of presenting content documents. The
>> formats are defined in the resource type declaration:"
>>
>> Assuming that this means the *entire* display, and not
>> just the display of the cmsbody,
> 
> No, it means only the document content ("cmsbody").
> The navigation elements are generated by the navigation
> framework (sitetree module).

BTW, I added an image to illustrate the concept of formats.
It should be online after the next staging website update at

http://lenya.zones.apache.org/docu/docs/2_0_x/reference/resource-types.html#Formats

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch


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


Re: Resource Type Formats

Posted by Andreas Hartmann <an...@apache.org>.
Nunez Steve schrieb:
> Hello Lenya Users,
> 
> Following the suggestions of Andreas, I've created a
> custom resource type and, using the default
> publication templet, am able to display the contents
> in the body (cmsbody?) of the default templet.
> 
> As mentioned in previous messages, because the styling
> for this site is done entirely in CSS, including the
> navigation elements, I'm trying to remove the
> navigational elements that are added by
> page2xhtml.xsl, with the goal of having my page render
> in the space just below the Lenya "File Edit Workflow
> ..." menus.
> 
> It appears that what I may need is a Resource Type
> Format (please correct me if this is wrong), which is
> described here:
> 
> http://lenya.apache.org/docs/2_0_x/reference/resource-types.html#Formats
> 
> This page states:
> 
> "A resource type provides a set of formats to provide
> different ways of presenting content documents. The
> formats are defined in the resource type declaration:"
> 
> Assuming that this means the *entire* display, and not
> just the display of the cmsbody,

No, it means only the document content ("cmsbody").
The navigation elements are generated by the navigation
framework (sitetree module).

> then this is what I
> want. It's still not clear to me where the pipeline
> begins and ends, so it's difficult to see where the
> page2xhtml stylesheet is actually being applied.
> 
> Assuming the above is correct, then what exactly does
> the format specification lines mean:
> 
> <format name="xhtml"
> uri="cocoon://modules/profile/xhtml.xml"/>
>   <format name="include"
> uri="cocoon://modules/profile/xhtml-inline.xml"/
> 
> ?

They declare different formats (presentation options) which
are available for your resource type. For a "person profile"
resource type, this might be

- XHTML for web pages
- XHTML snippets ("teasers") to be included in other pages
- VCard text files
- PDFs
- ...


> I can see that they're cocoon modules,

Actually, they define pipeline URLs to be called to obtain
the formatted document from.

> but they refer
> to the name given in the example "profile". Its not
> specified what file these lines are in either.

They're in the resource type declaration (resourcetype-profile.xconf).
I added this info to the docs.


> Continuing with the example, it states:
> 
> "This URI is matched inside the module sitemap (in our
> case, modules/profile/sitemap.xmap)"
> 
> followed by an excerpt of a sitemap.xmap file, however
> this example differs from the one given in the
> tutorial. In any case, its not clear how the URI is
> matched in this file.

It's up to you how you match the URIs. There is no standard,
the documentation just shows some examples. BTW, the matchers
in the resource type docs and in the example don't differ that
much - one matches the URI without parameters and one matches
the URI with parameters.


> Continuing a bit further, there's a statement:
> 
> "To request a formatted document, you can use the
> format parameter of the site: and lenya-document:
> protocols:"
> 
> followed by another excerpt from a file which is not
> specified. What file is displayed here (doing some
> kind of aggration).

The sitemap file is not specified because it is just an
example. It can be an arbitrary sitemap.


> Finally, there's an example of using this with
> dublincore, which is not clear at all (at least to
> someone new to Lenya). For example, what file is the
> line:
> 
> <map:generate
> src="lenya-document:{page-envelope:uuid}?format={dublincore:format}"/>
> 
> to be placed in?

Again, you can use this call in an arbitrary sitemap,
wherever you need to generate the formatted document.


> Assuming that I'm heading in the right direction,
> these examples appear to do what I want, but assume
> that the reader is already familar with Lenya. An
> expanded explanation would help a great deal
> (something I'm willing to do, provided I can
> understand it myself first!).

I hope my comments were a bit helpful ...
Maybe you'd like to get the documentation from SVN so that
you always have the latest changes.

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch


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


Resource Type Formats

Posted by Nunez Steve <st...@yahoo.com>.
Hello Lenya Users,

Following the suggestions of Andreas, I've created a
custom resource type and, using the default
publication templet, am able to display the contents
in the body (cmsbody?) of the default templet.

As mentioned in previous messages, because the styling
for this site is done entirely in CSS, including the
navigation elements, I'm trying to remove the
navigational elements that are added by
page2xhtml.xsl, with the goal of having my page render
in the space just below the Lenya "File Edit Workflow
..." menus.

It appears that what I may need is a Resource Type
Format (please correct me if this is wrong), which is
described here:

http://lenya.apache.org/docs/2_0_x/reference/resource-types.html#Formats

This page states:

"A resource type provides a set of formats to provide
different ways of presenting content documents. The
formats are defined in the resource type declaration:"

Assuming that this means the *entire* display, and not
just the display of the cmsbody, then this is what I
want. It's still not clear to me where the pipeline
begins and ends, so it's difficult to see where the
page2xhtml stylesheet is actually being applied.

Assuming the above is correct, then what exactly does
the format specification lines mean:

<format name="xhtml"
uri="cocoon://modules/profile/xhtml.xml"/>
  <format name="include"
uri="cocoon://modules/profile/xhtml-inline.xml"/

?

I can see that they're cocoon modules, but they refer
to the name given in the example "profile". Its not
specified what file these lines are in either.

Continuing with the example, it states:

"This URI is matched inside the module sitemap (in our
case, modules/profile/sitemap.xmap)"

followed by an excerpt of a sitemap.xmap file, however
this example differs from the one given in the
tutorial. In any case, its not clear how the URI is
matched in this file.

Continuing a bit further, there's a statement:

"To request a formatted document, you can use the
format parameter of the site: and lenya-document:
protocols:"

followed by another excerpt from a file which is not
specified. What file is displayed here (doing some
kind of aggration).

Finally, there's an example of using this with
dublincore, which is not clear at all (at least to
someone new to Lenya). For example, what file is the
line:

<map:generate
src="lenya-document:{page-envelope:uuid}?format={dublincore:format}"/>

to be placed in?

Assuming that I'm heading in the right direction,
these examples appear to do what I want, but assume
that the reader is already familar with Lenya. An
expanded explanation would help a great deal
(something I'm willing to do, provided I can
understand it myself first!).

Cheers,
    - Steve


       
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/

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


New Resource Type Presentation

Posted by Nunez Steve <st...@yahoo.com>.
Hello Lenya Users,

According to the documentation found at:

http://lenya.apache.org/docs/2_0_x/reference/resource-types.html#Formats

the presentation of a new resource is modified as
follows:

Presentation
To make your resources available as HTTP pages, you
have to add the appropriate pipelines and XSLT
stylesheets. In general, there are no restrictions.

If you derive your publication from the default
publication, the pipelines have to be placed in
<publication>/doctypes.xmap. The stylesheets are
located in <publication>/xslt/ and are named
<resource-type>2xhtml.xsl (e.g., profile2xhtml.xsl).
The stylesheet is supposed to generate a valid XHTML
fragment (in the XHTML namespace) with <div id="body">
as the document element.

However there is no <publication>/doctypes.xmap in the
default publication of the branch I just checked out
today. 

Is this file to be created, with only my custom
resource pipeline in it?

Regards,
    - Steve Nunez



       
____________________________________________________________________________________
Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
http://new.toolbar.yahoo.com/toolbar/features/mail/index.php

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


Re: Simple, application specific processing pipeline.

Posted by Nunez Steve <st...@yahoo.com>.
Andreas, et. al.,

Thanks for this. When you give the example of the
pipeline:

--- Andreas Hartmann <an...@apache.org> wrote:
> Basically, your publication pipeline might look like
> this:
> 
> <map:match pattern="**.xml">
>   <map:generate
>
src="lenya-document:{page-envelope:document-uuid}?format=..."/>
>   <map:serialize type="xml"/>
> </map:match>

do you mean that this should be located in the
$MODULE/sitemap.xmap, or elsewhere?

Cheers,
    - Steve Nunez


       
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433

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


Re: Simple, application specific processing pipeline.

Posted by Andreas Hartmann <an...@apache.org>.
Hi Steve,

Nunez Steve schrieb:
> Following up on my own message, I can think of an
> additional use case for Lenya that does not involve
> navigational elements being added by the foo2xhtml.xsl
> stylesheet: machine readable content.

yes, this is a typical application, and - thanks to
the Cocoon architecture - very easy to implement.

> One of the applications that we'd like to use Lenya
> for is to maintain content that will be read by
> machine using XML-RPC.
> 
> In this use case, the 'live' site will simply be the
> XML files. We will also use parameterized URL access
> to render the pages for humans by use of stylesheet.
> In  this case the stylesheet for the human readable
> version will not contain any navigation widgets
> because the machine readable XML won't have that
> information.
> 
> Any pointers to a simple example of the pipeline,
> without any Lenua elements or processing in it would
> be very helpful.

You'll find plenty of infos about pipeline structures
in the Cocoon documentation.

I'd recommend to use a resource type format for this purpose
(http://lenya.apache.org/docs/2_0_x/reference/resource-types.html#Formats).

Basically, your publication pipeline might look like this:

<map:match pattern="**.xml">
  <map:generate
src="lenya-document:{page-envelope:document-uuid}?format=..."/>
  <map:serialize type="xml"/>
</map:match>

HTH,
-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch


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