You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Annie Dumont <an...@univ-reunion.fr> on 2005/12/13 12:12:41 UTC

Some pb too display pictures in authoring-tab

Hi list, hi all,

When you go in the authoring-tab of lenya, you can edit a document with 
Kupu,  insert a picture, then save and exit of kupu :  you are supposed 
to see the picture you just have inserted in the authoring-tab "preview" 
of your document.
But, in our publication we have two cases :
you belong to the group reviewer and editor, with edit and publish right 
on all the sitetree : you can see the picture you have inserted with 
kupu in the authoring-tab.
you belong to another group with rights restricted to a part of the 
sitetree :
- you see the picture in Kupu
- you see the picture in the live view
- but you don't see the picture in the authoring view
Does anybody know how to fix this ?

Kind regards, annie

PS : we use cocoon 2.1.7 and lenya 1.2.3



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


Re: Some pb too display pictures in authoring-tab

Posted by Annie Dumont <an...@univ-reunion.fr>.
Hi Solprovider, hi all !

solprovider@apache.org a écrit :

>On 12/14/05, Annie Dumont <an...@univ-reunion.fr> wrote:
>  
>
>>solprovider@apache.org a écrit :
>>    
>>
>>>Try adding your img() function to:
>>>\build\lenya\webapp\lenya\resources\menu\menu.js
>>>It should work now.
>>>      
>>>
>>It displays the code :
>><div style="block:table-cell"><img src="test/Souris.jpg" width="410px"
>>border="0" height="462"/></div>
>>instead of  the image ...
>>
>>I don't know if this help, but here is the head of the document
>>displayed in the authoring-tab :
>><head>
>><META http-equiv="Content-Type" content="text/html; charset=UTF-8">
>><title>
>>      Apache Lenya |
>>      univ_reunion |
>>      authoring |
>>      /universite/test.html |
>>      Universit&eacute; de la R&eacute;union</title>
>><script src="/lenya_univ/lenya/menu/menu.js" type="text/javascript">Â </script>
>><link href="/lenya_univ/lenya/css/menu.css" rel="stylesheet" type="text/css">
>><meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
>><link href="/lenya_univ/univ_reunion/authoring/css/style.dynamic.css" type="text/css" rel="stylesheet">
>><script type="text/javascript" src="/lenya_univ/univ_reunion/authoring/js/general.dynamic.js">Â </script>
>></head>
>>The img() fonction is in "/lenya_univ/univ_reunion/authoring/js/general.dynamic.js"
>>Now there is a img() in /lenya_univ/lenya/menu/menu.js too.
>>    
>>
>
>1. menu2xslt.xsl is working correctly.  The SCRIPT tag for
>general.dynamic.js is added to the HEAD.   There is no bug.
>
>2. The JS img() function should not escape the < > characters.  In
>menu.js, change the &lt; to < and the &gt; to >.  It should work
>properly.  (This is still a hack, because it is not using the correct
>file.)
>  
>
Done. But code is still displaid instead of the image, even after 
emptying the cache.

>3. You are using a relative URL for the SCRIPT tag.  It seems:
>/lenya_univ/univ_reunion/authoring/js/general.dynamic.js
>does not exist.  Try that URL.  It should be a "Not found" error. 
>

No : it is the connection form. if i enter the name of a "good" login, 
the js is displaid

> The
>proper fix is either make that URL point to the correct file, or use
>an absolute URL in the XSL:
>/lenya_univ/univ_reunion/live/js/general.dynamic.js
>  
>
Done : it resolves the problem. Thank you very much for your help 
Solprovider. I am a little lost with lenya and all its files !

Kind regards, annie

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


Re: Some pb too display pictures in authoring-tab

Posted by so...@apache.org.
On 12/14/05, Annie Dumont <an...@univ-reunion.fr> wrote:
> solprovider@apache.org a écrit :
> >Try adding your img() function to:
> >\build\lenya\webapp\lenya\resources\menu\menu.js
> >It should work now.
> It displays the code :
> <div style="block:table-cell"><img src="test/Souris.jpg" width="410px"
> border="0" height="462"/></div>
> instead of  the image ...
>
> I don't know if this help, but here is the head of the document
> displayed in the authoring-tab :
> <head>
> <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
> <title>
>       Apache Lenya |
>       univ_reunion |
>       authoring |
>       /universite/test.html |
>       Universit&eacute; de la R&eacute;union</title>
> <script src="/lenya_univ/lenya/menu/menu.js" type="text/javascript">Â </script>
> <link href="/lenya_univ/lenya/css/menu.css" rel="stylesheet" type="text/css">
> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
> <link href="/lenya_univ/univ_reunion/authoring/css/style.dynamic.css" type="text/css" rel="stylesheet">
> <script type="text/javascript" src="/lenya_univ/univ_reunion/authoring/js/general.dynamic.js">Â </script>
> </head>
> The img() fonction is in "/lenya_univ/univ_reunion/authoring/js/general.dynamic.js"
> Now there is a img() in /lenya_univ/lenya/menu/menu.js too.

