You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Emyr Tomos <em...@gmail.com> on 2012/10/02 19:34:35 UTC

Adding favicons to Lenya RELEASE_2_0_4

I have tried everything to gain control over the favicons in lenya
with no success. The normal masking behaviour per publication has not
worked, and I have followed the instructions here :
http://markmail.org/message/37zfk5pxa6wevhvt#query:+page:1+mid:37zfk5pxa6wevhvt+state:results
with no success
basically I added
        <link rel="SHORTCUT ICON" type="image/x-icon"
href="{$root}/images/colet.ico"/>
to the publication page2xhtml.xsl and added
      <map:match pattern="*/*/**colet.ico">
        <map:read src="pubs/{1}resources/shared/favicon.ico"
mime-type="image/x-icon"/>
      </map:match>
to resources-shared.xconf
This is the output:
	at <map:read> -
file:///home/emyr/workspace/lenya-2.0.4/build/lenya/webapp/lenya/resources-shared.xmap:151:91
	at <map:mount> -
file:///home/emyr/workspace/lenya-2.0.4/build/lenya/webapp/global-sitemap.xmap:314:127
	at <map:mount> -
file:///home/emyr/workspace/lenya-2.0.4/build/lenya/webapp/sitemap.xmap:681:106java.io.FileNotFoundException:
/home/emyr/workspace/lenya-2.0.4/build/lenya/webapp/resources/shared/favicon.ico
(No such file or directory)full exception chain
stacktraceorg.apache.cocoon.ResourceNotFoundException: Error during
resolving of the input stream
	at <map:read> -
file:///home/emyr/workspace/lenya-2.0.4/build/lenya/webapp/lenya/resources-shared.xmap:151:91
	at <map:mount> -
file:///home/emyr/workspace/lenya-2.0.4/build/lenya/webapp/global-sitemap.xmap:314:127
	at <map:mount> -
file:///home/emyr/workspace/lenya-2.0.4/build/lenya/webapp/sitemap.xmap:681:106
	at org.apache.cocoon.components.source.SourceUtil.handle(SourceUtil.java:472)

The new map:read element is at resources-shared.xmap line 151, and
that is plainly where the trouble lies - it is falling through to look
for the favicon elsewhere. I don't understand why this map could not
use the fallback URL as is used elsewhere, and why it can find the
lenya.ico but not my colet.ico. We intend to use lenya for a number of
websites where identity is very important, so the favicon control is
something we _must_ have.
I have also looked at
http://lenya.apache.org/docu20/standardmodules/resourcemodulesection/resourcemoduleoverview.html#N10085
, and at the Wyona website, but there is nothing there to say how to
make them directly addressable as part of a publication.
Any help much appreciated,
regards
Emyr Tomos
Gambit Research

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Adding favicons to Lenya RELEASE_2_0_4

Posted by Emyr Tomos <em...@gmail.com>.
Hi Rainer,
Thanks for your reply, sorry I didn't respond earlier.
I am convinced from looking at my error logs that the lenya fallback
mechanism, in the case of favicons, is failing to include the "images"
folder in the filesystem path when it's looking for the file. the reason i
keep getting the lenya icon is not because lenya is falling back to that -
it fails to find that also - but because /favicon.ico works, and the
venerable old method that microsoft first introduced comes into play.
Interestingly when I wget to a static site this problem disappears, but
even if it didn't we will be either serving statically or frontending with
apache so we can ensure there is a correct favicon.ico in the docroot of
each virtual host. Since spending a vast amount of time on this would leave
my employers wondering at the wisdom of my choice of lenya, i have deferred
this indefinitely (i.e until nothing else needs doing :-D) but if ii pick
it up again i'll let you know what i find.

tx again,
regards
em


On Tue, Oct 2, 2012 at 8:01 PM, Rainer Schöpf <ra...@gmx.net>wrote:

