Re: Return xml from an Action to the pipeline?

2005-10-17 Thread Lachlan Paterson
Yes, you are probably right. I will try that. I see the answer was also in the 2.0 FAQ. 

http://cocoon.apache.org/2.0/faq/faq-sitemap.html#faq-4

The 2.1 FAQ is still empty, alas. I didn't think to check the older one - but google found it for me.
On 10/17/05, Chris Marasti-Georg [EMAIL PROTECTED] wrote:







Or easier still, have a pipeline for each source that simply does a 
generate and serialize as xml, and use an aggregation:

map:match pattern=request
 map:aggregate 
element=merged
 map:part 
src="">cocoon://report/
 
map:part 
src="">cocoon://other/
 
/map:aggregate
 
map:transform src="">
 
map:serialize type=xhtml/
/map:match



map:match 
pattern=report
 map:generate type=report-generator/
 map:serialize type=xml/

/map:match

map:match 
pattern=other
 map:generate 
src="">context://my/other/file.xml/
 map:serialize type=xml/

/map:match

The xml that gets to 
the transformer would look like:

merged
 report-document.../report-document
 other-document.../other-document
/merged

where 
report-document and other-document are the document elements of those individual 
xml files.

Chris Marasti-Georg


  
  
  From: Combinational Logic 
  [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 16, 
  2005 6:45 PMTo: users@cocoon.apache.orgSubject: RE: 
  Return xml from an Action to the pipeline?
  
  
  
  I think this would be possible with 
  cinclude. Each generator would have its own pipeline. One of your 
  generators would generate cinclude tags that pull in XML from the other 
  generator/pipeline.
  
  
  
  
  
  From: Lachlan 
  Paterson [mailto:[EMAIL PROTECTED]] Sent:
 Sunday, October 16, 2005 3:39 
  PMTo: 
  users@cocoon.apache.orgSubject: Re: Return xml from an Action to 
  the pipeline?
  
  Is it possible to have two generators and 
  then merge the results?
  
  On 10/16/05, Combinational Logic 
[EMAIL PROTECTED] 
   wrote:
  Having never created a generator, I can't 
  comment on that, but it sounds like a good idea.Can anyone 
  estimate how much effort this requires?Another way might be call the 
  java lib from flowscript, creating a DOM.Then pass the DOM to a JXTemplate 
  (along with any other DOMs you want to 'merge' with).The 
  flowscript would look as follows:var reportDom = 
  Way.To.Create.Dom.From.Some.Java.Lib();var otherDom = 
  Way.To.Load.Your.Other.Dom();cocoon.sendPage(merge-jxpipe, {reportDom 
  : reportDom, otherDom: otherDom } );The JXTemplate could be as 
  simple as the 
  following:to-mergereport#{reportDom/*}/reportother#{otherDom/*} 
  /other/to-mergeThen 
  you could use XSLT to do the merge.Lachlan Paterson wrote: 
  ... So, Jasper Reports aside, my question (assuming the above method 
  is sound) is a more general 2 part question:  1) How 
  do I return xml from an Action and access it in the pipeline? 2) How 
  to I merge that xml document into the one that the pipeline is 
  processing?Actions should not return XML. Why not write a generator 
  instead? 
  -To 
  unsubscribe, e-mail: [EMAIL PROTECTED]For 
  additional commands, e-mail: [EMAIL PROTECTED]-
To 
  unsubscribe, e-mail: [EMAIL PROTECTED]For 
  additional commands, e-mail: [EMAIL PROTECTED]
  




Re: Return xml from an Action to the pipeline?

2005-10-16 Thread Ralph Goers



Lachlan Paterson wrote:

I have a pipeline that is successfully producing web pages. I would 
like to create a report using Jasper Reports (which is just a simple 
java library) and then insert that report back into one of my web 
pages. Jasper Reports can output to xml so this should be possible.


I am open to suggestions for how to do this. If put the creation of 
the xml report into an Action, It seems like I should be able to 
return the xml and have it merge back into the pipeline. An Action 
returns a Map - and I can put whatever I want into that Map, so I 
thought about putting the xml result in there and then accessing it 
the pipeline. I'm how I'm not sure to get at it in the pipeline, or 
how to merge it into the xml that was already in the pipeline before I 
called the Action.


So, Jasper Reports aside, my question (assuming the above method is 
sound) is a more general 2 part question:


