[rt-users] Re: local customizations: debian packaging?
Jens Porup
jens at porup.com
Wed May 4 22:48:32 EDT 2005
On Fri, Apr 29, 2005 at 05:11:52AM -0400, Jesse Vincent wrote:
>
> > On Fri, Apr 29, 2005 at 06:08:04PM +1000,
> > Adam Clarke <adam.clarke at strategicdata.com.au> wrote
> > a message of 52 lines which said:
> >
> > > The problem is things like scrips and custom fields. These exist
> > > inside RT's database and are difficult to version control / package.
> >
> > Yes, the problem is much more general than packaging. I want to manage
> > my email templates in our version control system (Subversion) and the
> > only solution I find is to have a "install" target in the Makefile
> > which calls SQL UPDATE in the database.
>
> So. there are a couple things here.
>
> 1. Module::Install::RTx is a nice packaging tool to let you build and
> install custom RT extensions as perl modules
>
> 2. Those templates are Text::Template perl objects. Whcih means that you
> should be able to embed in them calls to, say, a perl module or to read
> a file from disk. Which should get you your versioning ;)
Hmmm....
I've had a good look at this over several days, but I'm not seeing
exactly how you can embed a Text::Template object into an RT
method call.
Sure, I could leave my template in my perl script, and simply pass my
paramhash of (Content =>, Name =>, Description =>, Queue =>), which
works fine, but that doesn't give me a separate file I can version from.
So:
use Text::Template;
my $source = Text::Template->new(TYPE => 'FILE', SOURCE => 'my_template.tmpl');
use RT::Template;
my $template = RT::Template->new($RT::SystemUser);
#(use of cat suggested by Text::Template docs)
my @errs = $template->Create(qx{cat my_template.tmpl});
#returns 0 for failure
print STDERR "errs is @errs\n";
There doesn't appear to be any Text::Template method call that can do this
either.
Suggestions?
Jens
More information about the rt-users
mailing list