Forum OpenACS Q&A: Binary file uploads in bug-tracker?

Collapse
Posted by Joe Cooper on
Hi all,

I'd like to modify the patch upload/download mechanism of the Bug-Tracker to accept any file format (primarily tarballs, but screenshots would be great too). In short, I'd like to have a generic file upload mechanism in my bug tracker that can associate the files uploaded with specified issues. This was discussed here:

https://openacs.org/forums/message-view?message_id=51207

But that was three years ago, the bug-tracker has been rewritten using workflow and other new stuff, and it has gotten adequate plain-text patch support.

I'm hoping someone else has tackled this, as I'm barely scraping by on customizing my OpenACS site. The learning curve is proving steeper than I'd hoped...partly due to the major changes in the API over the years, and major differences of opinion about how things ought to be done (for example, the bug-tracker is the only app in my site using workflow...this makes it hard to learn to use workflow by example, though it looks very powerful).

Anyone added binary file uploads to the bug-tracker?

Collapse
Posted by Malte Sussdorff on
Not to my knowledge, but there is a general standard emerging on how to upload files to an object. It has been written by Matthew G. for contacts and you can find the code in HEAD under /packages/contact/www/files*

Just exchange party_id with bug_id and you are set to go.

In the long run this functionality could hopefully be an include in acs-subsite (as neither acs-kernel nor acs-tcl have includes) and be reused to attach files to any object (currently we are copying the code manually to all the packages where we need it).

Collapse
Posted by Joe Cooper on
That sounds very promising, Malte, thanks for pointing it out!

I'll have a look, and when I run into something that looks scary (I'm a tcl/OACS newbie) I'll come crawling back to the forums for help.

Collapse
Posted by Dave Bauer on
Malte,

Am I mistaken or are you just advocating generating the cr_items.name that includes the linked object id?

Is that all there is to it?

We do have an attachments package that can do this. I am not sure its the best user interface for this, and it relies on file-storage due to a historical requirement, so I don't know if its the best bet either.

Since bugtracker already uses the content repository it should be simple to store a file int eh CR and associate it with a bug. The cr_item_rels table and associated APIs should work.

Collapse
Posted by Dave Bauer on
Ah, I see the other part of the trick is using party_id as cr_items.parent_id.

That can work, and maybe it makes sense for applications where you don't want to relate an upload to more than one object. I don't see why you need any special code though.

Collapse
Posted by Malte Sussdorff on
The point is: It is ready to use code that can be put into a lib and included on every page where you want to add files to any objects. It does not rely on filestorage but uses strictly the CR. I'm aware that other solutions exist, but this is the most straigthforward with regards to design and readyness to use I've seen so far.
Collapse
Posted by Carl Robert Blesius on
I am using a version of the OpenACS bug tracker with Solution Grove right now and it supports file upload (of any type) after you post a bug/ticket so make sure you look in the newer versions for code that does what you are looking for.