1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
|
<!--
$FML: create_program.sgml,v 1.3 2005/09/25 04:27:17 fukachan Exp $
$jaFML: create_program.sgml,v 1.6 2003/04/15 14:51:38 fukachan Exp $
-->
<chapter id="program.create">
<title>
Create A New Program
</title>
<sect1>
<title>
Create A Program (CUI)
</title>
<para>
Firstly, prepare a new module in FML::Process class. See
FML::Process::Calendar as the least functional model and see
FML::Process::Distribute for the most complicated class.
</para>
<para>
See FML::Process::Flow::ProcessStart() for mandatory methods to
implement. FML::Process::Flow::ProcessStart() kicks off several
methods sequentially.
At 2002/07, these methods are mandatory.
<screen>
new()
prepare()
verify_request()
run()
finish()
</screen>
</para>
<para>
<screen>
FML::Process::Kernel
| uses-a FML::Process::{Flow,Utils} FML::Parse ...
|
A
FML::Process::MODULE
uses-a FML::Something
uses-a CPAN module
uses-a ...
</screen>
</para>
<para>
If you have prepared FML::Process::MODULE, define relation between the
program name and the module at fml/etc/modules. Also, define available
command line options at fml/etc/command_line_options if needed.
</para>
<para>
After it is prepared, symlink the loader and the new program name.
For example,
<screen>
% ls -l /usr/local/libexec/fml
lrwxr-xr-x 1 root wheel 6 Apr 14 18:25 command@ -> loader
drwxr-xr-x 2 root wheel 512 Apr 14 18:25 current-20030414/
lrwxr-xr-x 1 root wheel 6 Apr 14 18:25 digest@ -> loader
lrwxr-xr-x 1 root wheel 6 Apr 14 18:25 distribute@ -> loader
lrwxr-xr-x 1 root wheel 6 Apr 14 18:25 error@ -> loader
lrwxr-xr-x 1 root wheel 6 Apr 14 18:25 fml@ -> loader
lrwxr-xr-x 1 root wheel 6 Apr 14 18:25 fml.pl@ -> loader
lrwxr-xr-x 1 root wheel 6 Apr 14 18:25 fmladdr@ -> loader
lrwxr-xr-x 1 root wheel 6 Apr 14 18:25 fmlalias@ -> loader
lrwxr-xr-x 1 root wheel 6 Apr 14 18:25 fmlconf@ -> loader
lrwxr-xr-x 1 root wheel 6 Apr 14 18:25 fmldoc@ -> loader
lrwxr-xr-x 1 root wheel 6 Apr 14 18:25 fmlhtmlify@ -> loader
lrwxr-xr-x 1 root wheel 6 Apr 14 18:25 fmlsch@ -> loader
lrwxr-xr-x 1 root wheel 6 Apr 14 18:25 fmlserv@ -> loader
-rwxr-xr-x 1 root wheel 6863 Apr 14 18:24 loader*
lrwxr-xr-x 1 root wheel 6 Apr 14 18:25 makefml@ -> loader
lrwxr-xr-x 1 root wheel 6 Apr 14 18:25 mead@ -> loader
</screen>
As a test, you symlink it explicitly. For the canonical programs, fml
installer symlinks them according to fml/etc/install.cf. You need to
define the program as $bin_programs or $exec_programs in install.cf.in
(configure generates install.cf).
</para>
</sect1>
<sect1>
<title>
Create A Program (CGI)
</title>
<para>
The main part of CGI program is implemented as an FML::CGI::XXX class.
These modules have the following relation.
<screen>
FML::Process::Kernel
|
A
FML::Process::CGI::Kernel uses-a CGI
|
A
FML::Process::CGI
|
A
FML::CGI::XXX
</screen>
</para>
<para>
How to write CGI programs is same as one of CUI. GUI modules locate
under FML::CGI to clarify the difference between CUI and GUI.
</para>
<para>
In the case of CGI, prepare the following methods for screen control
in FML::CGI::MODULE.
<screen>
html_start()
html_end()
</screen>
and
<screen>
run_cgi_main()
run_cgi_title()
run_cgi_navigator()
run_cgi_menu()
run_cgi_command_help()
run_cgi_options()
</screen>
These methods are called from verify_request() and run() in
FML::Process::CGI.
</para>
<para>
CGI process is driven by FML::Process::CGI.
run() method calls
<screen>
$curproc->html_start($args);
</screen>
call a set of run_cgi_xxx() methods
<screen>
$curproc->html_end($args);
</screen>
to control screen.
</para>
<para>
At 2001/11, FML::Process::CGI::Kernel consists of the following methods:
<footnote>
<para>
Almost cases,
FML::Process::Kernel method is overloaded by other modules.
So, not called directly.
</para>
</footnote>
<screen>
new()
prepare()
verify_request()
run()
finish()
</screen>
You do not need edit these files.
FML::CGI:: is called at run() method.
</para>
</sect1>
</chapter>
|