> On Tue, 2 Oct 2012 at 18:34 +0100, Emyr Tomos wrote:
>
>  > I have tried everything to gain control over the favicons in lenya
>  > with no success. The normal masking behaviour per publication has not
>  > worked, and I have followed the instructions here :
>  >
> http://markmail.org/message/37zfk5pxa6wevhvt#query:+page:1+mid:37zfk5pxa6wevhvt+state:results
>  > with no success
>  > basically I added
>  >         <link rel="SHORTCUT ICON" type="image/x-icon"
>  > href="{$root}/images/colet.ico"/>
>  > to the publication page2xhtml.xsl and added
>  >       <map:match pattern="*/*/**colet.ico">
>  >         <map:read src="pubs/{1}resources/shared/favicon.ico"
>
> There is a "/" missing immediately after "{1}", ie.
>
>  <map:read src="pubs/{1}/resources/shared/favicon.ico"
> mime-type="image/x-icon"/>
>
> You should use the fallback: protocol anyway. This will first look inside
> the
> publication directory and then in the global resources directory.
>
>  > I have also looked at
>  >
> http://lenya.apache.org/docu20/standardmodules/resourcemodulesection/resourcemoduleoverview.html#N10085
>  > , and at the Wyona website, but there is nothing there to say how to
>  > make them directly addressable as part of a publication.
>
> Here is what I do: add a case for files with a names like *.ico to the
> resources-shared.xmap:
>
>          <!-- matches pub-id/area/images/*.ico -->
>       <map:match pattern="*/*/images/*.ico">
>         <map:read src="fallback://resources/shared/images/{3}.ico"
> mime-type="image/x-icon" />
>       </map:match>
>
> (Note: I did this in the resources.xmap file for the publication in
> question,
> ie.
>
>   .../pubs/pub_name/lenya/resources-shared.xmap
>
> but it will work in the global resources-shared.xmap file as well.)
>
> Put the favicon into the images directory, e.g.,
>
>   .../pubs/pub_name/resources/shared/images/myicon.ico
>
> and reference it via
>
>   <LINK href="http://www.dante.de/images/myicon.ico" type="image/ico"
> rel="SHORTCUT ICON">
>
>   Rainer
>

Re: Adding favicons to Lenya RELEASE_2_0_4

Posted by Emyr Tomos <em...@gmail.com>.
Hi Rainer,
Thanks for your reply, sorry I didn't respond earlier.
I am convinced from looking at my error logs that the lenya fallback
mechanism, in the case of favicons, is failing to include the "images"
folder in the filesystem path when it's looking for the file. the reason i
keep getting the lenya icon is not because lenya is falling back to that -
it fails to find that also - but because /favicon.ico works, and the
venerable old method that microsoft first introduced comes into play.
Interestingly when I wget to a static site this problem disappears, but
even if it didn't we will be either serving statically or frontending with
apache so we can ensure there is a correct favicon.ico in the docroot of
each virtual host. Since spending a vast amount of time on this would leave
my employers wondering at the wisdom of my choice of lenya, i have deferred
this indefinitely (i.e until nothing else needs doing :-D) but if ii pick
it up again i'll let you know what i find.

tx again,
regards
em


On Tue, Oct 2, 2012 at 8:01 PM, Rainer Schöpf <ra...@gmx.net>wrote:

> On Tue, 2 Oct 2012 at 18:34 +0100, Emyr Tomos wrote:
>
>  > I have tried everything to gain control over the favicons in lenya
>  > with no success. The normal masking behaviour per publication has not
>  > worked, and I have followed the instructions here :
>  >
> http://markmail.org/message/37zfk5pxa6wevhvt#query:+page:1+mid:37zfk5pxa6wevhvt+state:results
>  > with no success
>  > basically I added
>  >         <link rel="SHORTCUT ICON" type="image/x-icon"
>  > href="{$root}/images/colet.ico"/>
>  > to the publication page2xhtml.xsl and added
>  >       <map:match pattern="*/*/**colet.ico">
>  >         <map:read src="pubs/{1}resources/shared/favicon.ico"
>
> There is a "/" missing immediately after "{1}", ie.
>
>  <map:read src="pubs/{1}/resources/shared/favicon.ico"
> mime-type="image/x-icon"/>
>
> You should use the fallback: protocol anyway. This will first look inside
> the
> publication directory and then in the global resources directory.
>
>  > I have also looked at
>  >
> http://lenya.apache.org/docu20/standardmodules/resourcemodulesection/resourcemoduleoverview.html#N10085
>  > , and at the Wyona website, but there is nothing there to say how to
>  > make them directly addressable as part of a publication.
>
> Here is what I do: add a case for files with a names like *.ico to the
> resources-shared.xmap:
>
>          <!-- matches pub-id/area/images/*.ico -->
>       <map:match pattern="*/*/images/*.ico">
>         <map:read src="fallback://resources/shared/images/{3}.ico"
> mime-type="image/x-icon" />
>       </map:match>
>
> (Note: I did this in the resources.xmap file for the publication in
> question,
> ie.
>
>   .../pubs/pub_name/lenya/resources-shared.xmap
>
> but it will work in the global resources-shared.xmap file as well.)
>
> Put the favicon into the images directory, e.g.,
>
>   .../pubs/pub_name/resources/shared/images/myicon.ico
>
> and reference it via
>
>   <LINK href="http://www.dante.de/images/myicon.ico" type="image/ico"
> rel="SHORTCUT ICON">
>
>   Rainer
>

Re: Adding favicons to Lenya RELEASE_2_0_4

Posted by Rainer Schöpf <ra...@gmx.net>.
On Tue, 2 Oct 2012 at 18:34 +0100, Emyr Tomos wrote:

 > I have tried everything to gain control over the favicons in lenya
 > with no success. The normal masking behaviour per publication has not
 > worked, and I have followed the instructions here :
 > http://markmail.org/message/37zfk5pxa6wevhvt#query:+page:1+mid:37zfk5pxa6wevhvt+state:results
 > with no success
 > basically I added
 >         <link rel="SHORTCUT ICON" type="image/x-icon"
 > href="{$root}/images/colet.ico"/>
 > to the publication page2xhtml.xsl and added
 >       <map:match pattern="*/*/**colet.ico">
 >         <map:read src="pubs/{1}resources/shared/favicon.ico"

There is a "/" missing immediately after "{1}", ie.

 <map:read src="pubs/{1}/resources/shared/favicon.ico" mime-type="image/x-icon"/>

You should use the fallback: protocol anyway. This will first look inside the 
publication directory and then in the global resources directory.

 > I have also looked at
 > http://lenya.apache.org/docu20/standardmodules/resourcemodulesection/resourcemoduleoverview.html#N10085
 > , and at the Wyona website, but there is nothing there to say how to
 > make them directly addressable as part of a publication.

Here is what I do: add a case for files with a names like *.ico to the 
resources-shared.xmap:
 
         <!-- matches pub-id/area/images/*.ico -->
      <map:match pattern="*/*/images/*.ico">
        <map:read src="fallback://resources/shared/images/{3}.ico" mime-type="image/x-icon" />
      </map:match>

(Note: I did this in the resources.xmap file for the publication in question, 
ie.

  .../pubs/pub_name/lenya/resources-shared.xmap

but it will work in the global resources-shared.xmap file as well.)

Put the favicon into the images directory, e.g.,

  .../pubs/pub_name/resources/shared/images/myicon.ico

and reference it via

  <LINK href="http://www.dante.de/images/myicon.ico" type="image/ico" rel="SHORTCUT ICON">

  Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org