You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2004/06/27 22:46:56 UTC

[RT] Resource Type Packages

Hi Lenya developers,

ATM we have a quite straightforward tutorial about creating
new resource types. This raises the question if installing
a resource type couldn't be done automatically.

BTW, I'm using the term "resource type" instead of "document
type" because I think non-document-resources (like images)
could also be supported.

The approach I'm imagining is based on some assumptions:

- Resource types are shared between publications.
   They are installed like publications, using a property
   in build.properties.
   Resource type files are deployed to
   $LENYA_WEBAPP/lenya/resource-types/{resource-type}/

- The resource type information is removed from the
   page envelope to support multiple resources in one page.

- All resource transformations take place in
   $LENYA_WEBAPP/lenya/resource-types.xmap

Resource Type Packages
======================

A resource type package contains

   - a creator component declaration (+ implementation if not in core)
     (<dream>hopefully this will be a cocoon.xconf patch
      someday ...</dream>)

   - a sample file (could be used by creator)

   - all necessary schemas / relax NGs etc.

   - a set of different views (e.g. XSLT, CSS)
     (at least one default view)

   - a patch for resource-types.xmap to add the necessary
     view pipelines

   - editor configuration(s)

   - ... (?)

Presentation
============

- By default, a resource is delivered to the publication
   as an XHTML snippet:

   <div id="resource">
     ...
   </div>

   The resource type package includes a transformation to
   achieve this.

- The transformation of a resource supports the fallback
   mechanism. This means, a publication can override the
   default transformation from the resource type package.

- Additional (custom) transformations to XHTML snippets and
   other formats can be offered by the package.


Approach A: Dynamic Generation of the Transformation
----------------------------------------------------

In this approach, the resource is generated in the publication
and transformed using the resource type.

- A resource transformation is called from a publication
   like follows:

   cocoon://resource/{resource-type}/{view}.xsl

   - resource-type: The resource type name. It must be passed
     because the page envelope
   - view: The transformation to choose.

   This request goes into resource-types.xmap, where the
   appropriate transformation is generated (XSLT / meta stylesheet).
   The fallback mechanism is applied
   (lenya/{mypub}/lenya/resource-types/{resource-type}/xslt/{view}.xsl)

   A more flexible alternative would be

   <map:transform type="{page-envelope:resource-type}"
       src="{view}"/>

   This would allow to use custom transformers (the resource type
   patches global-sitemap.xmap to install its transformer).

Disadvantages:
   - parameter handling requires meta stylesheets
   - multiple subsequent transformations must be called
     separately from the publication


Approach B: Using the lenya:// protocol
---------------------------------

- The transformed resource is called from the publication using

   <map:generate src="lenya://{resource-url}?lenya.view={view}"/>

   - resource-url: The resource URL for the LenyaSourceFactory.
   - view: The transformation to choose.

   The resource type is not passed, it can be obtained using
   the resource URL together with the URIParameterizer.

   In global-sitemap.xmap, a request parameter matcher redirects
   the request into resource-types.xmap, where the resource is
   generated using the LenyaSourceFactory and the appropriate
   transformation is applied.


As soon as we have the LenyaSourceFactory in 1.4 HEAD, I will
do some explorative prototyping.

WDYT?

-- Andreas


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


Re: [RT] Resource Type Packages

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

[...]

>   - resource-type: The resource type name. It must be passed
>     because the page envelope

Sorry, I forgot "because the page envelope does not contain the
resource type information anymore".

-- Andreas


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


Re: [RT] Resource Type Packages

Posted by Andreas Hartmann <an...@apache.org>.
Gregor J. Rothfuss wrote:

[...]

>> Approach B: Using the lenya:// protocol
>> ---------------------------------
> 
> 
> i like B better.

Me too.

> what about its downsides?

I'm not sure yet, the design is still quite vague.
I guess we will find out as soon as we do some prototyping ...

-- Andreas


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


Re: [RT] Resource Type Packages

Posted by Rolf Kulemann <ro...@apache.org>.
On Mon, 2004-06-28 at 15:15, Rolf Kulemann wrote:
> On Mon, 2004-06-28 at 14:04, Gregor J. Rothfuss wrote:
> > Andreas Hartmann wrote:
> > 
> > > Resource Type Packages
> > > ======================
> > 
> > i like this idea. resource types are the first thing someone extending 
> > lenya comes across. if it were easy to share them across publications, 
> > that would be a big plus. i wonder how they differ from the publets 
> > ideas? 
> 
> Another interesting question is:
> 
> What have publets in common with portlets ? 

