Disclaimer: Proximity Corporation provided the information in this article and it was deemed accurate as of 30 May 2007. Apple Inc. is not responsible for the article's content. This article is provided as is and may or may not be updated in the future.
The scripts which artbox uses to configure the data as shipped can also be used to set up data required specifically for a particular customer.
The basic procedure is to create a new file in CSV (comma-separated value) format, which can be maintained by most spreadsheet programs, and create a new initdata.conf file. Details vary depending on what sort of data requires the customisation. These files must be located in:
/usr/artbox/sql/custom
Once you have the data set up, you can get your changes into the database by running:
/usr/artbox/sbin/ab_initdb
Depending on the type of data, you can get updates propagated to the database by running that script again after editing the data files. Just be aware that in most cases, we don't attempt to capture changes to user-modifiable data, as we want to avoid clobbering anything someone may have done using the artbox ui itself. However we do capture additions of new fields etc.
The initdata.conf file can normally be found in /usr/artbox/sql on a production artbox system. It provides instructions as to which data files should be processed using which scripts. An example of what a current (at time of writing) one looks like is:
# $Id: initdata.conf,v 1.5 2004/10/21 06:55:41 ben Exp $ # # Config file for initdata.rb. The first column is the table name, the # second is a list single character flags and the third is an optional # ruby sub-script. Flags are: # # g - .dat file must be generated from a .def file # d - a .dat file is processed directly by the ruby script # r - use script in 3rd colum to insert data rather than a direct copy # # The r flag takes precedence over c and only works if a script is # specified. If the r flag is specified on its own, then the .def file # is read directly by the .rb script # # Columns must be tab separated # <table name> <flags> [script] pxtraitclass gr insTraitClass.rb pxuser rd insUser.rb pxgroup rd insGroup.rb pxgrouphasuser rd insGroupHasUser.rb pxschema gr insSchema.rb pxentitylinktype gr insEntityLinkType.rb pxenum r insEnum.rb pxenumentry r insEnumEntry.rb pxmdfield r insMdField.rb pxtrait gr insTrait.rb pxmdgroup r insMdGroup.rb pxmdgrouphasfield r insMdGroupHasField.rb pxmdmap r insMdMap.rb pxeventstatus gr insEventStatus.rb
The comments at the top explain the flag codes reasonably well. For each sort of data file, you could create a new data file of the appropriate type, and add a line to this file, using the script appropriate to the type of data.
You will need to create your own initdata.conf file inside the custom directory. The database update script will detect this file and execute it's contents.
The script which processes metadata fields is insMdField.rb. The data file needs to have fourteen columns, interpreted as follows:
Metadata groups are inserted with the insMdGroup.rb script. The data file has nine columns, as follows:
Metadata maps are inserted with the insMdMap.rb script. The data file has three columns, as follows:
Once you have a correctly formatted CSV document, the following preparations should be completed when importing data:
For example, if you have custom field metadata in a CSV document named "/usr/artbox/sql/custom/mystation-md.csv", then run the following command: