marcosamz / vaadin-ckeditor

Automatically exported from code.google.com/p/vaadin-ckeditor
0 stars 0 forks source link

Server side integration for file and link browsers #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I started a new java server side based file and link browser
for CKEditor 3.x

http://sourceforge.net/projects/jckconnector/

It is based on vaadin and could probably be integrated with this project.

I will probably start doing it myself in a few weeks, but just in case someone 
else is faster.... ;)

Original issue reported on code.google.com by a.sch...@aarboard.ch on 27 Apr 2011 at 9:05

GoogleCodeExporter commented 9 years ago
This sounds interesting. We'll have to see what it means to be integrated, but 
it should be doable, perhaps even with the current code.  We have used the 
current code to integrate a JSP-based file chooser.

What does your component need?  With CKEditor, we have the ability in the 
CKEditorConfig object to set:

filebrowserBrowseUrl
filebrowserWindowWidth
filebrowserWindowHeight

...as well as...

filebrowserImageBrowseUrl
filebrowserImageWindowWidth
filebrowserImageWindowHeight

Do you need more integration capabilities with CKEditor setup?  Let me know the 
details of what you need and I'm sure we'd be happy to consider this, but for 
now I'll change this from a defect to an enhancement and will await more info 
about what you need to make it happen.

Original comment by yoz...@gmail.com on 3 May 2011 at 8:43

GoogleCodeExporter commented 9 years ago
Added link to your SF project from our google code project home, so let's make 
it work together!

Original comment by yoz...@gmail.com on 3 May 2011 at 8:47

GoogleCodeExporter commented 9 years ago
Hello,

currently we use these:

        editor1.setFilebrowserBrowseUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserBrowseUrl());
        editor1.setFilebrowserImageBrowseUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserImageBrowseUrl());
        editor1.setFilebrowserFlashBrowseUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserFlashBrowseUrl());
        editor1.setFilebrowserLinkBrowseUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserLinkBrowseUrl());
        editor1.setFilebrowserUploadUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserUploadUrl());
        editor1.setFilebrowserImageUploadUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserImageUploadUrl());
        editor1.setFilebrowserFlashUploadUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserFlashUploadUrl());

So we basically have the filebrowser for the differnt types, (None, Images + 
Flash)
as well as the Linkbrowser

And in addition to this we also provide direct upload possibilities, and for 
this we also need the upload urls.

Since the browser stuff requires some external libraries,
perhaps a full integration as one package is not the best approach.
But having your integration as a base, and my package as the second .jar which 
provides server side browsing etc. stuff.

André

Original comment by a.sch...@aarboard.ch on 3 May 2011 at 8:54

GoogleCodeExporter commented 9 years ago
How do you do the editor settings now from Vaadin?  Anyway, you listed:

       editor1.setFilebrowserBrowseUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserBrowseUrl()); // SHOULD BE AVAILABLE TODAY
       editor1.setFilebrowserImageBrowseUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserImageBrowseUrl()); // SHOULD BE AVAILABLE TODAY
       editor1.setFilebrowserFlashBrowseUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserFlashBrowseUrl()); // NEEDS TO BE ADDED
       editor1.setFilebrowserLinkBrowseUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserLinkBrowseUrl()); // NEEDS TO BE ADDED
       editor1.setFilebrowserUploadUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserUploadUrl()); // NEEDS TO BE ADDED
       editor1.setFilebrowserImageUploadUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserImageUploadUrl()); // NEEDS TO BE ADDED
       editor1.setFilebrowserFlashUploadUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserFlashUploadUrl()); // NEEDS TO BE ADDED

The first two should already be there. We had no need for the others, but 
clearly they can be added easily to round out those capabilities of CKEditor.

If we put those in, what would be the process to make use of both in a single 
Vaadin app? If it's easily done, then I'd like to get these added right away 
since I'm about to create a 1.2 release of our project, and it might be nice to 
be able to show them working together.

Original comment by yoz...@gmail.com on 3 May 2011 at 9:09

GoogleCodeExporter commented 9 years ago
Working with the project http://sourceforge.net/projects/jckconnector/ added 
methods to set the following configurations:

   config.setFilebrowserUploadUrl(String)
   config.setFilebrowserImageUploadUrl(String)
   config.setFilebrowserFlashBrowseUrl(String)
   config.setFilebrowserFlashUploadUrl(String)
   config.setFilebrowserLinkBrowseUrl(String)

Original comment by yoz...@gmail.com on 3 May 2011 at 9:36

GoogleCodeExporter commented 9 years ago
Added those methods. This is available in the 1.2 release.

Original comment by yoz...@gmail.com on 3 May 2011 at 9:38

GoogleCodeExporter commented 9 years ago
Works fine, thanks.

Here the steps to integrate with a vaadin application:

- Add all required jar's to the project (WEB-INF/lib)
- Compile the widgetset
- When creating a editor object specify the browser url's

                config1.setFilebrowserBrowseUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserBrowseUrl());
                config1.setFilebrowserImageBrowseUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserImageBrowseUrl());
                config1.setFilebrowserFlashBrowseUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserFlashBrowseUrl());
                config1.setFilebrowserLinkBrowseUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserLinkBrowseUrl());
                config1.setFilebrowserUploadUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserUploadUrl());
                config1.setFilebrowserImageUploadUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserImageUploadUrl());
                config1.setFilebrowserFlashUploadUrl(org.aarboard.ckeditor.connector.VaadinBrowser.getFilebrowserFlashUploadUrl());

In the web.xml add the browser application as a servlet like:

    <servlet>
        <servlet-name>CKEditorConnector</servlet-name>
        <servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
        <init-param>
            <param-name>application</param-name>
            <param-value>org.aarboard.ckeditor.connector.VaadinBrowser</param-value>
        </init-param>
        <init-param>
            <param-name>widgetset</param-name>
            <param-value>HERE PUT IN YOUR APPLICATION WIDGETSET</param-value>
        </init-param>
    </servlet>

Add the direct upload servlet to web.xml:
   <servlet>
        <servlet-name>DirectUploadServlet</servlet-name>
        <servlet-class>org.aarboard.ckeditor.connector.upload.DirectUploadServlet</servlet-class>
        <init-param>
            <param-name>self.root</param-name>
            <param-value>/servlet/ckeditorconnector-dup/</param-value>
        </init-param>
    </servlet>

Finally add the servlet mappings:

    <servlet-mapping>
        <servlet-name>CKEditorConnector</servlet-name>
        <url-pattern>/servlet/ckeditorconnector/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>DirectUploadServlet</servlet-name>
        <url-pattern>/servlet/ckeditorconnector-dup/*</url-pattern>
    </servlet-mapping>

and the other web.xml settings required by the jckconnector

Original comment by a.sch...@aarboard.ch on 4 May 2011 at 7:02

GoogleCodeExporter commented 9 years ago
https://sourceforge.net/apps/mediawiki/jckconnector/index.php?title=How_to_integ
rate_with_ckeditor_wrapper

Original comment by a.sch...@aarboard.ch on 4 May 2011 at 9:28

GoogleCodeExporter commented 9 years ago
Thanks. I hope people find the pairing useful!

Original comment by yoz...@gmail.com on 4 May 2011 at 5:32