57

Extended Systems

  • Upload
    binah

  • View
    32

  • Download
    0

Embed Size (px)

DESCRIPTION

Extended Systems. OneBridge 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 (OneBridge Mobile Agent) - PowerPoint PPT Presentation

Citation preview

Page 1: Extended Systems
Page 2: Extended Systems

Extended Systems

OneBridge Mobile Agent

December 2002

Page 3: Extended Systems

Extended Systems

The History of PSP

Page 4: Extended Systems

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 (OneBridge Mobile Agent)• Web Interface for both online and offline use• Processes PSP pages• Rich UI

Page 5: Extended Systems

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

Page 6: Extended Systems

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

Page 7: Extended Systems

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 \Temp\Report.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.

Chris Leffel:

Fix this slide. Maybe needs a graphic?

Chris Leffel:

Fix this slide. Maybe needs a graphic?

Page 8: Extended Systems

Extended Systems

Working with the Mobile Device

Page 9: Extended Systems

Required Files for development

• Embedded Visual Tools

• PocketPC 2002 SDK

• OMA desktop install

Page 10: Extended Systems

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.

Page 11: Extended Systems

Extended Systems

HTML Overview

Page 12: Extended Systems

HTML Overview

All Mobile Agent pages are based on HTML documentsAll Mobile Agent pages are based on HTML documents

<!-– Hello World page -->

<html><body><h1> Hello World!</h1></body></html>

HelloWorld.txt

Page 13: Extended Systems

HTML Overview

Forms are processed similar to the way they are in web programming

Forms are processed similar to the way they are in web programming

<html><body><form method=post ACTION=“formShow.txt">

What is your name?<input type=“text” name=“username” value=“John Doe”><input type=submit value="submit">

</form></body></html>

formCapture.txt

Page 14: Extended Systems

HTML Overview

Forms are processed similar to the way they are in web programming

Forms are processed similar to the way they are in web programming

<html><body>Hello!<data value=username></body></html>

formShow.txt

Page 15: Extended Systems

Extended Systems

Mobile Databases

Page 16: Extended Systems

Mobile Databases

• Need an intro slide

Chris Leffel:

Fix this slide

Chris Leffel:

Fix this slide

Page 17: Extended Systems

Mobile Databases

PSP uses SQL to access databases

• The <recordset...> tag is used to open recordsets

<recordset name=“rs1”

sql=“select * from customers”>

Name: <data value=“rs1.CompanyName”><br>

</recordset>

• See MS SQL Server CE help for SQL help

Page 18: Extended Systems

Mobile Databases

Creating a database using SQL and PSP

<database connectionstring= "Provider=Microsoft.SQLSERVER.OLEDB.CE.1.0; Data Source=\windows\oma.sdf">

<recordset name=“rs1” sql='create database "\Program Files\OneBridge\trainingdemo\demo.sdf" ' action=“open”/>

<recordset name=“rs1” action=“close”/>

Page 19: Extended Systems

Mobile Databases

Creating a table using SQL and PSP

<recordset name=“rs1” sql=“create table Customers (CustomerID nvarchar(64), CompanyName nvarchar(64), ContactName nvarchar(64), ContactTitle nvarchar(64), Address nvarchar(64), City nvarchar(64), Region nvarchar(16), PostalCode nvarchar(10), Country nvarchar(16), Phone nvarchar(24), Fax nvarchar(24))” action=“open”>

<recordset name=“rs1” action=“close”/>

Page 20: Extended Systems

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 - ActiveSync– Slow, SQL is limited– Database size limited to 64K records

Page 21: Extended Systems

Extended Systems

View Libraries

Page 22: Extended Systems

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

Page 23: Extended Systems

View LibrariesList View with page selection popup

Details View

Page 24: Extended Systems

View Libraries – list view

What does a list view do?

• List pagination

• Column sorting

• Detail Linking

Page 25: Extended Systems

View Libraries – list view

• Defined in generateviews.txt – “customer view”

• Used on showall_customers.txt

Page 26: Extended Systems

View Libraries – detail view

What does a detail view do?

• Preformatted reusable HTML

• Easily linked to list views

Page 27: Extended Systems

View Libraries – detail view

• Defined in generateviews.txt – “customer details”

• Used on customer_details.txt

Page 28: Extended Systems

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

Page 29: Extended Systems

View Libraries – search view

