You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Oscar Picasso <os...@yahoo.com> on 2004/03/22 20:26:40 UTC

Caching and aggregate

Hi,

I am using the 2.1.5-dev version and am experiencing really weird things when I
use aggregation with caching pipelines.

Has the caching mechanism changed between 2.1.5 and 2.1.4?

Thanks

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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


Re: CForms (Cocoon Forms) validation & SelectionList fields

Posted by Surjan Singh <su...@misgl.com>.
Mark Lundquist wrote:

>
> On Mar 26, 2004, at 11:11 AM, Joerg Heinicke wrote:
>
> > On 26.03.2004 20:01, Mark Lundquist wrote:
> >> [Surjan wrote:]
> >>>
> >>> I thought of hiding the second list field if it's not required, but
> >>> I don't know how to do that either.
> >> Try this...
> > Hmm, if I read the above I think he only wants to conditionalize the
> > requiredness of selectionlist 2 in dependency on selectionlist 1, not
> > the displaying.
>
> See above :-)
>
> > This is what was called "optionally required" in discussions:
> > http://marc.theaimsgroup.com/?t=107349479500003&r=1&w=4 
> <http://marc.theaimsgroup.com/?t=107349479500003&r=1&w=4>
> >
> > Vadim has provided a solution:
> > http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107352171910636&w=4 
> <http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107352171910636&w=4>
> >
> > I have not used the XReporter expressions, but javascript using
> > <wd:validation>
> >   <wd:javascript>
> >     if (widget1 != null && widget2 == null) {
> >       widget2.setValidationError =
> >                              new ValidationError(general.required);
> >     } else {
> >       widget2.setValidationError = null;
> >     }
> >   </wd:javascript>
> > </wd:validation>
>
> Nice.  How would I do that from flow?  I could use form.onValidate()...
> or, can this be done on a per-widget basis in v2?
>
> Thanks,
> mark
>

You've both been very helpful. Thanks.

I still have one outstanding issue: if I want to use the JXTemplate 
generator, how do I say "don't display this SelectionList widget, if it 
has no items"?  (You see, the first widget can have any number of 
values. When the user makes a selection in the first drop-down, I make a 
db call to retrieve values for the second drop-down. I only want to hide 
the second one and make it not required if the the db returns zero items).



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


Re: CForms (Cocoon Forms) validation & SelectionList fields

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Mar 26, 2004, at 11:11 AM, Joerg Heinicke wrote:

> On 26.03.2004 20:01, Mark Lundquist wrote:
>> [Surjan wrote:]
>>>
>>> I thought of hiding the second list field if it's not required, but 
>>> I don't know how to do that either.
>> Try this...
> Hmm, if I read the above I think he only wants to conditionalize the 
> requiredness of selectionlist 2 in dependency on selectionlist 1, not 
> the displaying.

See above :-)

> This is what was called "optionally required" in discussions:
> http://marc.theaimsgroup.com/?t=107349479500003&r=1&w=4
>
> Vadim has provided a solution:
> http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107352171910636&w=4
>
> I have not used the XReporter expressions, but javascript using
> <wd:validation>
>   <wd:javascript>
>     if (widget1 != null && widget2 == null) {
>       widget2.setValidationError =
>                              new ValidationError(general.required);
>     } else {
>       widget2.setValidationError = null;
>     }
>   </wd:javascript>
> </wd:validation>

Nice.  How would I do that from flow?  I could use form.onValidate()... 
or, can this be done on a per-widget basis in v2?

Thanks,
mark


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


Re: CForms (Cocoon Forms) validation & SelectionList fields

Posted by Joerg Heinicke <jo...@gmx.de>.
On 26.03.2004 20:01, Mark Lundquist wrote:

