Leszek Gawron wrote:

> curl -T "test.xml"
http://localhost:8888/samples/scratchpad/module-source/test3

this is a tool I was looking for :) up till now I was using pure telnet.

Yes, it is very usefull, we use it a lot :)



I don't use XSP. Using flowscript I would write a pipeline consisting of
a file generator with module:request:inputStream as source and an xml
serializer. This pipeline is then called from processToDOM in
PipelineUtil. I don't know if there are any XSP tag libraries for using
sources, but you can at least simplify the above code considerably by
first geting the source resolver, then using
o.a.c.components.source.SourceUtil.readDOM with the URI
module:request:inputStream. There are lots of usefull stuff for using
sources in SourceUtil.

It really works. Her is the source in case someone lame as me searched for this kind of stuff later:

SourceResolver resolver = (SourceResolver)manager.lookup(SourceResolver.ROLE);
Source source = resolver.resolveURI( "module:request:inputStream" );

Document document = SourceUtil.toDOM( source );

getLogger().warn( DOMUtil.node2String( document, true ) );

resolver.release( source );
manager.release( resolver );

It is probably a good idea to call release within a final.


I placed the documentation in the announcement and some other stuff in the WIKI:

http://wiki.cocoondev.org/Wiki.jsp?page=ModuleSource
http://wiki.cocoondev.org/Wiki.jsp?page=XModuleSource

Maybe you would like to add your example.

/Daniel



Reply via email to