You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Drasko Kokic <dr...@yahoo.com> on 2001/08/10 11:37:38 UTC

[C2] Pipeing non-XML thrue Cocoon

Hi there,

I wonder if anybody had come accross this problem
before:
In the XSP generator I need to contact a back-end
system that (unfortunately) replies with PDF.  I would
like to know what would be a way to still use Cocoon
(because I have all other pages implemented thrue
XML/XSL).
Is there a way to insert the received PDF directly
into some kind of cache and just reffere it somehow?!

I would be very thankfull for all/any responses
This is very much endangering my idea of using the
Cocoon technology in our portal business :-(

Please, do not suggest that the PDF should be replaced
with some XML structure ... I have spent around 3
months fighting with our Billing department and have
not win the battle (but the war is not yet over).

TIA
Drasko

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

---------------------------------------------------------------------
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: [C2] Pipeing non-XML thrue Cocoon

Posted by Drasko Kokic <dr...@yahoo.com>.
Thanks for your pointers, Giacomo and Vadim.
I think I understand the basic idea and will dive in
code as soon as I finish this email :-)

Once again, thanks alot

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

---------------------------------------------------------------------
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: [C2] Pipeing non-XML thrue Cocoon

Posted by Vadim Gritsenko <vg...@hns.com>.
Drasko,

Take a look at DatabaseReader.java in reading package,
it should help you to start writing own PDF reader.

Vadim

