[xwiki-devs] [Discussion] New GWT-based WYSIWYG editor
Hi, Last time, I've presented some general ideas regarding the new GWT-based architecture for the WYSIWYG editor. Now I'm going to give you the details. More precisely, based on the components described in my last mail I've defined an API. You should be aware that all package, interface, class, method, field names are subject to change and I'm open to your suggestions. We should use self-explanatory and natural names as much as we can. But before delving into the API I should recap the main ideas from my last mail. We're designing a lightweight and extensible editor, both for WYSIWYG editing and for Wiki-syntax editing. The editor has a featureless core allowing us to easily add and remove features (plug-ins). Enough with the introduction. Here's the API: org.xwiki.editor.client.core.impl.def ------------------------------------- class DefaultConfigPanel extends AbstractConfigPanel class DefaultContextMenu extends AbstractContextMenu class DefaultEditor extends AbstractEditor +DefaultEditor(PlugInManager, EditorServiceAsync) class DefaultFloatingToolBar extends AbstractFloatingToolBar class DefaultRichTextArea extends AbstractRichTextArea class DefaultStatusBar extends AbstractStatusBar class DefaultToolBar extends AbstractToolBar org.xwiki.editor.client.core.impl --------------------------------- abstract class AbstractConfigPanel extends Composite implements ConfigPanel abstract class AbstractContextMenu extends Composite implements ContextMenu abstract class AbstractEditor extends Composite implements Editor #EditorServiceAsync editorService #PlugInManager plugInManager #AbstractConfigPanel configPanel #AbstractContextMenu contextMenu #AbstractFloatingToolBar floatingToolBar #AbstractRichTextArea richTextArea #AbstractStatusBar statusBar #AbstractToolBar toolBar abstract class AbstractFloatingToolBar extends Composite implements FloatingToolBar abstract class AbstractPropertyManager implements PropertyManager #boolean dirty #abstract void doApplyChanges() #abstract void doDiscardChanges() +boolean isDirty() #abstract void doRestoreDefaults() +void setDirty(boolean) abstract class AbstractRichTextArea extends Composite implements RichTextArea abstract class AbstractStatusBar extends Composite implements StatusBar abstract class AbstractToolBar extends Composite implements ToolBar org.xwiki.editor.client.core ---------------------------- interface ConfigPanel void addPage(String name, Widget page, PropertyManager manager) enum ContentType {HTML, XWIKI, CREOLE, CONFLUENCE} interface ContextMenu void addCheckBox(String label, Command cmd) void addImage(AbstractImagePrototype imgProto, String label, Command cmd) void addRadioButton(String groupName, String label, Command cmd) ContextMenu addSubMenu(AbstractImagePrototype imgProto, String label) interface Editor ConfigPanel getConfigPanel() ContextMenu getContextMenu() EditorServiceAsync getEditorService() FloatingToolBar getFloatingToolBar() RichTextArea getRichTextArea() StatusBar getStatusBar() ToolBar getToolBar() interface EditorService Serializable invoke(String plugInServiceName, Serializable args) Map<String, String> restoreProperties(String plugInName) void storeProperties(String plugInName, Map<String, String> properties) interface EditorServiceAsync void invoke(String plugInServiceName, Serializable args, AsyncCallback) void restoreProperties(String plugInName, AsyncCallback callback) void storeProperties(String pn, Map<String, String> props, AsyncCallback) interface FloatingToolBar extends ToolBar interface PropertyManager void applyChanges() void discardChanges() void restoreDefaults() interface RichTextArea extends SourcesClickEvents, SourcesFocusEvents, SourcesKeyboardEvents, SourcesMouseEvents, SourcesMouseWheelEvents, SourcesScrollEvents, HasHTML, HasText, com.google.gwt.user.client.ui.RichTextArea.ExtendedFormatter interface StatusBar extends HasWidgets interface ToolBar extends HasWidgets org.xwiki.editor.client.plugin.impl.def --------------------------------------- class DefaultPlugInManager extends AbstractPlugInManager -Map<ContentType, List<PlugIn>> plugInMap class DefaultPlugInPropertyManager extends AbstractPropertyManager -PlugIn plugIn -Map<String, String> properties -Map<String, String> defaults +DefaultPlugInPropertyManager(PlugIn plugIn, Map<String, String> defaults) org.xwiki.editor.client.plugin.impl ----------------------------------- abstract class AbstractPlugIn implements PlugIn #Editor editor #PropertyManager propertyManager #Map<String, String> properties #abstract void installConfigPanel() #abstract void installContextMenu() #abstract void installFloatingToolbar() #abstract void installRichTextArea() #abstract void installStatusBar() #abstract void installToolBar() #abstract void uninstallConfigPanel() #abstract void uninstallContextMenu() #abstract void uninstallFloatingToolbar() #abstract void uninstallRichTextArea() #abstract void uninstallStatusBar() #abstract void uninstallToolBar() abstract class AbstractPlugInManager implements PlugInManager org.xwiki.editor.client.plugin ------------------------------ interface PlugIn String getName() String getProperty(String name) PropertyManager getPropertyManager() Iterator<String> getPropertyNames() void install(Editor editor) void setProperty(String name, String value) void uninstall() interface PlugInManager void register(PlugIn plugIn, ContentType contentType) void register(PlugIn plugIn, ContentType[] contentTypes) void unregister(PlugIn plugIn, ContentType contentType) void unregister(PlugIn plugIn, ContentType[] contentTypes) Iterator iterator(ContentType contentType) org.xwiki.editor.server.core.impl.def ------------------------------------- class DefaultEditorService extends RemoteServiceServlet implements EditorService -PlugInServiceManager plugInServiceManager org.xwiki.editor.server.plugin.impl.def --------------------------------------- class DefaultPlugInServiceManager implements PlugInServiceManager -Map<String, PlugInService> plugInServiceMap org.xwiki.editor.server.plugin.impl ----------------------------------- abstract class AbstractPlugInService implements PlugInService org.xwiki.editor.server.plugin ------------------------------ interface PlugInService Serializable invoke(Serializable args) String getName() interface PlugInServiceManager PlugInService get(String plugInServiceName) Iterator iterator() void register(PlugInService plugInService) void unregister(PlugInService plugInService) NOTE: All the interfaces and classes that I'm referring to but I'm not defining them are from the last version of the GWT. I'll use this occasion to answer Ludovic and to ask him, and you at the same time, some questions. Ludovic, - we could make XWikiService extend EditorService - I'd like to keep the editor's core as simple as possible - a plugin could open as many popups, dialogs, windows as it needs. The idea is that finally it either changes the content or the way we visualize the content. So, I think the table AJAX editor could be handled as a plugin. Questions: - what 'real time editing' truly means? Unfortunately right now I don't have a clear idea of what it is supposed to do/offer. Can you give me some use cases or examples of applications that are already doing it. - how are we going to mix (at user interface level) text editing and chat activities? It seems to me that the chat is a different application. - what is 'table AJAX editor' supposed to do? What other editors could be 'embeded' into the WYSIWYG editor? WDYT? -Marius
participants (1)
-
Marius Dumitru Florea