You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Phil Blake <ph...@sparkbc.com.au> on 2002/09/09 07:17:28 UTC

sitemap substitution in actions

I have a directory with common resources like images and pdfs thyat are 
used by all sections of the site. I also have other directories with 
resources that are specific to a certain part of the site.

So... If the url points to a specific resource, and it doesn't exist 
then it returns the common resource. (assuming it exists)

I thought this might do the trick:

             <map:match pattern="*/**images/**.jpg">
                 <map:act type="resource-exists">
                     <map:parameter name="url" 
value="{1}/resources/images/{3}.jpg"/>
                     <map:read src="{1}/resources/images/{3}.jpg" 
mime-type="image/jpeg"/>
                 </map:act>
                 <map:redirect-to uri="common/images/{3}.jpg"/>
             </map:match>

but got the error:

org.apache.cocoon.ProcessingException: Failed to execute pipeline.: 
java.io.FileNotFoundException: /resources/images/.jpg (No such file or 
directory)

The Sitemap substitutions don't appear to be available in the action. 
What have I done wrong?

Thanks in advance,

Phil



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: sitemap substitution in actions

Posted by Phil Blake <ph...@sparkbc.com.au>.
thanks. my sanity is waning this afternoon.

i can use every cent I can get. :)
On Monday, September 9, 2002, at 04:44 PM, Barbara Post wrote:

> Since you have a map:act wouldn't you rather use {../1} instead of {1} 
> in
> the body of mp:act ?
>
> I am not sure but these are my 2 cents.
>
> Have a nice day,
>
> Babs
> --
> website: www.babsfrance.fr.st
> ICQ #: 135868405
> ----- Original Message -----
> From: "Phil Blake" <ph...@sparkbc.com.au>
> To: <co...@xml.apache.org>
> Sent: Monday, September 09, 2002 7:17 AM
> Subject: sitemap substitution in actions
>
>
>> I have a directory with common resources like images and pdfs thyat are
>> used by all sections of the site. I also have other directories with
>> resources that are specific to a certain part of the site.
>>
>> So... If the url points to a specific resource, and it doesn't exist
>> then it returns the common resource. (assuming it exists)
>>
>> I thought this might do the trick:
>>
>>              <map:match pattern="*/**images/**.jpg">
>>                  <map:act type="resource-exists">
>>                      <map:parameter name="url"
>> value="{1}/resources/images/{3}.jpg"/>
>>                      <map:read src="{1}/resources/images/{3}.jpg"
>> mime-type="image/jpeg"/>
>>                  </map:act>
>>                  <map:redirect-to uri="common/images/{3}.jpg"/>
>>              </map:match>
>>
>> but got the error:
>>
>> org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
>> java.io.FileNotFoundException: /resources/images/.jpg (No such file or
>> directory)
>>
>> The Sitemap substitutions don't appear to be available in the action.
>> What have I done wrong?
>>
>> Thanks in advance,
>>
>> Phil
>>
>>
>>
>> ---------------------------------------------------------------------
>> Please check that your question  has not already been answered in the
>> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>>
>> To unsubscribe, e-mail:     <co...@xml.apache.org>
>> For additional commands, e-mail:   <co...@xml.apache.org>
>>
>>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>
>
>
Phil Blake
Development Director
Prescience Open Source
Spark Brand Communications
Level 2
44 Mountain Street
ULTIMO NSW 2007
Telephone +61 2 9281 3399
Fax       +61 2 9281 1099
p.blake@sparkbc.com.au
http://www.sparkbc.com.au
__________________________________________________________________
Notice:  This message contains privileged and confidential information
intended only for the use of the addressee named above.  If you are not
the intended recipient of this message you are hereby notified that you
must not disseminate, copy or take any action in reliance on it.  If you
have received this message in error please notify Spark Brand
Communications Pty. Ltd. on +61 2 9281 3399 immediately.

Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of
Spark Brand Communications Pty. Ltd.



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: sitemap substitution in actions

Posted by Barbara Post <ba...@ifrance.com>.
Since you have a map:act wouldn't you rather use {../1} instead of {1} in
the body of mp:act ?

I am not sure but these are my 2 cents.

Have a nice day,

Babs
--
website: www.babsfrance.fr.st
ICQ #: 135868405
----- Original Message -----
From: "Phil Blake" <ph...@sparkbc.com.au>
To: <co...@xml.apache.org>
Sent: Monday, September 09, 2002 7:17 AM
Subject: sitemap substitution in actions


> I have a directory with common resources like images and pdfs thyat are
> used by all sections of the site. I also have other directories with
> resources that are specific to a certain part of the site.
>
> So... If the url points to a specific resource, and it doesn't exist
> then it returns the common resource. (assuming it exists)
>
> I thought this might do the trick:
>
>              <map:match pattern="*/**images/**.jpg">
>                  <map:act type="resource-exists">
>                      <map:parameter name="url"
> value="{1}/resources/images/{3}.jpg"/>
>                      <map:read src="{1}/resources/images/{3}.jpg"
> mime-type="image/jpeg"/>
>                  </map:act>
>                  <map:redirect-to uri="common/images/{3}.jpg"/>
>              </map:match>
>
> but got the error:
>
> org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
> java.io.FileNotFoundException: /resources/images/.jpg (No such file or
> directory)
>
> The Sitemap substitutions don't appear to be available in the action.
> What have I done wrong?
>
> Thanks in advance,
>
> Phil
>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: sitemap substitution in actions

Posted by Vadim Gritsenko <va...@verizon.net>.
Phil Blake wrote:

> I have a directory with common resources like images and pdfs thyat 
> are used by all sections of the site. I also have other directories 
> with resources that are specific to a certain part of the site.
>
> So... If the url points to a specific resource, and it doesn't exist 
> then it returns the common resource. (assuming it exists)
>
> I thought this might do the trick:
>
>             <map:match pattern="*/**images/**.jpg">
>                 <map:act type="resource-exists">
>                     <map:parameter name="url" 
> value="{1}/resources/images/{3}.jpg"/>
>                     <map:read src="{1}/resources/images/{3}.jpg" 
> mime-type="image/jpeg"/>
>                 </map:act>
>                 <map:redirect-to uri="common/images/{3}.jpg"/>
>             </map:match>
>
> but got the error:
>
> org.apache.cocoon.ProcessingException: Failed to execute pipeline.: 
> java.io.FileNotFoundException: /resources/images/.jpg (No such file or 
> directory)
>
> The Sitemap substitutions don't appear to be available in the action. 
> What have I done wrong?


Follow Barbara's advice. See also:

http://xml.apache.org/cocoon/faq/faq-sitemap.html#faq-7

Vadim



> Thanks in advance,
>
> Phil





---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>