Re: [Serializer] Get request and parameters?

2001-12-12 Thread David Rosenstrauch

It doesn't look like it to me.

FYI - one workaround that I've used for this is to stick an Action right before the 
serializer.  The action gets passed the objectModel (which contains the request 
object) and can therefore do the work you want.

e.g.:







DR



At 11:00 AM 12/12/01 +0100, you wrote:
>Hi,
>exists a way to get the request and the request parameters in a
>serialzier? AbstractGenerator and AbstractTransformer implements
>the interface SitemapModelComponent. If I implement SitemapModelComponent
>in my serializer it will ignored.
>
>And SitemapOutputComponent doesn't implement a method like setup. Doesn't
>implements SitemapOutputComponent this method on purpose.
>
>Thanks, Stephan Michels.
>
>
>-
>Please check that your question has not already been answered in the
>FAQ before posting. 
>
>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>For additional commands, e-mail: <[EMAIL PROTECTED]> 


-
Please check that your question has not already been answered in the
FAQ before posting. 

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




RE: [Serializer] Get request and parameters?

2001-12-12 Thread Max Larsson

Hi,

actually i don't know.
I never coded a serialzer, but when i did
a Transformer i had a similiar problem
and solved it with that method. And there should
be a mezthod in a Serialzer so that you can get access
to the request object. Maybe its named different.
I have no time now to take a deeper look, will
do it tomorrwor.

Wait for More

Max