Of course I meant "coplets" ...

-- 
Rolf Kulemann


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


Re: [RT] Resource Type Packages

Posted by Rolf Kulemann <ro...@apache.org>.
On Mon, 2004-06-28 at 14:04, Gregor J. Rothfuss wrote:
> Andreas Hartmann wrote:
> 
> > Resource Type Packages
> > ======================
> 
> i like this idea. resource types are the first thing someone extending 
> lenya comes across. if it were easy to share them across publications, 
> that would be a big plus. i wonder how they differ from the publets 
> ideas? 

Another interesting question is:

What have publets in common with portlets ? Maybe it makes sense to
leverage the portlet infrastructure to setup a publet framework.

The problem is I had only a few looks to the cocoon portal stuff yet.

Any ideas?

-- 
Rolf Kulemann


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


Re: Outlook: Publets was Re: [RT] Resource Type Packages

Posted by Rolf Kulemann <ma...@rolf-kulemann.com>.
On Mon, 2004-06-28 at 16:06, Scherler, Thorsten wrote:
> Rolf Kulemann wrote:
> > On Mon, 2004-06-28 at 15:19, Andreas Hartmann wrote:
> > 
> >>Rolf Kulemann wrote:
> >>
> >>>On Mon, 2004-06-28 at 14:04, Gregor J. Rothfuss wrote:
> >>>
> >>>
> >>>>Andreas Hartmann wrote:
> > 
> > ...
> > 
> >>I'm not familiar with the current state of the publet concept, 
> > 
> > 
> > Well, as soon as we have a 1.4 branch, I can show what I have. Before
> > that time I will try to work on the corresponding wiki.
> > 
> > One main problem is how to integrate a publet into lenyas sitemap
> > infrastructure. My protoype uses a sitemap hook in global-sitemap.xmap
> > which looks for a request parameter named lenya.publet . If this
> > parameter is available a sitemap mount takes place at
> > lenya/publets/[publet_name]/sitemap.xmap
> > 
> >>From there on the normal usecase stuff takes place i.e. imagine a
> > request params like this:
> > 
> > lenya.publet=news
> > lenya.usecase=edit
> > lenya.usecase.step=whatever
> > 
> > The publet itself makes heavy use of the fallback input modules to apply
> > publication specific xslts and stuff.
> > 
> > Two things I have not yet solved quite good is
> > 
> > - integrate a publet specific config area to lenya admin area, which is
> > build up dynamically from config meta data provided by the publet.
> > 
> > - Framework to integrate publet specicifc CMS menu items
> > 
> > Of course there are many more details missing in the prototype like
> > access control and stuff.
> > 
> > 
> [...] Dude I can't wait to see it in 1.4! As soon as we have SVN I will 
> try to support you with the implementation!

I can not wait to get some help.

> 
> The idea is brilliant! We should try that one create a cocoon webapp, 
> extended with publet logic and integrate it in lenya! That would solve 
> heaps of import problems.

I hope so. But I still fear we double concepts of Cocoon's coplets.
Thats needs some investigation.

> 
> I would like to integrate a forrest pub this way. I think that would be 
> awesome for editing forrest-documentation and extending our community. 
> You build your lenya application and write the documentation within. Great!

A forrest pub(let) would really rock.

Yes I also dream of a "self contained" cms. Imagine u edit xslts via bxe
or forms, save and version the changes and/or submit a diff as patch to
lenya-dev or so....


-- 

Regards,

Rolf Kulemann


"Beware of bugs in the above code; I have only proved it correct, not
tried it."
		-- Donald Knuth


PGP/GPG public key:
	 http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6B4EA7EA


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


Re: Outlook: Publets was Re: [RT] Resource Type Packages

