cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira ...@upaya.co.uk>
Subject Re: cocoon & JMS
Date Fri, 02 Jan 2004 15:57:01 GMT
enrico.maccias@free.fr wrote:

>Selon Upayavira <uv@upaya.co.uk>:
>
>  
>
>>enrico.maccias@free.fr wrote:
>>
>>    
>>
>>>Selon Geoff Howard <cocoon@leverageweb.com>:
>>>
>>> 
>>>
>>>      
>>>
>>>>enrico.maccias@free.fr wrote:
>>>>   
>>>>
>>>>        
>>>>
>>>>>Hi there and happy new year!
>>>>>
>>>>>
>>>>>  Does anyone know a way to trigger a sitemap pipeline in response to
a
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>JMS 
>>>>   
>>>>
>>>>        
>>>>
>>>>>notification (onMessage()) ?
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>A general solution for this has been discussed before but never 
>>>>implemented (here at least).  Still, this is certainly possible today 
>>>>with a custom component - but could be a lot of work because you'd need 
>>>>to create a full request environment on your own.
>>>>
>>>>But first, I should ask - why?  Do you need the response back from the 
>>>>pipeline re-sent as a followup message, or something?  Or do you simply 
>>>>need to fire off some business logic which is also done by firing off a 
>>>>pipeline?
>>>>
>>>>Geoff
>>>>
>>>>
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>Actually, I don't need to re-send a followup message. Anyway, I think JMS is
>>>      
>>>
>>>not important here. I just need to know if there's a way to fire off a 
>>>pipeline without an HTTP request (even if cocoon is used as a servlet)?
>>> 
>>>
>>>      
>>>
>>Why do you want to fire off a pipeline? Because of some kind of 
>>side-effect of the pipeline? What do you want to do with the output of 
>>the pipeline?
>>
>>There are ways, but it depends upon what you're trying to achieve.
>>
>>Regards, Upayavira
>>
>>
>>    
>>
>
>
>I need to "prepare" some static XML files (mainly XSLTransformations) to be 
>later processed/served by a Cocoon-based webapp. Those XML files are dropped 
>on an FTP server and I get notified of their arrival... Since I use cocoon (as 
>a servlet) I don't want to write an independant Xalan piece of code :)
>  
>
What do you mean by 'I get notified of their arrival'? Do you mean that 
they are sent by FTP to the server, and then the server is informed of 
their arrival?

I would say, using some combination of flow, HTTP post, the 
StreamGenerator and processPipelineTo might do you nicely.

That way, whatever starts the process off posts the raw data to Cocoon, 
in XML, using HTTPPost. In flow, you use code like:
var fis = new java.io.FileInputStream(new java.io.File("yourfile.xml"));
cocoon.processPipelineTo("stream-pipeline", fis);
cocoon.sendPage("show-success");
That way, the contents of the stream are transformed in a pipeline and 
then written to disk.

Alternatively, you could use the SourceWritingTransformer to do it.

I would recommend using HTTP to transfer data, rather than FTP. FTP is 
an antiquated and complex protocol, and, as you have seen, has no 
capacity to notify of delivery. Whereas, when data arrives via HTTP, you 
are free to take that data and place it wherever you want.

Hope this helps.

Regards, Upayavira

>Enrico 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>  
>



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


Mime
View raw message