Channel Designer

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

      WMChannelDesigner.htm

 

20051018 Version 1.0.1

Pablo Cepeda

20051017 Version 1.0.0

Karina Spak


 

INDEX

 

 

CHANNEL INTRODUCTION.. 3

CHANNEL COMPONENTS. 3

CHANNEL EXECUTION.. 3

CHANNEL DESIGN AND CONSTRUCTION.. 5

EXAMPLES. 9

EXAMPLE 1. 11

EXAMPLE 2. 13

EXAMPLE 3. 15

EXAMPLE 4. 18

EXAMPLE 5. 21

EXAMPLE 6. 26

DYNAMIC CHANNELS. 29

EXAMPLE. 29

ADVANCED TOPICS. 30

MULTIPLE SQL QUERIES. 30

EXAMPLE. 32

BIBLIOGRAPHY.. 33


 

 

CHANNEL INTRODUCTION

 

A channel is a web application that runs on the wireless mobile client. It is composed of various items or files.

 

 

CHANNEL COMPONENTS

 

A channel is composed of different items.

 

 

 

 

 

 

 

 

CHANNEL EXECUTION

 

When a channel is downloaded or updated during the synchronization process, several steps are taken.

 

 

Presynchronization: (Optional). In this step some queries are executed creating result files that can be send to the server.  To do this, a file named ChannelName_pre.mbq must be coded. [ 1 ]

 

Synchronization: Data is sent to the server (if there is any), new data and/or applications are downloaded from the server (if there are any). The data downloaded is a .zip file that contains all the content (queries, templates, etc) of the channel. The file is unzipped during this process.

 

PostSyncronization: (Optional). This step is done after synchronization and only if synchronization was successful. It is executed to make updates on the database. It can be used for example to delete data that is no longer necessary in the client PDA because it has already been sent to the server. [ 1 ]

 

Execution of dbl file: This file is used to change the database structure and/or to fill and/or delete rows of tables in the PDA client. The file is transferred from server to client during synchronization. The name of the file is ChannelName.DBL. [ 2 ]

 

Finalization: (optional). The structure is the same as that of postsync, with the difference that final is executed after the database is updated in the WireLess Mobile client.

 


 

CHANNEL DESIGN AND CONSTRUCTION

 

To create new channels take the following steps

 

1)      Open your browser, and write http://localhost/wmbsync/admin/ in the address bar.

 

 

2)      Login with your user and password

 

 

 

3)      Choose Channel management from the menu.

 

 

 

 

4) Click on New.

 

 

 


5) Enter the channel Name and click on Accept. DO NOT use special characters (accent, space, dot, underscore, apostrophe).

 

 

 

For this example write MYCHANNEL

 

A message like this should appear

 

 

 

6) Complete the form. Here is a description of the fields.

 

URL:  Channel’s inchecking URL for data submission. This is an advance item and we won’t   be using it for now. It can be used for example to download different data for different users.

In this example leave it blank.

 

Title: Channel’s title. It appears on the PDA homepage.

Example: EXAMPLE CHANNEL.

 

Description: Channel’s Description.

Example: This is my first channel.

 

CTI:  Catalogue title. Is the catalog button name, enter the button text that will appear on the PDA home page as access to the catalog.  (Only here for backward compatibility.)

 

ETI: List title. (Only here for backward compatibility.)

 

 

CPS Type: is the format of the input data.

·        CSP XmlE Data + CorpAliasSource Always select this option.  The others are there only for backward compatibility.

 


Available Devices: You can select the clients. For each client, a folder will be created when generating the content of the channel.

In this example we select Pocket PC 2002 because we are generating this channel for a Symbol 8100 with PocketPC 2002.

 

Set xls skins button: This is an advanced item and we are not going to use it in this example.

 

 

7) Now click on the Input Editor from the menu.

 

 

 

8) The next screen should appear.

 

 

 


Next there is a description of the fields.

 

DataSubmit Url: Url for data submission. In this example write  http://localhost/getorders.asp. [ 1 ] This field becomes necessary when a _pre synchronization file exists, all the data is sent to this page.

After filling the field click on the save button.

 

Form Submit Items: Pages that generates form data to be sent via WMServer at synchronization time. FormSubmit items can be generated with the WireLess Mobile Server. They require a destination url for outgoing data and there’s possible to select a custom XSL for each form.

 

Blob Definitions: Management of attached files also called BLOBs (for Binary Large Objects).

They are all the files that belong to a channel. This includes:

 

 

Blobs have a source file and a destination file name that may have different names.

Destination file names must be unique. If not, an error message will appear.

After selecting the source file, the destination file name and the device type click on the add blob button.

 

To follow the example described here you should download the example file (WmMyChannel.zip) from www.softogo.com from the wireless mobile section, and then unzip it into the ctgData folder of MYCHANNEL.

 

In MYCHANNEL example:

Changing destination filenames makes easier to reuse the same file in different channels.

 

 

