CASL Conduit
To provide an overview of the CASL Conduit we'll look at the following:
- How the dbfile definition instructs the conduit to
perform a HotSync operation
- How to use PRC Settings to specify the creator ID of
your CASL database files
- How to use CondReg to register conduit settings
- How to create a companion desktop version of Palm app
and share data
- How to use RemCond to unregister conduit settings
The CASL Conduit
CASL comes with a conduit
that serves as a common conduit for all CASL databases. The way that the database files are
defined, your PRC file is set, and the conduit
is registered (with Windows registry), defines how the CASL conduit will behave with each database.
The
following configuration settings are possible with the CASL conduit:
Configuration setting |
normal CASL options |
CASLpro options |
How to set |
Synchronization preference |
pc_to_pda, pda_to_pc, merge, none |
same |
sync_pref option in dbfile definition |
Database format |
CASL database, or ODBC |
same |
data_source_name option in dbfile
definition |
Creator ID |
defaults to "CASL", no change
possible |
defaults to "CASL", or your
program's creator ID |
no action needed for default, or use
CASLide menu option Project | PRC Settings, and register with CondReg
utility |
Application name displayed during the Hotsync operation
and in the
"Custom" window of the Palm Hotsync manager |
defaults to "CASL", no change
possible |
defaults to "CASL", or your
program's name |
no action needed for default, or
register with CondReg utility |
HotSync folder
Note: In case of ODBC DSN path, this is
used as temporary working folder |
defaults to "C:\Palm\user\ Casl\", no change possible
Note: space added to path for wrapping
|
defaults to "C:\Palm\user\
Casl\",
or "C:\Palm\user\ app_folder\"
Note: space added to path for wrapping
|
no action needed for default, or
register with CondReg utility |
Note: The CASL conduit only works with
Windows. For other platforms you'll need to write your own conduit.
See
www.palmos.com for conduit development options.
There are also many instances where the Palm Memopad conduit, or Palm backup
conduit can be used to get CASL data on a PC.
We'll look at each of these configuration properties one
at a time.
Conduit Settings Using Dbfile Object
The CASL conduit will only perform a HotSync operation on
a CASL database file defined using the dbfile object.
From the CASLide Manual, a dbfile definition has
the following syntax:
dbfile name;
{ field field_var, …. }
{ sync_pref orientation; }
{ data_source_name string_expression; }
end;
For example, a dbfile definition might look like this:
dbfile dbMydata;
field sField1;
field sField2;
sync_pref merge;
data_source_name "myODBClink";
end;
The variables sField1 and sField2 must have been
previously defined, and the type declarations must be consistent with the
field definitions of the ODBC data source, for example:
variables;
string sField1;
string sField2;
end;
Synchronization Preference
sync_pref defines the type of
synchronization, which will be performed between your PDA and the PC
application.
Constant |
Description |
pda_to_pc |
Replaces PC data with PDA data |
pc_to_pda |
Replaces PDA data with PC data |
merge |
New records from either are transferred
to the other |
none |
No synchronization take place in either
direction. |
Database format
data_source_name is optional.
By leaving the data_source_name specification out of the
dbfile definition, you'll be specifying that your CASL database will be saved on
the PC using the CASL database format. This is a text file with header
information, followed by data record information in a comma separated value (csv)
format. For details, see the cdb format specified in the CASLide Manual.
By specifying a data_source_name, your CASL database will
be saved on the PC using the ODBC object format.
When specified, data_source_name defines
the name of the ODBC link you have created on your PC. This allows you to
synchronize with databases that support the ODBC object, such as Access, SQL Server, Oracle, or an Excel
spreadsheet.
The DSN string can be up to 31 characters long and may
contain spaces. If an equals sign is found in the data_source_name string then
it is assumed that the string is the full connect string. If not then it will be
used as a DSN name in the default connect string "DSN=<name>;UID=;PWD=".
You will need to use the full connect string syntax if
you have password protected your PC database as is common, for example, with
Access databases, "DSN=myODBClink;UID=username;PWD=myPassword".
For more information about DSN connect strings, see Chapter 5 in the Microsoft
ODBC SDK Programmer's Reference.
Conduit Settings Using PRC Settings
For the HotSync operation to use other than the default Application
Name and Hotsync Folder, the creator ID of all CASL database must be set to use
that of its application. This is done with the CASLide menu option Project
| PRC Settings. You check the "Database creator ID" option under
the textbox where you enter your program's creator ID. This option is only
available with CASLpro.
Conduit Settings Using CondReg
Before the CASL conduit can perform a HotSync operation,
the CASL conduit file must be copied to the user's HotSync path, and it must be
registered with the Palm HotSync manager. For a PC with the CASLide
installed, these tasks have been done by the CASL installation program, for all
other PC's the CondReg.exe utility performs the necessary copy and registration
tasks.
CondReg.exe requires the CASL conduit dll file,
CASLcn20.dll,
to be available. You should also
ensure that two standard Microsoft files, MFC42.DLL and MSVCRT.DLL, are also
installed in the user's Windows folder. These files are generally present.
All these files are located in your ".\CASLxx\" folder, where xx
is the version number. The
full path will depend on your installation, but it's default location would
be in the form of, "C:\Program Files\CASLsoft\CASLxx\".
The syntax of CondReg is as follows:
CondReg DLLpath -Appname "name" -CreatorID id -Directory
"dir"
CondReg.exe is used from the DOS prompt, the Start | Run
line, in a command line in a Windows shortcut, or in a batch file.
An example of a command string which might be used for a
normal CASL database, or a default CASLpro database:
CondReg "C:\temp"
An example of a full command string which might be used
for a CASLpro database:
CondReg "C:\temp" -Appname "My
App" -CreatorID FRED -Directory "My App Folder"
NOTE: When specifying the DLLpath, there is no
trailing backslash. If the path name contains spaces, then it will need to be
enclosed in quotes.
In both cases, this command will copy the CASLcn20.dll file from "C:\temp",
and create a HotSync Registry entry. Before the new settings can take
effect, the HotSync manager must be restarted (exited and restarted). The details of the HotSync registry entry are explained
below.
Creator ID
Specifying a, -CreatorID id, option on the CondReg
command string will only make sense if you have a registered version of CASLpro,
and you've checked the "Database creator ID" option on the PRC
Settings dialog box.
When using this option you'll want "id" to be
your program's creator ID.
Application Name
Specifying a, -Appname "My
App", option on the CondReg command string will only make sense if you have
a registered version of CASLpro, and you've checked the "Database creator
ID" option on the PRC Settings dialog box.
When using this option you'll want "My App" to
be the program name that's displayed during a Hotsync operation, and in the Custom window of the Palm Hotsync
manager. During a Hotsync operation, the Hotsync progress dialog displays
"Synchronizing My App" while synchronizing your application's
databases.
If you don't use this option, or it's unavailable,
"CASL" is displayed during a Hotsync operation, and in the Custom window of the Palm Hotsync
manager. During a Hotsync operation, the Hotsync progress dialog displays
"Synchronizing CASL" while synchronizing CASL databases.
Tip: After restarting the HotSync manager,
checking your Custom window of the Palm HotSync manager is a good way to
determine if CondReg performed properly.
HotSync Folder
Specifying a, -Directory
"My App Folder", option on the CondReg command string will only make
sense if you have a registered version of CASLpro, and you've checked the
"Database creator ID" option on the PRC Settings dialog box.
When using this option you'll want "My App
Folder" to be the subfolder under
the user's HotSync folder where databases are read from and written to
during the Hotsync operation. The full path
specification will be of the form, "C:\Palm\user\My App Folder\", depending on
each PC's individual configuration. Be careful not to use the same folder name for
applications with different creator ID's. If you're synchronizing to an ODBC source,
it can be considered a temporary folder and is not the location of the PC
database itself, which is defined by the ODBC DSN link.
If you don't use this option, or it's unavailable, the "Casl" subfolder
under the user's HotSync folder is used. The full path
specification will be of the form, "C:\Palm\User\Casl\", depending on
each PC's individual configuration.
Installing a CASL database onto a Palm
device
For installing a CASL formatted database file from your
PC to a Palm device for the first time, you use the CDI extension. The CDI files
must be located in the HotSync folder that's registered with the HotSync manager
for your application. The CASL
conduit will install database files with this extension onto a user's Palm
device. There are more details about this in the CASLide Manual.
CASL Desktop Companion for Palm OS
Application
The easiest way to provide a desktop version of your Palm
OS application is to compile your CASL program for the Windows target platform,
and use the CASL database format. The Windows targeted application is compiled
to pseudo-code, which is interpreted by the CASL runtime, CASLwin.exe.
CASLwin programs can easily access a CASL formatted database. If you use
this strategy your installation program will also need to install the Windows
version of your CASL program, the CASLwin.exe runtime, and the runtime's
associated dll files. For details you can refer to the CASLide manual.
A more sophisticated strategy would be to create a
Windows version by using RAD Tool which supports ODBC access, such as Visual
Basic or Delphi. Your Windows application could be easily programmed to
access the ODBC database, or there are 3rd party ActiveX objects, which allow
access to the CASL database format. SingeDB is one such object, provided
by LFS Informatica, http://www.singera.com/Palm/.
As the CASL database format is basically a text-based csv format, manually
coding access isn't that difficult either.
RemCond
The utility RemCond.exe is used to remove a CASL HotSync conduit registry entry.
The syntax is as follows:
Remcond -CreatorID id -KeepDLL
CreatorID |
"id" is the application's
creator id |
KeepDLL |
If specified, the CASL conduit dll
CASLcn20.dll will not be deleted. |
Home | News | Community | Products | Download | Support | Sales | About CASL
|