You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "KUMAR,PANKAJ (HP-Cupertino,ex1)" <pa...@hp.com> on 2001/07/24 04:49:46 UTC

[C2]A tool to monitor SAX events in a Cocoon processing pipeline -- CPP

Hi,

I have developed a tool with GUI ( written in Swing JFC ) to monitor flow of
SAX events through a Cocoon pipeline.  I felt the need for such a tool while
trying to comeup with something that could demonstrate the inner workings of
Cocoon application in a visual manner. Later on, I also found it useful in
debugging my application.

You can find some description and the tool ( source and binaries ) at
http://www.pankaj-k.net/cpp

Please drop me a line if you liked the tool and would like it to be
maintained/evolved.

Pankaj.

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


Help:Cocoon and servlet

Posted by Mamadou Bobo Sylla <bo...@ewarna.com>.
Hello everyone,
I am trying to test some the code examples from Apache . When I call the xml
page countries.xml through bowser, it works fine being processd by page.xsl.
But I want countries.xml to be processed after a resquet to a servlet.
For that purpose I have writtent a servlet called Test which should now
output the xml  to be processed by a stylsheet called page.xsl.

How do I configure  Cocoon so that it becomes aware of my servlet.

The codes of Test.java:
============
public class Test extends HttpServlet {


 public void doGet( HttpServletRequest req,
                       HttpServletResponse res )
        throws ServletException, IOException
 {

  PrintWriter output = res.getWriter();
        res.setContentType( "text/xml" );

         StringBuffer xmlbuf =new StringBuffer("<?xml version=\"1.0\"
encoding = \"UTF-8\"?>");
  xmlbuf.append("<?cocoon-process type=\"xslt\"?>");
  xmlbuf.append("<?xml-stylesheet href=\"page.xsl\" type=\"text/xsl\"?>");
  xmlbuf.append("<page>");
  xmlbuf.append("<country code = \"ca\">Canada</country>");
  xmlbuf.append( "<country code = \"de\">Germany</country>");
  xmlbuf.append("<country code = \"fr\">France</country>") ;
  xmlbuf.append("<country code = \"uk\">United Kingdom</country>");
  xmlbuf.append("<country code = \"us\">United States</country>");
  xmlbuf.append("<country code = \"es\">Spain</country>");
  xmlbuf.append("</page>");

  output.println(xmlbuf.toString());

 }
==================

}
============



---------------------------------------------------------------------
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: Help:Cocoon and servlet

Posted by Jean-Marc Borer <je...@infodesign.com>.
I want to do exactly the same thing as you. If anyone could help us or
provide us advice I would really appreciate.

Cheers,

Jean-Marc Borer

Mamadou Bobo Sylla wrote:
> 
> Hello everyone,
> I am trying to test some the code examples from Apache . When I call the xml
> page countries.xml through bowser, it works fine being processd by page.xsl.
> But I want countries.xml to be processed after a resquet to a servlet.
> For that purpose I have writtent a servlet called Test which should now
> output the xml  to be processed by a stylsheet called page.xsl.
> 
> How do I configure  Cocoon so that it becomes aware of my servlet.
> 
> The codes of Test.java:
> ============
> public class Test extends HttpServlet {
> 
>  public void doGet( HttpServletRequest req,
>                        HttpServletResponse res )
>         throws ServletException, IOException
>  {
> 
>   PrintWriter output = res.getWriter();
>         res.setContentType( "text/xml" );
> 
>          StringBuffer xmlbuf =new StringBuffer("<?xml version=\"1.0\"
> encoding = \"UTF-8\"?>");
>   xmlbuf.append("<?cocoon-process type=\"xslt\"?>");
>   xmlbuf.append("<?xml-stylesheet href=\"page.xsl\" type=\"text/xsl\"?>");
>   xmlbuf.append("<page>");
>   xmlbuf.append("<country code = \"ca\">Canada</country>");
>   xmlbuf.append( "<country code = \"de\">Germany</country>");
>   xmlbuf.append("<country code = \"fr\">France</country>") ;
>   xmlbuf.append("<country code = \"uk\">United Kingdom</country>");
>   xmlbuf.append("<country code = \"us\">United States</country>");
>   xmlbuf.append("<country code = \"es\">Spain</country>");
>   xmlbuf.append("</page>");
> 
>   output.println(xmlbuf.toString());
> 
>  }
> ==================
> 
> }
> ============
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org