1) How do I return xml from an Action and access it in the pipeline?
2) How to I merge that xml document into the one that the pipeline is 
processing?


Actions should not return XML. Why not write a generator instead?


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



RE: Return xml from an Action to the pipeline?

2005-10-16 Thread Combinational Logic
Having never created a generator, I can't comment on that, but it sounds
like a good idea.  Can anyone estimate how much effort this requires?

Another way might be call the java lib from flowscript, creating a DOM.
Then pass the DOM to a JXTemplate (along with any other DOMs you want to
'merge' with).  The flowscript would look as follows:

var reportDom = Way.To.Create.Dom.From.Some.Java.Lib();
var otherDom = Way.To.Load.Your.Other.Dom();
cocoon.sendPage(merge-jxpipe, {reportDom : reportDom, otherDom:
otherDom } );

The JXTemplate could be as simple as the following:

to-merge
report
  #{reportDom/*}
/report
other
  #{otherDom/*}
/other
/to-merge

Then you could use XSLT to do the merge.


Lachlan Paterson wrote: ...
 So, Jasper Reports aside, my question (assuming the above method is 
 sound) is a more general 2 part question:

 1) How do I return xml from an Action and access it in the pipeline?
 2) How to I merge that xml document into the one that the pipeline is 
 processing?

Actions should not return XML. Why not write a generator instead?


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



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



Re: Return xml from an Action to the pipeline?

2005-10-16 Thread Lachlan Paterson
Is it possible to have two generators and then merge the results?On 10/16/05, Combinational Logic [EMAIL PROTECTED]
 wrote:Having never created a generator, I can't comment on that, but it sounds
like a good idea.Can anyone estimate how much effort this requires?Another way might be call the java lib from flowscript, creating a DOM.Then pass the DOM to a JXTemplate (along with any other DOMs you want to
'merge' with).The flowscript would look as follows:var reportDom = Way.To.Create.Dom.From.Some.Java.Lib();var otherDom = Way.To.Load.Your.Other.Dom();cocoon.sendPage(merge-jxpipe, {reportDom : reportDom, otherDom:
otherDom } );The JXTemplate could be as simple as the following:to-mergereport#{reportDom/*}/reportother#{otherDom/*}
/other/to-mergeThen you could use XSLT to do the merge.Lachlan Paterson wrote: ... So, Jasper Reports aside, my question (assuming the above method is sound) is a more general 2 part question:
 1) How do I return xml from an Action and access it in the pipeline? 2) How to I merge that xml document into the one that the pipeline is processing?Actions should not return XML. Why not write a generator instead?
-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: 
[EMAIL PROTECTED]-To unsubscribe, e-mail: 
[EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]


RE: Return xml from an Action to the pipeline?

2005-10-16 Thread Combinational Logic










I think this would be possible with
cinclude. Each generator would have its own pipeline. One of your generators
would generate cinclude tags that pull in XML from the other generator/pipeline.













From: Lachlan Paterson
[mailto:[EMAIL PROTECTED] 
Sent: Sunday, October 16, 2005
3:39 PM
To: users@cocoon.apache.org
Subject: Re: Return xml from an
Action to the pipeline?





Is it possible to have
two generators and then merge the results?



On 10/16/05, Combinational
Logic [EMAIL PROTECTED]
 wrote:

Having never created a
generator, I can't comment on that, but it sounds 
like a good idea.Can anyone estimate how much effort this requires?

Another way might be call the java lib from flowscript, creating a DOM.
Then pass the DOM to a JXTemplate (along with any other DOMs you want to 
'merge' with).The flowscript would look as follows:

var reportDom = Way.To.Create.Dom.From.Some.Java.Lib();
var otherDom = Way.To.Load.Your.Other.Dom();
cocoon.sendPage(merge-jxpipe, {reportDom : reportDom, otherDom:

otherDom } );

The JXTemplate could be as simple as the following:

to-merge
report
#{reportDom/*}
/report
other
#{otherDom/*} 
/other
/to-merge

Then you could use XSLT to do the merge.


Lachlan Paterson wrote: ...
 So, Jasper Reports aside, my question (assuming the above method is
 sound) is a more general 2 part question: 

 1) How do I return xml from an Action and access it in the pipeline?
 2) How to I merge that xml document into the one that the pipeline is
 processing?

Actions should not return XML. Why not write a generator instead? 


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



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