Posted by "Scherler, Thorsten" <th...@apache.org>.
Rolf Kulemann wrote:
> On Mon, 2004-06-28 at 15:19, Andreas Hartmann wrote:
> 
>>Rolf Kulemann wrote:
>>
>>>On Mon, 2004-06-28 at 14:04, Gregor J. Rothfuss wrote:
>>>
>>>
>>>>Andreas Hartmann wrote:
> 
> ...
> 
>>I'm not familiar with the current state of the publet concept, 
> 
> 
> Well, as soon as we have a 1.4 branch, I can show what I have. Before
> that time I will try to work on the corresponding wiki.
> 
> One main problem is how to integrate a publet into lenyas sitemap
> infrastructure. My protoype uses a sitemap hook in global-sitemap.xmap
> which looks for a request parameter named lenya.publet . If this
> parameter is available a sitemap mount takes place at
> lenya/publets/[publet_name]/sitemap.xmap
> 
>>>From there on the normal usecase stuff takes place i.e. imagine a
> request params like this:
> 
> lenya.publet=news
> lenya.usecase=edit
> lenya.usecase.step=whatever
> 
> The publet itself makes heavy use of the fallback input modules to apply
> publication specific xslts and stuff.
> 
> Two things I have not yet solved quite good is
> 
> - integrate a publet specific config area to lenya admin area, which is
> build up dynamically from config meta data provided by the publet.
> 
> - Framework to integrate publet specicifc CMS menu items
> 
> Of course there are many more details missing in the prototype like
> access control and stuff.
> 
> 
[...] Dude I can't wait to see it in 1.4! As soon as we have SVN I will 
try to support you with the implementation!

The idea is brilliant! We should try that one create a cocoon webapp, 
extended with publet logic and integrate it in lenya! That would solve 
heaps of import problems.

I would like to integrate a forrest pub this way. I think that would be 
awesome for editing forrest-documentation and extending our community. 
You build your lenya application and write the documentation within. Great!

King regards
thorsten
-- 
<thorsten>
  <name>Thorsten Scherler</name>
  <country>Spain</country>
  <@m...@mail>
 
<@c...@cocoon-WIKI>
  <http>http://www.target-x.de</http>
  <acronymfinder>http://www.acronymfinder.com</acronymfinder>
  <motto>
	"My task which I am trying to achieve is,
	by the power of the written word,
	[...] to make you see."
	*Joseph Conrad (1857-1924)*
  </motto>
</thorsten>



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


Outlook: Publets was Re: [RT] Resource Type Packages

Posted by Rolf Kulemann <ro...@apache.org>.
On Mon, 2004-06-28 at 15:19, Andreas Hartmann wrote:
> Rolf Kulemann wrote:
> > On Mon, 2004-06-28 at 14:04, Gregor J. Rothfuss wrote:
> > 
> >>Andreas Hartmann wrote:
...
> 
> I'm not familiar with the current state of the publet concept, 

Well, as soon as we have a 1.4 branch, I can show what I have. Before
that time I will try to work on the corresponding wiki.

One main problem is how to integrate a publet into lenyas sitemap
infrastructure. My protoype uses a sitemap hook in global-sitemap.xmap
which looks for a request parameter named lenya.publet . If this
parameter is available a sitemap mount takes place at
lenya/publets/[publet_name]/sitemap.xmap

>>From there on the normal usecase stuff takes place i.e. imagine a
request params like this:

lenya.publet=news
lenya.usecase=edit
lenya.usecase.step=whatever

The publet itself makes heavy use of the fallback input modules to apply
publication specific xslts and stuff.

Two things I have not yet solved quite good is

- integrate a publet specific config area to lenya admin area, which is
build up dynamically from config meta data provided by the publet.

- Framework to integrate publet specicifc CMS menu items

Of course there are many more details missing in the prototype like
access control and stuff.



