Hi Vincent,

Vincent Massol wrote:
> On Oct 19, 2009, at 3:19 PM, Marius Dumitru Florea wrote:
> 
>> Hi devs,
>>
>> The diff package from the WYSIWYG editor source is used only by the  
>> sync
>> (real time) plugin and it's suppose to be generic. I propose to move
>> this package outside of the WYSIWYG editor in a separate module:
>>
>> platform/web/xwiki-gwt-diff
>>
>> The package will become:
>>
>> org.xwiki.gwt.diff.*
>>
>> You can see the sources here
>> http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/wysiwyg/src/main/java/com/xpn/xwiki/wysiwyg/client/diff/
>>
>> Here's my +1. WDYT?

Let me explain a bit what I'd like to do. The current wysiwyg module 
contains a lot of reusable code. In the process of externalizing the 
editor from XWiki I'd like to start by extracting all this reusable code 
and place it in dependency modules. After this stage we could have:

platform/web/
    |_ standard/
    |_ xwiki-gwt-api/ (reusable only inside XWiki)
    |_ xwiki-gwt-diff/ (reusable outside XWiki)
    |_ xwiki-gwt-dom/ (reusable outside XWiki)
    |_ xwiki-gwt-user/ (reusable outside XWiki)
    |_ xwiki-gwt-wysiwyg/ (only WYSIWYG specific code + plugins)

Next I'll look for a solution to load WYSIWYG editor plugins 
dynamically. Right now there's no straightforward approach to do this 
because GWT doesn't support reflection. As a consequence we can't 
separate the plugins from the editor because we have a cyclic 
dependency. I'll have to use a trick most probably to decouple them. If 
I succeed we could have:

platform/web/xwiki-gwt-wysiwyg/
    |_ xwiki-gwt-wysiwyg-api/ (reusable outside XWiki)
    |_ xwiki-gwt-wysiwyg-plugins/
      |_ xwiki-gwt-wysiwyg-plugin-color/ (reusable outside XWiki)
      |_ xwiki-gwt-wysiwyg-plugin-link/ (XWiki specific)
      |_ (other plugins here)

At this point the plugins should be self contained. Regarding this, I'm 
currently changing the macro plugin to use its own service 
(MacroService) which is a pure component.

> 
> If we start to separate plugins I'd see more a directory structure  
> like this:
> 
> xwiki-gwt/
>    |_ xwiki-gwt_api/
>    |_ ...
>    |_ xwiki-gwt-plugins/
>      |_ xwiki-gwt-plugin-diff/
>      |_ (other plugins here)
> 

> Second question: who else than the sync plugin will use this diff  
> module?

The diff module is reusable. I doubt there will be soon another code 
using it besides the sync plugin. We could move it inside the sync 
plugin but I prefer moving it outside of the wysiwyg module.

WDYT?

Thanks,
Marius

> 
> Thanks
> -Vincent
> 
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to