Lars Huttar wrote:
Geert Josten wrote:
I replied to the list earlier that I have written a lightweight Transformer that does exactly what you want. But you make an even more lightweight one allowing only copying of files.Geert,
Thanks for your help.
I would like to take you up on your offer -- please send me the code for the "save" transformer. And I will probably need to ask detailed questions on where to put the code, etc.
I'll send two copies to you personally to give you a jump start..
I would also very much like to see your transformer contributed to the Cocoon distro; it seems like copying a file would be a pretty widely useful feature. (And I don't want to leave my successors here the hassle of trying to figure out compile their own transformers when they upgrade Cocoon!)
As a start, I think someone should at least write a wiki page specifying what your transformer does, so people can find it.
E.g. a page like http://cocoon.apache.org/2.1/userdocs/transformers/sourcewriting-transformer.html that describes the capabilities. (http://wiki.apache.org/cocoon/SavingFilesToFileSystem should have a link to such a page.)
On the other hand, maybe this would be better as an improvement to the source-writing transformer, since it does something very similar and could be handled with very little change to the API. Or do you think the source-writing transformer is "heavy" enough that a separate lightweight one is warranted?
(to all)
I'm more than willing to contribute to the community, but I said before, I'm unsure whether my solution fit the general picture. I'm convinced that a transformer that can copy is a great lack in the large range of transformers, but would rather see my solution integrated with one that carries more functionality. If the SourceWritingTransformer would support a src feature as contrary to fragment, that would be something, but I always thought that a IOTransformer was lacking as well. A transformer that can do things like copy/create/delete dirs and files..
By the way, I'm not against flowscript, actors, serializers etc that can do the same, but I think one should be able to switch easily between the solutions to pick the one that matches your strategy of the moment the best.
I recently saw comments on building components that provide both generator/transformer of transformer/serializer interface. Sounds really nice to me...
But then again, this discussion belongs on cocoon-dev mailinglist I guess. Time to sign up to that one as well...
Really, I would be happy to do the coding, but as I said before, I have never extended a transformer, and I'm not a very experienced Java programmer, so I don't have confidence that I'd do well even on a file copy function... especially in an environment like Cocoon where it's hard to know what a relative path should be relative to. But if somebody could coach me I'd be happy to do it.
You don't really have to bother about were the files really are. The paths are supplied, you use a resolver to get a file path and pass that to the copy. The files need to be physical of course... I'll send you some code that might jumpstart you on developing Cocoon components (locally)..
Cheers
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
