summaryrefslogtreecommitdiff
path: root/fml/doc/en/tutorial/command
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-07-29 12:13:54 +0000
committerfukachan <fukachan>2003-07-29 12:13:54 +0000
commit1e55dfb8a11faedb028f39d7529374a3714f4e9a (patch)
tree0b5c71787ba8bd1b6c3a71236119b41a618f98cf /fml/doc/en/tutorial/command
parent9b8aa01b71fa6ae09e7e12a9fe2f5150e1adec3f (diff)
downloadfml8-1e55dfb8a11faedb028f39d7529374a3714f4e9a.tar.gz
fml8-1e55dfb8a11faedb028f39d7529374a3714f4e9a.tar.bz2
fml8-1e55dfb8a11faedb028f39d7529374a3714f4e9a.zip
translated
Diffstat (limited to 'fml/doc/en/tutorial/command')
-rw-r--r--fml/doc/en/tutorial/command/internal.sgml100
1 files changed, 100 insertions, 0 deletions
diff --git a/fml/doc/en/tutorial/command/internal.sgml b/fml/doc/en/tutorial/command/internal.sgml
new file mode 100644
index 00000000..d671dcf0
--- /dev/null
+++ b/fml/doc/en/tutorial/command/internal.sgml
@@ -0,0 +1,100 @@
+<!--
+ $FML$
+ $jaFML: internal.sgml,v 1.6 2003/04/15 14:51:36 fukachan Exp $
+-->
+
+<sect1 id="fml.command.internal.change">
+ <title>
+ How differ coding style among &fml4; and &fml8;
+ </title>
+
+<para>
+(... not yet translated ...)
+</para>
+
+<para>
+Consider help command which send back help message to the sender, an
+example of command.
+</para>
+
+<para>
+In the case of &fmldevel;, the main code of help command locates at
+FML::Command::User::help class. This class is called by
+FML::Process::Command via AUTOLOAD of FML::Command.
+</para>
+
+<warning>
+<para>
+All commands are implemented as either of FML::Command::User
+FML::Command::Admin classes. CUI (makefml, fml) and GUI (CGI) uses
+FML::Command::Admin class. Command mail users both classes according
+to the context.
+</para>
+</warning>
+
+<para>
+The real content of help command is process() method in
+FML::Command::User::help class.
+<screen>
+sub process
+{
+ my ($self, $curproc, $optargs) = @_;
+ my $config = $curproc->{ config };
+ my $charset = $config->{ reply_message_charset };
+ my $help_file = $config->{ help_file };
+
+ # template substitution: kanji code, $varname expansion et. al.
+ my $params = {
+ src => $help_file,
+ charset_out => $charset,
+ };
+ my $help_template = $curproc->prepare_file_to_return( $params );
+
+ if (-f $help_template) {
+ $curproc->reply_message( {
+ type => "text/plain; charset=$charset",
+ path => $help_template,
+ filename => "help",
+ disposition => "help",
+ });
+ }
+ else {
+ croak("no help file ($help_template)\n");
+ }
+}
+</screen>
+where $curproc is an object, which type is hash reference.
+It corresponds to %Envelope of &fml4;.
+It contains several references to objects for this process.
+$config is an object, but global in $fml4;.
+</para>
+
+<para>
+prepare_file_to_return() converts the message language and expands the
+arguments in the message templtes.
+ </para>
+
+<para>
+$curproc->reply_message() inserts the specified mesage string into the
+queue.
+</para>
+
+<para>
+The error/log messages queued in are aggergated to one message at the
+last of the current process. It is driven by Mail::Delivery class to
+send it. If needed, the aggregator handles text strings and multipart
+properly.
+</para>
+
+<para>
+This mechanism is same as Notify() of &fml4; but the last aggregator
+is different.
+</para>
+
+<para>
+FYI: commands such as get for the file manipulation uses the same
+message queuing mechanism. This is different from &fml4;'s Notify()
+fundamentally.
+</para>
+
+</sect1>