The Ganymede XML Client |
The Ganymede server and client suites include a text-mode xmlclient, which can be used to load data and schema information into the Ganymede server, and which may be used to dump data from the server to an XML file.
There are six ways to run the xmlclient
:
Running xmlclient with a file name for a parameter will cause
that file to be loaded and transmitted to the server for action.
The -dump
option will cause the xmlclient to emit to
STDOUT a complete dump of the server's contents in XML format.
The -dumpschema
option dumps out just the schema
definition information, and the -dumpdata
option
dumps out just the data objects.
If you use the -dumpdata
option, there is an
optional sync
parameter that you can use to limit the
kind of data that is written. If you set the sync parameter to
the name of a registered Sync
Channel, the xmlclient will only write out data required for
that Sync Channel..
The -includeHistory
command line flag causes the
xmlclient to dump out the historical fields (creation time,
creator information, last modified time, last modifier
information) in the dump.
The -includeOid
command line flag causes the
xmlclient to dump out the oid attribute for dumped objects,
containing the full Invid for the object. This can be useful in
cases where the xml dump is going to be loaded into a server
running the -magic_import command line flag, and in cases where
the Invid string for the object is used elsewhere as a foreign key
against the Ganymede representation.
The xmlclient assumes that it is being run by the supergash
account by default. Only supergash-level admins are allowed to
use the three dump options. XML files may have the username and
password encoded in the <ganymede> document element, or
these may be specified with the optional username=
and password=
command line arguments. If you don't
want to expose your password on the command line, The xmlclient
will prompt you for your password as needed.
Examples:
xmlclient -dumpschema
This example will prompt for the supergash password and dump the server's schema to the screen.
xmlclient username=jonhart:supergash -dump >
database.xml
This example will prompt for user jonhart's personal supergash password and dump the server's complete contents to the database.xml file.
xmlclient username=broccol password=notReal changes.xml
This example will load the changes.xml file and send its contents to the server.
xmlclient schema.xml
This example will load the schema.xml file and send its contents to the server, prompting for the supergash password if the schema.xml file does not specify username and password.
xmlclient -dumpdata sync=Users > user_sync.xml
This example will dump all data from the Users Sync Channel to the user_sync.xml file.
xmlclient -query 'select object from editable "User" where "UID" >=2000'
This example will dump all users from the Ganymede database whose UID field contains a value equal to or greater than 2000.
See the Ganymede XML Guide for complete details on the XML file format used by xmlclient.
$Date$, $Rev$, $Author$