Forum OpenACS Development: cr_item or acs_object

Collapse
Posted by Iuri Sampaio on
Hi there,

I writing done a new datamodel and questioned myself what ACS Type this content should be.

It's data that everyday gets a new value and its old values must be storaged.

I believe as a content_item using cr_revision is the one I must choose. However, I'm not quite sure if it's the best approach.

Is there anybody out there?

Best wishes

Collapse
2: Re: cr_item or acs_object (response to 1)
Posted by Iuri Sampaio on
Further on content_revision approach, it would required to create its datamodel together with:

select content_type__create_type (...)

select content_folder__register_content_type(...);

Then on tcl procs level to add a new rate as well its revisions there will require to use a few methods such as

content::item::new
set revision_id [cr_import_content...]
item::publish -item_id $item_id -revision_id $revision_id

Assuming, a rate is never an actual file, to use cr_revisions doesn't seem to be the correct approach to take.

What's the proper way to storage rates of currencies?

Collapse
3: Re: cr_item or acs_object (response to 2)
Posted by Dave Bauer on
Do you need to permission each row of the rates table? If not you might not need acs_objects or content_items at all.

I think a simple table of current rates and an archive table of historical rates would work. You could do it all in one table as well, depends how often you need to refer to each.

Collapse
4: Re: cr_item or acs_object (response to 3)
Posted by Iuri Sampaio on
In fact I don't. That simplifies a lot!

I'll design it to storage all in one table only, with a new column to storage the date (timestamptz)

The idea is to show the latest rate in a headline panel, plus I'll built a forecast graphic based on its historic.

Thanks Dave.

Best wishes