Quantcast

TinyMCE use getUTility instead of getToolByName

classic Classic list List threaded Threaded
3 messages Options
toutpt toutpt
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

TinyMCE use getUTility instead of getToolByName

Hi,

I already have discuss this topic last year, but I still have the issue.

I have reported the bug at https://dev.plone.org/ticket/12800

Using getUtility(ITinyMCE) force you to not trying to output value like URL, because request is not bind on context, so absolute_url calls will never output a URL but a PATH.

The code start from a browserview, but use getUtility to compute the TinyMCE configuration, so URL of @@tinymce-getstyle will never be a valid URL.

So the question is: Why you don't want to use getToolByName, so the request is bind on the context ? Mean Change all calls in TinyMCEBrowserView if getUtility by getToolByName.

An other solution that seems used in the same view will give portal_url as a new arg of the method ITinyMCE.getConfiguration.

Regards / Cordialement,
JeanMichel FRANCOIS



------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
David Glick (GW) David Glick (GW)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TinyMCE use getUTility instead of getToolByName

On 3/26/12 7:48 AM, Jean-Michel FRANCOIS wrote:

> Hi,
>
> I already have discuss this topic last year, but I still have the issue.
>
> I have reported the bug at https://dev.plone.org/ticket/12800
>
> Using getUtility(ITinyMCE) force you to not trying to output value
> like URL, because request is not bind on context, so absolute_url
> calls will never output a URL but a PATH.
>
> The code start from a browserview, but use getUtility to compute the
> TinyMCE configuration, so URL of @@tinymce-getstyle will never be a
> valid URL.
>
> So the question is: Why you don't want to use getToolByName, so the
> request is bind on the context ? Mean Change all calls
> in TinyMCEBrowserView if getUtility by getToolByName.
>
> An other solution that seems used in the same view will give
> portal_url as a new arg of the method ITinyMCE.getConfiguration.
>
It looks like the utility lookup in five.localsitemanager is
intentionally removing the request container from the acquisition chain.
I'm not sure what the rationale is for that, but given that, +1 for
updating it to use getToolByName instead of getUtility.
David


----------
David Glick
 Web Developer
 [hidden email]
 206.286.1235x32

GiveBIG is coming! Mark your calendar for May 2 and get ready to give big to Groundwire
on this community-wide day of giving.

http://www.seattlefoundation.org/npos/Pages/Groundwire.aspx



------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
Domen Kožar Domen Kožar
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TinyMCE use getUTility instead of getToolByName

Hi,

I have pushed changes to reflect this issue, can you verify and provide a good test case?


Cheers, Domen

On Sun, Apr 8, 2012 at 1:09 AM, David Glick <[hidden email]> wrote:
On 3/26/12 7:48 AM, Jean-Michel FRANCOIS wrote:
> Hi,
>
> I already have discuss this topic last year, but I still have the issue.
>
> I have reported the bug at https://dev.plone.org/ticket/12800
>
> Using getUtility(ITinyMCE) force you to not trying to output value
> like URL, because request is not bind on context, so absolute_url
> calls will never output a URL but a PATH.
>
> The code start from a browserview, but use getUtility to compute the
> TinyMCE configuration, so URL of @@tinymce-getstyle will never be a
> valid URL.
>
> So the question is: Why you don't want to use getToolByName, so the
> request is bind on the context ? Mean Change all calls
> in TinyMCEBrowserView if getUtility by getToolByName.
>
> An other solution that seems used in the same view will give
> portal_url as a new arg of the method ITinyMCE.getConfiguration.
>
It looks like the utility lookup in five.localsitemanager is
intentionally removing the request container from the acquisition chain.
I'm not sure what the rationale is for that, but given that, +1 for
updating it to use getToolByName instead of getUtility.
David


----------
David Glick
 Web Developer
 [hidden email]
 <a href="tel:206.286.1235x32" value="+12062861235">206.286.1235x32

GiveBIG is coming! Mark your calendar for May 2 and get ready to give big to Groundwire
on this community-wide day of giving.

http://www.seattlefoundation.org/npos/Pages/Groundwire.aspx



------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
Loading...