[xwiki-devs] Wysiwyg editor and macro accessing to Alfresco (or other external tool)
Hi, Our goal is to develop a wysisyg macro allowing to : - Insert an Image stored on Alfresco - Insert a link to a document stored on Alfresco To do this; we have develop a small browser on Alfresco in order to choose the image to insert (img src) or the file to link (a href). After selecting the Alfresco file; we need to generate a macro like : [[Lien vers le doc toto>>http://alfresco.airfrance.fr/alfresco/.../toto.doc||rel="__blank" title="Ouvrir le doc toto..."]] or [[image:http://alfresco.airfrance.fr/alfresco/..../image.jpg]] Using the wiki editor and the old Wysiwyg editor; we had no problem to do this. (Openning popup and populate les link field with alfresco file path.) With the new editor; I can't find the way to do this. In fact my problem could be resume to add a picto in the 'link' and 'image' macro GUI allowing to open my alfresco browser in order to populate the path ! Any idea to do this ? Thanks, Julien -- View this message in context: http://xwiki.475771.n2.nabble.com/Wysiwyg-editor-and-macro-accessing-to-Alfr... Sent from the XWiki- Dev mailing list archive at Nabble.com.
Hi Julien, On 05/11/2010 12:17 PM, jurevert wrote:
Hi,
Our goal is to develop a wysisyg macro allowing to : - Insert an Image stored on Alfresco - Insert a link to a document stored on Alfresco
To do this; we have develop a small browser on Alfresco in order to choose the image to insert (img src) or the file to link (a href).
After selecting the Alfresco file; we need to generate a macro like : [[Lien vers le doc toto>>http://alfresco.airfrance.fr/alfresco/.../toto.doc||rel="__blank" title="Ouvrir le doc toto..."]] or [[image:http://alfresco.airfrance.fr/alfresco/..../image.jpg]]
Using the wiki editor and the old Wysiwyg editor; we had no problem to do this. (Openning popup and populate les link field with alfresco file path.)
With the new editor; I can't find the way to do this. In fact my problem could be resume to add a picto in the 'link' and 'image' macro GUI allowing to open my alfresco browser in order to populate the path !
Any idea to do this ?
Let me see if I understood correctly what you want to achieve: (1) On the "Select the image to insert" wizard step there should be three tabs: Current page, All pages and _Alfresco image_. On the _Alfresco image_ tab the user should be able to select an image from Alfresco using the browser you developed. (2) The link menu should contain a new _Alfresco document_ entry which should open a dialog containing the browser you developed. This way the user can choose a document from Alfresco to link to. In this case, you'll have to extend the image ( http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/xwiki-gwt-wysiwyg-clie... ) and link ( http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/xwiki-gwt-wysiwyg-clie... ) WYSIWYG editor plugins, which is not straightforward. Are you familiar with GWT? Extending the link plugin is a bit easier because it already supports external links. You just have to add a new menu entry ( http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/xwiki-gwt-wysiwyg-clie... ) and create a new WizardStep to display your Alfresco document browser. I can help you with this. Extending the image plugin is more difficult because we don't support yet inserting external images from the WYSIWYG editor. The image plugin was designed to work with XWiki attachment references. Some parts need to be rewritten to support external images use case. You can open a JIRA issue for this and I'll try to handle it asap. Then you'll be able to extend the http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/xwiki-gwt-wysiwyg-clie... to aggregate a step that displays your Alfresco images browser. Hope this helps, Marius
Thanks, Julien
Hi, As you suggest, I just create a new JIRA issue concerning inserting external image : http://jira.xwiki.org/jira/browse/XWIKI-5202 In fact, I'm not familiar with GWT but it's not to late :) I will try to extend the link plugin to add and insert a new wizard step. FYI I have add 4 properties in XWiki Preferences : - Is Alfresco link activate ? : alf_is_activate - Alfresco Host : alf_host - Alfresco default path : alf_default_path - Alfresco top path : alf_top_path Julien -- View this message in context: http://xwiki.475771.n2.nabble.com/Wysiwyg-editor-and-macro-accessing-to-Alfr... Sent from the XWiki- Dev mailing list archive at Nabble.com.
Hi Marius, Marius Dumitru Florea wrote:
Extending the link plugin is a bit easier because it already supports external links. You just have to add a new menu entry ( http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/xwiki-gwt-wysiwyg-clie... ) and create a new WizardStep to display your Alfresco document browser. I can help you with this.
I'm trying to modify link plugin of gwt editor as you said and I don't know exactly why but I can't compile the code. I have this sort of error : Le type org.xwiki.gwt.user.client.ui.wizard.SourcesNavigationEvents ne peut pas être résolu. Il est référencé indirectement à partir de fichiers .class requis. I'm using 2.4 XWiki release and in fact this class is not in the path, it's true ! :) Can you explain the reason of this error ? Is it a GWT developments specificity ? Thanks, Julien -- View this message in context: http://xwiki.475771.n2.nabble.com/Wysiwyg-editor-and-macro-accessing-to-Alfr... Sent from the XWiki- Dev mailing list archive at Nabble.com.
Hi Julien, On 08/30/2010 06:51 PM, jurevert wrote:
Hi Marius,
Marius Dumitru Florea wrote:
Extending the link plugin is a bit easier because it already supports external links. You just have to add a new menu entry ( http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/xwiki-gwt-wysiwyg-clie... ) and create a new WizardStep to display your Alfresco document browser. I can help you with this.
I'm trying to modify link plugin of gwt editor as you said and I don't know exactly why but I can't compile the code. I have this sort of error :
Le type org.xwiki.gwt.user.client.ui.wizard.SourcesNavigationEvents ne peut pas être résolu. Il est référencé indirectement à partir de fichiers .class requis.
I'm using 2.4 XWiki release and in fact this class is not in the path, it's true ! :)
Can you explain the reason of this error ? Is it a GWT developments specificity ?
GWT compiler needs the Java sources (not just the bytecode, i.e. the .class files that are usually found in a jar) to be able to generate the JavaScript code. In you case, the compiler detects that SourcesNavigationEvents interface is uses but is not able to find its source code in order to convert it to JavaScript. I think you are not building the WYSIWYG editor in the right way. In http://lists.xwiki.org/pipermail/devs/2010-August/019653.html I explained a bit how to build the WYSIWYG editor. To summarize: * xwiki-gwt-dom, xwiki-gwt-user (which includes SourcesNavigationEvents) and xwiki-gwt-wysiwyg-client modules generate jars when build. This jars contain both the .class files and the .java (source) files. This GWT modules are not directly compiled to JavaScript. In other words, when you build these modules the GWT compiler is not called. Only the Java compiler. * xwiki-gwt-wysiwyg-server module generates a war with the JavaScript code of the WYSIWYG editor, the rest of the client resource (style sheets, images) and some jars that are needed on the server side (e.g. the code that implements the GWT-RPC services used by the editor). The GWT (i.e. Java) code from xwiki-gwt-dom, xwiki-gwt-user and xwiki-gwt-wysiwyg-client jars is compiled to JavaScript while building the xwiki-gwt-wysiwyg-server module. * if you change classes in xwiki-gwt-wysiwyg-client you have to build it with maven (mvn clean install) to generate the corresponding jar and then build xwiki-gwt-wysiwyg-server (mvn clean install, with optional -Pdev to generate only one permutation, for Firefox+En). In the end you have to update the editor on your XWiki instance by removing resources/js/xwiki/wysiwyg/xwe directory and copying the one from the war. Note that I'm building from console, but I'm sure you can achieve the same thing from Eclipse with m2eclipse. Hope this helps, Marius
Thanks, Julien
participants (2)
-
jurevert -
Marius Dumitru Florea