Title: RE: Coplet and generator question
Well, this doesn't work for me. I get the following error:
 

org.apache.cocoon.ProcessingException: Failed to execute pipeline.: java.lang.RuntimeException: java.lang.RuntimeException: org.apache.cocoon.ProcessingException: Could not read resource cocoon://app/getFBScontent: org.apache.avalon.framework.component.ComponentException: pipes: ComponentSelector could not find the component for hint [expires] (key [expires])

 

Could you please tell me wehre I can find some additional infos on caching. Especially the part about generator-caching interests me.

 

Barthi



From: Ard Schrijvers [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 14, 2006 7:19 PM
To: [email protected]
Subject: RE: Coplet and generator question

It is not cached because of a small error you made:
 
 <map:pipeline internal- type="caching">  is not an expiring pipeline. This is a complete different caching strategie. You need
  
 <map:pipeline  type="expires" internal->
          <map:parameter name="expires" value="access plus 1 minutes"/>
You can also specify which cache key should be used. Default is the pipeline itself without parameters, but you can say something linke below
 
 <map:parameter name="cache-key" value="{0}{request-param:page}{request-param:query} ">
 
Though, I think expires pipeline should be only used if you cannot cache smarter. You could cache within the generator, that is better, though harder to make
 
AS 
 
  

Thanks for your detailed answer. I read about caching but didn't really know how to manage
this in conjunction with my generator. I think this will fullfill all my needs.
I haven't worked with AJAX yet. Just read some things.
For now I just need a quick solution, so I think
I'll try it with caching.

I used your code-snippet and adjusted some things that caused an error:

<map:pipeline internal- type="caching">
  <map:parameter name="expires" value="access plus 1 minutes"/>
  <map:match  pattern="getFBScontent">
    <map:generate type="FBS">
        <map:parameter name="objekt" value="{request-param:objekt}"/>
        <map:parameter name="objekt_ID" value="{request-param:objekt_ID}"/>
        <map:parameter name="typ" value="{request-param:typ}"/>
        <map:parameter name="geb_ID" value="{request-param:geb_ID}"/>
        <map:parameter name="stock_ID" value="{request-param:stock_ID}"/>
        <map:parameter name="abweichungen" value="{request-param:abweichungen}"/>
    </map:generate>
    <map:serialize type="xml"/>
  </map:match>
</map:pipeline>
 
<map:pipeline>
<map:match pattern="bsplt_suchergebnis_dyn">
  <map:generate src=""/>
  <map:transform src="">
    <map:parameter name="typ" value="{request-param:typ}"/>
  </map:transform>
  <map:serialize type="html"/>
</map:match>
</map:pipeline>


But it doesn't seem to work. In the Output-Window of Tomcat there is always made a connection to the DB and everything is

calculated from new. Am I missing a parameter?

Thanks,

Barthi

> -----Original Message-----
> From: Ard Schrijvers [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 14, 2006 12:02 PM
> To: [email protected]
> Subject: RE: Coplet and generator question
>
> Hello Barthi,
>
> Now I know what you are looking for. The first thing you ask,
> is very well possible (but again hard if you also want to
> have your second thing), but I don't think that you should
> really care about the generator being called twice: Why do
> you care anyway? Is it very expensive, so what, make it
> cacheable...Is it only valid for example one minute, no
> problem, make it an expire of a minute (you can actually do
> this very simple like below)
>
> <map:pipeline internal- type="expires">
> <map:parameter name="cache-expires" value="60"/> <map:match
> pattern="getFBScontent">
>       <map:generate type="FBS">
>               <map:parameter name="objekt"
> value="{request-param:objekt}"/>
>               <map:parameter name="objekt_ID"
> value="{request-param:objekt_ID}"/>
>               <map:parameter name="typ" value="{request-param:typ}"/>
>               <map:parameter name="geb_ID"
> value="{request-param:geb_ID}"/>
>               <map:parameter name="stock_ID"
> value="{request-param:stock_ID}"/>
>               <map:parameter name="abweichungen"
> value="{request-param:abweichungen}"/>
>       </map:generate>
>       <map:serialize type="xml"/>
> </map:match>
> </map:pipeline>
>
> <map:pipeline internal->
> <map:match pattern="bsplt_suchergebnis_dyn">
>       <map:generate src=""/>
>       <map:transform src="">
>               <map:parameter name="typ" value="{request-param:typ}"/>
>       </map:transform>
>       <map:serialize type="html"/>
> </map:match>
> </map:pipeline>
>
> Now, you're FBS will be cached for one minute. Even better,
> make a smart cache key in the generator.
>
> Of course, you would also have been able to accomplish this
> by one generator, and one xsl that does both coplets, but
> then you run into trouble with your second question...you
> only want to update you're second coplet. Well, AJAX is hot,
> though I am not (yet) familiar with it....of course you don't
> want to use iframes :-) Before AJAX existed, I solved these
> kind of things with an hidden iframe loading the second
> coplet, and when it is ready, _javascript_ back into the parent
> window....but....perhaps you don't even want to go there...
>
> AS
>
> >
> >
> > Ok, I will try to be more precisely. I attached a JPEG of
> our Portal.
> > There you see the two coplets I'm speaking of. I also attached the
> > part of the sitemap, where the coplets are created. As you can see,
> > I'm calling the generator "FBS"
> > twice, once for every coplet. Every coplet is transforming the
> > XML-data from the generator in a special way.
> > So, what I want is to call the generator "FSB" delivering
> the XML-data
> > only one time.
> > Then I want to pass this data to every coplet and create it.
> > That's my first demand.
> >
> > The second step would be the possibility to click something in the
> > "Overview-Coplet" and update The "Details-Coplet".
> >
> > I hope it clearer now.
> >
> > Thanks,
> > Barthi
> > 
> >
> > > -----Original Message-----
> > > From: Ard Schrijvers [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, January 13, 2006 12:29 PM
> > > To: [email protected]
> > > Subject: RE: Coplet and generator question
> > >
> > >
> > > >
> > > > Is it such a silly question? Or isn't it possible?
> > >
> > > Probably not, but I do not really, and I suppose others as well,
> > > entirely grasp your problem. Lot's of people want to help at this
> > > list, but when a question is unclear, few answers are given.
> > > Probably silly of me, but I for example don't know what you mean
> > > with a coplet...If you explain a little more we can probably help
> > > you out
> > >
> > > AS
> > >
> > >
> > > > I'm new to Cocoon and really don't know how to manage it.
> > > > Is there a hint in the docu I missed?
> > > >
> > > > Thanks,
> > > > Barthi
> > > > 
> > > >
> > > > > -----Ursprüngliche Nachricht-----
> > > > > Von: Christian Barth [mailto:[EMAIL PROTECTED]]
> > > > > Gesendet: Donnerstag, 12. Januar 2006 17:40
> > > > > An: [email protected]
> > > > > Betreff: Coplet and generator question
> > > > >
> > > > > Hi, it's me again!
> > > > > 
> > > > > I just wrote a new generator calculating some things in
> > Java and
> > > > > returning the results in an XML. This works fine.
> > > > > 
> > > > > But...
> > > > > 
> > > > > I need two coplets, one showing a kind of "overview" of
> > > the result
> > > > > and the second one showing "details" of the result.
> > > > >
> > > > > Both have to be displayed on the same page. It would also
> > > be nice if
> > > > > I could click something in the "overview"-coplet and the
> > > > > "details"-coplet is updated.
> > > > >
> > > > > So how can I build two coplets from one data-source?
> > > > >
> > > > > Thanks,
> > > > > BArthi
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>