You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Chitharanjan Das <cd...@accordiasys.com> on 2002/03/15 19:22:39 UTC

Urgent: How to invoke a stram Generator and invoke pipelines thru API calls (or Command line

Hello All,


I have the following requirement, I am trying to plot some graphs using
SVG.
The input for the graphs's are some XML documents, which are generated
from some queries to the database.
I have already implemented java code to retrieve the data in XML.

I have also created sitemap entry that will generated the graph for a
given XML
	<map:match pattern="svgxml/**">
   		<map:generate  src="docs/samples/jsp/svg/{1}.xml"/>   
   		<map:transform src="docs/samples/jsp/xsl/graph.xsl"/>
   		<map:serialize type="svgxml"/>
   	</map:match>

//The following is pipeline entry for handling stream........
	<map:match pattern="svgxmlstream">
   		<map:generate  type="stream" /> 
   		<map:transform src="docs/samples/jsp/xsl/graph.xsl"/>
   		<map:serialize type="svgxml"/>
   	</map:match>
As indicated above, the sitemap returns an SVG document for a given XML.

The code snippet of my JSP page looks like 

------------------------------------------------------------------------
-------
<html>
		...		
	<%
		Iterator itr = request.getAttribute("Graphs");
		String graphXML = null;
		If (itr.hasNext()) {
			graphXML = (String) itr.next();
			graphXMLStream = new
ByteArrayInputStream(graphXML.toBytes[]};
	%>
			//invoke the pipeline entry svgxmlstream and use
the embed command
		...
		...
<html>
------------------------------------------------------------------------
------------


My questiona are 

1.how does one invoke a pipeline with a stream type
generator.(Preferably with a cinclude transformer)
2. Is it possible to invoke Pipelines via java API calls (not through
URL)
3. Is there any pointer to documentation as how to use Cocoon from
Command line

Thanks a lot it advance,

Regds,
Chiths





---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Urgent: How to invoke a stram Generator and invoke pipelines thru API calls (or Command line

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Chitharanjan Das [mailto:cdas@accordiasys.com]
> 
> Hello All,

<snip/>

> As indicated above, the sitemap returns an SVG document for a given
XML.
> 
> The code snippet of my JSP page looks like

Hm. Why JSP?


> <html>
> 		...
> 	<%
> 		Iterator itr = request.getAttribute("Graphs");
> 		String graphXML = null;
> 		If (itr.hasNext()) {
> 			graphXML = (String) itr.next();
> 			graphXMLStream = new
> ByteArrayInputStream(graphXML.toBytes[]};
> 	%>
> 			//invoke the pipeline entry svgxmlstream and use
> the embed command
> 		...
> 		...
> <html>
>
------------------------------------------------------------------------
> ------------
> 
> 
> My questiona are
> 
> 1.how does one invoke a pipeline with a stream type
> generator.(Preferably with a cinclude transformer)

IIRC, you should POST XML there.


> 2. Is it possible to invoke Pipelines via java API calls (not through
> URL)

See CocoonServlet.java or Main.java. Or java.net.URL.


> 3. Is there any pointer to documentation as how to use Cocoon from
> Command line

see run.bat

Vadim

 
> Thanks a lot it advance,
> 
> Regds,
> Chiths



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>