1. menu2xslt.xsl is working correctly.  The SCRIPT tag for
general.dynamic.js is added to the HEAD.   There is no bug.

2. The JS img() function should not escape the < > characters.  In
menu.js, change the &lt; to < and the &gt; to >.  It should work
properly.  (This is still a hack, because it is not using the correct
file.)

3. You are using a relative URL for the SCRIPT tag.  It seems:
/lenya_univ/univ_reunion/authoring/js/general.dynamic.js
does not exist.  Try that URL.  It should be a "Not found" error.  The
proper fix is either make that URL point to the correct file, or use
an absolute URL in the XSL:
/lenya_univ/univ_reunion/live/js/general.dynamic.js

If you use the absolute URL, you should dynamically insert the
publication-id to ease maintenance if you change the name of the pub
or make a copy.

solprovider

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


Re: Some pb too display pictures in authoring-tab

Posted by Annie Dumont <an...@univ-reunion.fr>.
Hi solprovider, hi all,

solprovider@apache.org a écrit :

> [...]
>
>The image in the Authoring section is at:
>http://our_server.fr/lenya_directory/our_pub/authoring/universite/test/Souris.jpg
>Test that URL in a browser with a "bad" login.  Assuming my theory
>below is correct, it should work.
>  
>
Yes it works

>You should have mentioned that JS was involved.  The JS function is
>not in the HEAD when in the Authoring section because Lenya wraps the
>content page with the CMS GUI, so the JS is not loaded before the page
>is loaded, so the document.writes never happen.  That explains why no
>red X displays in MSIE; all it sees is a SCRIPT tag calling an
>unavailable function.
>  
>
Oh sorry, i didn't know all those things :(

>Try adding your img() function to:
>\build\lenya\webapp\lenya\resources\menu\menu.js
>It should work now.
>  
>
It displays the code :
<div style="block:table-cell"><img src="test/Souris.jpg" width="410px" 
border="0" height="462"/></div>
instead of  the image ...

>A better solution is for Lenya to combine the HEAD of the content with
>the HEAD of the CMS GUI. This should happen in:
>\build\lenya\webapp\lenya\xslt\menu\menu2xslt.xsl
>  
>
I am afraid i don't really understand what i have to test. I put my 
menu2xslt.xsl as attached file.
Do you mean i have something to add  between :

<xso:template match="/">
    <html>
      <head>
        <xso:call-template name="title"/>
        <script src="{$contextprefix}/lenya/menu/menu.js" type="text/javascript">&#160;</script>
        <link href="{$contextprefix}/lenya/css/menu.css" rel="stylesheet" type="text/css"/>
        <xso:apply-templates select="xhtml:html/xhtml:head/*[local-name() != 'title']"/>
      </head>


