Hi,

Bubulina wrote:
> hello
> i am trying to understand how the "edit a page" works, how does it
> know(where is sending the request) to preload the data of the page in the
> editor(wysiwyg). If the developers take a look on this topic, please give me
> a trail to follow. the flow at least . thank you

Here's what happens when you choose Edit > WYSIWYG from the menu:

1) The browser requests the edit URL: 
xwiki/bin/edit/Space/Page?editor=wysiwyg

2) The editwysiwygnew.vm velocity template is evaluated.

3) wysiwyg_editProperty velocity macro (from macros.vm) is called to 
replace the "content" plain text area with the WYSIWYG editor.

4) wysiwyg_inputProperty velocity macro (from macros.vm) is called to 
prepare the WYSIWYG editor input value. A key for the input URL (see 
below) is generated and this key is used to store the editor input value 
of the session.

5) wysiwyg_storeConfig velocity macro (from macros.vm) is called to 
configure the WYSIWYG editor. The inputURL configuration parameter looks 
like xwiki/bin/edit/Space/Page?xpage=wysiwyginput&key=yXrg&render=true . 
Notice the key in the query string.

6) The browser receives the response and executes the JavaScript code

7) A new WYSIWYG editor instance is created using the configuration that 
was generated on the server by the wysiwyg_storeConfig velocity macro.

8) The editor replaces the plain text area identified by the hookId 
parameter with an iframe and sets its src attribute to the inputURL 
configuration parameter.

9) The browser makes a request to the inputURL in order to load the iframe

10) The wysiwyginput.vm velocity template is evaluated.

11) The key from the query string is used to retrieve the editor input 
value from the session.

12) The browser receives the response and triggers the load event on the 
  iframe.

13) The WYSIWYG editor, which listens to the load event, is notified and 
makes the iframe editable then loads the editor plugins and the rest of 
its UI.

Hope this helps,
Marius
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to