[rt-devel] Callbacks in RT's Web UI

Jesse Vincent jesse at bestpractical.com
Fri Dec 27 16:45:11 EST 2002


It's easy to overlay your own components on top of RT's HTML::Mason web
UI by creating a component with the same name and dropping it in the
"local" component root. Often though, what you really want to do is to
drop your own bit of interface in the middle of an existing RT
component.  So you copy the component and drop in your own code.
A month later, a new release comes out with a critical bugfix in the
component you overrode. Every time an upgrade happens, you have to 
audit RT's code to make sure that none of your code will override 
the newly fixed component.

And what if two different add-ons alter the same component?  I forsee a
lot of diffing and patching in your future.

At least that's the way it _used to work_.  RT 3.0's web interface
now supports callbacks to stackable user-defined components.

within RT's HTML::Mason frontend, you'll see calls like this:

in /Ticket/Frob.html, you might see a line like:

<& /Elements/Callback, Name => 'foo', %ARGS &>

This means that RT will look for any components in 

$RTROOT/local/html/Callbacks/Ticket/Frob.html/foo/

and call them with the %ARGS passed to Frob.html

Some callbacks might additionally pass in other parameters, such as
Ticket, Transaction or Queue.

As of this moment, there's only a single callback in the codebase. I
expect them to proliferate like small woodland creatures. I'll be adding
them as _I_ need them for other RT-related projects. If _you_ need a
callback added to RT's codebase, send a unified diff as an attachment to
a message describing the callback to rt-3.0-bugs at fsck.com. Callbacks
don't really impact the codebase, so I'm willing to take them
"whenever," at my convenience.


	Best,
	Jesse

-- 
»|« http://www.bestpractical.com/rt  -- Trouble Ticketing. Free.



More information about the Rt-devel mailing list