9) Your channel is ready.  You can always go back to the Channel Management screen or the Input Editor to change anything.

 


.

EXAMPLES

 

 

The channel example we just made has various simple examples to see how a channel works.

We will look at them thoroughly. You can execute each of them by clicking on the respective link.

 

First of all we will look at the .dbl file to see what format the database has. For these simple examples we will use the same .dbl all the time, but as we mentioned before the .dbl is generated every time we do the synch process so the .dbl can be different each time.

 

 

Database

 

If you edit the .dbl file you will see this code:

 

<DBLFILE>

<VERSION NUM="1"></VERSION>

<DATABASE>

 

<SQL>DROP TABLE CLIENTS</SQL>

<SQL>CREATE TABLE CLIENTS ( CodCli integer PRIMARY KEY, Client nvarchar(20), CliMail nvarchar(20))</SQL>

<DATA-ADD TABLE="CLIENTES" FIELD01="CodCli" FIELD02="Client"  FIELD03="CliMail">

0001|FRODO|frodo@mail.com

0002|GANDALF|gandalf@mail.com

0003|LEGOLAS|legolas@mail.com

0004|ARAGORN|aragorn@mail.com

0005|EOWIN|eowin@mail.com

</DATA-ADD>

<SQL>CREATE INDEX iCodCli ON CLIENTES(CodCli)</SQL>

 

<SQL>DROP TABLE NEWCLIENTS</SQL>

<SQL>CREATE TABLE NEWCLIENTS ( CodCli integer PRIMARY KEY, CliName nvarchar(20), CliMail nvarchar(20), Sended integer)</SQL>

 

</DATABASE>

</DBLFILE>

 


This means that the next tables are generated

 

CLIENTS

CodCli

Client

CLiMail

0001

FRODO

frodo@mail.com

0002

GANDALF

gandalf@mail.com

0003

LEGOLAS

legolas@mail.com

0004

ARAGORN

aragorn@mail.com

0005

EOWIN

eowin@mail.com

 

 

NEWCLIENTS

CodCli

CliName

CliMail

 


EXAMPLE 1

 

In this example you have to write a client code (in this case a number from 1 to 5), then click ok.

This will perform a query to the database (on the PDA) and display the client name.

 

 

 

 

 

Files involved:

 

Home.html

Example1.tpl

Example1.qry

 

 

How it works:

 

If you edit the homepage, the part of the code that involves example1 is

 

<a href="call://DisplayList?tpl=Example1.tpl">

example 1

</a>: Input a Client Code with the keyboard and bring the data of that client

 

 

This means that when you click on example1, the template example1.tpl will be displayed.

 


We will examine example1.tpl. We will only look at the part of the code that is relevant.

 

<form method="post" name="client" action="call://DisplayList?qry=example1.qry&tpl=example1.tpl">

     Code: <input size="8" name="CODCLI" value="$CODCLI$">

     <input type="submit" value=" OK " name="ok"><br><br>

     Name: <input disabled type="text" value="$NOMCLI$" name="ok">

</form>

 

This form has two fields, Code and name of the client. Each time the form is submitted a query is performed (example1.qry), and the results are displays through the template example1.tpl (the same template each time).

 

Example1.qry

 

.#.EVAL

(EXITIF CID EQ "")

(DBOPEN $CID$)

.#.SQL

SELECT Client

FROM CLIENTS

WHERE CodCli = '$CODCLI$'

.#.EVAL

(SET NOMCLI $1$)

 

This file performs an sql query that returns the client name of the client with code CodCli (which value is the variable CODECLI that was in the .tpl). It then sets the result in a variable called NOMCLI.

 

 


EXAMPLE 2

 

This example performs a query to the database and displays the next valid client code.

 

 

 

 

 

Files involved:

 

Home.html

Example2.tpl

Example2.qry

 

 

How it works:

 

If you edit the homepage, the part of the code that involves example2 is

 

<a ref="call://DisplayList?qry=Example2.qry&tpl=Example2.tpl">

  example 2

</a>: Generate next client code automatically

 

When you click the example 2 link the query named Example2.qry will be performed and the results displayed through the template Example2.tpl.

 

 


Let´s first look at the query:

 

Example2.qry

 

.#.EVAL

(EXITIF CID EQ "")

(DBOPEN $CID$)

.#.SQL

SELECT MAX(CodCli)

FROM CLIENTS

.#.EVAL

(SET LASTCODE $1$)

(INCREMENT LASTCODE)

 

The query selects the Client code with the biggest value, then set a variable with that value named LASTCODE. Finally it increments that variable by one.

 

Now let´s look at the important part of the .tpl

 

<form method="post" name="client" action="">

  Client #: <input disabled size="12" name="LASTCODE" value="$LASTCODE$">     

</form>

 

In this form we receive the variable LASTCODE we queried from the hompage and display it in an input field.

 


EXAMPLE 3

 

This example performs a query and displays a list box with all the client codes that are in the database. You have to choose one and then click ok. This will perform another query and the name and email of the client will be displayed.