Froglingo |
An Alternative to DBMS, Programming Language, Web Server, and File System |
|
1. The batch file webcons.frog that initiate the application data. |
/* Case
Study: A Web Browser Interface for Froglingo
Console Froglingo Development Association 2/30/2010 file
name: webcons.frog The
MS DOS command to inventory this application: frog -b webcons.frog For
example in the folder FOLDER having the executable
frog.exe: C:\FOLDER\frog
-b webcons.frog This
application allows a non-root user to interact with Froglingo server through a web browser. The Brower
display a field for
entering Froglingo expressions; and another field
for uploading files. The
purpose of this application to show how developers can construct web-based applications. It is a very preliminary version
which still
need developers to log into his/her user account by using the
command: //www.myaccount.com
login . "password" via
web browser address field */ /* Create
a password for the root system. Please remember the password. It
is automatically generated and displayed on console when this
file was batch-loaded by using option "-b" */ passwd; /* Assume
that the user account to be used is www.myclienta.com. The
command addusr creates the account, which will be
the domain name used across Internet. Please
remember the password the system generated through this command. */ addusr www.myclienta.com; /* Log
into the account to set up additional data. Note that the password "passwd" is fake. When the
system is to be used later, the password the system generated via the commaond
addusr above has to be provided. */ login www.myclienta.com "passwd"; /* Load
the file webcons.html, a HTML file embedding Froglingo
expressions. The
file stays in the same folder as the file webcons.frog. */ load webcons.html; /* The
command rec_cmd is called from web browswer (rendered from webcons.html).
It is to execute the command carried in by the variable
$x; reply the result of the execution back to the HTML file
webcons.html, which will be rendered and displayed by web browswer Note
that this command cannot be called unless you logged into system via
the command: http://www.myaccount.com
login . "password" */ create rec_cmd $x = print
(webcons.html $x) in html; /* The
command fileload is called from web browser
(rendered from webcons.html).
It is to load a file whose name is carried by the variable $x, and the contents are carried in by HTTP
POST protocol. The
upload result is applied to the HTML file webcons.html, which will be rendered and displayed by web browser. Note
that this command cannot be called unless you logged into system via
the command: http://www.myaccount.com
login . "password" */ create fileload $x = print
(webcons.html (load $x)) in html; /* A
sample test for the command fileload, which is to
be called via a local console. It also can be down through a web browser. */ fileload "index.html"; grtacc index.html anyone; /* Testing
for the result */ "\n"; ls .; 2. The HTML file webcons.html that renders a web page where users can enter Froglingo expressions. <frog> $x </frog> <html> <body> <table> <tr> <td
colspan = 2> <font size = 8> <frog> whereami </frog> </font> </td> </tr> <tr> <td> Enter
Froglingo Expression: <br/> <form
method=get action="rec_cmd (@cmd)"> <input
type=text name=ident:cmd value="Enter Froglingo command", size = 45 /> <br/> <input
type=submit value=Go /> </form> <!--
rec_cmd $x = print (webcons.html $x) in html --> </td> <td> Upload
file: <br/> <form
method=post enctype="multipart/form-data"
name=fileload action="fileload
@filename"> <input
type = file name ="filename" size=20 /> <br/> <input
type = submit value = "Upload"/> </form> <!--
fileload $x = print (webcons.html (load $x)) in
html --> </td> </tr> <tr> <td
colspan = 2> <frog> "<input
type = text value=" + $x +
">" </frog>
</td> </tr> </table> </body> </html>
|