>> I have two selection lists on a page. The problem is this: the second 
>> one is a required field, only if the value of the first one is among a 
>> few values.
>>
>> I've seen the car example (localhost:8888/samples/forms/carselector), 
>> which has served as a useful starting point, as I can populate the 
>> second list given a value in the first. However, I still can't find 
>> out how to make the second selection list a required field if the 
>> first one has a certain value.
> 
> 
> Something tells me there might be a way to use a union widget to achieve 
> this.  But I couldn't give you any details, I'm kinda behind the curve 
> on those bits...  Tim, are you out there? :-)
> 
>>
>> I thought of hiding the second list field if it's not required, but I 
>> don't know how to do that either.
> 
> 
> Try this...
> 
> 1)
>     <wt:widget id="listA">
>         <wi:styling submit-on-change="true" />
>     </wt:widget>
> 
> This will cause the form to redisplay when the selection is changed, but 
> with any other form control values the user has entered/changed being 
> redisplayed as well (unlike a client-side reload), however neither 
> validation nor form finalization are triggered (think of it as a 
> "smart"/sticky refresh!)
> 
> 2) To conditionalize the display of the second selection list, use 
> JXTemplateGenerator to generate your Woody template, and write something 
> like this:
> 
>     <jx:if test="${listA.value == 'whatever'}">
>         <wt:widget id="listB"/>
>     </jx:if>

Hmm, if I read the above I think he only wants to conditionalize the 
requiredness of selectionlist 2 in dependency on selectionlist 1, not 
the displaying. This is what was called "optionally required" in 
discussions:
http://marc.theaimsgroup.com/?t=107349479500003&r=1&w=4

Vadim has provided a solution:
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107352171910636&w=4

I have not used the XReporter expressions, but javascript using
<wd:validation>
   <wd:javascript>
     if (widget1 != null && widget2 == null) {
       widget2.setValidationError =
                              new ValidationError(general.required);
     } else {
       widget2.setValidationError = null;
     }
   </wd:javascript>
</wd:validation>

For details have a look on the sample at
http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/woody/samples/forms/form1.xml?annotate=1.24#240

Joerg

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


Re: CForms (Cocoon Forms) validation & SelectionList fields

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Mar 26, 2004, at 9:18 AM, Surjan Singh wrote:

> Hello,
>
> I have two selection lists on a page. The problem is this: the second 
> one is a required field, only if the value of the first one is among a 
> few values.
>
> I've seen the car example (localhost:8888/samples/forms/carselector), 
> which has served as a useful starting point, as I can populate the 
> second list given a value in the first. However, I still can't find 
> out how to make the second selection list a required field if the 
> first one has a certain value.

Something tells me there might be a way to use a union widget to 
achieve this.  But I couldn't give you any details, I'm kinda behind 
the curve on those bits...  Tim, are you out there? :-)

>
> I thought of hiding the second list field if it's not required, but I 
> don't know how to do that either.

Try this...

1)
	<wt:widget id="listA">
		<wi:styling submit-on-change="true" />
	</wt:widget>

This will cause the form to redisplay when the selection is changed, 
but with any other form control values the user has entered/changed 
being redisplayed as well (unlike a client-side reload), however 
neither validation nor form finalization are triggered (think of it as 
a "smart"/sticky refresh!)

2) To conditionalize the display of the second selection list, use 
JXTemplateGenerator to generate your Woody template, and write 
something like this:

	<jx:if test="${listA.value == 'whatever'}">
		<wt:widget id="listB"/>
	</jx:if>

HTH,
mark

PS — please don't "reply" with a new subject, unless it's related 
somehow to what you're replying to.  It fouls up threaded news agents 
(including the archive web site).  Your message is more likely to get 
read if it's not buried inside a thread with a different subject.


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


CForms (Cocoon Forms) validation & SelectionList fields

Posted by Surjan Singh <su...@misgl.com>.
Hello,

I have two selection lists on a page. The problem is this: the second 
one is a required field, only if the value of the first one is among a 
few values.

