TclMML

TclMML Documentation

Documentation: Overview

[ Home | Docs | FAQ | Download | CVS | Mailing Lists | Bug Tracker | USPS's MOL Site ]

Using TclMML

package require TclMML
mml::connect -url url username password

The TclMML package implements one public command, mml::connect. This command is used to create an instance connection to either the staging or production MOL server (depending on the value given to the -url switch). Consult the MML documentation for the current URL(s).

The mml::connect command creates a new command (similar to how Tk widgets do). A specific command_name can be specified. Otherwise, a command is created within the mml namespace, and the name of this command is returned. For example:

mml::connect -url https://... mml username password
set mml [mml::connect https://... username password]

Which style you use is mostly a matter of taste. For the rest of our examples we'll assume the former syntax (where the command_name is specified) is used (with a value of mml for the command_name).

Basic Concepts: Nouns & Verbs

There are four main nouns & four main verbs, along with a couple of minor ones. The four main nouns are:

  1. documents
  2. mailing lists
  3. return addresses
  4. orders

The four main verbs are:

  1. upload
  2. list
  3. details
  4. delete

Besides the principal nouns & verbs there are a few minor ones:

Verb + Noun = Noun + Verb = An Action

Our newly created mml command takes a number of combinations of verbs and nouns, and usually some additional -switches & -flags, and sometimes one or more positional parameters. We'll call these combinations of verbs and nouns "actions".

Actions can be specified as either verb noun or noun verb. Use whichever seems most natural to you. For example:

Verb x Noun Action Matrix

v-- Nouns/Verbs --> upload list details delete retrieve map commit configure
documents Yes Yes Yes Yes No No No No
mailing lists Yes Yes Yes Yes No Yes Yes No
return addresses Yes Yes Yes Yes No No No No
orders Yes Yes Yes No No No No No
defaults No No No No Yes No No Yes
handle No No No No Yes No No No
content No No No No Yes No No No
billing address No No No No No No No Yes
errorinfo No No No No Yes No No No
url No No No No Yes No No No

Documenting Specific Actions