Manage Learn to apply best practices and optimize your operations.

Webphone Evaluation Agent

If you want people to be able to access your database via a hand held phone,
you probably know that some phones use HDML and some WML.. here is a SIMPLE
script I thought people might want to evaluate which protocol is supported by
the phone.

This script as is, could be used for a simple page sent to the user. The basic
eval logic could be expanded anyway you want...even a common gateway for many
browser types (handheld,Palm,HTML,etc)

**Notes**.. it only works with HDML or WML phones, anything else as is would
not do anything or return an error.

I do have more complex code that provides the basics to spew pages to the user
in correct format. It allows someone without HDML or WML knowlege to have
pages created by calling a function. exp:
mhtml("This is the info","BOLD;CR")

If I got enough requests for it, I could be perswaded to whip it into a
complete package with some help docs and post it here.

Hope you find this useful. At a minimum, it starts you on the path to wireless

Once you paste this code into an agent, just have your webphone (or emulator)
call the agent normally.
Option Public

Dim doc As notesdocument

Sub Initialize
Dim sess As New notessession
Dim ptype As String

Set doc = sess.documentcontext
ptype = doc.HTTP_ACCEPT(0)
If (Instr(ptype,"text/vnd.wap.wml")) Then
Call wml()
Elseif (Instr(ptype,"text/x-hdml")) Then
Call hdml()
End If
End Sub
Function wml()
Print "Content-type:text/vnd.wap.wml"
Print "<?xml version=""1.0""?>"
Print "<!DOCTYPE wml PUBLIC ""-//WAPFORUM//DTD WML 1.1//EN""
Print "&LTwml>"
Print "&LTcard id='home'> "
Print "&LTp>&LTstrong>This is the WML page</strong></p>"
Print "</card>"
Print "</wml>"
End Function
Function hdml()
Print "&LTHDML VERSION=3.0>"
Print "&LTDisplay>"
Print "This is the HDML page"
Print "</Display>"
Print "</HDML>"
End Function

Dig Deeper on Domino Resources - Part 5

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...