Index: /gsdl/trunk/bin/script/buildcol.pl
===================================================================
--- /gsdl/trunk/bin/script/buildcol.pl	(revision 17569)
+++ /gsdl/trunk/bin/script/buildcol.pl	(revision 17570)
@@ -20,6 +20,4 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-# @note 11/04/03 Added usage datastructure - John Thompson
 #
 # @author New Zealand Digital Library Project unless otherwise stated
@@ -63,6 +61,4 @@
 no strict 'subs'; # allow barewords (eg STDERR) as function arguments
 
-# used in updating Collectionconfig.xml in create_images()
-use Twig;
 
 my $mode_list =
@@ -118,9 +114,4 @@
 	'reqd' => "no",
         'hiddengli' => "yes" },
-      { 'name' => "create_images",
-	'desc' => "{buildcol.create_images}",
-	'type' => "flag",
-	'reqd' => "no",
-	'modegli' => "4" },
       { 'name' => "debug",
 	'desc' => "{buildcol.debug}",
@@ -285,5 +276,5 @@
 	$debug, $mode, $indexname, $removeold, $keepold, $incremental, 
 	$remove_empty_classifications,
-	$create_images, $collectdir, $build, $type, $textindex,
+	$collectdir, $build, $type, $textindex,
 	$no_strip_html, $no_text, $faillog, $gli, $index, $language,
 	$sections_index_document_metadata, $maxnumeric,
@@ -443,8 +434,4 @@
     }
     
-    
-    if (defined $collectcfg->{'create_images'} && $collectcfg->{'create_images'} =~ /^true$/i) {
-	$create_images = 1;
-    }
     if ($buildtype eq "mgpp" && defined $collectcfg->{'textcompress'}) {
 	$textindex = $collectcfg->{'textcompress'};
@@ -482,12 +469,4 @@
     else {
 	$textindex = "section:text";
-    }
-
-    # create default images if required
-    if ($create_images) {
-	my $collection_name = $collection;
-	$collection_name = $collectcfg->{'collectionmeta'}->{'collectionname'}->{'default'}
-	if defined $collectcfg->{'collectionmeta'}->{'collectionname'}->{'default'};
-	&create_images ($collection_name);
     }
 
@@ -612,108 +591,4 @@
 ## main() ##
 
-## @method create_images()
-#
-#  [Used to create default cover images... from what I'm not quite sure - John]
-#
-sub create_images {
-    my ($collection_name) = @_;
-
-    my $image_script = &util::filename_cat ($ENV{'GSDLHOME'}, "bin", "script", "gimp", "title_icon-1.2.pl");
-    if (!-e $image_script) {
-	&gsprintf($out, "{buildcol.no_image_script}", $image_script);
-	&gsprintf($out, "{buildcol.no_default_images}\n\n");
-	return;
-    }
-
-    my $imagedir = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "images");
-
-    &util::mk_all_dir ($imagedir);
-
-    # create the images
-    system ("$image_script -size 1.5 -image_dir \"$imagedir\" -filename $collection.gif -text \"$collection_name\"");
-    system ("$image_script -image_dir \"$imagedir\" -filename ${collection}sm.gif -text \"$collection_name\"");
-
-    if ($gs_mode eq "gs3") { 
-	# update the CollectionConfig.xml file
-	# what we need to do is find in CollectionConfig.xml the two elements with attributes 'icon' and 'smallicon'
-	# and replace the node text with $collection.gif and ${collection}sm.gif respectively. If they don't exist,
-	# create new ones by using the image names.
-
-
-	my $found = 0; my $foundsm = 0;
-	
-	my $twig = XML::Twig->new();
-	$twig->parsefile($configfilename);
-	my $root = $twig->root;
-	my $displayItemList = $root->first_child('displayItemList');
-	my @displayItem = $displayItemList->children('displayItem');
-	foreach my $displayItem (@displayItem) {
-	    my $att_value = $displayItem->{'att'}->{'name'};
-	    
-	    if($att_value eq 'icon') {
-		$found = 1;
-	    }
-	    elsif ( $att_value eq 'smallicon') {
-		$foundsm = 1;
-	    }
-	}
-
-	if ($found eq 0) { print "write icon";
-	    my $icon_displayItem_element = XML::Twig::Elt->new('displayItem');
-	    $icon_displayItem_element->set_att('name', '$collection.gif');
-	    $icon_displayItem_element->set_att('lang', 'en');
-	    $icon_displayItem_element->set_text("$collection.gif");
-	    $icon_displayItem_element->paste('last_child', $displayItemList);
-	}
-	if ($foundsm eq 0) { 
-	    my $smallicon_displayItem_element = XML::Twig::Elt->new('displayItem');
-	    $smallicon_displayItem_element->set_att('name', 'smallicon');
-	    $smallicon_displayItem_element->set_att('lang', 'en');
-	    $smallicon_displayItem_element->set_text("${collection}sm.gif");
-	    $smallicon_displayItem_element->paste('last_child', $displayItemList);
-	    
-	    
-	}
-	open (OUT, ">$configfilename") or die "cannot open file $configfilename for output: $!";
-	#select OUT;
-	$twig->print( \*OUT );
-	close OUT;
-	return;
-    }
-
-    # update the collect.cfg configuration file (this will need
-    # to be changed when the config file format changes)
-    if (!open (CFGFILE, $configfilename)) {
-	&gsprintf($out, "{buildcol.cannot_open_cfg_file}\n", $configfilename);
-	&gsprintf($out, "{buildcol.unlinked_col_images}\n");
-	return;
-    }
-
-    my $line = ""; my $file = "";
-    my $found = 0; my $foundsm = 0;
-    while (defined ($line = <CFGFILE>)) {
-	if ($line =~ /collectionmeta\s+iconcollection\s+/) {
-	    $line = "collectionmeta iconcollection _httpprefix_/collect/$collection/images/$collection.gif\n";
-	    $found = 1;
-	} elsif ($line =~ /collectionmeta\s+iconcollectionsmall\s+/) {
-	    $line = "collectionmeta iconcollectionsmall _httpprefix_/collect/$collection/images/${collection}sm.gif\n";
-	    $foundsm = 1;
-	}
-	$file .= $line;
-    }
-    close CFGFILE;
-
-    $file .= "collectionmeta iconcollection _httpprefix_/collect/$collection/images/$collection.gif\n" if !$found;
-    $file .= "collectionmeta iconcollectionsmall _httpprefix_/collect/$collection/images/${collection}sm.gif\n" if !$foundsm;
-
-    if (!open (CFGFILE, ">$configfilename")) {
-	&gsprintf($out, "{buildcol.cannot_open_cfg_file}\n", $configfilename);
-	&gsprintf($out, "{buildcol.unlinked_col_images}\n");
-	return;
-    }
-    print CFGFILE $file;
-    close CFGFILE;
-}
-## create_images() ##
 
 ## @method make_absolute()
