[rt-devel] Search based on (M$ word *.doc) attachment keywords
Ron
rong at israsrv.net.il
Mon Jul 7 14:48:47 EDT 2003
Autrijus Tang wrote:
>On Sun, Jul 06, 2003 at 12:15:45PM +0000, Ron wrote:
>
>
>>found in word documents that are sent to the queue as ticket attachments..
>>I understand that I will not be able to use Win32::OLE (the active state
>>package) as I am running on Linux (how feasible is it to run RT on
>>windows btw?). are there any other packages? has anyone done any work in
>>this direction yet?
>>
>>
>
>Try Wv/wvHtml (previous known as MSWordView):
>
> http://wvware.sourceforge.net/
>
>It worksforme. :-)
>
Watch out Java programmer needs help with perl.... :-[
So I spent half a day getting wvware to build on my (flashing) MDK box
(turns out the source on the homepage is not compatible with the source
on abiword.org and blablabla....) and now I was thinking of doing
something like so:
whenever a new attachment is added (either on creation or on any other
stage in the ticket's lifetime) check is the attachment is a *.doc file
and if it is, create an html version of the same file (HTML covers
directions and languages and so is better then text..) and add it to the
ticket as second attachment (later probably add a config variable to
flag this on and off etc...). I was thinking of creating an
Attachments_Local.pm module that only overrides the Create method and
does something like this:
sub Create {
my $self = shift; # I have no practical experience
with OO perl please tell me about the stuff I am doing wrong here
# get the name of the file being attached (copied from
Attachment_Overlay)
my $Filename = $Attachment->head->recommended_filename || eval {
${ $Attachment->head->{mail_hdr_hash}{'Content-Disposition'}[0] }
=~ /^.*\bfilename="(.*)"$/ ? $1 : ''
};
# see if we got a *.doc attachment
my @parts;
my $filename = $Filename; # save the filename
split /./, $filename; # primitive, any better
suggestions very welcome
if(lc($parts[1]) eq "doc") {
`wvHtml $Filename $parts[0]."html"`; #this is where the
conversion is done
}
#
# Here is where I would like to call "super" on both $Filename
and $filename
# I don't know how to do this in perl, I am not sure I am even
in the right direction with the idea of Attachments_Local???
#
Any help will be greatly appreciated.
Regards
Ron.
>
>Thanks,
>/Autrijus/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pallas.eruditorum.org/pipermail/rt-devel/attachments/20030707/99b23bf9/attachment.html
More information about the Rt-devel
mailing list