> but
> when it comes to deployment etc. the two might indeed have something
> in common. Maybe it makes sense to see resource type packages as special
> publets?
> 
> Apart from that, your scenario really makes sense.
> 
> [...]
> 
> > I also thought some more about the lenya protocol. One idea I had was,
> > since the LenyaSourceFactory mainly delegates to other SourceFactories,
> > to mount special delegations. I.e. pubs/*/content/ would cause a
> > delegation the jcr/slide SourceFactory. We decided to use this "feature"
> > to "port" our current sitemaps to use the lenya protocol without
> > breaking the current "file based content storage", because we simply
> > delegate to the context protocol. this is already tested on the sprint
> > and waits for inclusion.
> > 
> > BTW: Do you think the lenya protocol should go into 1.2.1 ?
> 
> I think I'm -1 ...
> 
> Lenya 1.2.1 should only add minor features and bug fixes.
> To benefit from this change, a 1.2 publication would probably
> need some refactoring.

Ok. So I have more time for some research.

-- 
Rolf Kulemann


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


Re: [RT] Resource Type Packages

Posted by Andreas Hartmann <an...@apache.org>.
Rolf Kulemann wrote:
> On Mon, 2004-06-28 at 14:04, Gregor J. Rothfuss wrote:
> 
>>Andreas Hartmann wrote:
>>
>>
>>>Resource Type Packages
>>>======================
>>
>>i like this idea. resource types are the first thing someone extending 
>>lenya comes across. if it were easy to share them across publications, 
>>that would be a big plus. i wonder how they differ from the publets 
>>ideas? 
> 
> 
> Mhh, I think publets and resource types are somehow "orthogonal". A news
> publet could be configured/implemented to use "the" blog resource/doc
> type. Maybe I understood the idea of the resource types wrong, but since
> a resource type can also be a doctype, the scenario would make sense.

I'm not familiar with the current state of the publet concept, but
when it comes to deployment etc. the two might indeed have something
in common. Maybe it makes sense to see resource type packages as special
publets?

Apart from that, your scenario really makes sense.

[...]

> I also thought some more about the lenya protocol. One idea I had was,
> since the LenyaSourceFactory mainly delegates to other SourceFactories,
> to mount special delegations. I.e. pubs/*/content/ would cause a
> delegation the jcr/slide SourceFactory. We decided to use this "feature"
> to "port" our current sitemaps to use the lenya protocol without
> breaking the current "file based content storage", because we simply
> delegate to the context protocol. this is already tested on the sprint
> and waits for inclusion.
> 
> BTW: Do you think the lenya protocol should go into 1.2.1 ?

I think I'm -1 ...

Lenya 1.2.1 should only add minor features and bug fixes.
To benefit from this change, a 1.2 publication would probably
need some refactoring.

-- Andreas


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


Re: [RT] Resource Type Packages

Posted by Rolf Kulemann <ro...@apache.org>.
On Mon, 2004-06-28 at 14:04, Gregor J. Rothfuss wrote:
> Andreas Hartmann wrote:
> 
> > Resource Type Packages
> > ======================
> 
> i like this idea. resource types are the first thing someone extending 
> lenya comes across. if it were easy to share them across publications, 
> that would be a big plus. i wonder how they differ from the publets 
> ideas? 

Mhh, I think publets and resource types are somehow "orthogonal". A news
publet could be configured/implemented to use "the" blog resource/doc
type. Maybe I understood the idea of the resource types wrong, but since
a resource type can also be a doctype, the scenario would make sense.

Both, resource types and publets, have in common, that they can be used
across publications.

> how much custom behaviour can a resource type have?
> 
> > Approach A: Dynamic Generation of the Transformation
> > ----------------------------------------------------
> 
> > Approach B: Using the lenya:// protocol
> > ---------------------------------

I also like this better, since it fits into our concept of using a
common (lenya) protocol in sitemaps. 

I also thought some more about the lenya protocol. One idea I had was,
since the LenyaSourceFactory mainly delegates to other SourceFactories,
to mount special delegations. I.e. pubs/*/content/ would cause a
delegation the jcr/slide SourceFactory. We decided to use this "feature"
to "port" our current sitemaps to use the lenya protocol without
breaking the current "file based content storage", because we simply
delegate to the context protocol. this is already tested on the sprint
and waits for inclusion.

BTW: Do you think the lenya protocol should go into 1.2.1 ? I think side
effects could be found quite fast. We could start to port only some
relevant sitemaps, which we can inverstigate over some time. Then we
could decide to port the rest. From that point on we are close to use a
repository like slide/jcr.

I think I will play with the jcr RI of slide the next weeks. Of course
the rep integration should not be scheduled for 1.2.1-


> 
> i like B better. what about its downsides?

Dunno yet. Lets do some prototyping.
-- 
Rolf Kulemann


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


Re: [RT] Resource Type Packages

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Andreas Hartmann wrote:

> Resource Type Packages
> ======================

i like this idea. resource types are the first thing someone extending 
lenya comes across. if it were easy to share them across publications, 
that would be a big plus. i wonder how they differ from the publets 
ideas? how much custom behaviour can a resource type have?

> Approach A: Dynamic Generation of the Transformation
> ----------------------------------------------------

> Approach B: Using the lenya:// protocol
> ---------------------------------

i like B better. what about its downsides?


-- 
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-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org