Extended Systems One Bridge Mobile Agent December 2002


Extended Systems One. Bridge Mobile Agent December 2002

Extended Systems The History of PSP

PSP History PSP is a markup language (Pocket Server Pages) • HTML/XML based • Approx. 66 PSP-specific tags + HTML • PSP tags support mobile applications OMA (One. Bridge Mobile Agent) • Web Interface for both online and offline use • Processes PSP pages • Rich UI

PSP History Using PSP requires a basic understanding of HTML and web development. Who is PSP for? • Web developers • Novice developers eager to create applications of moderate complexity • Experienced developers eager to rapidly generate complex online/offline data-driven applications

PSP History Why chose PSP? • Rapid application development and prototyping • Built-in support for mobile applications – Signature capture – Online/offline database access – Print HTML on portable printers via IR • Familiar web interface • Applications are easy to modify – PSP is an interpreted language – No compiler or special tools required to write PSP

Chris Leffel: Fix this slide. Maybe needs a graphic? How OMA works 1. The user clicks on a link or executes a form, or (at startup), a default page is selected. 2. The page is loaded from the database, from the file system, or from an HTTP server. 3. The file is scanned from beginning to end. PSP tags are parsed and interpreted. All non-PSP tags are output to the output file. (The output file is located at TempReport. htm). 4. The resulting HTML file (from the non-PSP tags, and from the interpreted PSP tags) is passed to an HTML rendering control that displays the result on the screen. 5. OMA waits for the next user action to provoke the execution of the next page.

Extended Systems Working with the Mobile Device

Required Files for development • Embedded Visual Tools • Pocket. PC 2002 SDK • OMA desktop install

OMA File Server • Allows you to easily move files from your development computer to the emulator or device. • Sets the default OMA application to run.

Extended Systems HTML Overview

HTML Overview All Mobile Agent pages are based on HTML documents Hello. World. txt <!-– Hello World page <html> <body> <h 1> Hello World!</h 1> </body> </html> -->

HTML Overview Forms are processed similar to the way they are in web programming form. Capture. txt <html> <body> <form method=post ACTION=“form. Show. txt"> What is your name? <input type=“text” name=“username” value=“John Doe”> <input type=submit value="submit"> </form> </body> </html>

HTML Overview Forms are processed similar to the way they are in web programming form. Show. txt <html> <body> Hello! <data value=username> </body> </html>

Extended Systems Mobile Databases

Chris Leffel: Fix this slide Mobile Databases • Need an intro slide

Mobile Databases PSP uses SQL to access databases • The <recordset. . . > tag is used to open recordsets <recordset name=“rs 1” sql=“select * from customers”> Name: <data value=“rs 1. Company. Name”> </recordset> • See MS SQL Server CE help for SQL help

Mobile Databases Creating a database using SQL and PSP <database connectionstring= "Provider=Microsoft. SQLSERVER. OLEDB. CE. 1. 0; Data Source=windowsoma. sdf"> <recordset name=“rs 1” sql='create database "Program FilesOne. Bridgetrainingdemodemo. sdf" ' action=“open”/> <recordset name=“rs 1” action=“close”/>

Mobile Databases Creating a table using SQL and PSP <recordset name=“rs 1” sql=“create table Customers (Customer. ID nvarchar(64), Company. Name nvarchar(64), Contact. Title nvarchar(64), Address nvarchar(64), City nvarchar(64), Region nvarchar(16), Postal. Code nvarchar(10), Country nvarchar(16), Phone nvarchar(24), Fax nvarchar(24))” action=“open”> <recordset name=“rs 1” action=“close”/>

Mobile Databases Two database providers supported for Windows CE • SSCE: SQL Server CE Provider – Very fast and efficient for large databases – Few SQL limitations • CEDB: Pocket Access Provider – Databases are easier to create - Active. Sync – Slow, SQL is limited – Database size limited to 64 K records

Extended Systems View Libraries

View Libraries • A set of PSP defined tags used to render database data • Provides a framework delivering easily modified applications. • Automatically generates code to handle sorting and pagination • Makes presentation of database information easy to define and manage

View Libraries List View with page selection popup Details View

View Libraries – list view What does a list view do? • List pagination • Column sorting • Detail Linking

View Libraries – list view • Defined in generateviews. txt – “customer view” • Used on showall_customers. txt

View Libraries – detail view What does a detail view do? • Preformatted reusable HTML • Easily linked to list views

