diff options
| author | fukachan <fukachan> | 2004-03-31 12:53:50 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2004-03-31 12:53:50 +0000 |
| commit | 5432a7011fcb4386b56fc044a54ec4c4dd2da0e5 (patch) | |
| tree | 0d73b11db0e7a903d7b020323b97f6aaaa8cd10d /fml/lib/FML | |
| parent | 408f950159c3aae27154eaaceb15d6d91095d9d9 (diff) | |
| download | fml8-5432a7011fcb4386b56fc044a54ec4c4dd2da0e5.tar.gz fml8-5432a7011fcb4386b56fc044a54ec4c4dd2da0e5.tar.bz2 fml8-5432a7011fcb4386b56fc044a54ec4c4dd2da0e5.zip | |
Mail::ThreadTrack is obsoleted. remove related codes.
Diffstat (limited to 'fml/lib/FML')
| -rw-r--r-- | fml/lib/FML/CGI/ThreadTrack.pm | 247 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/thread.pm | 116 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Distribute.pm | 41 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Switch.pm | 3 |
4 files changed, 3 insertions, 404 deletions
diff --git a/fml/lib/FML/CGI/ThreadTrack.pm b/fml/lib/FML/CGI/ThreadTrack.pm deleted file mode 100644 index 9e729338..00000000 --- a/fml/lib/FML/CGI/ThreadTrack.pm +++ /dev/null @@ -1,247 +0,0 @@ -#-*- perl -*- -# -# Copyright (C) 2001,2002,2003,2004 Ken'ichi Fukamachi -# All rights reserved. This program is free software; you can -# redistribute it and/or modify it under the same terms as Perl itself. -# -# $FML: ThreadTrack.pm,v 1.28 2004/01/01 23:52:10 fukachan Exp $ -# - -package FML::CGI::ThreadTrack; -use strict; -use Carp; -use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); -use CGI qw/:standard/; # load standard CGI routines - -use FML::Process::CGI; -@ISA = qw(FML::Process::CGI); - - -=head1 NAME - -FML::CGI::ThreadTrack - CGI details to control thread system - -=head1 SYNOPSIS - - $obj = new FML::CGI::ThreadTrack; - $obj->prepare(); - $obj->verify_request(); - $obj->run(); - $obj->finish(); - -run() executes html_start(), run_cgi() and html_end() described below. - -See L<FML::Process::Flow> for flow details. - -=head1 DESCRIPTION - -=head2 CLASS HIERARCHY - -C<FML::CGI::ThreadTrack> is a subclass of C<FML::Process::CGI>. - -=head1 METHODS - -Almost methods common for CGI or HTML are forwarded to -C<FML::Process::CGI> base class. - -=cut - - -# Descriptions: print out HTML header + body former part -# Arguments: OBJ($curproc) -# Side Effects: none -# Return Value: none -sub html_start -{ - my ($curproc) = @_; - my $config = $curproc->config(); - my $title = $config->{ thread_cgi_title } || 'thread system interface'; - my $color = $config->{ thread_cgi_bgcolor } || '#E6E6FA'; - my $myname = $curproc->myname(); - my $charset = $curproc->get_charset("cgi"); - - # o.k start html - print start_html(-title => $title, - -lang => $charset, - -BGCOLOR => $color); - print "\n"; -} - - -# Descriptions: print out body latter part -# Arguments: OBJ($curproc) -# Side Effects: none -# Return Value: none -sub html_end -{ - my ($curproc) = @_; - - # o.k. end of html - print end_html; - print "\n"; -} - - -# Descriptions: main routine for thread control. -# run_cgi() can process request: list, show, change_status -# Arguments: OBJ($curproc) -# Side Effects: none -# Return Value: none -sub run_cgi_main -{ - my ($curproc) = @_; - my $config = $curproc->config(); - my $myname = $config->{ program_name }; # XXX-TODO: valid ? - my $ttargs = $curproc->_build_threadtrack_param(); - my $action = $curproc->safe_param_action() || ''; - - use Mail::ThreadTrack; - my $thread = new Mail::ThreadTrack $ttargs; - - if (defined $thread) { - $thread->set_mode('html'); - - if ($action eq 'list') { - $thread->summary(); - } - elsif ($action eq 'show') { - my $id = $curproc->safe_param_article_id(); - # XXX-TODO: do not call _XXX() internal method from outside. - my $tid = $thread->_create_thread_id_strings($id); - $thread->show($tid); - } - elsif ($action eq 'change_status') { - # fmlthread.cgi is for administorator, so you can change status. - if ($myname eq 'fmlthread.cgi') { - my $list = $curproc->safe_paramlist2_threadcgi_change_status(); - for my $param (@$list) { - my ($ml, $id, $value) = @$param; - if ($value eq 'closed') { - my $tid = $thread->_create_thread_id_strings($id); - print "closed $tid", br, "\n"; - $thread->close($tid); - } - } - } - # XXX-TODO: ? clarify this message more. - else { - print "Warning: only administrator change status\n"; - } - - $thread->summary(); - } - else { - $thread->summary(); - } - } - else { - croak("fail to create thread object"); - } -} - - -# Descriptions: prepare basic parameters for Mail::ThreadTrack module -# Arguments: OBJ($curproc) -# Side Effects: none -# Return Value: HASH_REF -sub _build_threadtrack_param -{ - my ($curproc) = @_; - my $config = $curproc->config(); - my $myname = $config->{ program_name }; - my $option = $curproc->command_line_options(); - - # prepare arguments for thread track module - # XXX-TODO: hmm, we should provide $curproc->util->article_max_id() ? - my $ml_name = $curproc->safe_param_ml_name(); - my $thread_db_dir = $config->{ thread_db_dir }; - my $spool_dir = $config->{ spool_dir }; - my $max_id = $curproc->article_max_id(); - my $ttargs = { - myname => $myname, - logfp => \&Log, - fd => \*STDOUT, - db_base_dir => $thread_db_dir, - ml_name => $ml_name, - spool_dir => $spool_dir, - reverse_order => 0, - }; - - # import some variables - for my $varname (qw(base_url msg_base_url)) { - if (defined $option->{ $varname }) { - $ttargs->{ $varname } = $option->{ $varname }; - } - elsif (defined $config->{ $varname }) { - $ttargs->{ $varname } = $config->{ $varname }; - } - } - - return $ttargs; -} - - -# Descriptions: print navigation bar -# Arguments: OBJ($curproc) -# Side Effects: none -# Return Value: none -sub run_cgi_navigator -{ - my ($curproc) = @_; - my $config = $curproc->config(); - my $action = $curproc->safe_cgi_action_name(); - my $target = $config->{ thread_cgi_target_window } || '_top'; - # XXX-TODO: we should provide $curproc->util->get_ml_list() method ? - my $ml_list = $curproc->get_ml_list(); - my $ml_name = $config->{ ml_name }; - - print start_form(-action=>$action, -target=>$target); - - print "ML: "; - print popup_menu(-name => 'ml_name', -values => $ml_list); - print "<BR>\n"; - - print "orderd by: "; - my $order = [ 'cost', 'date', 'reverse date' ]; - print popup_menu(-name => 'order', -values => $order ); - print "<BR>\n"; - - print submit(-name => 'change target'); - print reset(-name => 'reset'); - - print end_form; - print "<HR>\n"; -} - - -=head1 SEE ALSO - -L<CGI>, -L<FML::Process::CGI> -and -L<FML::Process::Flow> - -=head1 CODING STYLE - -See C<http://www.fml.org/software/FNF/> on fml coding style guide. - -=head1 AUTHOR - -Ken'ichi Fukamachi - -=head1 COPYRIGHT - -Copyright (C) 2001,2002,2003,2004 Ken'ichi Fukamachi - -All rights reserved. This program is free software; you can -redistribute it and/or modify it under the same terms as Perl itself. - -=head1 HISTORY - -FML::CGI::ThreadTrack first appeared in fml8 mailing list driver package. -See C<http://www.fml.org/> for more details. - -=cut - - -1; diff --git a/fml/lib/FML/Command/Admin/thread.pm b/fml/lib/FML/Command/Admin/thread.pm index b6038ee8..f3876af0 100644 --- a/fml/lib/FML/Command/Admin/thread.pm +++ b/fml/lib/FML/Command/Admin/thread.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: thread.pm,v 1.5 2004/03/28 13:05:55 fukachan Exp $ +# $FML: thread.pm,v 1.6 2004/03/29 14:13:20 fukachan Exp $ # package FML::Command::Admin::thread; @@ -126,120 +126,6 @@ sub _new_switch } -=head1 OLD VERSION - -=cut - - -# Descriptions: thread manipulation interface. -# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) -# Side Effects: update $recipient_map -# Return Value: none -sub old_process -{ - my ($self, $curproc, $command_args) = @_; - my $config = $curproc->config(); - my $myname = $curproc->myname(); - - # prepare argumente for thread track module (Mail::ThreadTrack). - my $ml_name = $config->{ ml_name }; - my $thread_db_dir = $config->{ thread_db_dir }; - my $spool_dir = $config->{ spool_dir }; - my $max_id = $curproc->article_max_id(); - my $ttargs = { - myname => $myname, - logfp => \&Log, - fd => \*STDOUT, - db_base_dir => $thread_db_dir, - ml_name => $ml_name, - spool_dir => $spool_dir, - max_id => $max_id, - reverse_order => 1, - }; - - # if (defined $options->{ f }) { - # _read_filter_list($thread, $options->{ f }); - # } - - $self->_old_switch($curproc, $command_args, $ttargs); -} - - -# Descriptions: switch thread library command -# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) -# HASH_REF($ttargs) -# Side Effects: thread db may be updated -# Return Value: none -sub _old_switch -{ - my ($self, $curproc, $command_args, $ttargs) = @_; - my $options = $command_args->{ options }; - my $command = $options->[ 0 ] || 'list'; - my $max_id = $ttargs->{ max_id }; - - # utility functions for spool in fml side. - use FML::Article::Thread; - my $a_thread = new FML::Article::Thread $curproc; - - # functions to manipulate thread db. - use Mail::ThreadTrack; - my $thread = new Mail::ThreadTrack $ttargs; - $thread->set_mode('text'); - - if ($command eq 'list' || $command eq 'summary') { - $thread->$command(); - } - elsif ($command eq 'review') { - my $str = $options->[ 1 ] || 'last:100'; - $thread->review( $str , 1, $max_id ); - } - elsif ($command eq 'db_dump') { - my $type = $options->[ 1 ] || 'status'; - $thread->db_open(); - $thread->db_dump( $type ); - $thread->db_close(); - } - elsif ($command eq 'db_update') { - my $last_id = $a_thread->speculate_last_id($curproc, $thread); - print STDERR "db_update: $last_id -> $max_id\n"; - $thread->db_mkdb($last_id, $max_id); - } - elsif ($command eq 'db_rebuild') { - print STDERR "\$thread->db_mkdb(1, $max_id);\n"; - $thread->db_mkdb(1, $max_id); - } - elsif ($command eq 'db_clear') { - $thread->db_open(); - $thread->db_clear(); - $thread->db_close(); - } - elsif ($command eq 'close') { - my $thread_id = $options->[ 1 ]; - if (defined $thread_id) { - $a_thread->close($thread, $thread_id, 1, $max_id); - } - else { - croak("specify \$thread_id"); - } - } - elsif ($command eq 'cui') { - # XXX-TODO: hmm, run interactive session unless @ARGV ? - # XXX-TODO: showing help is appropriate ? - if ($options->[ 1 ]) { - push(@ISA, 'FML::Article::Thread::CUI'); - # $ttargs->{ ml_name } = $argv->[ 0 ]; - $a_thread->interactive($thread, $ttargs); - } - else { - help(); - } - } - else { - croak("subcommand not specified"); - } -} - - =head1 CODING STYLE See C<http://www.fml.org/software/FNF/> on fml coding style guide. diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm index 717e45be..a756acd8 100644 --- a/fml/lib/FML/Process/Distribute.pm +++ b/fml/lib/FML/Process/Distribute.pm @@ -3,7 +3,7 @@ # Copyright (C) 2000,2001,2002,2003,2004 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Distribute.pm,v 1.140 2004/03/17 10:27:35 fukachan Exp $ +# $FML: Distribute.pm,v 1.141 2004/03/28 10:33:35 fukachan Exp $ # package FML::Process::Distribute; @@ -514,45 +514,6 @@ sub _deliver_article # Arguments: OBJ($curproc) # Side Effects: update thread information # Return Value: none -sub _old_thread_check -{ - my ($curproc) = @_; - my $config = $curproc->config(); - my $pcb = $curproc->pcb(); - my $myname = $curproc->myname(); - - my $ml_name = $config->{ ml_name }; - my $thread_db_dir = $config->{ thread_db_dir }; - my $spool_dir = $config->{ spool_dir }; - my $article_id = $pcb->get('article', 'id'); - my $is_rewrite_hdr = $config->yes('use_thread_subject_tag') ? 1 : 0; - my $ttargs = { - myname => $myname, - logfp => \&Log, - fd => \*STDOUT, - db_base_dir => $thread_db_dir, - ml_name => $ml_name, - spool_dir => $spool_dir, - article_id => $article_id, - rewrite_header => $is_rewrite_hdr, - }; - - my $msg = $curproc->article_message(); - - # old thread engine - eval q{ - use Mail::ThreadTrack; - my $thread = new Mail::ThreadTrack $ttargs; - $thread->analyze($msg); - }; - $curproc->log($@) if $@; -} - - -# Descriptions: the top level interface to drive thread tracking system. -# Arguments: OBJ($curproc) -# Side Effects: update thread information -# Return Value: none sub _new_thread_check { my ($curproc) = @_; diff --git a/fml/lib/FML/Process/Switch.pm b/fml/lib/FML/Process/Switch.pm index bd1f6fd1..4ed2859b 100644 --- a/fml/lib/FML/Process/Switch.pm +++ b/fml/lib/FML/Process/Switch.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Switch.pm,v 1.103 2003/12/30 03:56:00 fukachan Exp $ +# $FML: Switch.pm,v 1.104 2004/01/02 14:42:44 fukachan Exp $ # package FML::Process::Switch; @@ -547,7 +547,6 @@ L<FML::Process::Distribute>, L<FML::Process::Command>, L<FML::Process::ListServer>, L<FML::Process::Configure>, -L<FML::Process::ThreadTrack>, L<FML::Process::MailErrorAnalyzer> =head1 CODING STYLE |
