Introduction to Access Grid Development
This document provides an introduction to programming using the Access Grid software. It will introduce new developers to the basic concepts needed for writing small scripts to interact with various Access Grid services, and to understand concepts that will arise when building collaborative applications and services.
This guide assumes a basic knowledge of programming in general, and programming in Python in particular.
Applications that use specific facilities of the Access Grid Toolkit should create an Access Grid application and initialize it. This is needed if, for example, a developer will rely on argument processing, logging, the various configuration classes, or the certificate infrastructure. The two application classes are CmdlineApplication and WXGUIApplication; an example of initializing a CmdlineApplication is as follows.
from AccessGrid.Toolkit import CmdlineApplication
app = CmdlineApplication.instance()
app.Initialize('MyApp')
Standard arguments accepted by all applications are given below.
|
-d, --debug |
Set the debug level of this program |
|
-l, --logfile |
Specify a log file to output logging to |
|
--numlogfiles |
Specify the number of log files to retain |
|
--logfilesize |
Specify the size of log files to retain |
|
-c, --configure |
Specify a configuration file for the program |
|
--version |
Print out what version of the toolkit this is |
Additional command line arguments can be added as follows.
TBD
Many of the Access Grid application classes log their activity. When initialized, this logging facility writes information to a logfile in the user's home directory, with the name of the file derived from the application name given when the application was initialized. In the case of the initialization example above, then, there should exist a MyApp.log file in the Logs directory:
~/.AccessGrid3/Logs
C:\Documents and Settings\%USERNAME%\Application Data\AccessGrid3\Logs
The AG logging support relies on the Python logging module. Applications can use the logging facilities as follows.
TBD
The three configuration classes include SystemConfig, AGTkConfig, and UserConfig. These classes encompass information about the system, the Access Grid toolkit configuration, and the user configuration, respectively (obviously).
Examples of SystemConfig methods include the following. Alternatively, view the full list of SystemConfig methods
GetFileSystemFreeSpace()
Retrieve the amount of free space on the system.GetUsername()
Retrieve the name of the user running the software.
Examples of AGTKConfig methods include the following. Alternatively, view the full list of AGTkConfig methods
GetInstallDir()
Retrieve the software installation directoryGetDocDir()
Retrieve the documentation directory
Examples of UserConfig methods include the following. Alternatively, view the full list of UserConfig methods
GetProfile()
Return path to user profileGetPreferences()
Return path to preferences file
Many of the data types that a developer will encounter are included in a single file, Descriptions.py. Some of the types defined in this file include:
DataDescription
Description of a venue data fileStreamDescription
Description of a multicast or unicast address (i.e., stream)VenueDescription
Description of an Access Grid Venue
VenueState
Description of the contents of an Access Grid Venue
http://www.ci.uchicago.edu/trac/accessgrid/browser/trunk
View the code in Subversion, complete with revision history.
Documentation is generated from the code for each released version.
If you discover any problems with this or other documentation, please file a bug report in Bugzilla under the product 'Documentation'. In particular, the generated documentation is relatively new (as of May 2008), so there may well be problems in this documentation and they should be reported liberally.