From 13ef97114ca3f44fe534d0f4228c9e21b9febd8e Mon Sep 17 00:00:00 2001 From: fukachan Date: Mon, 28 Jul 2003 15:20:17 +0000 Subject: trasnlated --- fml/doc/en/tutorial/module/create.sgml | 120 +++++++++++++++++++++++++ fml/doc/en/tutorial/module/nativelanguage.sgml | 48 ++++++++++ 2 files changed, 168 insertions(+) create mode 100644 fml/doc/en/tutorial/module/create.sgml create mode 100644 fml/doc/en/tutorial/module/nativelanguage.sgml (limited to 'fml/doc/en/tutorial/module') diff --git a/fml/doc/en/tutorial/module/create.sgml b/fml/doc/en/tutorial/module/create.sgml new file mode 100644 index 00000000..496255ca --- /dev/null +++ b/fml/doc/en/tutorial/module/create.sgml @@ -0,0 +1,120 @@ + + + + + Execise: create a new program + + + + +Consider creation of a simple scheduler listing tool in the &fml8; +framework. Here the program name is fmlsch and the cgi is fmlsch.cgi. + + + + + + Case study: create a fmlsch + + + + + + step 1: add fmlsch into installer configuration + + + +add fmlsch into $bin_programs in fml/etc/install.cf.in. +Run configreu to re-create fml/etc/install.cf. + + + + + + + + step 2: build a module + + + + +Write fml/lib/Calender/Lite.pm for the main functions of fmlsch. + + + +Import libraries if needed. +For fmlsch we import +HTML-CalendarMonthSimple-1.02.tar.gz +from CPAN. + + + +Also, install Date-Calc if your system has not it. + + + + + + + + step 3: modify FML::Process:: class + + + +Calender::Lite works mainly but we build the machanism how &fml8; +loads and runs it. We modify FML::Process:: for &fml8; bootloader to +call Calender::Lite. + + + +Firstly, write mandatory methods for fmlsch process in +fml/lib/FML/Process/Calender.pm. You need to create this module. + + + +Secondary, set up boot loader configuration. In the case of fmlsch, +the bootloader loads FML::Process::Calender. Define it in +fml/etc/modules. Set up fml/etc/command_line_options properly. +"command_line_options" file has a map between a command and the +command line options parsed by Getopt::Long(). + + + + +Create FML::Process::Calender module by copy-and-pasting other +FML::Process:: modules :-) However fmlsch has least functions, you +need to write FML::Process::Calender::run() method. For undefined +methods, fml loads FML::Process::Kernel functions (inheritence). + + + + + + + + + + case study: fmlsch.cgi + + + + +The hacking is similar to fmlsch. The differnce is that the target to +modify is FML::CGI:: class. FML::CGI::Calender is a sub-class of +FML::Process::CGI. + + + +If undefined method is called, fml loads it from FML::Process::CGI or +FML::Process::Kernel. FML::Process::CGI uses CGI.pm to create a http +header et.al. If FML::Process::CGI functions are not enough, +FML::CGI:: module should support the lack. + + + + + + diff --git a/fml/doc/en/tutorial/module/nativelanguage.sgml b/fml/doc/en/tutorial/module/nativelanguage.sgml new file mode 100644 index 00000000..57c3eb97 --- /dev/null +++ b/fml/doc/en/tutorial/module/nativelanguage.sgml @@ -0,0 +1,48 @@ + + + + + Language dependent functions + + + +fml needs language dependent functions internally. Especially, JIS +to/from EUC conversion is used anywhere since. Japanese messages are +written in JIS code but programs are easy to use string in EUC-JP. + + + +See + +message internationalization + +for the language dependence handling in messages. + + + + + + Something::Language:: + + + +Language dependent module locates at Something::Language. + + + +For example, there are + +FML::Language::Japanese::String +Mail::Bounce::Language::Japanese + +The former provides Japanese dependent string functions. +The latter provides Japanese dependent error mail analyzer functions. + + + + + + -- cgit v1.2.1