# Copyright (c) 2006 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: TupleHistoryList.pm,v 1.6 2007/01/30 22:48:10 aviggio Exp $ package Bivio::Biz::Model::TupleHistoryList; use strict; use base 'Bivio::Biz::Model::MailThreadList'; our($VERSION) = sprintf('%d.%02d', q$Revision: 1.6 $ =~ /\d+/g); sub internal_initialize { my($self) = @_; return $self->merge_initialize_info($self->SUPER::internal_initialize, { version => 1, other => [ map(+{ name => $_, type => 'Text64K', constraint => 'NONE', }, qw(slot_headers comment)), ], }); } sub internal_post_load_row { my($self, $row) = @_; my($body); $self->new_other('MailPartList')->execute_from_realm_file_id( $self->get_request, $row->{'RealmMail.realm_file_id'}); $self->get_request->get('Model.MailPartList')->do_rows( sub { my($list) = @_; $body = $list->get_body if $list->get('mime_type') eq 'text/plain'; return 1; } ); my($slot_headers, $comment) = $self->get_instance('Tuple') ->split_body($body); $slot_headers =~ s/[_-]/ /g if $slot_headers; @$row{qw(slot_headers comment)} = ($slot_headers, $comment); return 1; } 1;