Tools for designing web based interfaces for erlang otp
This presentation is the property of its rightful owner.
Sponsored Links
1 / 13

Tools for Designing Web Based Interfaces for Erlang/OTP PowerPoint PPT Presentation


  • 54 Views
  • Uploaded on
  • Presentation posted in: General

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.

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Tools for designing web based interfaces for erlang otp

Tools for Designing Web Based Interfaces for Erlang/OTP

Martin Gustafsson


Program

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

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.


Problems with web based user interfaces

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.


Httpd the webserver in erlang otp

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.


The functionality of httpd

The functionality of httpd

HTTP-request

httpd

s

HTTP-Response

mod_xxx

{response{statuscode,Body}}


Creation of dynamic web pages

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).


Example

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


Starting webtool

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/


Tools for designing web based interfaces for erlang otp

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.


Developing tools to be used via webtool

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}}}]}.


Design principles for web based tools

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


  • Login