File: webtool.3

package info (click to toggle)
erlang-manpages 1%3A12.b.3-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,188 kB
  • ctags: 2
  • sloc: makefile: 68; perl: 30; sh: 15
file content (135 lines) | stat: -rw-r--r-- 3,778 bytes parent folder | download
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
.TH webtool 3 "webtool  0.8.3.2" "Ericsson AB" "ERLANG MODULE DEFINITION"
.SH MODULE
webtool \- WebTool is a tool used to simplify the implementation of web based tools with Erlang/OTP\&.
.SH DESCRIPTION
.LP
WebTool makes it easy to use web based tools with Erlang/OTP\&. WebTool configures and starts the webserver httpd\&.

.SH EXPORTS
.LP
.B
start()-> {ok,Pid}| {stop,Reason}
.br
.RS
.LP
Start WebTool with default data, i\&.e\&. port 8888, ip-number 127\&.0\&.0\&.1, and server-name \fIlocalhost\fR\&. If port 8888 is in use, port 8889 is tried instead\&. If 8889 is also in use, 8890 is tried and so on\&. Max number of ports tried is 256\&. 
.LP
The \fImime\&.types\fR file and WebTool\&'s own HTML files are assumed to be in the directory \fIwebtool-<vsn>/priv/root/conf\fR\&.
.RE
.LP
.B
start(Path,Data)->{ok,Pid}|{stop,Reason}
.br
.RS
.TP
Types
Path = string() | standard_path
.br
Data = [Port, Address, Name] | PortNumber | standard_data
.br
Port = {port, PortNumber}
.br
Address = {bind_address, IpNumber}
.br
Name = {server_name, ServerName}
.br
PortNumber = integer()
.br
IpNumber = tuple(), e\&.g\&. {127, 0, 0, 1}
.br
ServerName = string()
.br
Pid = pid()
.br
.RE
.RS
.LP
Use this function to start WebTool if the default port, ip-number,servername or path can not be used\&.
.LP
\fIPath\fR is the directory where the \fImime\&.types\fR file and WebTool\&'s own HTML files are located\&. By default this is \fIwebtool-<vsn>/priv\fR, and in most cases there is no need to change this\&. If \fIPath\fR is set to \fIstandard_path\fR the default will be used\&.
.LP
If \fIData\fR is set to \fIPortNumber\fR, the default data will be used for ip-number (\fI127\&.0\&.0\&.1\fR) and server name (\fIlocalhost\fR)\&.
.RE
.LP
.B
stop()->void
.br
.RS
.LP
Stop WebTool and the tools started by WebTool\&.
.RE
.LP
.B
debug_app(Module)->void
.br
.RS
.TP
Types
Module = atom()
.br
.RE
.RS
.LP
Debug a WebTool application by tracing all functions in the given module which are called from WebTool\&.
.RE
.LP
.B
stop_debug()->void
.br
.RS
.LP
Stop the tracing started by \fIdebug_app/1\fR, and format the trace log\&.
.RE
.SH CALLBACK FUNCTIONS
.LP
The following callback function must be implemented by each web based tool that will be used via WebTool\&. When started, WebTool searches the Erlang code path for *\&.tool files to locate all web based tools and their callback functions\&. See the WebTool User\&'s Guide for more information about the *\&.tool files\&.
.SH EXPORTS
.LP
.B
Module:Func(Data)-> {Name,WebData}|error
.br
.RS
.TP
Types
Data = term()
.br
Name = atom()
.br
WebData = [WebOptions]
.br
WebOptions = LinkData | Alias | Start
.br
LinkData = {web_data, {ToolName, Url}}
.br
Alias = {alias, {VirtualPath, RealPath}} | {alias, {erl_alias, Path, [Modules]}
.br
Start = {start, StartData}
.br
ToolName = Url = VirtualPath = RealPath = Path = string()
.br
Modules = atom()
.br
StartData = AppData | ChildSpec | Func
.br
AppData = {app, AppName}
.br
ChildSpec = {child, child_spec()}
.br
  See the Reference Manual for the module supervisor in the STDLIB application for details about child_spec()\&.
.br
Func = {func, {StartMod, StartFunc, StartArg}, {StopMod, StopFunc, StopArg}}
.br
AppName = StartMod = StartFunc = StopMod = StopFunc =atom()
.br
StartArg = StopArg = [term()]
.br
.RE
.RS
.LP
This is the configuration function (\fIconfig_func\fR) which must be stated in the \fI*\&.tool\fR file\&.
.LP
The function is called by WebTool at startup to retrieve the data needed to start and configure the tool\&. \fILinkData\fR is used by WebTool to create the link to the tool\&. \fIAlias\fR is used to create the aliases needed by the webserver\&. \fIStart\fR is used to start and stop the tool\&.
.RE
.SH SEE ALSO
.LP
start_webtool(1), WebTool User\&'s Guide