cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anuja Gokhale <Anu...@manh.com>
Subject RE: Writing my own Producer to generate dynamic XML- How do I pas s parameters to a custom generator that extends Abstract Generator
Date Mon, 25 Aug 2003 18:21:11 GMT

thanx. I was able to write my own custom generator that works with static
data. 

I however need my generate to generate an XML document based on the user's
input (form data). How can I pass and retrieve request parameters to and
from my generator (My generator extends the AbstractGenerator..is this what
i should be using?)

Attached is the source for my simple generator...

public class MyGenerator extends AbstractGenerator {
  public void generate () throws IOException, SAXException,
    ProcessingException {
	  RequestParameterModule requestData = new RequestParameterModule();
      String message = "<doc>" + requestData.getAttribute + "</doc>";

      XMLReader xmlreader = XMLReaderFactory.createXMLReader();
      xmlreader.setContentHandler(super.xmlConsumer);
      InputSource source = new InputSource(new StringReader(message));
      xmlreader.parse(source);
  }
}


-Anuja

-----Original Message-----
From: Joerg Heinicke [mailto:jheinicke@virbus.de]
Sent: Thursday, August 21, 2003 6:48 PM
To: users@cocoon.apache.org
Subject: Re: Writing my own Producer to generate dynamic XML


The component you search for is "generator" 
(http://cocoon.apache.org/2.1/userdocs/generators/generators.html). 
There are already different technologies generating XML from DB 
(http://cocoon.apache.org/2.1/userdocs/concepts/databases.html). Also 
search on http://wiki.cocoondev.org/ for more information.

Joerg

Anuja Gokhale wrote:

> Hello,
> 
> My application needs to read information from a DB plus do other stuff and
> then have this displayed in different views. For this, I was planning on
> writing a Producer that generates my XML and then defining XSL transformer
> to operate on this dynamic XML.
> 
> Here are my questions:
> 1) Should my producer implement the AbstractProducer interface (even
though
> I may never use the HttpServletRequest and response objects to generate my
> XML)
> 2) Where do I define my producer for cocoon? In the sitemap?
> 3) How can I ensure that this Producer gets called when I need to get my
> dynamic XML data?
> 
> 
> -Anuja


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