diff options
| author | fukachan <fukachan> | 2001-03-27 17:01:09 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-03-27 17:01:09 +0000 |
| commit | 9abb5dafad5887fda1637c1320d0d86133e39593 (patch) | |
| tree | d7818a8db794012b01437b2cce814d9d979a9eac /fml/lib/FML | |
| parent | bde2fc4d3815353c2a2a67615a50e01873dd59cc (diff) | |
| download | fml8-9abb5dafad5887fda1637c1320d0d86133e39593.tar.gz fml8-9abb5dafad5887fda1637c1320d0d86133e39593.tar.bz2 fml8-9abb5dafad5887fda1637c1320d0d86133e39593.zip | |
demonstration to add a little CUI and GUI to the system. "fmlsch" and
"fmlsch.cgi" is a tiny scheduler using HTML::CalenderMonthSimple and
w3m:)
I log how to make them as a document, which is the purpose of this hack.
Diffstat (limited to 'fml/lib/FML')
| -rw-r--r-- | fml/lib/FML/CGI/Scheduler.pm | 102 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Scheduler.pm | 104 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Switch.pm | 12 |
3 files changed, 218 insertions, 0 deletions
diff --git a/fml/lib/FML/CGI/Scheduler.pm b/fml/lib/FML/CGI/Scheduler.pm new file mode 100644 index 00000000..b723c490 --- /dev/null +++ b/fml/lib/FML/CGI/Scheduler.pm @@ -0,0 +1,102 @@ +#-*- perl -*- +# +# Copyright (C) 2001 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. +# +# $Id$ +# $FML$ +# + +package FML::CGI::Scheduler; +use strict; +use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); +use Carp; + +use CGI qw/:standard/; # load standard CGI routines + +use FML::Process::CGI; +@ISA = qw(FML::Process::CGI); + + +=head1 NAME + +FML::CGI::Scheduler - CGI details to control ticket system + +=head1 SYNOPSIS + + $ticket = new FML::CGI::Scheduler; + $ticket->new(); + $ticket->run(); + +See L<FML::Process::Flow> for flow methods details. + +=head1 DESCRIPTION + +C<NOT YET IMPLEMENTED>. + +=head2 CLASS HIERARCHY + +C<FML::CGI::Scheduler> is a subclass of C<FML::Process::CGI>. + + FML::Process::Kernel + | + A + FML::Process::CGI + | + A + ----------------------- + | | + A A + FML::CGI::Scheduler + +=head1 METHODS + +Almost methods common for CGI or HTML are forwarded to +C<FML::Process::CGI> base class. + +This module has routines needed for CGI. + +=cut + + +sub run +{ + my ($curproc, $args) = @_; + + use FileHandle; + use TinyScheduler; + + my $schedule = new TinyScheduler { user => param('user') }; + $schedule->parse; + $schedule->print; +} + + +=head1 SEE ALSO + +L<CGI>, +L<FML::Process::CGI> +and +L<FML::Process::Flow> + +=head1 AUTHOR + +Ken'ichi Fukamachi + +=head1 COPYRIGHT + +Copyright (C) 2001 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::Scheduler appeared in fml5 mailing list driver package. +See C<http://www.fml.org/> for more details. + +=cut + + +1; diff --git a/fml/lib/FML/Process/Scheduler.pm b/fml/lib/FML/Process/Scheduler.pm new file mode 100644 index 00000000..49b5f103 --- /dev/null +++ b/fml/lib/FML/Process/Scheduler.pm @@ -0,0 +1,104 @@ +#!/usr/local/bin/perl -w +#-*- perl -*- +# +# Copyright (C) 2000 Ken'ichi Fukamachi +# All rights reserved. +# +# $FML$ +# + +package FML::Process::Scheduler; + +use vars qw($debug @ISA @EXPORT @EXPORT_OK); +use strict; +use Carp; + +use FML::Process::Kernel; +@ISA = qw(FML::Process::Kernel); + +=head1 NAME + +FML::Process::Scheduler -- demonstration + +=head1 SYNOPSIS + + use FML::Process::Configure; + $curproc = new FML::Process::Configure; + $curproc->run(); + +=head1 DESCRIPTION + +FML::Process::Configure is the wrapper for fmlconf and makefml. +See C<FML::Process::Flow> for each method definition. + +=head2 MODULES + +These programs, +C<fmlconf> and C<makefml>, +bootstrap by using these modules in this order. + + libexec/loader -> FML::Process::Switch -> FML::Process::Configure + +=head1 METHODS + +=head2 C<new($args)> + +usual constructor. + +=head2 C<prepare($args)> + +dummy. + +=cut + + +sub prepare { ; } + + +sub run +{ + my ($self, $args) = @_; + + use FileHandle; + use TinyScheduler; + + my $schedule = new TinyScheduler; + $schedule->parse; + + my $tmp = $schedule->tmpfile; + my $fh = new FileHandle $tmp, "w"; + $schedule->print($fh); + $fh->close; + + system "w3m -dump $tmp"; + + unlink $tmp; +} + + +# dummy to avoid the error ( undefined function ) +sub AUTOLOAD +{ + ; +} + +=head1 AUTHOR + +Ken'ichi Fukamachi + +=head1 COPYRIGHT + +Copyright (C) 2001 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::Process::Configure appeared in fml5 mailing list driver package. +See C<http://www.fml.org/> for more details. + +=cut + + +1; diff --git a/fml/lib/FML/Process/Switch.pm b/fml/lib/FML/Process/Switch.pm index 8f7d6633..cc2f087a 100644 --- a/fml/lib/FML/Process/Switch.pm +++ b/fml/lib/FML/Process/Switch.pm @@ -323,6 +323,9 @@ sub _module_specific_options elsif ($myname eq 'makefml.cgi') { return qw(debug!); } + elsif ($myname eq 'fmlsch.cgi' || $myname eq 'fmlsch') { + return qw(debug!); + } else { croak "options for $myname are not defined.\n"; } @@ -340,6 +343,9 @@ sub _ml_name_is_required if ($myname eq 'fmldoc') { return 0; } + elsif ($myname eq 'fmlsch' || $myname eq 'fmlsch.cgi') { + return 0; + } elsif ($myname eq 'makefml') { return 0; } @@ -391,6 +397,12 @@ sub _module_we_use elsif ($name eq 'makefml.cgi') { $pkg = 'FML::CGI::Configure'; } + elsif ($name eq 'fmlsch') { + $pkg = 'FML::Process::Scheduler'; + } + elsif ($name eq 'fmlsch.cgi') { + $pkg = 'FML::CGI::Scheduler'; + } else { return ''; } |
