Index: trunk/gsdl/perllib/colcfg.pm
===================================================================
--- trunk/gsdl/perllib/colcfg.pm	(revision 809)
+++ trunk/gsdl/perllib/colcfg.pm	(revision 810)
@@ -34,14 +34,25 @@
 #
 # {'creator'}->string
-# {'maintainer'}->array of strings
 # {'public'}->string
 # {'beta'}->string
-# {'key'}->string
+# {'defaultindex'}->string
+# {'importdir'}->string
+# {'archivedir'}->string
+# {'cachedir'}->string
+# {'builddir'}->string
+# {'removeold'}->string
+
+# {'maintainer'}->array of strings
 # {'languages'}->array of strings
-# {'subcollection'}->hash of key-value pairs
 # {'indexsubcollections'}->array of strings
 # {'indexes'}->array of strings
-# {'defaultindex'}->string
-# {'plugins'}->array of strings
+# {'dontbuild'}->array of strings
+# {'dontgdbm'}->array of strings
+
+# {'subcollection'}->hash of key-value pairs
+# {'collectionmeta'}->hash of key-value pairs
+
+# {'plugin'}->array of arrays of strings
+# {'classify'}->array of arrays of strings
 
 sub read_collect_cfg {
@@ -49,8 +60,10 @@
 
     return &cfgread::read_cfg_file ($filename, 
-		    '^(creator|public|beta|key|defaultindex|importdir|' .
-				    'archivedir|cachedir|builddir|textindex|removeold)$',
-		    '^(maintainer|languages|indexsubcollections|indexes|plugins|dontbuild|dontgdbm)$',
-		    '^(subcollection|collectionmeta)$');
+				    q/^(creator|public|beta|defaultindex|importdir|/ .
+					q/archivedir|cachedir|builddir|removeold)$/,
+				    q/(maintainer|languages|indexsubcollections|/ .
+				       q/indexes|dontbuild|dontgdbm)$/,
+				    q/^(subcollection|collectionmeta)$/,
+				    q/^(plugin|classify)$/);
 }
 
@@ -59,8 +72,10 @@
 
     &cfgread::write_cfg_file($filename, $data,
-		    '^(creator|public|beta|key|defaultindex|importdir|' .
-				    'archivedir|cachedir|builddir|textindex|removeold)$',
-		    '^(maintainer|languages|indexsubcollections|indexes|plugins|dontbuild|dontgdbm)$',
-		    '^(subcollection|collectionmeta)$');
+			     q/^(creator|public|beta|defaultindex|importdir|/ .
+				 q/archivedir|cachedir|builddir|removeold)$/,
+			     q/^(maintainer|languages|indexsubcollections|/ .
+				 q/indexes|dontbuild|dontgdbm)$/,
+			     q/^(subcollection|collectionmeta)$/,
+			     q/^(plugin|classify)$/);
 }
 
@@ -79,6 +94,6 @@
 
     return &cfgread::read_cfg_file ($filename, 
-		    '^(builddate|numdocs|numwords|numbytes)$', 
-		    '^(metadata|languages)$');
+				    q/^(builddate|numdocs|numwords|numbytes)$/, 
+				    q/^(metadata|languages)$/);
 }
 
@@ -87,6 +102,6 @@
 
     &cfgread::write_cfg_file($filename, $data,
-		    '^(builddate|numdocs|numwords|numbytes)$', 
-		    '^(metadata|languages)$');
+			     q/^(builddate|numdocs|numwords|numbytes)$/, 
+			     q/^(metadata|languages)$/);
 }
 
