Forum OpenACS Improvement Proposals (TIPs): TIP #84 (approved): Make template type extend revision instead of item in content repository

The objective of this TIP is to simplify the CR API by allowing code to retrieve a template using the same calls that are used to retrieve an item. This is currently impossible because the template object type extends item, rather than revision as a normal type would.

The specific changes necessary are:

1. Change the content-create code to deal correctly with types that extend revision but use cr_revisions as their object table (template is not the only case where this is necessary).

2. Drop the cr_templates table

3. Change the pl/sql API to create templates in the revision table rather than the item table. Change the tcl API to pass title and description to the pl/sql when creating a template.

An upgrade script will be necessary, but should be relatively trivial.

This requires a core datamodel change (allow NULL as the table name associated with an object type, i.e. subtypes with no type-specific table) ...

We need to do this but your changes need to follow those changes.

Yeah, roger the datamodel changes. When I implemented this on my test server, I set the table name to "cr_revisions" rather than "null", which seemed to work, but this required removing the unique constraint on the table name column (can't remember the exact name of the column now). There is actually already an object type in acs_messaging that wants this constraint removed (in 5.1, on oracle), which suggests that it probably shouldn't be there.

Thoughts? And, should I put in a separate TIP to remove or change the constraint?

Is making table_name nullable the right solution? When I implemented this, I just made table_name non-unique (so I could have more than one object type using cr_revisions as their storage table). Isn't having a null table-name going to break all the code that looks up an object's table_name to create selects and inserts on the "table-name"x and "table-name"i views?

Or, has this already been fixed for PG, and I'm just looking at it from the Oracle side?

Thanks,
--H