View Libraries – detail view • Defined in generateviews. txt – “customer details” • Used on customer_details. txt

View Libraries – search view What does a search view do? • Creates HTML form elements dynamically • Developer does not need to be concerned with HTML formatting

View Libraries – search view • Defined in generateviews. txt – “customer search” • Used on customer_search. txt

View Libraries – edit view Why create an edit view? • Consistent UI • No need to build dynamic form elements using PSP

View Libraries – edit view • Defined in generateviews. txt – “customer details” • Used on edit_customer. txt

View Libraries – edit view Saving from an edit view • Copy form variables to record set values • Save the recordset & redirect <var "rs. View. Company. Name=g_name. Edit"> <recordset name=rs. View action=update> <redirect href="sys: //customer_details. txt">

View Libraries – search view What does a search view do? • Creates HTML form elements dynamically • Developer does not need to be concerned with HTML formatting

View Libraries – search view • Defined in generateviews. txt – “customer search” • Used on customer_search. txt

Extended Systems Variables & Conditional Logic

Variables and Data Types 3 data types: 1. Number 2. String 3. Date - All numeric and boolean data Character data (Unicode by default) Date and Time values Variables are global by default Page level local variables may be specified. When possible, use local variables!

Variables and Data Types Declaring variables – A local string: <var expr=“local string s=‘this is a string’”/> <var “local s=‘this is a string’”> Using variables – An expression: <var expr=“total=total+price*discount”/> <var “total=total+price*discount”> Shortcut forms are easier to read, but not XML compliant!

Conditional Logic <if>…</if> Conditionally process code Example: <if "x+y<0"> Less than zero <else> Greater than or equal to zero </if>

Conditional Logic <while>… </while> Used for conditional looping Example: <var "x=0"> <while "x<10"> <var "x=x+1"> <data value=x> </while>

Extended Systems UI Elements

Pop Up Windows • Give feedback to the user without changing the screen they are looking at. • See authenticate. txt for sample code.

UI Controls <BUTTON> Allows buttons to be set programmatically. Example: <NAME="BACK" HREF="index. txt“ SCOPE=“global”>

UI Controls <MENUITEM> Allows the navigation menu to be set programmatically <Menu. Item Name = item identifier, Value = text, Href = link, Action = add | remove, default = add Image = path/name of bitmap /> Example: <Menu. Item name=”cust” value=”Customers” href=“cust. txt”/>

UI Controls Date Pick To specify a date-pick control, use "cal: "+optional (default) date as the content of the textarea block. Example: <Add. View. Item label=“thedate" name=“the. Date"> <textarea name="var. Date" cols=12 rows=1>cal: 1/1/2002</ textarea> </Add. View. Item>

UI Controls Time Pick To specify a time-pick control, use "tim: "+optional (default) time as the content of the textarea block. Example: <Add. View. Item label="Time" name="g_time"> <textarea name="var. Time" cols=12 rows=1>tim: 14: 00</textarea> </Add. View. Item>

UI Controls Signature Capture Example: <Add. View. Item label="Time" name="g_time"> <textarea name="Signature" cols=16 rows=5> sig: </textarea> </Add. View. Item>

Chris Leffel: Fix this slide UI Controls db. Select Example:

Extended Systems Debugging

Debugging • OMA can generate a log file • The log file shows details of PSP code execution • Logging may be activated manually or via code • • Debugging online applications can be difficult Server problem or client problem? Very important to have a tool (tcp. Trace) Tool shows HTTP request and response data

Chris Leffel: Fix this slide Debugging sys. Message Example:

Extended Systems Miscellaneous Topics

Printing of HTML via IR is supported. Headers, footers, images, pagination are supported. Printing is FAST OMA auto-detects the printer and determines if it is supported. Driver for Canon BJC- series printers included. Additional drivers produced as needed.

Printing Sample Report • Full color supported • HTML <table. . . > and <img. . . > tags are fully supported.

Chris Leffel: Fix this slide Printing Need sample code… Example:

Internationalization • View library strings (labels) may be internationalized • XML resource files define strings for different languages • The Resource Library is used to load resources • Applications may be designed to dynamically switch language at user request

Chris Leffel: Fix this slide Internationalization Need slide with resource file and / or picture of how resource file is used. Example:

Chris Leffel: Fix this slide Internationalization <writestring> Example:
- Slides: 57