Mamadou Bobo Sylla wrote:
> 
> Hello everyone,
> I am trying to test some the code examples from Apache . When I call the xml
> page countries.xml through bowser, it works fine being processd by page.xsl.
> But I want countries.xml to be processed after a resquet to a servlet.
> For that purpose I have writtent a servlet called Test which should now
> output the xml  to be processed by a stylsheet called page.xsl.
> 
> How do I configure  Cocoon so that it becomes aware of my servlet.
> 
> The codes of Test.java:
> ============
> public class Test extends HttpServlet {
> 
>  public void doGet( HttpServletRequest req,
>                        HttpServletResponse res )
>         throws ServletException, IOException
>  {
> 
>   PrintWriter output = res.getWriter();
>         res.setContentType( "text/xml" );
> 
>          StringBuffer xmlbuf =new StringBuffer("<?xml version=\"1.0\"
> encoding = \"UTF-8\"?>");
>   xmlbuf.append("<?cocoon-process type=\"xslt\"?>");
>   xmlbuf.append("<?xml-stylesheet href=\"page.xsl\" type=\"text/xsl\"?>");
>   xmlbuf.append("<page>");
>   xmlbuf.append("<country code = \"ca\">Canada</country>");
>   xmlbuf.append( "<country code = \"de\">Germany</country>");
>   xmlbuf.append("<country code = \"fr\">France</country>") ;
>   xmlbuf.append("<country code = \"uk\">United Kingdom</country>");
>   xmlbuf.append("<country code = \"us\">United States</country>");
>   xmlbuf.append("<country code = \"es\">Spain</country>");
>   xmlbuf.append("</page>");
> 
>   output.println(xmlbuf.toString());
> 
>  }
> ==================
> 
> }
> ============
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org

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


AW: Help:Cocoon and servlet

Posted by Max Larsson <ma...@gmservice.de>.
Hi,

as long as i know you have to tell your servelt engine e.g.
Jakarta about the other servlet. I think cocoon doesn't
really care about it. The servlet engine decides which
servlet get the request. To configure it with jakarta
you have to change the web.xml file within the WEB-INF
directory of your webapp. For exmaple like the example
web.xml file below. But if the mapping works like this
i don't know, but if think it should. I even think
that at the website of SUN you can find more information
about the structure of the web.xml file.

Max

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
  This is the web-app configurations that allow Cocoon to work under
  Apache Tomcat. Please, follow the installation section of the
  documentation for more information about installing Cocoon on Tomcat
-->
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app>
	<display-name>Cocoon2 Demo</display-name>
	<description>Demo application for Cocoon2</description>
	<servlet>
		<servlet-name>Cocoon2</servlet-name>
		<display-name>Cocoon2</display-name>
		<description>The main Cocoon2 servlet</description>
		<servlet-class>org.apache.cocoon.servlet.CocoonServlet</servlet-class>
		<init-param>
			<param-name>configurations</param-name>
			<param-value>/cocoon.xconf</param-value>
		</init-param>

		<init-param>
			<param-name>log-level</param-name>
			<param-value>DEBUG</param-value>
		</init-param>

		<init-param>
			<param-name>allow-reload</param-name>
			<param-value>yes</param-value>
		</init-param>
		<init-param>
			<param-name>load-class</param-name>
			<param-value> org.gjt.mm.mysql.Driver</param-value>
		</init-param>
	</servlet>
	<!-- HERE YOU'RE SERVLET -->
	<servlet>
		<servlet-name>Test</servlet-name>
		<display-name>Test</display-name>
		<description>The other servelt besides the Cocoon2 servlet</description>
		<servlet-class>Test</servlet-class>
	</servlet>
	<!-- END -->
	<servlet-mapping>
		<servlet-name>Cocoon2</servlet-name>
		<url-pattern>/</url-pattern>
	</servlet-mapping>
	<!-- MAP YOUR SERVLET TO AN URI -->
	<servlet-mapping>
		<servlet-name>Test</servlet-name>
		<url-pattern>/test</url-pattern>
	</servlet-mapping>
	<!-- END -->
</web-app>

-----Ursprüngliche Nachricht-----
Von: Mamadou Bobo Sylla [mailto:bobo@ewarna.com]
Gesendet: Dienstag, 24. Juli 2001 08:54
An: cocoon-users@xml.apache.org; cocoon-dev@xml.apache.org
Betreff: Help:Cocoon and servlet


Hello everyone,
I am trying to test some the code examples from Apache . When I call the xml
page countries.xml through bowser, it works fine being processd by page.xsl.
But I want countries.xml to be processed after a resquet to a servlet.
For that purpose I have writtent a servlet called Test which should now
output the xml  to be processed by a stylsheet called page.xsl.

How do I configure  Cocoon so that it becomes aware of my servlet.

