You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

The standard Registry Data Model is unlikely to cover all attributes required for a given CO. There are two ways of extending the data model to add additional attributes.

Simple

The Registry supports simple extended attributes that can be attached to CO Person Role records on a per-CO basis. These extended attributes can be managed entirely via the COnsole or the REST COnnector, however the following limitations currently apply:

  • Extended attributes only permit one value per CO Person Role. For example, if you wanted to add an attribute for a favorite ice cream flavor, each person can have only one favorite ice cream flavor. (As a workaround, you could define two similar fields: favorite1 and favorite2.)
  • The only data types currently supported are:
    • INTEGER
    • TIMESTAMP
    • VARCHAR(32)
  • Once defined, an attribute's type cannot be changed.
  • Complex relationships, such as foreign keys, are not supported.

Implementation Notes

The information in this section is primarily of use for database administrators who need to know what is going on under the hood.

When an extended attribute is added to a CO, a record of it is added to the cm_co_extended_attributes table. However, this record serves primarily as an index or reference. The actual extended attribute values attached to a given CO Person Role are stored in dynamically managed tables.

The first extended attribute to be added to a CO will trigger the creation of a new table of the pattern cm_co#_person_extended_attributes, where # is the numeric ID of the relevant CO. Each extended attribute that is defined gets a column in the table, and as values are set for individual CO Person Roles, each individual Person Role receives a row in this table. If an extended attribute is set to index, the appropriate index is automatically created on this dynamic table.

Deleting an extended attribute causes the associated column to be dropped from the table. If all extended attributes are deleted from a CO, then the dynamic table is dropped as well.

Complicated

More sophisticated requirements can be met by implementing native models, views, and controllers in the CakePHP framework. Specifics are beyond the scope of this document, however note that while the Registry knows about and can manipulate simple extended attributes, it will not know about complicated extended attributes except to the extent that you modify the appropriate code.

Currently, there are no standards for implementing complicated extended attributes. As such, future versions of the Registry may not be compatible with your implementation.

  • No labels