content_callback.rb

Path: app/models/content_callback.rb
Last Update: Fri Jun 27 23:25:02 -0400 2008

API for interaction with the database table ‘content_callbacks’, and it‘s related data model.

Callback Modules

Callback modules are specific to a project host, because each content type is defined for a project host.

All project specific callback libraries use the same file name, as specified by the constant CONTENT_CALLBACK_LIB. These libraries are stored within a project‘s library directory:

  • hosts/<project id>/lib/<CONTENT_CALLBACK_LIB>

Callback Methods

Callback fields map to callback methods using their content type database id and content callback database id:

  • callback_<content type id>_<content callback id>

For example, the content callback method with content type id = 47 and content callback id = 2 would be named:

  • callback_47_2()

This naming convention increases portability, stability, and maintainability; a content type‘s name and content callback field‘s name may be changed without impacting the callback method.

[Validate]