Forum OpenACS Q&A: Response to What is the best way to store long texts in PostgreSQL?

Hi Peter,

I think the best way to make a content type on the Content Repository (CR).  Have this content type store the data into either file or lob.  I am not yet familiar with Bug Tracker but I think it would best if Bug Tracker made use of CR to store the patches and even the description etc.  File-Storage, ETP, CMS are just UI and extensions of CR.

In a nutshell here is how I will approach the problem:

- create a bugtacker_item and bugtracker_patch content type.  See content_type__create

- for each bug tracker instance create a cr_folder and register the custom content types into this folder.  This is optional since you may not need a folder paradigm anyway.  You can also make use of your own table and point the bugtracker_item parent_id to its primary key.

- A bug will be stored in bugtracker_item and the patch files on the bugtracker_patch content type.  The bugtracker_patch will point its parent_id to the bugtracker_item.

Content Repository is part of the core anyway so this should not add any dependency to the bug tracker.  If the bugtracker is more or less finished you can just create a bugtracker_patch content type and store the patch files on the CR.  Store them in either file or lob storage type.  And point the parent_id of the bugtracker_patch to the object_id of the bug entry.  I hope this helps.

For a sample code of this I put in a feature on ticket-tracker lite to attach files.  The files are stored in CR.  Of course this code was made about a year ago.  So some approaches are not done properly.  If you still want to make use of file-storage you may want to look at the attachment package at dotLRN.  Attachment makes us of the file storage as its backend.