[opencms-dev] RE: RE: XmlHttpRequest and OpenCms Direct Edit

Jonathan Woods jonathan.woods at scintillance.com
Fri Nov 17 11:14:32 CET 2006


I know what you mean - it took me a while, and it's so tangled up with
everything else that I can't easily extract code to send you.

Perhaps there might still be some way for you to hook into the OpenCms
direct edit Javascript plumbing - just figure out what's called and why, and
mimic that behaviour through your own Javascript function executed when the
child document has been included.

Another alternative: use asynchronicity when you detect you're in the online
project, but a server-side direct include when you're offline.

Jon

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Roman Uhlig
Sent: 17 November 2006 10:00
To: opencms-dev at opencms.org
Subject: [opencms-dev] RE: RE: XmlHttpRequest and OpenCms Direct Edit


Thanks for your suggestions, Jon.

I've tried the following:

Session: Everything's ok. The project is set correctly, CmsJspLoginBean
returns the right values for the logged in values when called inside the
asynchronously loaded "child jsp".

Header JavaScript/CSS: This is most probably the problems source. I've tried
all possible configurations of calling <cms:editable /> (parent only, child
only, parent and child), none of them works.


The only possible solution that came to my mind yet is to code custom
buttons, calling OpenCms XmlContent functionality directly. This is
basically the worst I can think of, so I'd prefer a more common solution.

Roman


Jonathan Woods wrote:
> 
> Roman -
> 
> As you know, the direct edit machinery relies on buttons etc being 
> registered by Javascript called in the <head> element - but your 
> included stuff is presumably not executable like this, because its 
> <head> element is not that of the whole browser page.  Would that 
> explain it?  (It's been a while... I gave up on direct edit some time 
> ago.)
> 
> Jon
> 
> -----Original Message-----
> From: opencms-dev-bounces at opencms.org
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Jonathan Woods
> Sent: 16 November 2006 18:51
> To: 'The OpenCms mailing list'
> Subject: RE: [opencms-dev] RE: XmlHttpRequest and OpenCms Direct Edit
> 
> Second thought: session management/cookie problem, though I don't see 
> why the XMLHttpRequest shouldn't be made by the browser with the same 
> session cookie presented (unless there's some odd difference in the 
> host part of the URL).  I guess you could test this by including in 
> the page some kind of
> getCurrentProject() call and seeing what the result is - should be 
> non-online project, of course.
> 
> Jon
> 
> -----Original Message-----
> From: opencms-dev-bounces at opencms.org
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Roman Uhlig
> Sent: 16 November 2006 18:29
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] RE: XmlHttpRequest and OpenCms Direct Edit
> 
> 
> Unfortunately not. There's nothing except some "unidentified entities"
> caused as usual by special (german) chars.
> 
> Roman
> 
> 
> Jonathan Woods wrote:
>> 
>> First thought: some kind of Javascript scoping problem.  Try doing 
>> all this in Firefox and enabling the Javascript [error] console to 
>> see if anything crops up.
>> 
>> Jon
>> 
>> -----Original Message-----
>> From: opencms-dev-bounces at opencms.org 
>> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Roman Uhlig
>> Sent: 16 November 2006 17:57
>> To: opencms-dev at opencms.org
>> Subject: [opencms-dev] XmlHttpRequest and OpenCms Direct Edit
>> 
>> 
>> Hi,
>> 
>> I'm currently trying to implement some simple asynchronous 
>> functionality by using XMLHttpRequest inside OpenCms. So far 
>> everything is working as expected, except the rendering of OpenCms 
>> direct edit buttons. They don't get displayed. This is quite strange, 
>> since I'm not doing anything unusual.
>> 
>> The generated HTML response from XMLHttpRequest is valid and contains 
>> everything a page with direct edit functionality needs (CSS and 
>> JavaScript inside the head). If I call this page directly without 
>> XMLHttpRequest, everything works fine. As soons as I load it inside 
>> another page by using XMLHttpRequest, the direct edit buttons don't 
>> show up. I'm using it like
>> this:
>> 
>> JSP:
>> 
>> ...
>> <div id="async_content">
>> </div>
>> <input type="button" value="Load async content"
>> onClick="loadCnt('async_content', '<%=
>> cms.link(some_page_with_direct_edit)
>> %>'">
>> ...
>> 
>> 
>> JavaScript:
>> 
>> function loadCnt(id, src) {
>> ...
>> http_request = new XMLHttpRequest();
>> ...
>> http_request.open('GET', src, true);
>> http_request.send();
>> document.getElementById(id).innerHTML = http_request.responseText; }
>> 
>> 
>> 
>> That's basically all. Does anyone have an idea why this is happening?
>> 
>> Thank you in advance,
>> Roman
>> --
>> View this message in context:
>> http://www.nabble.com/XmlHttpRequest-and-OpenCms-Direct-Edit-tf264479
>> 7
>> .html#
>> a7383194
>> Sent from the OpenCMS - Dev mailing list archive at Nabble.com.
>> 
>> 
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list To change 
>> your list options, or to unsubscribe from the list, please visit 
>> http://lists.opencms.org/mailman/listinfo/opencms-dev
>> 
>> 
>> 
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list To change 
>> your list options, or to unsubscribe from the list, please visit 
>> http://lists.opencms.org/mailman/listinfo/opencms-dev
>> 
>> 
> 
> --
> View this message in context:
> http://www.nabble.com/XmlHttpRequest-and-OpenCms-Direct-Edit-tf2644797
> .html#
> a7383780
> Sent from the OpenCMS - Dev mailing list archive at Nabble.com.
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list To change 
> your list options, or to unsubscribe from the list, please visit 
> http://lists.opencms.org/mailman/listinfo/opencms-dev
> 
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list To change 
> your list options, or to unsubscribe from the list, please visit 
> http://lists.opencms.org/mailman/listinfo/opencms-dev
> 
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list To change 
> your list options, or to unsubscribe from the list, please visit 
> http://lists.opencms.org/mailman/listinfo/opencms-dev
> 
> 

--
View this message in context:
http://www.nabble.com/XmlHttpRequest-and-OpenCms-Direct-Edit-tf2644797.html#
a7396711
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.


_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list