Changes between Version 1 and Version 2 of TestManagerForTracPluginGenericClass
- Timestamp:
- Jan 4, 2011, 5:32:58 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TestManagerForTracPluginGenericClass
v1 v2 20 20 * The '''!AbstractVariableFieldsObject''' base class, providing most object features. Inheriting from this class is a matter of a few lines of code, and will provide your objects with the features outlined above. 21 21 22 * The ''' !IConcreteClassProvider''' interface, allowing your plugin to register your classes with the framework, participate in the framework's objects factory and provide custom security.22 * The '''IConcreteClassProvider''' interface, allowing your plugin to register your classes with the framework, participate in the framework's objects factory and provide custom security. 23 23 24 24 * The '''!GenericClassModelProvider''' component, providing the objects factory, managing concrete class providers and handling metadata about custom classes and their fields. … … 147 147 [[BR]][[BR]] 148 148 Well, actually before being able to use our new class, we must: 149 * '''Define our concrete class provider''', implementing the ''' !IConcreteClassProvider''' interface, and149 * '''Define our concrete class provider''', implementing the '''IConcreteClassProvider''' interface, and 150 150 * '''Declare the data model''' to be created into the Trac DB. 151 151 … … 251 251 Then here comes the declaration of the database schema, class fields and class metadata, to be later returned in the corresponding methods of the interface. 252 252 253 Following is the ''' !IConcreteClassProvider interface''' documentation, which is pretty explanatory about the format and meaning of the required data.253 Following is the '''IConcreteClassProvider interface''' documentation, which is pretty explanatory about the format and meaning of the required data. 254 254 255 255 {{{ … … 353 353 }}} 354 354 355 For what concerns the ''' !IEnvironmentSetupParticipant interface''' implementation, it is really straightforward, in that the framework provides utility methods that, reading the schema declared in the above section:355 For what concerns the '''IEnvironmentSetupParticipant interface''' implementation, it is really straightforward, in that the framework provides utility methods that, reading the schema declared in the above section: 356 356 * Determine whether a database upgrade is needed, checking the availability of the tables and the columns as declared. This is achieved through the utility method {{{need_db_upgrade()}}}. 357 357 * Perform the database upgrade if required. This is achieved through the utility method {{{upgrade_db()}}}. '''Note:''' only creating all the tables is currently supported, not altering existing tables (for example due to your plugin database schema changing between versions). 358 358 359 359 [[BR]] 360 == !IGenericObjectChangeListener - Registering listeners to objects lifecycle events ==360 == IGenericObjectChangeListener - Registering listeners to objects lifecycle events == 361 361 362 362 Every class inheriting from !AbstractVariableFieldsObject supports a listener interface for components interested in objects' lifecycle events. 363 363 364 To register a listener for any particular class type, i.e. "realm", your component must implement the {{{ !IGenericObjectChangeListener}}} from the {{{tracgenericclass.api}}} package.364 To register a listener for any particular class type, i.e. "realm", your component must implement the {{{IGenericObjectChangeListener}}} from the {{{tracgenericclass.api}}} package. 365 365 366 366 Following is the documentation from the interface itself. … … 381 381 }}} 382 382 383 384 385 383 [[BR]] 384 The object that has just been created, modified or deleted is passed along with the methods in the interface. 385 386 You can extract basic information about the object as follows: 387 388 * The object's type can be retrieved from the {{{realm}}} field: 389 {{{ 390 object_realm = g_object.realm 391 }}} 392 393 * The information in the "special fields" as described above. 394 395