From 1e55dfb8a11faedb028f39d7529374a3714f4e9a Mon Sep 17 00:00:00 2001 From: fukachan Date: Tue, 29 Jul 2003 12:13:54 +0000 Subject: translated --- fml/doc/en/tutorial/command/internal.sgml | 100 ++++++++++++++++ fml/doc/en/tutorial/internals/credential.sgml | 39 +++++++ fml/doc/en/tutorial/internals/dbms.sgml | 52 +++++++++ fml/doc/en/tutorial/message/discussion.sgml | 159 ++++++++++++++++++++++++++ fml/doc/en/tutorial/message/language.sgml | 48 ++++++++ 5 files changed, 398 insertions(+) create mode 100644 fml/doc/en/tutorial/command/internal.sgml create mode 100644 fml/doc/en/tutorial/internals/credential.sgml create mode 100644 fml/doc/en/tutorial/internals/dbms.sgml create mode 100644 fml/doc/en/tutorial/message/discussion.sgml create mode 100644 fml/doc/en/tutorial/message/language.sgml (limited to 'fml') 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 @@ + + + + + How differ coding style among &fml4; and &fml8; + + + +(... not yet translated ...) + + + +Consider help command which send back help message to the sender, an +example of command. + + + +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. + + + + +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. + + + + +The real content of help command is process() method in +FML::Command::User::help class. + +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"); + } +} + +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;. + + + +prepare_file_to_return() converts the message language and expands the +arguments in the message templtes. + + + +$curproc->reply_message() inserts the specified mesage string into the +queue. + + + +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. + + + +This mechanism is same as Notify() of &fml4; but the last aggregator +is different. + + + +FYI: commands such as get for the file manipulation uses the same +message queuing mechanism. This is different from &fml4;'s Notify() +fundamentally. + + + diff --git a/fml/doc/en/tutorial/internals/credential.sgml b/fml/doc/en/tutorial/internals/credential.sgml new file mode 100644 index 00000000..4a9409b6 --- /dev/null +++ b/fml/doc/en/tutorial/internals/credential.sgml @@ -0,0 +1,39 @@ + + + + + User authentication + + + +User authentication is provydes by methods of FML::Credential class. + + + + + + + Discussion: FML::Credential implementation + + + + + + case sensitive / case insensitive + + + +For the user@domain address, we handle user part as case sensitively +and domain as case insensitively. Is it better to prepare the option +that handling of user part is insensitive. + + + + + + + + diff --git a/fml/doc/en/tutorial/internals/dbms.sgml b/fml/doc/en/tutorial/internals/dbms.sgml new file mode 100644 index 00000000..25a2d32a --- /dev/null +++ b/fml/doc/en/tutorial/internals/dbms.sgml @@ -0,0 +1,52 @@ + + + + + database management system + + + + + + Overview + + + +Communication with DBMS (database management system) +via + +IO::Adapter + +class. + + + +This class provides fundamental functions such as insersion and +deletion of data. If more complex operation is needed, the +preprocessing module calling IO::Adapter should handle it. + + + + + + + + TODO + + + +Consider if methods are least set or not. +But + +IO::Adapter + +is enough ? + + + + + + diff --git a/fml/doc/en/tutorial/message/discussion.sgml b/fml/doc/en/tutorial/message/discussion.sgml new file mode 100644 index 00000000..3d4e48b2 --- /dev/null +++ b/fml/doc/en/tutorial/message/discussion.sgml @@ -0,0 +1,159 @@ + + + + + Discussion: how to send back language dependent error mesages + + + +fml needs to send back language dependent error mesages. +How we should implement it ? + + + + + + + &fml4; case + + + +In the case of &fml4;, call language dependent message converter like +this: + + Mesg(*e, KEYWORD, DEFAULT MESSAGE, ARGUMENT); + + + + +Mesg() searches the specified keyword in files +/usr/local/fml/messages/Japanese/ directory. Each file contains +messages with keywords to be substituted properly. + + + +For example, the keyword not_found matches not_found entry in +/usr/local/fml/messages/Japanese/kern file. + + + + + + + + + + What &fmldevel; should do ? + + + +Hmm, which is better ? "One file has one keyword" and "one file for +one category, so one file contains plural entries". +I don't determine it. + + + + + X/Open Portability Guide Issue 4 Version 2 (``XPG4.2'') + + + +If you use XPG (X/Open standard), + +catgets(catd, set_id, msg_id, char *s); + +function converts the message specified by LOCALE_XXX. + + + "s" is the default message. + + +For example, the usage is as follows: + +printf(catgets(catd, 30, 4, "%s: Internal match error.\n"), progname); + +Thie function uses se 30 and entry 4 in th local definition file such +as /usr/pkg/share/nls/ja_JP.EUC/PROGNAME.cat. + + + + + + + &fmldevel;: design (temporary ?) + + + +One problem is whether we should use locale or not ? +By considering CUI e.g. makefml, it is better to use locale. +For example, prepare + +/usr/local/lib/fml/$fml_version/messages/ja_JP.EUC/kern + +1: %s not found +2: %s (error number = %d) + +. + + + +Instead one file for one message may be useful. +Especially we can customize only one message. + + + +To try the latter case, we can prepare a lot of classes such as + +FML::Message::ja::KEYWORD + +For example, there are 200 or 300 files such as + +FML::Message::ja::not_found + +. + + + +This methods has the following problems: + + + + separete files but in contrast more customizable. + + + + + + locale friendly? may be no. + + + + + + + + +Consider the example. In the latter case, +the message module will be like this? + +sub not_found +{ + my .. = @_; + + return <<"_EOF_" +$sender is ... something ... +_EOF_ +} + +hmm, is it good ??? + + + + + + + + diff --git a/fml/doc/en/tutorial/message/language.sgml b/fml/doc/en/tutorial/message/language.sgml new file mode 100644 index 00000000..7e34be55 --- /dev/null +++ b/fml/doc/en/tutorial/message/language.sgml @@ -0,0 +1,48 @@ + + + + + + message internationalization: + the usage of reply_message_nl() + + + +For the message internationalization, +use reply_message_nl() + + + See FML::Process::Kernel module. + + +like this: + +$curproc->reply_message_nl('error.already_member', + 'already member', + { _arg_address => $address }); + +This function uses the message template at +/usr/local/share/fml/$fml_version/message/$language/error/already_member +. + + + +$_arg_VARNAME in the message such as + +$_args_address + +is expanded by using the value specified as the argument of +reply_mesage_nl(). + + + +Usual $VARIABLE is also expaned by replacing it with value of config.cf. +For example, $ml_name is expanded to ML name defined in config.cf +$_arg_ prefix is used for lexical scope variables to avoid +conflicts against variables in config.cf. + + + -- cgit v1.2.1