.TH webtool 3erl "webtool 0.8.9.1" "Ericsson AB" "Erlang Module Definition" .SH NAME 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-/priv/root/conf\fR\&\&. .RE .LP .B start(Path,Data)->{ok,Pid}|{stop,Reason} .br .RS .LP Types: .RS 3 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 .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-/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 .LP Types: .RS 3 Module = atom() .br .RE .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 \fBWebTool User\&'s Guide\fR\& for more information about the *\&.tool files\&. .SH EXPORTS .LP .B Module:Func(Data)-> {Name,WebData}|error .br .RS .LP Types: .RS 3 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 .RS 2 See the Reference Manual for the module supervisor in the STDLIB application for details about child_spec()\&. .RE Func = {func,{StartMod,StartFunc,StartArg}, {StopMod,StopFunc,StopArg}} .br AppName = StartMod = StartFunc = StopMod = StopFunc =atom() .br StartArg = StopArg = [term()] .br .RE .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 \fBstart_webtool(1)\fR\&, \fBWebTool User\&'s Guide\fR\&