Forum OpenACS Development: Re: xoWiki and images

Collapse
8: Re: xoWiki and images (response to 1)
Posted by Deds Castillo on
Solution Grove provides subsites for clients on http://www.solutiongrove.com and we needed to tie up with a per client instance as well. The thing is that we do not use xinha exclusively for xowiki and also use it for say forums, etc.

What I ended up doing on SG site is to pass in source_package_id as a xinha_option in richtext-procs.tcl and use that in OacsFs.js so that its propagated up to the point of file-selector.tcl in xowiki. That in turn would allow to query for a parameter, say FSPackageID specific to each package as we have the source_package_id on where xinha is being called.

In file-selector.tcl, That has priority over all fs instances assuming none was passed. We are also able to add in more package parameters like in most of SG clients's cases, UseLRNFs or UseFOLIOFs if .lrn or dotfolio is installed respectively.

It's generic enough for Solution Grove's roster of clients but I don't know if it will be generic enough for everyone else. Just posting here so that one would know where to get the code if one needs the same functionality.

Collapse
9: Re: Re: xoWiki and images (response to 8)
Posted by Orzenil Silva Junior on
Hi,

Deds, could SG share this code? We have a similar scenario here: people would like to use OacsFS xinha plugin in the dotlrn forums and access shared community folder from wyswyg editor.

Thank you.

Collapse
Posted by Deds Castillo on
Orzenil, sure. I'll create a diff of the affected files, tar it up and post it on a publicly accessible page in SG. I'll post here again on the location when I'm done.
Collapse
Posted by Orzenil Silva Junior on
Hi Deds,

Thank you for share. I followed up instructions you pointed and everything works well.

I think SG approach in this topic was very good providing several options to use xinha OacsFs plugin. We choose add XinhaFileStoragePackageID to forum package so we could now set the community/class file-storage package intance for store files/images and referring them inside forums. Great! A very attractive way to replace attachments package in forums.

Collapse
Posted by Gustaf Neumann on
I am not to happy with this patch. do i see correctly, that it requires package ids to be specified as parameters? There must be better ways to do this. the resolver logic is way to complex for me and has hard coded names in it. There must be better ways for achieving this. The current implementation allows a per-form configuration of folders (not only package ids). The widget code should be able to derive the folder id from parameters and default values and pass it around. If the folder is specified via parameter, it should be specified via the URL such a user can do a cut&paste...
Collapse
Posted by Deds Castillo on
Gustaf, this is just one way I scratched the itch and I'm not happy with it as well from a generic reusable kind of way that's why I mentioned I did it internally for SG and just have the code lying around if someone needs the same. 😊

I do admit it's not pretty at this point but we just needed something real quick that deviates from the default implementation. It just attempts to do more on the resolver but the code is backwards compatible with current implementation such that everything can still be passed by URL and folder ids are still supported. The package ids are not required to be specified as parameter but just an option that I check precedence-wise.

We also have several clients who use .lrn and .folio and we needed to support both with a single patch that's why the resolver looks complex. The only actual hard code on the resolver in the strict sense is the check on a mounted /xowiki which is already being mounted on install.

If you have implementations that achieve similar functionality lying around feel free to commit 😉 and we're sure to pull it. 😊