cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From footh <fo...@yahoo.com>
Subject Forcing error in sitemap
Date Fri, 11 Aug 2006 20:41:01 GMT
I have a sitemap that first goes through a javaflow,
then is forwarded to an aggregation of several
different pieces.

One of those pieces is the main content.  If a URL is
requested that doesn't exist, grabbing the main
content will cause a null error in the pipeline (but
since it "matches" a pipeline, a 404 error will not be
thrown).

I need these instances to produce 404 error because
I'm getting killed by search engines that are
requesting URLs that don't exist anymore. They are not
getting 404 so they keep trying the URLs which causes
my log file to balloon in size.

So, anyway, I've figured out I should use the
"resource-exists" selector on the main content
aggregation part.  But, if the resource doesn't exist,
I want to force a 404 error so the "handle-errors"
block properly handles the error.  However, I can't
figure out how to generate an error that moves the
sitemap processing to the handle-errors block.  Here
is the pipeline snippet in question:

<map:match pattern="**-content">
  <map:select type="resource-exists">
    <map:when test="documents/{1}.xml">
      <map:generate type="jx"
src="documents/{1}.xml"/>
      <map:serialize type="xml"/>
    </map:when>
    <map:otherwise>
    <!-- force 404 error here!!! -->
    </map:otherwise>      
  </map:select>
</map:match>

So, in the "otherwise" block, I'd like to force a 404
error.  I'm hoping there is a really simple way to do
this.  Anyone have a suggestion?

Thanks,

JF


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message