> -Original Message-
> From: Stephan Michels [mailto:[EMAIL PROTECTED]]
> Sent: Mittwoch, 12. Dezember 2001 12:02
> To: [EMAIL PROTECTED]
> Subject: RE: [Serializer] Get request and parameters?
> 
> 
> 
> 
> On Wed, 12 Dec 2001, Max Larsson wrote:
> 
> > hi,
> >
> > i think it works, wour class has to implement the avalon interface,
> > which contains the setup method (see below). if you 
> implement it, the
> > method will be called each time your Serialzer is used. In 
> the setup method
> > you can retrieve the request object the so called ComponentManage.
> > objectModel in my source.
> > Of cousre there is lot missing in the snipet below.
> >
> > HTH
> >
> > Max
> >
> >
> > Code snipet:
> >
> >   public void setup( SourceResolver resolver,Map 
> objectModel,String source,
> > Parameters paras )
> > throws ProcessingException,SAXException,IOException {
> >
> > request  = (Request)(objectModel.get( 
> Constants.REQUEST_OBJECT ) );
> > response = (Response)(objectModel.get( 
> Constants.RESPONSE_OBJECT ) );
> >   }
> >
> 
> Which avalon interface do you mean?
> org.apache.avalon.framework.component.Component? I think the 
> setup method
> owns the org.apache.cocoon.sitemap.SitemapModelComponent.
> 
> In my example of a serializer the setup method doesn't work.
> 
> public abstract class DOMSerializer extends AbstractSerializer
>   implements Cacheable, Composable, Configurable, 
> SitemapModelComponent
> {
> 
>   public void setup(SourceResolver resolver, Map objectModel, 
> String src,
> Parameters par)
>   {
> System.out.println("DOMSerializer.java: setup");
>   }
> [...]
> 
> 
> > > -Original Message-
> > > From: Stephan Michels [mailto:[EMAIL PROTECTED]]
> > > Sent: Mittwoch, 12. Dezember 2001 11:01
> > > To: [EMAIL PROTECTED]
> > > Subject: [Serializer] Get request and parameters?
> > >
> > >
> > > Hi,
> > > exists a way to get the request and the request parameters in a
> > > serialzier? AbstractGenerator and AbstractTransformer implements
> > > the interface SitemapModelComponent. If I implement
> > > SitemapModelComponent
> > > in my serializer it will ignored.
> > >
> > > And SitemapOutputComponent doesn't implement a method like
> > > setup. Doesn't
> > > implements SitemapOutputComponent this method on purpose.
> > >
> > > Thanks, Stephan Michels.
> 
> 
> -
> 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: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>

-
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




RE: [Serializer] Get request and parameters?

2001-12-12 Thread Stephan Michels



On Wed, 12 Dec 2001, Max Larsson wrote:

> hi,
>
> i think it works, wour class has to implement the avalon interface,
> which contains the setup method (see below). if you implement it, the
> method will be called each time your Serialzer is used. In the setup method
> you can retrieve the request object the so called ComponentManage.
> objectModel in my source.
> Of cousre there is lot missing in the snipet below.
>
> HTH
>
> Max
>
>
> Code snipet:
>
>   public void setup( SourceResolver resolver,Map objectModel,String source,
> Parameters paras )
> throws ProcessingException,SAXException,IOException {
>
> request  = (Request)(objectModel.get( Constants.REQUEST_OBJECT ) );
> response = (Response)(objectModel.get( Constants.RESPONSE_OBJECT ) );
>   }
>

Which avalon interface do you mean?
org.apache.avalon.framework.component.Component? I think the setup method
owns the org.apache.cocoon.sitemap.SitemapModelComponent.

In my example of a serializer the setup method doesn't work.

public abstract class DOMSerializer extends AbstractSerializer
  implements Cacheable, Composable, Configurable, SitemapModelComponent
{

  public void setup(SourceResolver resolver, Map objectModel, String src,
Parameters par)
  {
System.out.println("DOMSerializer.java: setup");
  }
[...]


> > -Original Message-
> > From: Stephan Michels [mailto:[EMAIL PROTECTED]]
> > Sent: Mittwoch, 12. Dezember 2001 11:01
> > To: [EMAIL PROTECTED]
> > Subject: [Serializer] Get request and parameters?
> >
> >
> > Hi,
> > exists a way to get the request and the request parameters in a
> > serialzier? AbstractGenerator and AbstractTransformer implements
> > the interface SitemapModelComponent. If I implement
> > SitemapModelComponent
> > in my serializer it will ignored.
> >
> > And SitemapOutputComponent doesn't implement a method like
> > setup. Doesn't
> > implements SitemapOutputComponent this method on purpose.
> >
> > Thanks, Stephan Michels.


-
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




RE: [Serializer] Get request and parameters?

2001-12-12 Thread Max Larsson

hi,

i think it works, wour class has to implement the avalon interface,
which contains the setup method (see below). if you implement it, the
method will be called each time your Serialzer is used. In the setup method
you can retrieve the request object the so called ComponentManage.
objectModel in my source.
Of cousre there is lot missing in the snipet below.

HTH

Max


Code snipet:

  public void setup( SourceResolver resolver,Map objectModel,String source,
Parameters paras )
throws ProcessingException,SAXException,IOException {

request  = (Request)(objectModel.get( Constants.REQUEST_OBJECT ) );
response = (Response)(objectModel.get( Constants.RESPONSE_OBJECT ) );
  }


> -Original Message-
> From: Stephan Michels [mailto:[EMAIL PROTECTED]]
> Sent: Mittwoch, 12. Dezember 2001 11:01
> To: [EMAIL PROTECTED]
> Subject: [Serializer] Get request and parameters?
>
>
> Hi,
> exists a way to get the request and the request parameters in a
> serialzier? AbstractGenerator and AbstractTransformer implements
> the interface SitemapModelComponent. If I implement
> SitemapModelComponent
> in my serializer it will ignored.
>
> And SitemapOutputComponent doesn't implement a method like
> setup. Doesn't
> implements SitemapOutputComponent this method on purpose.
>
> Thanks, Stephan Michels.
>
>
> -
> 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: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>


-
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




[Serializer] Get request and parameters?

2001-12-12 Thread Stephan Michels

Hi,
exists a way to get the request and the request parameters in a
serialzier? AbstractGenerator and AbstractTransformer implements
the interface SitemapModelComponent. If I implement SitemapModelComponent
in my serializer it will ignored.

And SitemapOutputComponent doesn't implement a method like setup. Doesn't
implements SitemapOutputComponent this method on purpose.

Thanks, Stephan Michels.


-
Please check that your question has not already been answered in the
FAQ before posting. 

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