Mnesia Web Interface for O&M and Customer Care

Sean Hinde Sean.Hinde@REDACTED
Wed Dec 18 18:01:32 CET 2002


> Hello Sean,
> 
> Many Thanks!
> 
> If I understand the idea, (please correct me if I am wrong in the
> process description) erl pages are saved within Mnesia. When inets
> receives an URL request, which is an ".esp" page, it calls "esp.erl"
> which retrieves it from Mnesia. One question: how do we 
> configure inets
> to call "esp.erl" when receiving an URL request which is an 
> "erl" page,
> and where does "esp.erl" go (I suppose within "/cgi-bin/erl/" for
> example)? 

Almost. The .esp pages are stored in mnesia with esp:store("page.esp").

The /cgi-bin/erl is in the configuration file to inets. It tells inets that
if it gets a request for a URL like /cgi-bin/erl/mod/func then it should
just call mod:func(Env, Data) to get the page to serve. This function
returns the result of esp:expand(page.esp,[]) whcih is the html code.

> Question: where does the logic that makes the mnesia database
> lookup and data retrieval go? Within the ".esp" page, or within the
> "esp.erl" ?

in the callback for mod:func/2 which receives the content of the POST.

See http://www.erlang.org/doc/r9b/lib/inets-3.0/doc/html/mod_esi.html for
more details

Sean



> -----Mensaje original-----
> De: owner-erlang-questions@REDACTED
> [mailto:owner-erlang-questions@REDACTED] En nombre de Sean Hinde
> Enviado el: miércoles, 18 de diciembre de 2002 9:22
> Para: 'Inswitch Solutions - Erlang Evaluation';
> erlang-questions@REDACTED
> Asunto: RE: Mnesia Web Interface for O&M and Customer Care
> 
> Hi,
>  
> Inets works fine for the sort of O&M activity you are talking 
> about. We
> use
> a modified version of Joe's Erlang Server Pages (esp.erl 
> attached) which
> stores the page templates in mnesia itself.
>  
> The idea is to have an erlang callback using the mod_erl 
> inets mechanism
> which can pass data into the esp page to make a dynamic page.
>  
> a trivial example for http://localhost:8080/cgi-bin/erl/test/page
> <http://localhost:8080/cgi-bin/erl/test/page>  would be:
>  
> -module(test).
> -export([page/2]).
>  
> page(_,_) ->
>     Dynamic_content = "Sean",
>     esp:expand("test_page.esp", [{"my_data", Dynamic_content}]).
>  
> test_page.esp could look something like:
>  
> <html>
>  <body>
>   Name: ${my_data}
>  <body/>
> <html/>
>  
> This is what we do for all our config pages including customer
> provisioning
> for a full blown VPN IN service.
>  
> Sean
> 
> -----Original Message-----
> From: Inswitch Solutions - Erlang Evaluation 
> [mailto:erlang@REDACTED]
> Sent: 17 December 2002 22:53
> To: erlang-questions@REDACTED
> Subject: Mnesia Web Interface for O&M and Customer Care
> 
> 
> 
> Hello,
> 
>  
> 
> We are implementing a Mnesia database, for mobile prepaid 
> accounts. Now,
> we
> need to implement both O&M and customer's care graphical 
> modules. And we
> would prefer them to be web based interfaces. The web 
> interface would be
> used to retrieve and update prepaid accounts data from the Mnesia
> accounts
> database. How would you recommend us to make the web to mnesia
> interface? Is
> there anything already implemented, that would help, as inets?    
> 
>  
> 
> Regards,
> 
>  
> 
> daniel
> 
>  
> 
> Daniel Fernandez
> 
>  
> 
>  
> 
> INswitch Solutions
> 
> T. 5989-9667353
> 
>  
> 
> 
> 
> 
> NOTICE AND DISCLAIMER:
> This email (including attachments) is confidential.  If you have
> received
> this email in error please notify the sender immediately and 
> delete this
> email from your system without copying or disseminating it or placing
> any
> reliance upon its contents.  We cannot accept liability for 
> any breaches
> of
> confidence arising through use of email.  Any opinions 
> expressed in this
> email (including attachments) are those of the author and do not
> necessarily
> reflect our opinions.  We will not accept responsibility for any
> commitments
> made by our employees outside the scope of our business.  We do not
> warrant
> the accuracy or completeness of such information.
> 
>     
> 
> 



NOTICE AND DISCLAIMER:
This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.




More information about the erlang-questions mailing list