I've seen the car example (localhost:8888/samples/forms/carselector), 
which has served as a useful starting point, as I can populate the 
second list given a value in the first. However, I still can't find out 
how to make the second selection list a required field if the first one 
has a certain value.

I thought of hiding the second list field if it's not required, but I 
don't know how to do that either.

Any help appreciated.

Thanks,
Surj

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


Re: Caching and aggregate

Posted by Oscar Picasso <os...@yahoo.com>.
>>>The 'is-logged' attribute is a Boolean that is set upper in the pipeline 
>>>inside an action. The action sets correctly the 'is-logged'
>>>attribute. 

> so the is-logged attribute that is the critical change in your use-case 
> is set inside an action. This could be the problem ...

I would love to be sure that the problem is in my code.

> because cocoon 
> evaluates the pipeline cache keys and validities *before* it executes 
> any pipeline components.

I directed the Action, Generator and CachingProcessingPipeline logger to 
the same file  to see how the components are called.

And I found the following results:

First hit:

- Action.act --> is-logged is set here
- Generator.configure
- Generator.setup
- Generator.getKey
- Generator.getValidity
- AbstractCachingProcessingPipeline
  + getValidityForInternalPipeline
  + Cached response not found
  ....
  + caching content for further requests... 


Second hit:

- Action.act --> is-logged is set here
- Generator.setup
- Generator.getValidity
- AbstractCachingProcessingPipeline
  + Found cached response for
  + using valid cached content
    --> Generator.getKey
  + getValidityForInternalPipeline
  ...


So, from what is see in my log it seems my action
act method is executed *before* the key and validities
of the other components are evaluated.

How can this be?

Anyway. As I said, I have solved my problem by changing 
the urls used for the logged state vs. unlogged state.

Oscar


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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


Re: Caching and aggregate

Posted by Jorg Heymans <jh...@domek.be>.
>>>The 'is-logged' attribute is a Boolean that is set upper in the pipeline 
>>>inside an action. The action sets correctly the 'is-logged'
>>>attribute. 

so the is-logged attribute that is the critical change in your use-case 
is set inside an action. This could be the problem because cocoon 
evaluates the pipeline cache keys and validities *before* it executes 
any pipeline components.

You said in your previous email that you can't systematic reproduce the 
problem, this is wierd. Have you tried using a different validity than 
the CheckIntervalValidity like a NOPValidity.SHARED_INSTANCE for example 
(caches forever).


Jorg


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


RE: Security exception running applet in coplet

Posted by Jeff Davis <je...@firstam.com>.
Never mind...I figured it out...I just changed my reference to how I was
including the jar files in the applet tags.

Sorry if I wasted anyone's time...

jeff

-----Original Message-----
From: Jeff Davis [mailto:jedavis@firstam.com] 
Sent: Wednesday, March 24, 2004 1:12 PM
To: users@cocoon.apache.org
Subject: Security exception running applet in coplet

Hi,

Has any ever tried running a Java applet inside of a coplet? When I run the
coplet page directly as a direct HTML link through Cocoon, my applet runs
fine. However, when I run it within a coplet, I get the following error
message on the Browser's Java console:

java.lang.SecurityException: illegal URL redirect
	at sun.plugin.net.protocol.http.HttpUtils.followRedirects(Unknown
Source)
	at sun.plugin.cache.CachedJarLoader.download(Unknown Source)
	at sun.plugin.cache.CachedJarLoader.load(Unknown Source)
	at sun.plugin.cache.JarCache.get(Unknown Source)
	at
sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
	at
sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown
Source)
	at sun.misc.URLClassPath$JarLoader.getJarFile(Unknown Source)
	at sun.misc.URLClassPath$JarLoader.<init>(Unknown Source)
	at sun.misc.URLClassPath+3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.misc.URLClassPath.getLoader(Unknown Source)
	at sun.misc.URLClassPath.getLoader(Unknown Source)
	at sun.misc.URLClassPath.getResource(Unknown Source)
	at java.net.URLClassLoader+1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
