Artbox Custom Data Definition

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:

Once you have the data set up, you can get your changes into the database by running:

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.

Configuring an initdata.conf file

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:

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.

Metadata Fields

The script which processes metadata fields is insMdField.rb. The data file needs to have fourteen columns, interpreted as follows:

Metadata Group

Metadata groups are inserted with the insMdGroup.rb script. The data file has nine columns, as follows:

Metadata Map

Metadata maps are inserted with the insMdMap.rb script. The data file has three columns, as follows:

Setup

Once you have a correctly formatted CSV document, the following preparations should be completed when importing data:

  1. Copy the CSV document to /usr/artbox/sql/custom
  2. Convert the line endings of the CSV document to Unix-style endings ('\\n'), if required
  3. Remove any blank rows
  4. Ensure that certain characters are correctly escaped for the database, single quote entries ' should be escaped to \\'
  5. Add an entry to /usr/artbox/sql/custom/initdata.conf to reference the customer specific metadata.

    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:

      mystation-md
      r
      insMdField.rb
  6. Ensure that artbox is not running by running artbox stop
  7. Run the update script and check to see if there are any error messages
      /usr/artbox/sbin/ab_initdb
  8. Restart artbox by running artbox start
Published Date: Feb 20, 2012