The codes of Test.java:
============
public class Test extends HttpServlet {


 public void doGet( HttpServletRequest req,
                       HttpServletResponse res )
        throws ServletException, IOException
 {

  PrintWriter output = res.getWriter();
        res.setContentType( "text/xml" );

         StringBuffer xmlbuf =new StringBuffer("<?xml version=\"1.0\"
encoding = \"UTF-8\"?>");
  xmlbuf.append("<?cocoon-process type=\"xslt\"?>");
  xmlbuf.append("<?xml-stylesheet href=\"page.xsl\" type=\"text/xsl\"?>");
  xmlbuf.append("<page>");
  xmlbuf.append("<country code = \"ca\">Canada</country>");
  xmlbuf.append( "<country code = \"de\">Germany</country>");
  xmlbuf.append("<country code = \"fr\">France</country>") ;
  xmlbuf.append("<country code = \"uk\">United Kingdom</country>");
  xmlbuf.append("<country code = \"us\">United States</country>");
  xmlbuf.append("<country code = \"es\">Spain</country>");
  xmlbuf.append("</page>");

  output.println(xmlbuf.toString());

 }
==================

}
============



---------------------------------------------------------------------
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>



---------------------------------------------------------------------
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>


Help:Cocoon and servlet

Posted by Mamadou Bobo Sylla <bo...@ewarna.com>.
Hello everyone,
I am trying to test some the code examples from Apache . When I call the xml
page countries.xml through bowser, it works fine being processd by page.xsl.
But I want countries.xml to be processed after a resquet to a servlet.
For that purpose I have writtent a servlet called Test which should now
output the xml  to be processed by a stylsheet called page.xsl.

How do I configure  Cocoon so that it becomes aware of my servlet.

The codes of Test.java:
============
public class Test extends HttpServlet {


 public void doGet( HttpServletRequest req,
                       HttpServletResponse res )
        throws ServletException, IOException
 {

  PrintWriter output = res.getWriter();
        res.setContentType( "text/xml" );

         StringBuffer xmlbuf =new StringBuffer("<?xml version=\"1.0\"
encoding = \"UTF-8\"?>");
  xmlbuf.append("<?cocoon-process type=\"xslt\"?>");
  xmlbuf.append("<?xml-stylesheet href=\"page.xsl\" type=\"text/xsl\"?>");
  xmlbuf.append("<page>");
  xmlbuf.append("<country code = \"ca\">Canada</country>");
  xmlbuf.append( "<country code = \"de\">Germany</country>");
  xmlbuf.append("<country code = \"fr\">France</country>") ;
  xmlbuf.append("<country code = \"uk\">United Kingdom</country>");
  xmlbuf.append("<country code = \"us\">United States</country>");
  xmlbuf.append("<country code = \"es\">Spain</country>");
  xmlbuf.append("</page>");

  output.println(xmlbuf.toString());

 }
==================

}
============



---------------------------------------------------------------------
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>


Help:Cocoon and servlet

Posted by Mamadou Bobo Sylla <bo...@ewarna.com>.
Hello everyone,
I am trying to test some the code examples from Apache . When I call the xml
page countries.xml through bowser, it works fine being processd by page.xsl.
But I want countries.xml to be processed after a resquet to a servlet.
For that purpose I have writtent a servlet called Test which should now
output the xml  to be processed by a stylsheet called page.xsl.

How do I configure  Cocoon so that it becomes aware of my servlet.

The codes of Test.java:
============
public class Test extends HttpServlet {


 public void doGet( HttpServletRequest req,
                       HttpServletResponse res )
        throws ServletException, IOException
 {

  PrintWriter output = res.getWriter();
        res.setContentType( "text/xml" );

         StringBuffer xmlbuf =new StringBuffer("<?xml version=\"1.0\"
encoding = \"UTF-8\"?>");
  xmlbuf.append("<?cocoon-process type=\"xslt\"?>");
  xmlbuf.append("<?xml-stylesheet href=\"page.xsl\" type=\"text/xsl\"?>");
  xmlbuf.append("<page>");
  xmlbuf.append("<country code = \"ca\">Canada</country>");
  xmlbuf.append( "<country code = \"de\">Germany</country>");
  xmlbuf.append("<country code = \"fr\">France</country>") ;
  xmlbuf.append("<country code = \"uk\">United Kingdom</country>");
  xmlbuf.append("<country code = \"us\">United States</country>");
  xmlbuf.append("<country code = \"es\">Spain</country>");
  xmlbuf.append("</page>");

  output.println(xmlbuf.toString());

 }
==================

}
============



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