>A quick read of Lenya 1.2.2's version suggests that if the content
>contains a HEAD tag, the page will contain two HEAD tags.  (I hope I
>am wrong.  I'll test tomorrow if you do not confirm it.)
>
>Check the source of the page in the Authoring section.  Does it have 2
>HEAD tags?  Where is the img() function?
>  
>
I don't know if this help, but here is the head of the document 
displayed in the authoring-tab :

<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>
      Apache Lenya |
      univ_reunion |
      authoring |
      /universite/test.html |
      Universit&eacute; de la R&eacute;union</title>
<script src="/lenya_univ/lenya/menu/menu.js" type="text/javascript">Â </script>
<link href="/lenya_univ/lenya/css/menu.css" rel="stylesheet" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link href="/lenya_univ/univ_reunion/authoring/css/style.dynamic.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="/lenya_univ/univ_reunion/authoring/js/general.dynamic.js">Â </script>

</head>

The img() fonction is in "/lenya_univ/univ_reunion/authoring/js/general.dynamic.js"
Now there is a img() in /lenya_univ/lenya/menu/menu.js too.

Kind regards, annie



Re: Some pb too display pictures in authoring-tab

Posted by so...@apache.org.
On 12/13/05, Annie Dumont <an...@univ-reunion.fr> wrote:
>  solprovider@apache.org a écrit :
>  On 12/13/05, Annie Dumont <an...@univ-reunion.fr> wrote:
>  When you go in the authoring-tab of lenya, you can edit a document with
> Kupu, insert a picture, then save and exit of kupu : you are supposed
> to see the picture you just have inserted in the authoring-tab "preview"
> of your document.
> But, in our publication we have two cases :
> you belong to the group reviewer and editor, with edit and publish right
> on all the sitetree : you can see the picture you have inserted with
> kupu in the authoring-tab.
> you belong to another group with rights restricted to a part of the
> sitetree :
> - you see the picture in Kupu
> - you see the picture in the live view
> - but you don't see the picture in the authoring view
> Does anybody know how to fix this ?
> PS : we use cocoon 2.1.7 and lenya 1.2.3
>
>  This is probably a relative URL issue.
> - What is the IMG SRC parameter when looking in the Source in Kupu?
>  This is a relative one
>  <img src="test/Souris.jpg" ismap="ismap" alt="" border="0" height="519"
> width="460">
>  - What is the URL of the Authoring tab?
> http://our_server.fr/lenya_directory/our_pub/authoring/universite/test.html
>  What is the SRC parameter
> when looking at the source of the page in the browser?
>  <script>img('test/Souris.jpg', 519, 460)</script>
>
> with the js function img :
> function img(url, hauteur, largeur)
> {
>  if (largeur>410)
>  {
>  document.write('&lt;div style="block:table-cell">&lt;img
> src="' + url +
> '" width="410px" border="0" height="' + Math.floor(hauteur*410/largeur) +
> '"/>&l
> t;/div>');
>  }
>  else if (largeur>=0)
>  {
>  document.write('&lt;img src="' + url + '" width="' + largeur +'" height=
> "' + hauteur + '"/>');
>  }
>  else
>  {
>  document.write('&lt;img src="' + url + '"/>');
>  }
> }
>  - What is the URL of the live version?
> http://our_server.fr/lenya_directory/our_pub/live/universite/test.html
>  What is the SRC parameter when
> looking at the source of the page in the browser?
>  <div>
> <script>img('test/Souris.jpg', 519, 460)</script>
> </div>
>
>  With that information, we can figure the complete path of the IMG.
> Then decide why some people do not have access to the IMG for certain
> cases.
>
> Are you using MSIE or Mozilla for editing? for viewing?
>  I am using firefox for editing and viewing, MSIE only for viewing
>
>  MSIE can
> damage URLs when saving from Kupu. (That will be evident from the
> above information.) MSIE displays a box with an X when an image file
> is not available. Mozilla shows nothing, pretending the IMG tag does
> not exist, if the file is not available.
>
>  I verify : under MSIE, when the picture doesn't display for user with
> restricted rights : no red X in place and the source is the same :
>  <div>
>  <script>img('test/Souris.jpg', 519, 460)</script>
>  </div>
>  Does the image appear properly after publishing the page?
>  Yes, that's the entire mystery ! I need the image to be displaid in the
> authoring-tab because my users will be disturbed by no seeing what they did,
> even if its done.
>  I don't understand, how with the same code, it can be sometimes displaid
> and sometimes not :(

The image in the Authoring section is at:
http://our_server.fr/lenya_directory/our_pub/authoring/universite/test/Souris.jpg
Test that URL in a browser with a "bad" login.  Assuming my theory
below is correct, it should work.

You should have mentioned that JS was involved.  The JS function is
not in the HEAD when in the Authoring section because Lenya wraps the
content page with the CMS GUI, so the JS is not loaded before the page
is loaded, so the document.writes never happen.  That explains why no
red X displays in MSIE; all it sees is a SCRIPT tag calling an
unavailable function.

Try adding your img() function to:
\build\lenya\webapp\lenya\resources\menu\menu.js
It should work now.

A better solution is for Lenya to combine the HEAD of the content with
the HEAD of the CMS GUI. This should happen in:
\build\lenya\webapp\lenya\xslt\menu\menu2xslt.xsl
A quick read of Lenya 1.2.2's version suggests that if the content
contains a HEAD tag, the page will contain two HEAD tags.  (I hope I
am wrong.  I'll test tomorrow if you do not confirm it.)

Check the source of the page in the Authoring section.  Does it have 2
HEAD tags?  Where is the img() function?

solprovider

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


Re: Some pb too display pictures in authoring-tab

Posted by Annie Dumont <an...@univ-reunion.fr>.
Hi Solprovider, hi all,

solprovider@apache.org a écrit :

>On 12/13/05, Annie Dumont <an...@univ-reunion.fr> wrote:
>  
>
>>When you go in the authoring-tab of lenya, you can edit a document with
>>Kupu,  insert a picture, then save and exit of kupu :  you are supposed
>>to see the picture you just have inserted in the authoring-tab "preview"
>>of your document.
>>But, in our publication we have two cases :
>>you belong to the group reviewer and editor, with edit and publish right
>>on all the sitetree : you can see the picture you have inserted with
>>kupu in the authoring-tab.
>>you belong to another group with rights restricted to a part of the
>>sitetree :
>>- you see the picture in Kupu
>>- you see the picture in the live view
>>- but you don't see the picture in the authoring view
>>Does anybody know how to fix this ?
>>PS : we use cocoon 2.1.7 and lenya 1.2.3
>>    
>>
>
>This is probably a relative URL issue.
>- What is the IMG SRC parameter when looking in the Source in Kupu?
>  
>
This is a relative one

<img src="test/Souris.jpg" ismap="ismap" alt="" border="0" height="519" 
width="460">

>- What is the URL of the Authoring tab?
>
http://our_server.fr/lenya_directory/our_pub/authoring/universite/test.html

>  What is the SRC parameter
>when looking at the source of the page in the browser?
>  
>

<script>img('test/Souris.jpg', 519, 460)</script>

with the js function img :
function img(url, hauteur, largeur)

{

        if (largeur>410)

    {

        document.write('&lt;div style="block:table-cell">&lt;img src="' + url +

'" width="410px" border="0" height="' + Math.floor(hauteur*410/largeur) + '"/>&l

t;/div>');

    }

        else if (largeur>=0)

    {

        document.write('&lt;img src="' + url + '" width="' + largeur +'" height=

"' + hauteur + '"/>');

    }

    else

    {

        document.write('&lt;img src="' + url + '"/>');

    }

}



>- What is the URL of the live version?
>
http://our_server.fr/lenya_directory/our_pub/live/universite/test.html

>  What is the SRC parameter when
>looking at the source of the page in the browser?
>  
>
<div>
<script>img('test/Souris.jpg', 519, 460)</script>
</div>

>With that information, we can figure the complete path of the IMG. 
>Then decide why some people do not have access to the IMG for certain
>cases.
>
>Are you using MSIE or Mozilla for editing?  for viewing?
>
I am using firefox for editing and viewing, MSIE only for viewing

>  MSIE can
>damage URLs when saving from Kupu.  (That will be evident from the
>above information.)  MSIE displays a box with an X when an image file
>is not available.  Mozilla shows nothing, pretending the IMG tag does
>not exist, if the file is not available.
>  
>
I verify : under MSIE, when the picture doesn't display for user with 
restricted rights : no red X in place and the source is the same :
<div>
<script>img('test/Souris.jpg', 519, 460)</script>
</div>

>Does the image appear properly after publishing the page?
>  
>
Yes, that's the entire mystery ! I need the image to be displaid in the 
authoring-tab because my users will be disturbed by no seeing what they 
did, even if its done.
I don't understand, how with the same code, it can be sometimes displaid 
and sometimes not :(

Kind regards, annie

Re: Some pb too display pictures in authoring-tab

Posted by so...@apache.org.
On 12/13/05, Annie Dumont <an...@univ-reunion.fr> wrote:
> When you go in the authoring-tab of lenya, you can edit a document with
> Kupu,  insert a picture, then save and exit of kupu :  you are supposed
> to see the picture you just have inserted in the authoring-tab "preview"
> of your document.
> But, in our publication we have two cases :
> you belong to the group reviewer and editor, with edit and publish right
> on all the sitetree : you can see the picture you have inserted with
> kupu in the authoring-tab.
> you belong to another group with rights restricted to a part of the
> sitetree :
> - you see the picture in Kupu
> - you see the picture in the live view
> - but you don't see the picture in the authoring view
> Does anybody know how to fix this ?
> PS : we use cocoon 2.1.7 and lenya 1.2.3

This is probably a relative URL issue.
- What is the IMG SRC parameter when looking in the Source in Kupu?
- What is the URL of the Authoring tab?  What is the SRC parameter
when looking at the source of the page in the browser?
- What is the URL of the live version?  What is the SRC parameter when
looking at the source of the page in the browser?

With that information, we can figure the complete path of the IMG. 
Then decide why some people do not have access to the IMG for certain
cases.

Are you using MSIE or Mozilla for editing?  for viewing?  MSIE can
damage URLs when saving from Kupu.  (That will be evident from the
above information.)  MSIE displays a box with an X when an image file
is not available.  Mozilla shows nothing, pretending the IMG tag does
not exist, if the file is not available.

Does the image appear properly after publishing the page?

solprovider

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