java.lang.SecurityException: illegal URL redirect
	at sun.plugin.net.protocol.http.HttpUtils.followRedirects(Unknown
Source)
	at sun.plugin.cache.CachedJarLoader.download(Unknown Source)
	at sun.plugin.cache.CachedJarLoader.load(Unknown Source)
	at sun.plugin.cache.JarCache.get(Unknown Source)
	at
sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
	at
sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown
Source)
	at sun.misc.URLClassPath$JarLoader.getJarFile(Unknown Source)
	at sun.misc.URLClassPath$JarLoader.<init>(Unknown Source)
	at sun.misc.URLClassPath+3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.misc.URLClassPath.getLoader(Unknown Source)
	at sun.misc.URLClassPath.getLoader(Unknown Source)
	at sun.misc.URLClassPath.getResource(Unknown Source)
	at java.net.URLClassLoader+1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Anyone have any ideas? I was planning to use thinlet-based coplets for my
system (www.thinlets.com).

Thanks!

jeff




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


Security exception running applet in coplet

Posted by Jeff Davis <je...@firstam.com>.
Hi,

Has any ever tried running a Java applet inside of a coplet? When I run the
coplet page directly as a direct HTML link through Cocoon, my applet runs
fine. However, when I run it within a coplet, I get the following error
message on the Browser's Java console:

java.lang.SecurityException: illegal URL redirect
	at sun.plugin.net.protocol.http.HttpUtils.followRedirects(Unknown
Source)
	at sun.plugin.cache.CachedJarLoader.download(Unknown Source)
	at sun.plugin.cache.CachedJarLoader.load(Unknown Source)
	at sun.plugin.cache.JarCache.get(Unknown Source)
	at
sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
	at
sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown
Source)
	at sun.misc.URLClassPath$JarLoader.getJarFile(Unknown Source)
	at sun.misc.URLClassPath$JarLoader.<init>(Unknown Source)
	at sun.misc.URLClassPath+3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.misc.URLClassPath.getLoader(Unknown Source)
	at sun.misc.URLClassPath.getLoader(Unknown Source)
	at sun.misc.URLClassPath.getResource(Unknown Source)
	at java.net.URLClassLoader+1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
java.lang.SecurityException: illegal URL redirect
	at sun.plugin.net.protocol.http.HttpUtils.followRedirects(Unknown
Source)
	at sun.plugin.cache.CachedJarLoader.download(Unknown Source)
	at sun.plugin.cache.CachedJarLoader.load(Unknown Source)
	at sun.plugin.cache.JarCache.get(Unknown Source)
	at
sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
	at
sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown
Source)
	at sun.misc.URLClassPath$JarLoader.getJarFile(Unknown Source)
	at sun.misc.URLClassPath$JarLoader.<init>(Unknown Source)
	at sun.misc.URLClassPath+3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.misc.URLClassPath.getLoader(Unknown Source)
	at sun.misc.URLClassPath.getLoader(Unknown Source)
	at sun.misc.URLClassPath.getResource(Unknown Source)
	at java.net.URLClassLoader+1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Anyone have any ideas? I was planning to use thinlet-based coplets for my
system (www.thinlets.com).

Thanks!

jeff




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


Re: Caching and aggregate

Posted by Oscar Picasso <os...@yahoo.com>.
>> The relevant attribute is 'caching-attributes'
>> which means in this case that the
RequestAttributesCacheableVelocityGenerator
>> will look for a request attribute named 'is-logged' to compute
>> the key. (It uses also the name of the velocity template).
>
> so this caching-attributes is a comma separated list of both request and 
> pipeline-set attributes that should be used during key calculation?

Not quite sure what you mean by 'pipeline-set attributes' but
'caching-attributes' contains only the names of the
request attributes that are to be used for key generation.

