Posts Mentioning RSS Toggle Comment Threads | Keyboard Shortcuts

  • ashish revar 6:37 pm on October 9, 2009 Permalink | Reply  

    WML: Basic Application 

    Below a basic application is given which Assn.wml build only to demonstrate the basic flow of the wml files,

    this file is for only to use selectbox and to check the functionalities of .wml and .wmls files.

    Assn.wml

    <?xml version=”1.0″ encoding=”utf-8″?>
    <!DOCTYPE wml PUBLIC “-//WAPFORUM//DTD WML 1.3//EN”
    “http://www.wapforum.org/DTD/wml13.dtd”>
    <wml>
    <!– Possible <head> elements here. –>
    <card id=”card1″ title=”Home Page”>
    <!– Additional <do> elements here. –>
    <p align=”center”>
    <!– Card implementation here. –>
    <big><b>Subjects:</b></big><br/>
    <select name=”subject” value=”FA”>
    <option value=”FA”>FA</option>
    <option value=”ADCN”>ADCN</option>
    <option value=”DDA”>DDA</option>
    <option value=”SE”>SE</option>
    <option value=”ES”>ES</option>
    </select>
    <big><b>Assignments:</b></big>
    <select name=”assignments” value=”Assignment-1″>
    <option value=”Assignment-1″>Assignment-1</option>
    <option value=”Assignment-2″>Assignment-2</option>
    <option value=”Assignment-3″>Assignment-3</option>
    </select>
    Title = <b>$(answer)</b>
    <do type=”accept” label=”Show”>
    <go href=”Assn.wmls#checkassn(‘answer’, ‘$(subject)’, ‘$(assignments)’)”/>
    </do>
    </p>
    <!– Additional <p> elements here. –>
    </card>
    </wml>
    <?xml version=”1.0″ encoding=”utf-8″?>
    <!DOCTYPE wml PUBLIC “-//WAPFORUM//DTD WML 1.3//EN”
    “http://www.wapforum.org/DTD/wml13.dtd”>
    <wml>
    <!– Possible <head> elements here. –>
    <card id=”card1″ title=”Home Page”>
    <!– Additional <do> elements here. –>
    <p align=”center”>
    <!– Card implementation here. –>
    <big><b>Subjects:</b></big><br/>
    <select name=”subject” value=”FA”>
    <option value=”FA”>FA</option>
    <option value=”ADCN”>ADCN</option>
    <option value=”DDA”>DDA</option>
    <option value=”SE”>SE</option>
    <option value=”ES”>ES</option>
    </select>
    <big><b>Assignments:</b></big>
    <select name=”assignments” value=”Assignment-1″>
    <option value=”Assignment-1″>Assignment-1</option>
    <option value=”Assignment-2″>Assignment-2</option>
    <option value=”Assignment-3″>Assignment-3</option>
    </select>
    Title = <b>$(answer)</b>
    <do type=”accept” label=”Show”>
    <go href=”Assn.wmls#checkassn(‘answer’, ‘$(subject)’, ‘$(assignments)’)”/>
    </do>
    </p>
    <!– Additional <p> elements here. –>
    </card>
    </wml>
    Assn.wmls

    extern function checkassn(result,subject,assignment)
    {
    var ans = 0;
    if(subject == ‘FA’ && assignment == ‘Assignment-1′)
    {
    ans = ‘Histogram Equalization’;
    }
    if(subject == ‘FA’ && assignment == ‘Assignment-2′)
    {
    ans = ‘Sorting Algorithms’;
    }
    if(subject == ‘FA’ && assignment == ‘Assignment-3′)
    {
    ans = ‘Probability Models for Lossy Compression’;
    }
    if(subject == ‘ADCN’ && assignment == ‘Assignment-1′)
    {
    ans = ‘TCP/IP Protocol’;
    }
    if(subject == ‘ADCN’ && assignment == ‘Assignment-2′)
    {
    ans = ‘UDP Protocol’;
    }
    if(subject == ‘ADCN’ && assignment == ‘Assignment-3′)
    {
    ans = ‘WAP’;
    }
    if(subject == ‘DDA’ && assignment == ‘Assignment-1′)
    {
    ans = ‘LCR Algorithm’;
    }
    if(subject == ‘DDA’ && assignment == ‘Assignment-2′)
    {
    ans = ‘HS Algorithm’;
    }
    if(subject == ‘DDA’ && assignment == ‘Assignment-3′)
    {
    ans = ‘GHS-MST Tree’;
    }
    if(subject == ‘SE’ && assignment == ‘Assignment-1′)
    {
    ans = ‘Software Process Model’;
    }
    if(subject == ‘SE’ && assignment == ‘Assignment-2′)
    {
    ans = ‘Testing Strategies’;
    }
    if(subject == ‘SE’ && assignment == ‘Assignment-3′)
    {
    ans = ‘Web Engineering’;
    }
    if(subject == ‘ES’ && assignment == ‘Assignment-1′)
    {
    ans = ‘GCD Processor – Logisim’;
    }
    if(subject == ‘ES’ && assignment == ‘Assignment-2′)
    {
    ans = ‘USB Driver’;
    }
    if(subject == ‘ES’ && assignment == ‘Assignment-3′)
    {
    ans = ‘Firewire’;
    }

    WMLBrowser.setVar(result,ans);
    WMLBrowser.refresh();
    }

     
  • ashish revar 6:32 pm on October 9, 2009 Permalink | Reply  

    WML: Calculator 

    calc.wml is the basic file  coded below to work as basic calculator with another function file which is also provided here,

    <?xml version=”1.0″?>
    <!DOCTYPE wml PUBLIC “-//WAPFORUM//DTD WML 1.1//EN” “http://www.wapforum.org/DTD/wml_1.1.xml”>
    <wml>
    <card id=”card1″ title=”Calculator” newcontext=”true”>
    <p>
    Value1: <br/><input format=”N*M” name=”amount1″ title=”First Amount:”/>
    Operator : <br/><select name=”operator” value=”ADD” title=”Operation:”>
    <option value=”ADD”>Addition</option>
    <option value=”SUB”>Subtraction</option>
    <option value=”MULT”>Multiplication</option>
    <option value=”DIV”>Division</option>
    </select>
    Value2: <br/><input format=”N*M” name=”amount2″ title=”Second Amount:”/>
    Result : = <b>$(answer)</b>
    <do type=”accept” label=”Result”>
    <go href=”calc.wmls#operation(‘answer’,$(amount1),’$(operator)’,$(amount2))”/>
    </do>
    </p>
    </card>
    </wml>

    <?xml version=”1.0″?>

    <!DOCTYPE wml PUBLIC “-//WAPFORUM//DTD WML 1.1//EN” “http://www.wapforum.org/DTD/wml_1.1.xml”>

    <wml>

    <card id=”card1″ title=”Calculator” newcontext=”true”>

    <p>

    Value1: <br/><input format=”N*M” name=”amount1″ title=”First Amount:”/>

    Operator : <br/><select name=”operator” value=”ADD” title=”Operation:”>

    <option value=”ADD”>Addition</option>

    <option value=”SUB”>Subtraction</option>

    <option value=”MULT”>Multiplication</option>

    <option value=”DIV”>Division</option>

    </select>

    Value2: <br/><input format=”N*M” name=”amount2″ title=”Second Amount:”/>

    Result : = <b>$(answer)</b>

    <do type=”accept” label=”Result”>

    <go href=”calc.wmls#operation(‘answer’,$(amount1),’$(operator)’,$(amount2))”/>

    </do>

    </p>

    </card>

    </wml>

    Here, calc.wmls is the function file, means script which contains all the functions which is needed in calc.wml

    extern function operation(result,val1,operate,val2) {

    var ans=0;

    if (operate==’ADD’)

    {

    ans = val1 + val2;

    }

    else if (operate==’SUB’)

    {

    ans=val1 – val2;

    }

    else if (operate==’MULT’)

    {

    ans=val1 * val2;

    }

    else

    {

    ans=val1 / val2;

    }

    WMLBrowser.setVar(result,ans);

    WMLBrowser.refresh();

    }

     
  • ashish revar 6:27 pm on October 9, 2009 Permalink | Reply  

    WML: Configuring Microsoft Internet Information Services (IIS) 

    Configuring Microsoft Internet Information Services (IIS)
    Microsoft Internet Information Server (IIS) is a free Web server that can be acquired with the following operating systems to serve WML pages:
    • Microsoft Windows NT 4 – IIS version 4.0 comes in the NT 4.0 option pack.
    • Microsoft Windows 2000/server – IIS 5.0 is built in to Windows 2000.
    • Microsoft Windows XP – IIS 5.1 is built in to Windows XP.
    • Microsoft Windows 2003 – IIS 6.0 is built in to Windows 2003.
    IIS has a graphical user interface, the Internet Service Manager, for configuring all aspects of the Web server.
    The following step-by-step guide can be used to set up MIME types:
    1. Start the Microsoft Management Console (Start => Run =>MMC) and load the IIS snap-in from the c:\winnt\system32\inetsrv\iis directory.
    The Internet Services Manager can also be opened from Start => Control Panel => Administrative Tools => ‘Internet Information Services Manager’ or ‘Internet Information Services’ depending on the version and Windows Operating System.
    2. Right click on the node that matches the name of your web server (by default: ‘Default Web Site’) and choose the Properties option.

    Configuring Microsoft Internet Information Services (IIS)

    Microsoft Internet Information Server (IIS) is a free Web server that can be acquired with the following operating systems to serve WML pages:

    • Microsoft Windows NT 4 – IIS version 4.0 comes in the NT 4.0 option pack.

    • Microsoft Windows 2000/server – IIS 5.0 is built in to Windows 2000.

    • Microsoft Windows XP – IIS 5.1 is built in to Windows XP.

    • Microsoft Windows 2003 – IIS 6.0 is built in to Windows 2003.

    IIS has a graphical user interface, the Internet Service Manager, for configuring all aspects of the Web server.

    The following step-by-step guide can be used to set up MIME types:

    1. Start the Microsoft Management Console (Start => Run =>MMC) and load the IIS snap-in from the c:\winnt\system32\inetsrv\iis directory.

    The Internet Services Manager can also be opened from Start => Control Panel => Administrative Tools => ‘Internet Information Services Manager’ or ‘Internet Information Services’ depending on the version and Windows Operating System.

    2. Right click on the node that matches the name of your web server (by default: ‘Default Web Site’) and choose the Properties option.

    3. Click on the edit button next to the master properties drop down box.
    4. Select the HTTP Headers tab, and click on the file type button. This will load the registered file types dialog.
    5. Click on the new type button and create a new file type using the below parameters (Refer to figure 1 below). Repeat the procedure for each associated extension:
    1. File Type 1:
    • Associated extension: wml
    • Content type: text/vnd.wap.wml
    2. File Type 2:
    • Associated extension: wbmp
    • Content type: image/vnd.wap.wbmp
    6. Click OK to close all of the open dialogs, and then close MMC or Internet Services Manager itself.
    7. Restart ‘IIS Admin Service’ from the ‘Services’. (Click Start program, Administrative Tools, and click on the Services application) so that the newly added MIME types are picked up.
    IIS - Configuration
     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
esc
cancel