Ignore:
Timestamp:
2001-04-03T14:37:44+12:00 (23 years ago)
Author:
davidb
Message:

Augmented so GML files generated conform to XML syntax. Main addition
at the top level is to generate a DTD for the collection once all
the files have been read in.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/import.pl

    r1970 r2268  
    4848
    4949sub print_usage {
    50     print STDERR "\n";
    51     print STDERR "import.pl: Converts documents in collections -importdir directory into\n";
    52     print STDERR "           gml documents which are written to the -archivedir directory.\n\n";
    53     print STDERR "  usage: $0 [options] collection-name\n\n";
     50    print STDERR "\n  usage: $0 [options] collection-name\n\n";
    5451    print STDERR "  options:\n";
    5552    print STDERR "   -verbosity number      0=none, 3=lots\n";
     
    6865    print STDERR "                          building. This will be disabled if groupsize > 1\n";
    6966    print STDERR "   -debug                 Print imported text to STDOUT\n";
    70     print STDERR "   -collectdir directory  Collection directory (defaults to " .
    71     &util::filename_cat ($ENV{'GSDLHOME'}, "collect") . ")\n";
    7267    print STDERR "   -out                   Filename or handle to print output status to.\n";
    7368    print STDERR "                          The default is STDERR\n\n";
     
    8075    $removeold, $gzip, $groupsize, $debug, $maxdocs, $collection,
    8176    $configfilename, $collectcfg, $pluginfo, $sortmeta,
    82     $archive_info_filename, $archive_info, $processor,
    83     $out, $collectdir);
     77    $archive_info_filename, $archive_info, $processor, $out);
    8478    if (!parsargv::parse(\@ARGV,
    8579             'verbosity/\d+/2', \$verbosity,
     
    9387             'debug', \$debug,
    9488             'maxdocs/^\-?\d+/-1', \$maxdocs,
    95              'collectdir/.*/', \$collectdir,
    9689             'out/.*/STDERR', \$out)) {
    9790    &print_usage();
     
    111104
    112105    # get and check the collection name
    113     if (($collection = &util::use_collection(@ARGV, $collectdir)) eq "") {
     106    if (($collection = &util::use_collection(@ARGV)) eq "") {
    114107    &print_usage();
    115108    die "\n";
     
    133126    # get the list of plugins for this collection
    134127    my $plugins = [];
    135     $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg");
     128    $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc/collect.cfg");
    136129    if (-e $configfilename) {
    137130    $collectcfg = &colcfg::read_collect_cfg ($configfilename);
     
    159152    # fill in the default import and archives directories if none
    160153    # were supplied, turn all \ into / and remove trailing /
    161     $importdir = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "import") if $importdir eq "";
     154    $importdir = "$ENV{'GSDLCOLLECTDIR'}/import" if $importdir eq "";
    162155    $importdir =~ s/[\\\/]+/\//g;
    163156    $importdir =~ s/\/$//;
    164     $archivedir = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "archives") if $archivedir eq "";
     157    $archivedir = "$ENV{'GSDLCOLLECTDIR'}/archives" if $archivedir eq "";
    165158    $archivedir =~ s/[\\\/]+/\//g;
    166159    $archivedir =~ s/\/$//;
     
    200193    &plugin::read ($pluginfo, $importdir, "", {}, $processor, $maxdocs);
    201194   
    202     &plugin::end($pluginfo, $processor);
     195    &plugin::end($pluginfo,$processor);
    203196   
    204197    # write out the archive information file
Note: See TracChangeset for help on using the changeset viewer.