However the key generation also uses the velocity template
file name that is provided at setup time.

>> The 'is-logged' attribute is a Boolean that is set upper in the pipeline 
>> inside an action. The action sets correctly the 'is-logged'
>> attribute. 
>> 
> In RequestAttributesCacheableVelocityGenerator you set String[] 
> cachingAttributeNames in configure(), are you aware that configure is 
> called only once during component setup and never afterwards? Could this 
> be affecting your logic?

No, it shouldn't. For a particular component definition (let say
here 'login-velocity') the key should always use the same request attributes
names. However as the key uses both the request attribute name and value, the
key
is different if the values for a same attribute is different between
two requests.


Let's me summarize:

+ configure --> we tell the component which attribute names to use
for each request. Let'say we configure cached-attribute="first-attr,
second-attr"

+ setup --> the input source is set in the component for use by getKey.
Let's say it's 'file:/my-velocity-template.xvt'

+ getKey --> 
return a HashMap:

"source"      : "file:/my-velocity-template.xvt"
"first-attr"  : The value of the request attribute called "first-attr"
"second-attr" : The value of the request attribute called "second-attr"

Oscar

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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


Re: Caching and aggregate

Posted by Oscar Picasso <os...@yahoo.com>.
>> The relevant attribute is 'caching-attributes'
>> which means in this case that the
RequestAttributesCacheableVelocityGenerator
>> will look for a request attribute named 'is-logged' to compute
>> the key. (It uses also the name of the velocity template).
>
> so this caching-attributes is a comma separated list of both request and 
> pipeline-set attributes that should be used during key calculation?

Not quite sure what you mean by 'pipeline-set attributes' but
'caching-attributes' contains only the names of the
request attributes that are to be used for key generation.

However the key generation also uses the velocity template
file name that is provided at setup time.

>> The 'is-logged' attribute is a Boolean that is set upper in the pipeline 
>> inside an action. The action sets correctly the 'is-logged'
>> attribute. 
>> 
> In RequestAttributesCacheableVelocityGenerator you set String[] 
> cachingAttributeNames in configure(), are you aware that configure is 
> called only once during component setup and never afterwards? Could this 
> be affecting your logic?

No, it shouldn't. For a particular component definition (let say
here 'login-velocity') the key should always use the same attributes
names. However as the key uses both the attribute name and value, the key
is different if the values for a same attribute is different between
two requests.


Let's summarize:

+ configure --> we tell the component which attribute names to use
for each request. Let'say we configure cached-attribute="first-attr,
second-attr"

+ setup --> the input source is set in the component for use by getKey.
Let's say it's 'file:/my-velocity-template.xvt'

+ getKey --> 
return a HashMap:

"source"      : "file:/my-velocity-template.xvt"
"first-attr"  : The value of the request attribute called "first-attr"
"second-attr" : The value of the request attribute called "second-attr"

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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


Re: Caching and aggregate

Posted by Jorg Heymans <jh...@domek.be>.
confusing :|

Oscar Picasso wrote:

>>Alternatively (and maybe more easily), are you in a position to retrieve 
>>2.1.5 HEAD and test your case there?
> 
> Same problem with 2.1.5 HEAD.
ok then that should rule out my suspicion about the old bug resurfacing 
again.
> 
> The log-on component is a VelocityGenerator subclass.
> The key is based on some request attributes that are
> chosen upon configuration of the component.
should work, i have a similar cachingrequestgenerator in 2.0.4
> 
> example:
> <map:generator usecache="false" label="content"
>                logger="xenata"  caching-attributes="is-logged"
>                name="loggin-velocity"
>               
> src="org.apache.cocoon.generation.RequestAttributesCacheableVelocityGenerator"/>
> 
> The relevant attribute is 'caching-attributes'
> which means in this case that the RequestAttributesCacheableVelocityGenerator
> will look for a request attribute named 'is-logged' to compute
> the key. (It uses also the name of the velocity template).