Index: trunk/gsdl/perllib/docsave.pm
===================================================================
--- trunk/gsdl/perllib/docsave.pm	(revision 809)
+++ trunk/gsdl/perllib/docsave.pm	(revision 810)
@@ -100,10 +100,12 @@
     my @assoc_files = ();
     foreach $assoc_file (@{$doc_obj->get_assoc_files()}) {
+	my ($dir, $afile) = $assoc_file->[1] =~ /^(.*?)([^\/\\]+)$/;
+	$dir = "" unless defined $dir;
 	if (-e $assoc_file->[0]) {
-	    my $afile = &util::filename_cat($archive_dir, $doc_dir, $assoc_file->[1]);
-	    &util::cp ($assoc_file->[0], $afile);
+	    my $filepath = &util::filename_cat($archive_dir, $doc_dir, $afile);
+	    &util::hard_link ($assoc_file->[0], $filepath);
 	    $doc_obj->add_metadata ($doc_obj->get_top_section(), 
 				    "gsdlassocfile", 
-				    "$assoc_file->[1]:$assoc_file->[2]");
+				    "$afile:$assoc_file->[2]:$dir");
 	} else {
 	    print STDERR "docsave::process couldn't copy the associated file " .
Index: trunk/gsdl/perllib/mgbuilder.pm
===================================================================
--- trunk/gsdl/perllib/mgbuilder.pm	(revision 809)
+++ trunk/gsdl/perllib/mgbuilder.pm	(revision 810)
@@ -93,12 +93,11 @@
 
     # get the list of plugins for this collection
-    my @plugins = (); # some good choice of plugins .... ????
-    if (defined $self->{'collect_cfg'}->{'plugins'}) {
-	@plugins = @{$self->{'collect_cfg'}->{'plugins'}};
+    my $plugins = [];
+    if (defined $self->{'collect_cfg'}->{'plugin'}) {
+	$plugins = $self->{'collect_cfg'}->{'plugin'};
     }
     
-
     # load all the plugins
-    $self->{'pluginfo'} = &plugin::load_plugins ($collection, \@plugins);
+    $self->{'pluginfo'} = &plugin::load_plugins ($plugins);
     if (scalar(@{$self->{'pluginfo'}}) == 0) {
 	print STDERR "No plugins were loaded.\n";
@@ -106,22 +105,12 @@
     }
 
+    # get the list of classifiers for this collection
+    my $classifiers = [];
+    if (defined $self->{'collect_cfg'}->{'classify'}) {
+	$classifiers = $self->{'collect_cfg'}->{'classify'};
+    }
+    
     # load all the classifiers
-    $self->{'classifiers'} = [];
-    if (open (COLCFG, $colcfgname)) {
-	while (defined ($line = &cfgread::read_cfg_line('mgbuilder::COLCFG'))) {
-	    if (scalar(@$line) >= 2) {
-		my $key = shift (@$line);
-		if ($key eq "classify") {
-		    my $classinfo = &classify::load_classifier($line);
-		    push (@{$self->{'classifiers'}}, $classinfo) 
-			if defined $classinfo;
-		}
-	    }
-	}
-	close (COLCFG);
-    } else {
-	print STDERR "mgbuilder::new couldn't read the cfg file $colcfgname\n";
-	print STDERR "               no classifiers were loaded\n";
-    }
+    $self->{'classifiers'} = &classify::load_classifiers ($classifiers);
 
     # load up any dontgdbm fields
@@ -560,5 +549,7 @@
     my $self = shift (@_);
     my $textdir = &util::filename_cat($self->{'build_dir'}, "text");
+    my $assocdir = &util::filename_cat($self->{'build_dir'}, "assoc");
     &util::mk_all_dir ($textdir);
+    &util::mk_all_dir ($assocdir);
 
     # get db name
@@ -572,5 +563,6 @@
     my $txt2db_exe = &util::filename_cat($exedir, "txt2db$exe");
 
-    print STDERR "\n*** creating the info database\n" if ($self->{'verbosity'} >= 1);
+    print STDERR "\n*** creating the info database and processing associated files\n" 
+	if ($self->{'verbosity'} >= 1);
 
     # init all the classifiers
@@ -590,4 +582,5 @@
     $self->{'buildproc'}->set_output_handle ($handle);
     $self->{'buildproc'}->set_mode ('infodb');
+    $self->{'buildproc'}->set_assocdir ($assocdir);
     $self->{'buildproc'}->set_dontgdbm ($self->{'dontgdbm'});
     $self->{'buildproc'}->set_classifiers ($self->{'classifiers'});
Index: trunk/gsdl/perllib/mgbuildproc.pm
===================================================================
--- trunk/gsdl/perllib/mgbuildproc.pm	(revision 809)
+++ trunk/gsdl/perllib/mgbuildproc.pm	(revision 810)
@@ -51,4 +51,5 @@
     $self->{'classifiers'} = [];
     $self->{'mode'} = "text";
+    $self->{'assocdir'} = $build_dir;
     $self->{'dontgdbm'} = {};
     $self->{'index'} = "section:text";
@@ -102,4 +103,11 @@
 
     $self->{'mode'} = $mode;
+}
+
+sub set_assocdir {
+    my $self = shift (@_);
+    my ($assocdir) = @_;
+
+    $self->{'assocdir'} = $assocdir;
 }
 
@@ -177,4 +185,14 @@
 }
 
+sub assoc_files {
+    my $self = shift (@_);
+    my ($doc_obj) = @_;
+    
+    foreach $assoc_file (@{$doc_obj->get_assoc_files()}) {
+	$afile = &util::filename_cat($self->{'assocdir'}, $assoc_file->[1]);
+	&util::hard_link ($assoc_file->[0], $afile);
+    }
+}
+
 sub infodb {
     my $self = shift (@_);
@@ -183,4 +201,6 @@
 #    $handle = "main::STDOUT";
 
+    $self->assoc_files ($doc_obj);
+
     my $doctype = $doc_obj->get_doc_type();
 
@@ -197,4 +217,5 @@
     my $doc_OID = $doc_obj->get_OID();
     my $first = 1;
+    my $url = "";
     while (defined $section) {
 	# update a few statistics
@@ -222,15 +243,25 @@
 
 	    if ($field ne "Identifier" && $field !~ /^gsdl/ && 
-		defined $value && $value ne "" && 
-		!defined $self->{'dontgdbm'}->{$field}) {
+		defined $value && $value ne "") {
+
 		# escape problematic stuff
 		$value =~ s/\\/\\\\/g;
 		$value =~ s/\n/\\n/g;
 		$value =~ s/\r/\\r/g;
-		
-		print $handle "<$field>$value\n";
-	    }
-	}
-
+
+		# special case for URL metadata
+		if ($field =~ /^URL$/i) {
+                    $url .= "[$value]\n";
+                    if ($section eq "") {$url .= "<section>$doc_OID\n";}
+                    else {$url .= "<section>$doc_OID.$section\n";}
+                    $url .= '-' x 70 . "\n";
+		}
+
+		if (!defined $self->{'dontgdbm'}->{$field}) {
+		    print $handle "<$field>$value\n";
+		}
+	    }
+	}
+	
 	# output archivedir if at top level
 	if ($section eq $doc_obj->get_top_section()) {
@@ -242,5 +273,5 @@
 	    print $handle "<archivedir>$archivedir\n";
 	}
-
+	
 	# output document display type
 	if ($first) {
@@ -280,4 +311,9 @@
 	else { print $handle "<section>$doc_OID.$section\n"; }
 	print $handle '-' x 70, "\n";
+	
+        # output entry for url
+        if ($url ne "") {
+            print $handle $url;
+        }
 
 	$first = 0;