> -----Original Message-----
> From: Drasko Kokic [mailto:drasko_kokic@yahoo.com]
> Sent: Friday, August 10, 2001 3:25 PM
> To: cocoon-users@xml.apache.org
> Subject: Re: [C2] Pipeing non-XML thrue Cocoon
> 
> 
> Thanks for the reply Giacomo
> 
> I wish I could understand more what you are proposing
> ... would you by any chance have some code samples
> doing something similar?!
> 
> What do you mean by "Write a custom Reader class that
> retrieves that PDF and puts it down the stream." ?!
> 
> TIA
> Drasko
> 
> --- giacomo <gi...@apache.org> wrote:
> > On Fri, 10 Aug 2001, Drasko Kokic wrote:
> > 
> > > Hi there,
> > >
> > > I wonder if anybody had come accross this problem
> > > before:
> > > In the XSP generator I need to contact a back-end
> > > system that (unfortunately) replies with PDF.  I
> > would
> > > like to know what would be a way to still use
> > Cocoon
> > > (because I have all other pages implemented thrue
> > > XML/XSL).
> > > Is there a way to insert the received PDF directly
> > > into some kind of cache and just reffere it
> > somehow?!
> > 
> > Refactor your back-end system interaction into an
> > Action and store the
> > result into a request attribute (if you need it only
> > for one response)
> > or put it into a Session object or the Store
> > component (if you need it
> > for more than once). Write a custom Reader class
> > that retrieves that PDF
> > and puts it down the stream.
> > 
> > Giacomo
> > 
> > >
> > > I would be very thankfull for all/any responses
> > > This is very much endangering my idea of using the
> > > Cocoon technology in our portal business :-(
> > >
> > > Please, do not suggest that the PDF should be
> > replaced
> > > with some XML structure ... I have spent around 3
> > > months fighting with our Billing department and
> > have
> > > not win the battle (but the war is not yet over).
> > >
> > > TIA
> > > Drasko
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Make international calls for as low as $.04/minute
> > with Yahoo! Messenger
> > > http://phonecard.yahoo.com/
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > 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>
> > 
> 
> __________________________________________________
> Do You Yahoo!?
> Send instant messages & get email alerts with Yahoo! Messenger.
> http://im.yahoo.com/
> 
> ---------------------------------------------------------------------
> 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>


Re: [C2] Pipeing non-XML thrue Cocoon

Posted by giacomo <gi...@apache.org>.
On Fri, 10 Aug 2001, Drasko Kokic wrote:

> Thanks for the reply Giacomo
>
> I wish I could understand more what you are proposing
> ... would you by any chance have some code samples
> doing something similar?!

Ok, move the code you have to connect to your back-end system in your
XSP page into a class that implements the
org.apache.cocoon.acting.Action interface or extend one of the concrete
classes in that package were you also find a huge amount of concrete
Actions.

In the sitemap you have to put the <map:act to your Action at the right
place where your URI will be matched to grab the PDF.

> What do you mean by "Write a custom Reader class that retrieves that
> PDF and puts it down the stream." ?!

The org.apache.cocoon.reading.Reader interface is a combination of a
Generator and a Serializer. Look at the classes in there for samples.

Giacomo

>
> TIA
> Drasko
>
> --- giacomo <gi...@apache.org> wrote:
> > On Fri, 10 Aug 2001, Drasko Kokic wrote:
> >
> > > Hi there,
> > >
> > > I wonder if anybody had come accross this problem
> > > before:
> > > In the XSP generator I need to contact a back-end
> > > system that (unfortunately) replies with PDF.  I
> > would
> > > like to know what would be a way to still use
> > Cocoon
> > > (because I have all other pages implemented thrue
> > > XML/XSL).
> > > Is there a way to insert the received PDF directly
> > > into some kind of cache and just reffere it
> > somehow?!
> >
> > Refactor your back-end system interaction into an
> > Action and store the
> > result into a request attribute (if you need it only
> > for one response)
> > or put it into a Session object or the Store
> > component (if you need it
> > for more than once). Write a custom Reader class
> > that retrieves that PDF
> > and puts it down the stream.
> >
> > Giacomo
> >
> > >
> > > I would be very thankfull for all/any responses
> > > This is very much endangering my idea of using the
> > > Cocoon technology in our portal business :-(
> > >
> > > Please, do not suggest that the PDF should be
> > replaced
> > > with some XML structure ... I have spent around 3
> > > months fighting with our Billing department and
> > have
> > > not win the battle (but the war is not yet over).
> > >
> > > TIA
> > > Drasko
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Make international calls for as low as $.04/minute
> > with Yahoo! Messenger
> > > http://phonecard.yahoo.com/
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > 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>
> >
>
> __________________________________________________
> Do You Yahoo!?
> Send instant messages & get email alerts with Yahoo! Messenger.
> http://im.yahoo.com/
>
> ---------------------------------------------------------------------
> 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>


Re: [C2] Pipeing non-XML thrue Cocoon

Posted by Drasko Kokic <dr...@yahoo.com>.
Thanks for the reply Giacomo

I wish I could understand more what you are proposing
... would you by any chance have some code samples
doing something similar?!

What do you mean by "Write a custom Reader class that
retrieves that PDF and puts it down the stream." ?!

TIA
Drasko

--- giacomo <gi...@apache.org> wrote:
> On Fri, 10 Aug 2001, Drasko Kokic wrote:
> 
> > Hi there,
> >
> > I wonder if anybody had come accross this problem
> > before:
> > In the XSP generator I need to contact a back-end
> > system that (unfortunately) replies with PDF.  I
> would
> > like to know what would be a way to still use
> Cocoon
> > (because I have all other pages implemented thrue
> > XML/XSL).
> > Is there a way to insert the received PDF directly
> > into some kind of cache and just reffere it
> somehow?!
> 
> Refactor your back-end system interaction into an
> Action and store the
> result into a request attribute (if you need it only
> for one response)
> or put it into a Session object or the Store
> component (if you need it
> for more than once). Write a custom Reader class
> that retrieves that PDF
> and puts it down the stream.
> 
> Giacomo
> 
> >
> > I would be very thankfull for all/any responses
> > This is very much endangering my idea of using the
> > Cocoon technology in our portal business :-(
> >
> > Please, do not suggest that the PDF should be
> replaced
> > with some XML structure ... I have spent around 3
> > months fighting with our Billing department and
> have
> > not win the battle (but the war is not yet over).
> >
> > TIA
> > Drasko
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Make international calls for as low as $.04/minute
> with Yahoo! Messenger
> > http://phonecard.yahoo.com/
> >
> >
>
---------------------------------------------------------------------
> > 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>
> 

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

---------------------------------------------------------------------
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: [C2] Pipeing non-XML thrue Cocoon

Posted by giacomo <gi...@apache.org>.
On Fri, 10 Aug 2001, Drasko Kokic wrote:

> Hi there,
>
> I wonder if anybody had come accross this problem
> before:
> In the XSP generator I need to contact a back-end
> system that (unfortunately) replies with PDF.  I would
> like to know what would be a way to still use Cocoon
> (because I have all other pages implemented thrue
> XML/XSL).
> Is there a way to insert the received PDF directly
> into some kind of cache and just reffere it somehow?!

Refactor your back-end system interaction into an Action and store the
result into a request attribute (if you need it only for one response)
or put it into a Session object or the Store component (if you need it
for more than once). Write a custom Reader class that retrieves that PDF
and puts it down the stream.

Giacomo

>
> I would be very thankfull for all/any responses
> This is very much endangering my idea of using the
> Cocoon technology in our portal business :-(
>
> Please, do not suggest that the PDF should be replaced
> with some XML structure ... I have spent around 3
> months fighting with our Billing department and have
> not win the battle (but the war is not yet over).
>
> TIA
> Drasko
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
>
> ---------------------------------------------------------------------
> 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>