so this caching-attributes is a comma separated list of both request and 
pipeline-set attributes that should be used during key calculation?

> 
> The 'is-logged' attribute is a Boolean that is set upper in the pipeline 
> inside an action. The action sets correctly the 'is-logged'
> attribute. 
> 
In RequestAttributesCacheableVelocityGenerator you set String[] 
cachingAttributeNames in configure(), are you aware that configure is 
called only once during component setup and never afterwards? Could this 
be affecting your logic?

Jorg


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


Re: Caching and aggregate

Posted by Oscar Picasso <os...@yahoo.com>.
> Alternatively (and maybe more easily), are you in a position to retrieve 
> 2.1.5 HEAD and test your case there?

Same problem with 2.1.5 HEAD.

> How do you calculate your cachekey in the log-on component?

The log-on component is a VelocityGenerator subclass.
The key is based on some request attributes that are
chosen upon configuration of the component.

example:
<map:generator usecache="false" label="content"
               logger="xenata"  caching-attributes="is-logged"
               name="loggin-velocity"
              
src="org.apache.cocoon.generation.RequestAttributesCacheableVelocityGenerator"/>

The relevant attribute is 'caching-attributes'
which means in this case that the RequestAttributesCacheableVelocityGenerator
will look for a request attribute named 'is-logged' to compute
the key. (It uses also the name of the velocity template).

The 'is-logged' attribute is a Boolean that is set upper in the pipeline 
inside an action. The action sets correctly the 'is-logged'
attribute. 


> The cachekey that is used for aggregated content is composed of the 
> individual key-parts of the aggregation, i just have the feeling that it 
> does not get invalidated properly sometimes.

That what I thought. However, looking at my log files there is something that
I don't understand:

++ The 'log component' key

DEBUG   (2004-03-24) 08:07.12:006   [sitemap] (/cocoon/xenata/one)
http8080-Processor25/AbstractCachingProcessingPipeline: Found cached response
for 'one/home-glou/login-status.xml' using key:
PK_G-loggin-velocity-{attributes={is-logged=false},
source=file:/mnt/desktop/home/jboss/workspace/utils/docs/login-status.xvt}

++ The aggregate key

DEBUG   (2004-03-24) 08:07.12:025   [sitemap] (/cocoon/xenata/one)
http8080-Processor25/AbstractCachingProcessingPipeline: Found cached response
for 'one' using key:
PK_G-<aggregator>-CA(:site<>)P=false:cocoon://utils/path-steps-factory?pipelinehash=-3582795169034738359;P=false:file:/mnt/desktop/home/jboss/workspace/xenata/conf/toc.xml;P=false:cocoon://xenata/one/home-glou/content.xml?pipelinehash=-3880234879657994098;P=false:cocoon://utils/one/home-glou/login-status.xml?pipelinehash=8060913660035705947;_T-xslt-cocoon://utils/stylesheets/structure.xsl?pipelinehash=-6754528278973152800;locale=en;content-type=content_T-i18n-dicts?en___T-xslt-cocoon://utils/stylesheets/skin.xsl?pipelinehash=139531528648284058;static-base-uri=http://www.xenata.com:8080/static/xenata_T-encodeURL-1_S-xhtml-transitional-1
D

As you can see the 'log component' key is not included in the aggregate key
instead it uses something like 
P=false:cocoon://utils/one/home-glou/login-status.xml?pipelinehash=8060913660035705947;

By the way, what is the meaning of 'P=false'?


Attachement: the RequestAttributesCacheableVelocityGenerator and its
subclass.

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

Re: Caching and aggregate

Posted by Jorg Heymans <jh...@domek.be>.
This sounds vaguely like a bug i closed last week on the 2.1.5 branch. 
Could you have look at the test case in 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25887 and see if this 
fails on your 2.1.4 as well?

Alternatively (and maybe more easily), are you in a position to retrieve 
2.1.5 HEAD and test
your case there?

