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/21 10:00:23 UTC

Resource Type Formats

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


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