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/11/05 20:17:06 UTC

EventValidity problem

I have some problems to use EventValidity inside an action. Here are some
elements:

-- SITEMAP --
...
<map:match type="wildcard-host" pattern="*.test.org*">
  <map:match pattern="subdomains">
    <map:generate type="serverpages" src="subdomains.xsp">
      <map:parameter name="subdomain" value="{../1}"/>
    </map:generate>
    <map:serialize type="xml"/>
  </map:match>
</map:match>
...

--  in subdomains.xsp --
...
public Serializable getKey()
{
  return parameters.getParameter("subdomain", null);
}


public SourceValidity getValidity() {
  return new EventValidity(new NamedEvent("/subdomains"));
}
...

I have also another pipeline that uses a CacheEventAction to invalidate the
subdomains.xsp cache. It works fine if I call 'directly' the 'subdomains' pipe
line. 

However I use also the 'subdomains' pipepline in a custom Action.

My act method looks something like this.
...
if (this.source == null)
{
  this.source = resolver.resolveURI(src);
}

if(this.source.getValidity().isValid() != SourceValidy.VALID)
{
  // A costly computation
  this.result = extractResult(this.source.getInputStream());
}

.. use this.result

The problem is that source.getValidity().isValid() always returns
SourceValidy.VALID, even after having invalidated the 'subdomains' pipeline
with the CacheEventAction.

If a use a FileTimeStampValidity instead of an EventValidity in the
subdomain.xsp getValidity() method, it works fine
(this.source.getValidity().isValid() doesn't return SourceValidy.VALID after
having modified the subdomain.xsp file, which is what I expect in that case).

I need however to use an EventValidity.

Any idea?

Thanks.

Oscar.


		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 


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