Sometimes EurekaLog does not have an option to implement a behavior that you want. If this is the case - you can alter behavior of build-in send method. Default behavior (for bug trackers) is described in this article.
All EurekaLog send methods are implemented in WinAPI, wrapped inside classes with lots of virtual and helper functions. Base send class is TELUniversalSender from ESend unit. All send methods are child classes from this class. For example, Mantis send method is implemented as TELTrackerMantisSender class from ESendAPIMantis unit. If you want to alter any aspect of default send method - you need to sub-class it and override desired virtual methods. You can also call inherited helper methods to simplify developing.
First, you need to subclass the desired send method class:
uses
The example above uses Mantis as example. If you want to customize a different send method - you will need to replace unit name and class name.
You must use the same class name as original class. You'll have to append unit name to class ident to avoid compiler confusion. That way your class will look as original class, so it will use the same options.
Second, you need to register your class:
uses // Register send class to be the first in the list.
The TELTrackerMantisSender class in the example above is your class, which you have derived from default EurekaLog class.
The important piece here is to register your class as first, which is archived by using registering function with "First" suffix. Default class (from EurekaLog) will be listed after your class in registered senders. Any search for class by name will find your class, because it's listed first.
Now that preparations are completed - you can customize your class in any way you want, by overriding virtual methods. For example, if you want to replace bug title:
protected
This example overrides ComposeTitle virtual method and calls inherited helper methods BugAppVersion, BugType, BugID. You can check interface declaration to determinate method that you need to override and invoke (available in all EurekaLog editions). You can also check implementation for details (for EurekaLog Enterprise edition only).
See also:
|