Forum OpenACS Development: Re: i18n of content repository content

Collapse
Posted by Dave Bauer on
There is a small problem with this:

-item_id: If supplied the system assumes we want to store a new revision of the cr_item, otherwise it will create a new item.

This doesn't work if you predefine the item_id, such as pre-generated keys for double-click protection. Also the pl/sql api supports supplying an item_id without creating a new revision. The pl/sql api only creates a new revision if title or content is specified, and I think as much as possible the tcl api should function similarly to the pl/sql api. Its not absolutely necessary, but it is the design with the least surprise.

Right now the BCMS tcl api has a tcl procedure to create a new item, and another to create a new revision. Once you have the item created, there is no need to call the procedure to create a new item.

I don't think the tcl API really needs to guess for you if your content is a translation. Clearly there would need to be a user interface to specify a translation, and the form processing should be able to handle that case with the information provided by the user. For example in the case of using a cr_chil_rel to relate translations:

content_item::new <params>
content_revision::new <params>

to create the inition item,

content_item::new <params>
content_revision::new <params>
content_item::child_rel::new item_id_one item_id_two "translation"

Or something along those lines would make it pretty clear what is happening.

There is a procedure to change the live version, and more than one procedure to get content already :) We do want to make the procedures more consistent, right now they are not.