The cachekey that is used for aggregated content is composed of the 
individual key-parts of the aggregation, i just have the feeling that it 
does not get invalidated properly sometimes.

How do you calculate your cachekey in the log-on component?

Oscar Picasso wrote:

> Hi,
> 
> I have installed the 2.1.4 version and realized I have the same problem.
> 
> Let's try to explain it.
> 
> We have:
> 
> + aggregate
>   - part A is generated by a cacheable component. The content depends on the
> uri.
>     Example:
>      > http://localhost/my-first-section ==> part A = "The content of my first
> section"
>      > http://localhost/my-section-section ==> part A = "The content of my
> second section"
>   - part B is generated by a cacheable component whose content depends only of
> whether the user is logged or not. The login status is part of the key of the
> cacheable component.
> 
> Part A and B, work fine when used separately whether or not caching is enabled.
> If caching is not enabled they work fine also in an aggregation.
> 
> But if A and B part of an aggregation and caching is enabled I run into the
> problems.
> 
> 
> example of navigation sequence:
> 
> http://localhost/my-first-section + user not logged
> ==> first section + not logged content (OK)
> 
> http://localhost/my-second-section + user not logged
> ==> second section + not logged content (OK)
> 
> ++ login
> 
> http://localhost/my-first-section + user is logged
> ==> first section + logged content (OK)
> 
> http://localhost/my-second-section + user is logged
> ==> second section + logged content (OK)
> 
> ++ logout
> 
> http://localhost/my-second-section + user not logged
> ==> 
>   - second section (OK)
>   - logged content (**PROBLEM**)
>     (It should be 'not logged content').
> 
> 
> Since my post I have found a workaround: I use a different uri whether the user
> is logged or not.
> 
> It seems the problem arise because the key use to cache the aggregated content
> doesn't use the individual keys of the parts (not quit sure I am correct here
> though). I have also to add that the problem was not reproductible in a
> systematic way.
> 
> 
> --- Jorg Heymans <jh...@domek.be> wrote:
> 
>>Can you elaborate a bit more on what exactly you're experiencing 
>>(pipeline snippets etc)? There was a bug in 2.1.3 with nested 
>>aggregations and caching but it automagically disappeared in 2.1.5.
>>
>>
>>Oscar Picasso wrote:
>>
>>>Hi,
>>>
>>>I am using the 2.1.5-dev version and am experiencing really weird things
>>
>>when I
>>
>>>use aggregation with caching pipelines.
>>>
>>>Has the caching mechanism changed between 2.1.5 and 2.1.4?
>>>
>>>Thanks
>>>
>>>__________________________________
>>>Do you Yahoo!?
>>>Yahoo! Finance Tax Center - File online. File on time.
>>>http://taxes.yahoo.com/filing.html
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.
> http://taxes.yahoo.com/filing.html


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


Re: Caching and aggregate

Posted by Oscar Picasso <os...@yahoo.com>.
Hi,

I have installed the 2.1.4 version and realized I have the same problem.

Let's try to explain it.

We have:

+ aggregate
  - part A is generated by a cacheable component. The content depends on the
uri.
    Example:
     > http://localhost/my-first-section ==> part A = "The content of my first
section"
     > http://localhost/my-section-section ==> part A = "The content of my
second section"
  - part B is generated by a cacheable component whose content depends only of
whether the user is logged or not. The login status is part of the key of the
cacheable component.

Part A and B, work fine when used separately whether or not caching is enabled.
If caching is not enabled they work fine also in an aggregation.

But if A and B part of an aggregation and caching is enabled I run into the
problems.


example of navigation sequence:

http://localhost/my-first-section + user not logged
==> first section + not logged content (OK)

http://localhost/my-second-section + user not logged
==> second section + not logged content (OK)

++ login

http://localhost/my-first-section + user is logged
==> first section + logged content (OK)

