Palm::ListDB::Writer - Create databases for Palm List application


NAME

Palm::ListDB::Writer - Create databases for Palm List application


SYNOPSIS

  use Palm::ListDB::Writer;
  my $db = new Palm::ListDB::Writer
    "MyDataBase",
    "label1" => "Name",
    "label2" => "Address");
  $db->add("Private", "Wife", "16 Localstreet, Netcity", "Some comments");
  $db->add("Public", "John Doe", "1 Main St., Connecticut", "Blah blah");
  $db->write("addr.pdb");


ABSTRACT

  Palm::ListDB::Writer creates databases for the Palm utility List.


DESCRIPTION

Palm::ListDB::Writer can be used to create databases for the Palm utility List, a simple but convenient database application. List is written by Andrew Low (roo@magma.ca, http://www.magma.ca/~roo).

List databases consist of a collection of records, each having two label fields and one note field (arbitrary data).

The basic usage is to create a Palm::ListDB::Writer object with attributes like the name of the database, the primary and secondary field labels, and then add records by calling its add() method.

The write() method writes the collected data out in the form of a Palm database.

Limitations posed by the Palm operating system and/or the List application: database name - 31 characters; field names - 15 characters; category names - 15 characters; 15 categories excluding the default (Unfiled) catagory; field values - 63 characters; length of note data - 1023 characters.

This module is not related to the Palm::ListDB manpage; the latter can also import Palm List databases, and requires some knowledge about Palm databases.


METHODS

new database, [ attributes ]
Default constructor for a new database object.

new() requires one argument, the name of the database.

Initial attributes for the database can be specified after the database name in the form of key => value pairs:

label1
The name for the primary record field, max. 15 characters.

label2
The name for the secondary record field, max. 15 characters.

cat
An array reference with the names of the categories. Max. 15 categories are allowed, and category names must not exceed 15 characters in length.

autocat
If non-zero, new categories are automatically added when records are added. Defaults to true if no initial category names were supplied.

Additional methods can be added later with the add_cat() method.

readonly
If true, the database will be readonly and cannot be modified by the List application.

backup
If false, the database will not be backupped upon the next HotSync. Note that the List application may change this, for example when modifications are made.

private
If true, the database is private and cannot be beamed.

truncate
Controls truncation of names and fields that are too long. If zero, no truncation takes place (the program is terminated). If one, excess data for the record fields is truncated. If two, also truncates names for categories and fields. If three, also truncates the name of the database if needed.

add category, field1, field2, note data
As the name suggests, add() adds records to the database.

Add() takes exactly four arguments: the category for the record, its first field, its second field, and the note data. Fields may be left empty (or undefined), but not all of them.

If the named category does not exists, and autocat is in effect, it is automatically added to the list of categories.

Add() returns true if the record was successfully added.

add_cat name
Adds a new category. One parameter, the name of the category to be added. If the category already exists, nothing happens.

categories
Returns an array with the current set of categories. Note that this excludes the (default) 'Unfiled' category.

write filename
Write() takes one argument: the file name for the database.

Returns true if the database was successfully written.


SEE ALSO

http://www.magma.ca/~roo web site for the Palm List application.

the Palm::ListDB manpage.


AUTHOR

Johan Vromans, <jvromans@squirrel.nl>


COPYRIGHT AND LICENSE

Copyright 2003 by Squirrel Consultancy

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

 Palm::ListDB::Writer - Create databases for Palm List application