1 / 13

Tools for Designing Web Based Interfaces for Erlang/OTP

Tools for Designing Web Based Interfaces for Erlang/OTP. Martin Gustafsson. Program. Why Web Based User Interfaces. httpd the Webserver in Erlang/OTP. How to use and develop with WebTool. Best Desing of Web Based Tools, with Erlang/OTP. Why Web Based User Interfaces. Easy for the user.

noel-solis
Download Presentation

Tools for Designing Web Based Interfaces for Erlang/OTP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tools for Designing Web Based Interfaces for Erlang/OTP Martin Gustafsson

  2. Program • Why Web Based User Interfaces. • httpd the Webserver in Erlang/OTP. • How to use and develop with WebTool. • Best Desing of Web Based Tools, with Erlang/OTP.

  3. Why Web Based User Interfaces • Easy for the user. • Fast development, • Easy to Learn. • Fast Development. • The tool can be used from the network. • Easy to generate printable reports.

  4. Problems with Web based User Interfaces • Takes little more time to start than command-line tools. • Interaction with the files system. • Browser incompabilities. • Security is problem, • Functionality that can stop the Erlang node. • Data transfer between server and client is not secure.

  5. httpd -The Webserver in Erlang/OTP • Support for Basic User Authentication. • Support for SSL. • Support for creation of Dynamic Web Pages. • httpd is a Apache styled Webserver.

  6. The functionality of httpd HTTP-request httpd s HTTP-Response mod_xxx {response{statuscode,Body}}

  7. Creation of dynamic Web Pages • CGI • Eval Scheme • Ex: http://server:port/EvalSchemAlias/mod:func(AnyArg) • Erl Scheme Ex: http://server:port/ErlSchemeAlias/mod/func The Webserver will return the result of calling mod:func(Env,Input).

  8. index(Env,Input) -> [“\r\n\r\n”,html_head(),htmlbody(), createMenu(Env),”</HTML>”]. createMenu(Env)-> Ag=httpd_util:key1search( Env, http_user_agent,other), case mod_browser:getBrowser(Ag) of {{msie,_},_} -> menu(ie); {{netscape,_},_} -> menu(nav) end. menu(nav) -> “<LAYER NAME=\”popup\” VISIBILITY=\”hidden\”> <TABLE> <TR><TD> <A HREF=./start> Start tool </A> </TD></TR> …. </TABLE> </LAYER>”; Example

  9. Starting WebTool • Create a *.tool file for each tool and save it in the directory MyTool-vsn/priv/FileName.tool • Ex: {version,1.2},[{config_func,{webappmon,configData,[]}}] • Start WebTool. • Ex: webtool:start().webtool:start(Path,Port). • Point a browser to http://HostName:Port/

  10. Callback function for WebTool • WebTool use the callback function to receive configuration data for the tool. • Configuration data is needed for: • Creating links from WebTool to the tool. • Configuration of the Webserver. • Data about how to start and stop the tool.

  11. Developing tools to be used via WebTool • The tools must export a callback function that returns the configuration data needed by WebTool. • Example:configData()-> Application=my_app RealPath=code:priv_dir(Application), {mytool,[{web_data,{“URL”,”Linktext”}}, {alias,{erl_alias,”VPath”,[“Module”]}}, {alias,{“VirtualPath2”,RealPath}}, {start{{Mod,Func,Arg},{Mod,Func,Arg}}}]}.

  12. Design principles for Web based Tools • A N-layered solution has many advantages • Easier to update the code • If well designed the logic module might be possible to use as a command-line version. HTTP-Request Module that generates the User Interface logic Module WebPage

More Related