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 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
<TITLE>webtool</TITLE>
<SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
<STYLE TYPE="text/css">
<!--
.REFBODY { margin-left: 13mm }
.REFTYPES { margin-left: 8mm }
-->
</STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
ALINK="#FF0000">
<!-- refpage -->
<CENTER>
<A HREF="http://www.erlang.se">
<IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif">
</A>
<H1>webtool</H1>
</CENTER>
<H3>MODULE</H3>
<DIV CLASS=REFBODY>
webtool
</DIV>
<H3>MODULE SUMMARY</H3>
<DIV CLASS=REFBODY>
WebTool is a tool used to simplify the implementation of web based
tools with Erlang/OTP.
</DIV>
<H3>DESCRIPTION</H3>
<DIV CLASS=REFBODY>
<P> WebTool makes it easy to use web based tools with Erlang/OTP. WebTool
configures and starts the webserver httpd.
</DIV>
<H3>EXPORTS</H3>
<P><A NAME="start/0"><STRONG><CODE>start()-> {ok,Pid}| {stop,Reason}</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY>
<P>Start WebTool with default data, i.e. port 8888, ip-number
127.0.0.1, and server-name <CODE>localhost</CODE>. 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.
<P>The <CODE>mime.types</CODE> file and WebTool's own HTML files
are assumed to be in the directory
<CODE>webtool-<vsn>/priv/root/conf</CODE>.
</DIV>
<P><A NAME="start/2"><STRONG><CODE>start(Path,Data)->{ok,Pid}|{stop,Reason}</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Path = string() | standard_path</CODE></STRONG><BR>
<STRONG><CODE>Data = [Port,Address,Name] | PortNumber | standard_data</CODE></STRONG><BR>
<STRONG><CODE>Port = {port,PortNumber}</CODE></STRONG><BR>
<STRONG><CODE>Address = {bind_address,IpNumber}</CODE></STRONG><BR>
<STRONG><CODE>Name = {server_name,ServerName}</CODE></STRONG><BR>
<STRONG><CODE>PortNumber = integer()</CODE></STRONG><BR>
<STRONG><CODE>IpNumber = tuple(), e.g. {127,0,0,1}</CODE></STRONG><BR>
<STRONG><CODE>ServerName = string()</CODE></STRONG><BR>
<STRONG><CODE>Pid = pid()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P>Use this function to start WebTool if the default port,
ip-number,servername or path can not be used.
<P> <CODE>Path</CODE> is the directory where the <CODE>mime.types</CODE>
file and WebTool's own HTML files are located. By default
this is <CODE>webtool-<vsn>/priv</CODE>, and in most cases there
is no need to change this. If <CODE>Path</CODE> is set to
<CODE>standard_path</CODE> the default will be used.
<P> If <CODE>Data</CODE> is set to <CODE>PortNumber</CODE>, the default data
will be used for ip-number (<CODE>127.0.0.1</CODE>) and server
name (<CODE>localhost</CODE>).
</DIV>
<P><A NAME="stop/0"><STRONG><CODE>stop()->void</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY>
<P>Stop WebTool and the tools started by WebTool.
</DIV>
<P><A NAME="debug_app/1"><STRONG><CODE>debug_app(Module)->void</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Module = atom()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P>Debug a WebTool application by tracing all functions in the
given module which are called from WebTool.
</DIV>
<P><A NAME="stop_debug/0"><STRONG><CODE>stop_debug()->void</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY>
<P>Stop the tracing started by <CODE>debug_app/1</CODE>, and format
the trace log.
</DIV>
<H3>CALLBACK FUNCTIONS</H3>
<DIV CLASS=REFBODY>
<P> 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 <A HREF="webtool_chapter.html">WebTool User's Guide</A> for more
information about the *.tool files.
</DIV>
<H3>EXPORTS</H3>
<P><A NAME="Module:Func/1"><STRONG><CODE>Module:Func(Data)-> {Name,WebData}|error</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Data = term()</CODE></STRONG><BR>
<STRONG><CODE>Name = atom()</CODE></STRONG><BR>
<STRONG><CODE>WebData = [WebOptions]</CODE></STRONG><BR>
<STRONG><CODE>WebOptions = LinkData | Alias | Start</CODE></STRONG><BR>
<STRONG><CODE>LinkData = {web_data,{ToolName,Url}}</CODE></STRONG><BR>
<STRONG><CODE>Alias = {alias,{VirtualPath,RealPath}} |
{alias,{erl_alias,Path,[Modules]}</CODE></STRONG><BR>
<STRONG><CODE>Start = {start,StartData}</CODE></STRONG><BR>
<STRONG><CODE>ToolName = Url = VirtualPath = RealPath = Path = string()</CODE></STRONG><BR>
<STRONG><CODE>Modules = atom()</CODE></STRONG><BR>
<STRONG><CODE>StartData = AppData | ChildSpec | Func</CODE></STRONG><BR>
<STRONG><CODE>AppData = {app,AppName}</CODE></STRONG><BR>
<STRONG><CODE>ChildSpec = {child,child_spec()}</CODE></STRONG><BR>
<DIV CLASS=REFBODY>
See the Reference Manual for the module supervisor in the
STDLIB application for details about child_spec().
</DIV>
<STRONG><CODE>Func = {func,{StartMod,StartFunc,StartArg},
{StopMod,StopFunc,StopArg}}</CODE></STRONG><BR>
<STRONG><CODE>AppName = StartMod = StartFunc = StopMod = StopFunc =atom()</CODE></STRONG><BR>
<STRONG><CODE>StartArg = StopArg = [term()]</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<P> This is the configuration function (<CODE>config_func</CODE>)
which must be stated in the <CODE>*.tool</CODE> file.
<P>
The function is called by WebTool at startup to retrieve the
data needed to start and configure the tool. <CODE>LinkData</CODE> is
used by WebTool to create the link to the tool. <CODE>Alias</CODE> is
used to create the aliases needed by the webserver. <CODE>Start</CODE>
is used to start and stop the tool.
</DIV>
<H3>See Also</H3>
<DIV CLASS=REFBODY>
<P> <A HREF="start_webtool.html">start_webtool(1)</A>,
<A HREF="webtool_chapter.html">WebTool User's Guide</A>
</DIV>
<H3>AUTHORS</H3>
<DIV CLASS=REFBODY>
Martin Gustafsson - support@erlang.ericsson.se<BR>
</DIV>
<CENTER>
<HR>
<SMALL>webtool 0.8.3<BR>
Copyright © 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>
|