http://localhost/my-second-section + user is logged
==> second section + logged content (OK)

++ logout

http://localhost/my-second-section + user not logged
==> 
  - second section (OK)
  - logged content (**PROBLEM**)
    (It should be 'not logged content').


Since my post I have found a workaround: I use a different uri whether the user
is logged or not.

It seems the problem arise because the key use to cache the aggregated content
doesn't use the individual keys of the parts (not quit sure I am correct here
though). I have also to add that the problem was not reproductible in a
systematic way.


--- Jorg Heymans <jh...@domek.be> wrote:
> Can you elaborate a bit more on what exactly you're experiencing 
> (pipeline snippets etc)? There was a bug in 2.1.3 with nested 
> aggregations and caching but it automagically disappeared in 2.1.5.
> 
> 
> Oscar Picasso wrote:
> > Hi,
> > 
> > I am using the 2.1.5-dev version and am experiencing really weird things
> when I
> > use aggregation with caching pipelines.
> > 
> > Has the caching mechanism changed between 2.1.5 and 2.1.4?
> > 
> > Thanks
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Finance Tax Center - File online. File on time.
> > http://taxes.yahoo.com/filing.html
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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


Re: Caching and aggregate

Posted by Jorg Heymans <jh...@domek.be>.
Can you elaborate a bit more on what exactly you're experiencing 
(pipeline snippets etc)? There was a bug in 2.1.3 with nested 
aggregations and caching but it automagically disappeared in 2.1.5.


Oscar Picasso wrote:
> Hi,
> 
> I am using the 2.1.5-dev version and am experiencing really weird things when I
> use aggregation with caching pipelines.
> 
> Has the caching mechanism changed between 2.1.5 and 2.1.4?
> 
> Thanks
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.
> http://taxes.yahoo.com/filing.html


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


Error in free() and crash : help need

Posted by Montier Patrick <pa...@montier.com>.
hello,

i have thousand lines of "Error in free()" error in my localhost_log (15 Go
in one day), and then tomcat freeze
any idea ?

I'm too desesperate with this error.....

2004-03-22 08:25:55 ERROR   10799   [root.sto] (): Error in free()
java.util.NoSuchElementException
        at java.util.LinkedList.remove(LinkedList.java:557)
        at java.util.LinkedList.removeLast(LinkedList.java:127)
        at
org.apache.cocoon.components.store.MRUMemoryStore.free(MRUMemoryStore.java:3
80)
        at
org.apache.cocoon.components.store.MRUMemoryStore.hold(MRUMemoryStore.java:2
83)
        at
org.apache.cocoon.components.store.MRUMemoryStore.get(MRUMemoryStore.java:32
8)
        at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.processReader(Ca
chingStreamPipeline.java:160)
        at
org.apache.cocoon.components.pipeline.AbstractStreamPipeline.process(Abstrac
tStreamPipeline.java:116)
        at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingS
treamPipeline.java:255)
        at
org.apache.cocoon.www.bethe2.sitemap_xmap.wildcardMatchN953(sitemap_xmap.jav
a:9742)
        at
org.apache.cocoon.www.bethe2.sitemap_xmap.process(sitemap_xmap.java:1928)
        at
org.apache.cocoon.www.bethe2.sitemap_xmap.process(sitemap_xmap.java:1273)
        at org.apache.cocoon.sitemap.Handler.process(Handler.java:163)
        at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:115)
        at
org.apache.cocoon.www.sitemap_xmap.wildcardMatchN1FF(sitemap_xmap.java:2883)
        at
org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:2199)
        at
org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:2134)
        at org.apache.cocoon.sitemap.Handler.process(Handler.java:163)
        at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:115)
        at org.apache.cocoon.Cocoon.process(Cocoon.java:446)
        at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:520)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:190)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
        at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1017)
        at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1115
)
        at java.lang.Thread.run(Thread.java:479)



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