(This program is not part of the regular Version 4.0 package, but a special distribution package is available.)
HARCIMPORT is a batch mode alternative to using the interactive SDA Manager. This procedure (named 'harcimport.jar') is a Java program that reads a HARC file and imports its contents into a Version 4 SDA database. Before you can use HARCIMPORT for the first time, the system administrator must do some editing of the 'harcimport.jar' file during installation. This procedure is described in the installation instructions below.
Before running the HARCIMPORT program, you must prepare a batch options file. The current document describes the contents of such an options file. The full pathname of this file is then passed to the Java program at the end of the JAVA command line. An example of the Java command line is given below.
Note that the configuration specifications for Version 4 of SDA are somewhat different from Version 3 of SDA. Not all of the Version 3 HARC file specifications are relevant for setting up an SDA dataset in Version 4. HARC file specifications that are no longer applicable to Version 4 are simply ignored by HARCIMPORT.
There is also one incompatibility between the HARC files of Version 3 and the equivalent HARC files of Version 4. This difference has to do with specifying the location of a file available for downloading, using the 'DLFILE=' keyword. In Version 3, the location of such a file was given as a URL. In Version 4, however, the location must be given as an absolute pathname. Therefore, before using HARCIMPORT with a Version 3 HARC file, you need to search for 'DLFILE=' keywords in the HARC file and change the specified URLs to absolute pathname locations.
See the HARC file documentation for information on the applicable specifications and for a cross- reference between the fields used by the Version 4 SDA Manager and the HARC file specifications.
These keywords must be given in lower case, and all of the characters are significant. If a specification requires multiple lines, put a backslash (\) at the end of each line that will be continued to another line. (See some examples below.)
Keyword Possible Specification Default (if no keyword) _____________________________________________________________________ harc= full pathname of the HARC file REQUIRED globalopts= ID of global options REQUIRED (see below) datasets= IDs of the datasets in Import ALL datasets the HARC file to import and/or REPLACE (see below) groups= permission groups to which No permissions the imported datasets will granted be added (see below)
If one of the datasets is already in the database, it will first be deleted and then it will be replaced using the specifications given in the HARC file.
If you want the datasets to be available to everyone who has access to your data archive, specify the 'anonymous' group like this: groups=anonymous.
If no groups are specified, the datasets imported will not be accessible to anyone, until you later use the SDA Manager to grant access to specific groups.
harc = /sa/sdatest/harcsda globalopts = standard_options groups = anonymous
harc = /sa/sdatest/harcsda globalopts = standard_options datasets = study1 study2 study3 \ study7 study9 study11 groups = research1 research2
harc = /sa/sdatest/harcsda groups = research1 research2 globalopts = new_globaloptions
You should now see a 'harcimport.jar' file and a 'lib' directory (containing several other auxiliary jar files). You should also see a 'harcimport.properties' file that contains database configuration information.
% tar xzvf harcimport.tgz
The 'harcimport.properties' file needs to be edited to conform to your MySQL installation's settings. Then it needs to be copied into the harcimport.jar file using the Java JDK 'jar' utility. These steps are explained next.
db.driverClassName=com.mysql.jdbc.Driver db.url=jdbc:mysql://localhost:3306/sdaschema db.username=myusername db.password=mypassword
The first two specifications ("db.driverClassName" and "db.url") will probably not need to be edited. The name "com.mysql.jdbc.Driver" is a hard-wired name and should not be altered. The "db.url" specification would only need to be changed in some rare instances -- where you run MySQL on a non- standard port for example. However, the "myusername" and "mypassword" entries will need to be replaced with a username and password that are valid for your MySQL installation.
The 'jar' utility program is a standard part of the Java JDK and is in the JDK's 'bin' directory (along with 'java', etc.).
jar -uvf harcimport.jar harcimport.properties
Once these steps have been completed, the HARCIMPORT program is ready to be used, as shown in the usage section above. An example is given in the next paragraph.
This example assumes that you have written the desired batch import options into the file 'harcimportbatch.txt' in the directory '/var/sdatest'.
java -jar harcimport.jar /var/sdatest/harcimportbatch.txt
|HARC||HTML archive specification file|