Forum OpenACS Development: xowiki, ckeditor and file storage?

Posted by Paul Babin on
Hi all,

With xinha we had a plugin that allowed xinha to browse file storage called oacsfs. Has anyone used anything similar for ckeditor? We're trying to get a solution together using the native file api with ckeditor and file storage but have been hitting a number of brick walls.

Thank you in advance for any tips!

Posted by Gustaf Neumann on
Dear Paul,

Have you tried the version of richtext-ckeditor4 0.14 (in CVS head, since 2017-08-19). It supports the standard "filebrowser" plugin of CKEditor for uploading images, such that no special plugin is required.

This new integration does not require the file-storage package at all but uses "attachments" to associate pages with images and to clean up, when the objects, to which the images are attached, are deleted.


Posted by Paul Babin on
Thank you as always for your pointed tips. I had poked around at the new version late last month but hit a brick wall. I've gotten the dialogue to start working but cannot upload yet. I've isolated it to a permission issue so I think I should have it figured out sometime tomorrow.

I'm not too familiar with the attachments package. So I've added it under our xowiki package. In the installation documentation, it has the following:

"First, you must select a file-storage instance that will provide the files you can attach.

You must map the root folder of that file-storage instance with the package_id of the instance of your package.

fs::get_root_folder and attachments::map_root_folder"

If I am reading this correctly, once I fix my permission issue, I still need to link the xowiki package with the root folder of a file storage instance via the attachments package by using the code listed above.

I'm trying to make sure I am on the right track before going too far down a rabbit hole.

Thank you again in advance.


Posted by Gustaf Neumann on
Paul, one has to make sure, that the displayed_object_id is passed properly from the application to the toplevel template, such that the ckeditor knows to which object it should attach images. Although the displayed_object_id is an old thing, it is/was not passed properly in several templates via "property" statements. Since the permissions depend on the displayed_object_id, my first guess is, that this might be the problem in your installation.

The functionality of handling images in ckeditor via attachments was added after the 5.9.1 release, so make sure, you have the changes for the theme [1], for news [2], forums [3], or xowiki [4]. Check as well your custom templates if applicable, whether these pass a property for "displayed_object_id". Note, that xowiki can handle embedded images also via the xowikiimage plugin, which handles images as subobjects of wiki pages and which uses xowiki image markup (with "[[image:...]]"). In the latter approach, pages with embedded images can be exported/imported in other OpenACS instances, but with the ckfinder/attachments approach, images are currently not preserved.

Concerning file-storage dependencies of the attachment package: The attachment package has essentially 2 parts: (a) an internal API and (b) a user interface. The way the attachments are used in the ckeditor packages, only (a) is used, since the user-interface is provided by the ckeditor4. The part of the attachment-description is based on the assumption, that everything works over the file-storage.... it should be made more precise.

hope this helps