Forum OpenACS Q&A: Generic Log Package for a CRM

Collapse
Posted by Nima Mazloumi on
Hi all,

I need to write a generic logging package as a service. The idea is to provide a proc that can be used to log actions taken place on the system. I want to use it as part of a CRM module where you log when for instance the user has contacted a customer, when he sent out a letter to the customer, when the customer contacted the user for a complaint and the like.

Now I am not sure how to define the data model. Shall a logged message be a cr_item or a table by its own? A logged message can either consist of a text or a binary file (like an uploaded letter received). It has a create date and a create user. Also it needs to refer to a customer. Another important issue is that the logged messages have to be store for at least 10 years. This can result into tons of data. Any thought whether I should log into postgres tables or better into files?

Greetings,
Nima

Collapse
Posted by Claudio Pasolini on
Considering that you need a creation date and a creation user, I would define a plain table linked to acs_objects, but not to cr_items.

I found that the overhead of using the content repository is too high and can be justified only if you really need versioning and / or inheritance.

Collapse
Posted by Nima Mazloumi on
Ok, but what shall I do with binary content? I might need to save a scanned fax or a pdf or an email.
Collapse
Posted by Claudio Pasolini on
Defining your log table as an acs_object you get automatically the opportunity to attach any file to your log entry using the general-attachments package.

In simpler cases you could define two more columns in your table to store the content of the attachment (type oid) and its mime_type.

Collapse
Posted by Nima Mazloumi on
Yes, I also thought of that. I also want to make available as a web service for other applications. For this purpose I need to generate global unique ids that are returned once the service is called.

Thank you.

Collapse
Posted by Malte Sussdorff on
If you need to build this in OpenACS, just use contacts which has the contact history doing exactly this. If not, just take the datamodel.

If you go for OpenACS please do us the favour and look at contacts for your requirements before writing a new CRM on top of OpenACS. Maybe you can share the requirements?