• Defined in generateviews.txt – “customer search”

• Used on customer_search.txt

Page 30: Extended Systems

View Libraries – edit view

Why create an edit view?

• Consistent UI

• No need to build dynamic form elements using PSP

Page 31: Extended Systems

View Libraries – edit view

• Defined in generateviews.txt – “customer details”

• Used on edit_customer.txt

Page 32: Extended Systems

View Libraries – edit view

Saving from an edit view

• Copy form variables to record set values

• Save the recordset & redirect

<var "rsView.CompanyName=g_nameEdit">

<recordset name=rsView action=update>

<redirect href="sys://customer_details.txt">

Page 33: Extended Systems

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

Page 34: Extended Systems

View Libraries – search view

• Defined in generateviews.txt – “customer search”

• Used on customer_search.txt

Page 35: Extended Systems

Extended Systems

Variables & Conditional Logic

Page 36: Extended Systems

Variables and Data Types

3 data types:1. Number - All numeric and boolean data

2. String - Character data (Unicode by default)

3. Date - Date and Time values

Variables are global by default

Page level local variables may be specified. When possible, use local variables!

Page 37: Extended Systems

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!

Page 38: Extended Systems

Conditional Logic

<if>…</if>

Conditionally process code

Example:

<if "x+y<0"> Less than zero<else> Greater than or equal to zero</if>

Page 39: Extended Systems

Conditional Logic

<while>… </while>

Used for conditional looping

Example:

<var "x=0"><while "x<10"> <var "x=x+1"> <data value=x><br></while>

Page 40: Extended Systems

Extended Systems

UI Elements

Page 41: Extended Systems

Pop Up Windows

• Give feedback to the user without changing the screen they are looking at.

• See authenticate.txt for sample code.

Page 42: Extended Systems

UI Controls

<BUTTON>

Allows buttons to be set programmatically.

Example:

<NAME="BACK" HREF="index.txt“ SCOPE=“global”>

Page 43: Extended Systems

UI Controls

<MENUITEM>

Allows the navigation menu to be set programmatically

<MenuItem

Name = item identifier,

Value = text,

Href = link,

Action = add | remove,

default = add

Image = path/name of bitmap

/>

Example:<MenuItem name=”cust” value=”Customers” href=“cust.txt”/>

Page 44: Extended Systems

UI Controls

Date Pick

To specify a date-pick control, use "cal:"+optional (default) date as the content of the textarea block.

Example:

<AddViewItem label=“thedate" name=“theDate"><textarea name="varDate" cols=12 rows=1>cal:1/1/2002</textarea></AddViewItem>

Page 45: Extended Systems

UI Controls

Time Pick

To specify a time-pick control, use "tim:"+optional (default) time as the content of the textarea block.

Example:

<AddViewItem label="Time" name="g_time"><textarea name="varTime" cols=12 rows=1>tim:14:00</textarea></AddViewItem>

Page 46: Extended Systems

UI Controls

Signature Capture

Example:

<AddViewItem label="Time" name="g_time"><textarea name="Signature" cols=16 rows=5>sig:</textarea></AddViewItem>

Page 47: Extended Systems

UI Controls

dbSelect

Example:

Chris Leffel:

Fix this slide

Chris Leffel:

Fix this slide

Page 48: Extended Systems

Extended Systems

Debugging

Page 49: Extended Systems

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 (tcpTrace)• Tool shows HTTP request and response data

Page 50: Extended Systems

Debugging

sysMessage

Example:

Chris Leffel:

Fix this slide

Chris Leffel:

Fix this slide

Page 51: Extended Systems

Extended Systems

Miscellaneous Topics

Page 52: Extended Systems

Printing

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.

Page 53: Extended Systems

Printing

Sample Report

• Full color supported

• HTML <table ...> and <img ...> tags are fully supported.

Page 54: Extended Systems

Printing

Need sample code…

Example:

Chris Leffel:

Fix this slide

Chris Leffel:

Fix this slide

Page 55: Extended Systems

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

Page 56: Extended Systems

Internationalization

Need slide with resource file and / or picture of how resource file is used.

Example:

Chris Leffel:

Fix this slide

Chris Leffel:

Fix this slide

Page 57: Extended Systems

Internationalization

<writestring>

Example:

Chris Leffel:

Fix this slide

Chris Leffel:

Fix this slide