Thorsten Scherler schrieb:

[...]

These cases could be handled by a transformer:

1) <rev:insert-history document="lenya-document:1234-234-asdf"/>

would be expanded to

  <rev:history document="...">
    <rev:revision ...
    <rev:revision ...
    ...
  </rev:history>

which can be evaluated by a subsequent XSLT.
lovely. imho, this is the most natural way of dealing with it.
unfortunately, lenya uses this pattern only in some obscure corner
cases. we should change that.

Exactly and if we change it, then please let us try to use just a
wrapper transformer. I mean the transformer will call 2 or three methods
max of a cocoon independent helper class which is actually doing the
work. This way I can write a JSF tag attacking the same helper in no
time.

I totally agree. This is what SoC means. The transformer should only care about SAX, not about business logic. Take a look at the AbstractLinkTransformer and its subclasses - they delegate the actual link rewriting to a LinkRewriter implementation.

http://lenya.apache.org/apidocs/2.0/modules/linking/org/apache/lenya/cms/cocoon/transformation/AbstractLinkTransformer.html

IMO the LuceneIndexTransformer is a good example how it should not be done. It totally mixes XML and business logic aspects.

-- Andreas


--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to