Changeset 1279
- Timestamp:
- 2000-07-13T10:21:53+12:00 (23 years ago)
- Location:
- branches/New_Config_Format-branch/gsdl
- Files:
-
- 13 deleted
- 147 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/New_Config_Format-branch/gsdl/bin/script/buildcol.pl
r1031 r1279 54 54 print STDERR " -keepold will not destroy the current contents of the\n"; 55 55 print STDERR " building directory\n"; 56 print STDERR " -allclassifications Don't remove empty classifications\n\n"; 56 print STDERR " -allclassifications Don't remove empty classifications\n"; 57 print STDERR " -create_images Attempt to create default images for new\n"; 58 print STDERR " collection. This relies on the Gimp being\n"; 59 print STDERR " installed along with relevant perl modules\n"; 60 print STDERR " to allow scripting from perl\n\n"; 57 61 } 58 62 … … 61 65 { 62 66 my ($verbosity, $archivedir, $cachedir, $builddir, $maxdocs, 63 $debug, $mode, $indexname, $keepold, $allclassifications); 67 $debug, $mode, $indexname, $keepold, $allclassifications, 68 $create_images); 64 69 if (!parsargv::parse(\@ARGV, 65 70 'verbosity/\d+/2', \$verbosity, … … 72 77 'index/.*/', \$indexname, 73 78 'keepold', \$keepold, 74 'allclassifications', \$allclassifications)) { 79 'allclassifications', \$allclassifications, 80 'create_images', \$create_images)) { 75 81 &print_usage(); 76 82 die "\n"; … … 85 91 # read the configuration file 86 92 $textindex = "section:text"; 87 $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc /collect.cfg");93 $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg"); 88 94 if (-e $configfilename) { 89 95 $collectcfg = &colcfg::read_collect_cfg ($configfilename); … … 101 107 } 102 108 109 # create default images if required 110 if ($create_images) { 111 my $collection_name = $collection; 112 $collection_name = $collectcfg->{'collectionmeta'}->{'collectionname'} 113 if defined $collectcfg->{'collectionmeta'}->{'collectionname'}; 114 115 &create_images ($collection_name); 116 } 117 103 118 # fill in the default archives and building directories if none 104 119 # were supplied, turn all \ into / and remove trailing / … … 177 192 } 178 193 179 194 sub create_images { 195 my ($collection_name) = @_; 196 197 my $image_script = &util::filename_cat ($ENV{'GSDLHOME'}, "bin", "script", "gimp", "title_icon.pl"); 198 if (!-e $image_script) { 199 print STDERR "WARNING: Image making script ($image_script) could not be found\n"; 200 print STDERR " Default images will not be generated\n\n"; 201 return; 202 } 203 204 my $imagedir = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "images"); 205 206 &util::mk_all_dir ($imagedir); 207 208 # create the images 209 system ("$image_script -size 1.5 -image_dir \"$imagedir\" -filename $collection.gif -text \"$collection_name\""); 210 system ("$image_script -image_dir \"$imagedir\" -filename ${collection}sm.gif -text \"$collection_name\""); 211 212 # update the collect.cfg configuration file (this will need 213 # to be changed when the config file format changes) 214 if (!open (CFGFILE, $configfilename)) { 215 print STDERR "WARNING: Couldn't open config file ($configfilename)\n"; 216 print STDERR " for updating so collection images may not be linked correctly\n"; 217 return; 218 } 219 220 my $line = ""; my $file = ""; 221 my $found = 0; my $foundsm = 0; 222 while (defined ($line = <CFGFILE>)) { 223 if ($line =~ /collectionmeta\s+iconcollection\s+/) { 224 $line = "collectionmeta iconcollection _httprefix_/collect/$collection/images/$collection.gif\n"; 225 $found = 1; 226 } elsif ($line =~ /collectionmeta\s+iconcollectionsmall\s+/) { 227 $line = "collectionmeta iconcollectionsmall _httprefix_/collect/$collection/images/${collection}sm.gif\n"; 228 $foundsm = 1; 229 } 230 $file .= $line; 231 } 232 close CFGFILE; 233 234 $file .= "collectionmeta iconcollection _httprefix_/collect/$collection/images/$collection.gif\n" if !$found; 235 $file .= "collectionmeta iconcollectionsmall _httprefix_/collect/$collection/images/${collection}sm.gif\n" if !$foundsm; 236 237 if (!open (CFGFILE, ">$configfilename")) { 238 print STDERR "WARNING: Couldn't open config file ($configfilename)\n"; 239 print STDERR " for updating so collection images may not be linked correctly\n"; 240 return; 241 } 242 print CFGFILE $file; 243 close CFGFILE; 244 } -
branches/New_Config_Format-branch/gsdl/bin/script/gimp/flash_button.pl
r1037 r1279 55 55 56 56 sub print_usage { 57 print STDERR "\n usage: $0 [options] macrofile\n\n";57 print STDERR "\n usage: $0 [options]\n\n"; 58 58 print STDERR " options:\n"; 59 59 print STDERR " -cfg_file file configuration file containing one or more\n"; … … 136 136 chomp $image_dir; 137 137 } 138 139 # replace any '\n' occurring in text with carriage return 140 $text =~ s/\\n/\n/gi; 138 141 139 142 if ($cfg_file =~ /\w/) { -
branches/New_Config_Format-branch/gsdl/bin/script/gimp/title_icon.pl
r1037 r1279 46 46 47 47 48 my ($cfg_file, $imagefile, $width, $height, $imageheight, $stripecolor, $stripewidth,49 $stripe_alignment, $i_transparency, $text, $text_alignment, $filename, $textspace_x,50 $textspace_y, $bgcolor, $fontcolor, $fontsize, $minfontsize, $fontname,51 $fontweight, $fontslant, $fontwidth, $fontspacing, $image_dir);48 local ($cfg_file, $size, $imagefile, $width, $height, $imageheight, $stripecolor, $stripewidth, 49 $stripe_alignment, $i_transparency, $text, $text_alignment, $filename, $textspace_x, 50 $textspace_y, $bgcolor, $fontcolor, $fontsize, $minfontsize, $fontname, 51 $fontweight, $fontslant, $fontwidth, $fontspacing, $image_dir, $dont_wrap); 52 52 53 53 sub print_usage { … … 57 57 print STDERR " sets of the following options - use to create\n"; 58 58 print STDERR " batches of images\n"; 59 print STDERR " -size number the overall size ratio of the image (i.e. a size\n"; 60 print STDERR " of 2 will create an image twice the default size)\n"; 59 61 print STDERR " -image_dir directory directory to create images in [`pwd`]\n"; 60 62 print STDERR " this should be full path to existing directory\n"; … … 83 85 print STDERR " -fontslant [r]\n"; 84 86 print STDERR " -fontwidth [*]\n"; 85 print STDERR " -fontspacing [*]\n\n"; 87 print STDERR " -fontspacing [*]\n"; 88 print STDERR " -dont_wrap don't attempt to wrap text\n\n"; 86 89 } 87 90 … … 89 92 $image_dir = "./"; 90 93 $imagefile = ""; 91 $width = 150;92 $height = 44;93 $imageheight = 110;94 $width = int (150 * $size); 95 $height = int (44 * $size); 96 $imageheight = int (110 * $size); 94 97 $stripecolor = $gsdl_green; 95 $stripewidth = 40;98 $stripewidth = int (40 * $size); 96 99 $stripe_alignment = "left"; 97 100 $i_transparency = 60; … … 99 102 $text_alignment = "left"; 100 103 $filename = ""; 101 $textspace_x = 3;102 $textspace_y = 3;104 $textspace_x = int (3 * $size); 105 $textspace_y = int (3 * $size); 103 106 $bgcolor = $gsdl_green; 104 107 $fontcolor = $black; 105 $fontsize = 17;106 $minfontsize = 10;108 $fontsize = int (17 * $size); 109 $minfontsize = int (10 * $size); 107 110 $fontname = "lucida"; 108 111 $fontweight = "medium"; … … 116 119 if (!parsargv::parse(\@ARGV, 117 120 'cfg_file/.*/', \$cfg_file, 121 'size/\d+/1', \$size, 118 122 'image_dir/.*/./', \$image_dir, 119 123 'imagefile/.*/', \$imagefile, … … 138 142 'fontslant/.*/r', \$fontslant, 139 143 'fontwidth/.*/*', \$fontwidth, 140 'fontspacing/.*/*', \$fontspacing)) { 144 'fontspacing/.*/*', \$fontspacing, 145 'dont_wrap', \$dont_wrap)) { 141 146 &print_usage(); 142 147 die "title_icon.pl: incorrect options\n"; … … 148 153 chomp $image_dir; 149 154 } 150 155 151 156 if ($cfg_file =~ /\w/) { 152 157 … … 177 182 178 183 sub produce_image { 184 185 &adjust_args (); 186 &wrap_text () unless $dont_wrap; 179 187 180 188 my $use_image = 0; … … 338 346 return 1; 339 347 } 348 349 # adjust arguments that are effected by the size argument 350 sub adjust_args { 351 352 if ($size != 1) { 353 my @size_args = ('width', 'height', 'imageheight', 'stripewidth', 354 'textspace_x', 'textspace_y', 'fontsize', 'minfontsize'); 355 foreach $arg (@size_args) { 356 $$arg = int ($$arg * $size); 357 } 358 } 359 } 360 361 sub wrap_text { 362 363 # don't wrap text if it already contains carriage returns 364 return if $text =~ /\n/; 365 366 # the following assumes that all words are less than $wrap_length long 367 my $wrap_length = 14; 368 369 my $new_text = ""; 370 while (length ($text) >= $wrap_length) { 371 my $line = substr ($text, 0, $wrap_length); 372 $text =~ s/^$line//; 373 $line =~ s/\s([^\s]*)$/\n/; 374 $text = $1 . $text; 375 $new_text .= $line; 376 } 377 $new_text .= $text; 378 $text = $new_text; 379 } 340 380 341 381 sub query { -
branches/New_Config_Format-branch/gsdl/bin/script/gsw3mir.pl
r845 r1279 1 #!/usr/ local/bin/perl5-w1 #!/usr/bin/perl -w 2 2 3 3 ########################################################################### -
branches/New_Config_Format-branch/gsdl/bin/script/import.pl
r1031 r1279 56 56 print STDERR " directory -- use with care\n"; 57 57 print STDERR " -gzip Use gzip to compress resulting gml documents\n"; 58 print STDERR " (don't forget to include ZIPPlug in your plugin\n"; 59 print STDERR " list when building from compressed documents)\n"; 58 60 print STDERR " -maxdocs number Maximum number of documents to import\n"; 59 61 print STDERR " -groupsize number Number of GML documents to group into one file\n"; … … 135 137 136 138 # load all the plugins 137 $pluginfo = &plugin::load_plugins ($plugins );139 $pluginfo = &plugin::load_plugins ($plugins, $verbosity); 138 140 if (scalar(@$pluginfo) == 0) { 139 141 print STDERR "No plugins were loaded.\n"; -
branches/New_Config_Format-branch/gsdl/bin/script/mkcol.pl
r1031 r1279 51 51 print STDERR " -title text The title for the collection\n"; 52 52 print STDERR " -about text The about text for the collection\n"; 53 print STDERR " -plugins list Space separated list of perl plugin modules to use\n"; 53 print STDERR " -plugin text perl plugin module to use (there may be multiple\n"; 54 print STDERR " plugin entries\n"; 54 55 print STDERR " -refine list Space separated list of perl plugin modules to use\n"; 55 56 … … 106 107 $line =~ s/\*\*title\*\*/$title/g; 107 108 $line =~ s/\*\*about\*\*/$about/g; 108 $line =~ s/\*\*plugins\*\*/$plugins /g;109 $line =~ s/\*\*plugins\*\*/$pluginstring/g; 109 110 $line =~ s/\*\*refine\*\*/$refine/g; 110 111 … … 119 120 120 121 121 my (@indexes, @indexestext );122 my (@indexes, @indexestext, @plugin); 122 123 123 124 # get and check options … … 132 133 'title/.+/', \$title, 133 134 'about/.+/', \$about, 134 'plugin s/.+/GMLPlug TEXTPlug ArcPlug RecPlug/', \$plugins,135 'plugin/.+', \@plugin, 135 136 'refine/.+/', \$refine 136 137 )) { … … 138 139 die "\n"; 139 140 } 140 141 142 # load default plugins if none were on command line 143 if (!scalar(@plugin)) { 144 @plugin = (GMLPlug,TEXTPlug,ArcPlug,RecPlug); 145 } 146 141 147 # get and check the collection name 142 148 ($collection) = @ARGV; … … 195 201 } 196 202 203 $pluginstring = ""; 204 foreach $plugin (@plugin) { 205 $pluginstring .= "plugin $plugin\n"; 206 } 197 207 198 208 # make sure the model collection exists -
branches/New_Config_Format-branch/gsdl/bin/script/newsrc.pl
r546 r1279 1 #!/usr/ local/bin/perl5-w1 #!/usr/bin/perl -w 2 2 3 3 ########################################################################### -
branches/New_Config_Format-branch/gsdl/bin/script/togb.pl
r630 r1279 1 #!/usr/ local/bin/perl5-w1 #!/usr/bin/perl -w 2 2 3 3 ########################################################################### … … 36 36 if (!parsargv::parse(\@ARGV, 37 37 'unicode', \$unicode, 38 ' extended', \$extended,38 'iso_8859_1', \$iso_8859_1, 39 39 'gb', \$gb)) { 40 40 print STDERR "\n usage: $0 [options]\n\n"; 41 41 print STDERR " options:\n"; 42 print STDERR " -u tf8input is in utf-8 or unicode (default)\n";43 print STDERR " - extended input is in extended ascii\n";44 print STDERR " -gb input is in GB or GBK\n\n";42 print STDERR " -unicode input is in utf-8 or unicode (default)\n"; 43 print STDERR " -iso_8859_1 input is in extended ascii (ISO-8859-1 Latin 1)\n"; 44 print STDERR " -gb input is in GB or GBK (simplified Chinese)\n\n"; 45 45 die "\n"; 46 46 } 47 47 48 48 $encoding = "utf8" if $unicode; 49 $encoding = " extended" if $extended;49 $encoding = "iso_8859_1" if $iso_8859_1; 50 50 $encoding = "gb" if $gb; 51 51 -
branches/New_Config_Format-branch/gsdl/bin/script/touc.pl
r630 r1279 1 #!/usr/ local/bin/perl5-w1 #!/usr/bin/perl -w 2 2 3 3 ########################################################################### … … 36 36 if (!parsargv::parse(\@ARGV, 37 37 'unicode', \$unicode, 38 'extended', \$extended, 38 'iso_8859_1', \$iso_8859_1, 39 'iso_8859_6', \$iso_8859_6, 40 'windows_1256', \$windows_1256, 39 41 'gb', \$gb)) { 40 42 print STDERR "\n usage: $0 [options]\n\n"; 41 43 print STDERR " options:\n"; 42 print STDERR " -utf8 input is in utf-8 or unicode (default)\n"; 43 print STDERR " -extended input is in extended ascii\n"; 44 print STDERR " -gb input is in GB or GBK\n\n"; 44 print STDERR " -unicode input is in utf-8 or unicode (default)\n"; 45 print STDERR " -iso_8859_1 input is in extended ascii (ISO-8859-1 Latin 1)\n"; 46 print STDERR " -iso_8859_6 input is in 8 bit Arabic (ISO-8859-6)\n"; 47 print STDERR " -windows_1256 input is in Windows 1256 (Arabic)\n"; 48 print STDERR " -gb input is in GB or GBK (simplified Chinese)\n\n"; 45 49 die "\n"; 46 50 } 47 51 48 52 $encoding = "utf8" if $unicode; 49 $encoding = "extended" if $extended; 53 $encoding = "iso_8859_1" if $iso_8859_1; 54 $encoding = "iso_8859_6" if $iso_8859_6; 55 $encoding = "windows_1256" if $windows_1256; 50 56 $encoding = "gb" if $gb; 51 57 -
branches/New_Config_Format-branch/gsdl/bin/script/toutf8.pl
r630 r1279 1 #!/usr/ local/bin/perl5-w1 #!/usr/bin/perl -w 2 2 3 3 ########################################################################### … … 36 36 if (!parsargv::parse(\@ARGV, 37 37 'unicode', \$unicode, 38 'extended', \$extended, 38 'iso_8859_1', \$iso_8859_1, 39 'iso_8859_6', \$iso_8859_6, 40 'windows_1256', \$windows_1256, 39 41 'gb', \$gb)) { 40 42 print STDERR "\n usage: $0 [options]\n\n"; 41 43 print STDERR " options:\n"; 42 print STDERR " -utf8 input is in utf-8 or unicode (default)\n"; 43 print STDERR " -extended input is in extended ascii\n"; 44 print STDERR " -gb input is in GB or GBK\n\n"; 44 print STDERR " -unicode input is in utf-8 or unicode (default)\n"; 45 print STDERR " -iso_8859_1 input is in extended ascii (ISO-8859-1 Latin 1)\n"; 46 print STDERR " -iso_8859_6 input is in 8 bit Arabic (ISO-8859-6)\n"; 47 print STDERR " -windows_1256 input is in Windows 1256 (Arabic)\n"; 48 print STDERR " -gb input is in GB or GBK (simplified Chinese)\n\n"; 45 49 die "\n"; 46 50 } 47 51 48 52 $encoding = "utf8" if $unicode; 49 $encoding = "extended" if $extended; 53 $encoding = "iso_8859_1" if $iso_8859_1; 54 $encoding = "iso_8859_6" if $iso_8859_6; 55 $encoding = "windows_1256" if $windows_1256; 50 56 $encoding = "gb" if $gb; 51 57 -
branches/New_Config_Format-branch/gsdl/bin/script/translate.pl
r1062 r1279 54 54 'Ouml' => chr (214), 55 55 'Uuml' => chr (220), 56 'szlig' => chr (223)); 56 'szlig' => chr (223), 57 'aacute' => chr (225), 58 'eacute' => chr (233), 59 'iacute' => chr (237), 60 'oacute' => chr (243), 61 'uacute' => chr (250), 62 'Aacute' => chr (193), 63 'Eacute' => chr (201), 64 'Iacute' => chr (205), 65 'Oacute' => chr (211), 66 'Uacute' => chr (218), 67 'ntilde' => chr (241), 68 'Ntilde' => chr (209)); 57 69 58 70 my $hand_made = 0; … … 137 149 # process all the images 138 150 139 $dmfile =~ s/\n\#\#\s*\"([^\"]*)\"\s*\#\#\s*([^\s\#]*)\s*\#\#\s*([^\s\#]*)\s*\#\#(.*?)(?=(\n\#|\s*\Z))/ 140 &process_image ($1, $2, $3, $4)/esg; 151 $dmfile =~ s/\n\#\#\s*\"([^\"]*)\"\s*\#\#\s*([^\s\#]*)\s*\#\#\s*([^\s\#]*)\s*\#\#(.*?)(?=(\n\#|\s*\Z))/&process_image ($1, $2, $3, $4)/esg; 141 152 142 153 # add language parameter to each macro … … 150 161 151 162 my $origtext = $text; 163 $text =~ s/&(\d{3,4});/chr($1)/ge; 152 164 $text =~ s/&([^;]*);/$rmap{$1}/g; 153 165 … … 204 216 } elsif ($image_type eq "green_title") { 205 217 206 # generate green title image 218 # read the width if it is specified in $image_macros 219 my ($width) = $image_macros =~ /_width${image_name}x?_\s*[^\{]*\{(\d+)\}/; 220 $width = 200 unless ($width); 221 222 # generate green title image 207 223 my $options = "-text \"$text\" -filename ${image_name}.gif -image_dir $image_dir"; 208 $options .= " -width 200-height 57 -stripe_alignment right -text_alignment right";224 $options .= " -width $width -height 57 -stripe_alignment right -text_alignment right"; 209 225 $options .= " -fontsize 26 -fontweight bold"; 210 226 `$ENV{'GSDLHOME'}/bin/script/gimp/title_icon.pl $options`; 211 227 212 # get width of new images and edit width macro 213 # we'll do this even though title_icon.pl will always create images of the 214 # width specified (200) 215 my $fullfilename = &util::filename_cat ($image_dir, "${image_name}.gif"); 216 &process_width_macro ($fullfilename, $image_name, \$image_macros); 228 # get width of resulting image and edit _width..._ macro in $image_macros 229 # (no longer needed since we always resize to the width read from $image_macros.) 230 # my $fullfilename = &util::filename_cat ($image_dir, "${image_name}.gif"); 231 # &process_width_macro ($fullfilename, $image_name, \$image_macros); 217 232 218 233 } elsif ($image_type eq "hand_made") { … … 226 241 } 227 242 228 return "\n\#\# \"$ text\" \#\# $image_type \#\# $image_name \#\#$image_macros";243 return "\n\#\# \"$origtext\" \#\# $image_type \#\# $image_name \#\#$image_macros"; 229 244 } 230 245 … … 233 248 234 249 my $img_info = &get_img_info ($filename); 235 $$image_macros =~ s/(_width${image_name}x _\s*(?:\[[^\]]*\])?\s*\{)(\d+)(\})/$1$img_info->{'width'}$3/s;250 $$image_macros =~ s/(_width${image_name}x?_\s*(?:\[[^\]]*\])?\s*\{)(\d+)(\})/$1$img_info->{'width'}$3/s; 236 251 } 237 252 -
branches/New_Config_Format-branch/gsdl/cgi-bin/gsdlsite.cfg
r1038 r1279 3 3 4 4 # points to the GSDLHOME directory 5 gsdlhome /home/gsdl5 gsdlhome **GSDLHOME** 6 6 7 7 # this is the http address of GSDLHOME 8 httpprefix /gsdl 8 # if your webservers DocumentRoot is set to $GSDLHOME 9 # then httpprefix can remain commented out 10 #httpprefix /gsdl 9 11 10 12 # this is the http address of the directory which 11 13 # contains the images for the interface. 12 httpimg /gsdl/images 14 # if your webservers DocumentRoot is set to $GSDLHOME 15 # then httpimg will be /images 16 httpimg /images 13 17 14 18 # should contain the http address of this cgi script. This -
branches/New_Config_Format-branch/gsdl/cgi-bin/webpage_buildcol.pl
r841 r1279 1 #! /usr/local/bin/perl5-w1 #!perl -w 2 2 3 3 ########################################################################### … … 32 32 # an already running cgi program. 33 33 34 use Fcntl ':flock'; 34 package webpage_buildcol; 35 35 36 use File::Basename; 37 use GSDLHOME; 38 use gflock; 36 39 37 40 my $args; … … 46 49 my ($variable,$assignment) = ($1,$3); 47 50 $args->{$variable} = $assignment; 48 49 $ENV{'GSDLHOME'} = $assignment if ($variable eq "gsdlhome"); 50 $ENV{'GSDLOS'} = $assignment if ($variable eq "gsdlos"); 51 } 52 } 53 54 if (defined($ENV{'GSDLHOME'})) 55 { 56 if (!defined($ENV{'GSDLOS'})) 57 { 58 $ENV{'GSDLOS'} = $^O; # special perl variable set to OS 59 ##### Need to check to see what this is set to 60 ##### under Windows 61 } 62 63 $ENV{'PATH'} .= ":$ENV{'GSDLHOME'}/bin/script"; 64 $ENV{'PATH'} .= ":$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}"; 65 66 unshift (@INC, "$ENV{'GSDLHOME'}/perllib"); 67 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan"); 68 } 69 else 70 { 71 print STDERR "Environment variable GSDLHOME not set\n"; 72 exit 1; 51 } 73 52 } 74 53 } … … 84 63 if (open(TMPOUT,">$full_tmpname")) 85 64 { 86 if (flock(TMPOUT,LOCK_EX)) 87 { 65 if (&gflock::lock (webpage_buildcol::TMPOUT)) { 88 66 print TMPOUT $text; 89 67 close(TMPOUT); 90 flock(TMPOUT,LOCK_UN); 91 } 92 else 93 { 68 &gflock::unlock (webpage_buildcol::TMPOUT); 69 70 } else { 94 71 # Problem locking file 95 72 my $mess = "Unable to lock temporary communication file:"; … … 118 95 my $full_importname = &util::filename_cat($full_dirname,"import"); 119 96 120 my $log_filename = &util::filename_cat($ENV{'GSDLHOME'}," log","$dirname.bld");97 my $log_filename = &util::filename_cat($ENV{'GSDLHOME'},"etc","$dirname.bld"); 121 98 if (!open (LOGOUT, ">$log_filename")) 122 99 { … … 140 117 if ($copy_dir =~ m/^yes$/i) 141 118 { 142 my $download_cmd = " ";119 my $download_cmd = "perl " . &util::filename_cat ($ENV{'GSDLHOME'}, "bin", "script"); 143 120 my $file_or_url = $building_cfg_text->{'building'}->{'fileorurl'}; 144 121 … … 146 123 { 147 124 # run urlcopy.pl to download files 148 $download_cmd = " urlcopy.pl ";125 $download_cmd = " urlcopy.pl "; 149 126 my @urls = split("\n",$input_dir); 150 127 my $u; … … 161 138 $input_dir =~ s/^\s+//; 162 139 $input_dir =~ s/\s+$//; 163 $download_cmd = " filecopy.pl $input_dir";140 $download_cmd = " filecopy.pl $input_dir"; 164 141 } 165 142 … … 194 171 } 195 172 196 if ( $copy_dir =~ /^no$/i)173 if ((defined $copy_dir) && ($copy_dir =~ /^no$/i)) 197 174 { 198 175 # link it … … 221 198 { 222 199 # Import operation 223 my $import_cmd = "import.pl -removeold $dirname"; 200 my $import_cmd = "perl "; 201 $import_cmd .= &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script", "import.pl"); 202 $import_cmd .= " -removeold $dirname"; 224 203 225 204 if(!open(IMPORTOUT,"$import_cmd 2>&1 |")) … … 254 233 255 234 # Build operation 256 my $build_cmd = ""; 235 my $build_cmd = "perl " . 236 &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script", "buildcol.pl"); 257 237 if (($do_import eq "true") 258 238 || (($do_import eq "false") && (-e $full_archivename))) 259 239 { 260 $build_cmd = "buildcol.pl$dirname";240 $build_cmd .= " $dirname"; 261 241 } 262 242 else 263 243 { 264 265 $build_cmd = "buildcol.pl";266 244 $build_cmd .= " -archivedir $full_importname"; 267 245 $build_cmd .= " -cachedir $full_archivename"; … … 354 332 = &util::filename_cat($full_dirname,"etc","collect.cfg"); 355 333 356 if (open(CFGIN,"<$cfg_filename")) 357 { 358 if (flock(CFGIN,LOCK_EX)) 359 { 360 # do requested stages for building 361 my $result = do_build($full_dirname,$dirname,$args); 362 flock(CFGIN,LOCK_UN); 363 close(CFGIN); 364 return if ($result ne "success"); 365 } 366 else 367 { 368 # Problem locking file 369 my $mess = "Unable to lock configuration file: $cfg_filename"; 370 print STDERR "$mess\n"; 371 return; 372 } 373 } 374 375 # my $mess_url = "$args->{'httpbuild'}&bca=mess&bc1dirname=$dirname"; 376 # print "Location: $mess_url&head=_headdone_&mess=_messdonebuildcol_\n\n"; 377 # print "done\n"; # in tmp file 334 # do requested stages for building 335 my $result = do_build($full_dirname,$dirname,$args); 336 return if ($result ne "success"); 337 338 my $mess_url = "$args->{'httpbuild'}&bca=mess&bc1dirname=$dirname"; 339 print "Location: $mess_url&head=_headdone_&mess=_messdonebuildcol_\n\n"; 340 print "done\n"; # in tmp file 378 341 } 379 342 380 343 &main(); 381 382 383 384 385 -
branches/New_Config_Format-branch/gsdl/cgi-bin/webpage_buildstatus.pl
r724 r1279 1 #! /usr/local/bin/perl5-w1 #!perl -w 2 2 3 3 ########################################################################### … … 31 31 use CGI; 32 32 use GSDLHOME; 33 use Fcntl ':flock';34 33 35 34 require util; … … 66 65 } 67 66 68 my $full_tmpname 69 = &util::filename_cat($ENV{'GSDLHOME'},"tmp",$tmpname); 67 my $full_tmpname = &util::filename_cat($ENV{'GSDLHOME'},"tmp"); 68 69 if (!-d $full_tmpname) { 70 mkdir ($full_tmpname, 0777); 71 } 72 73 $full_tmpname = &util::filename_cat($full_tmpname, $tmpname); 70 74 71 75 if (open(TMPIN,"<$full_tmpname")) … … 81 85 $bc1finished = 1 if ($mess eq "Done"); 82 86 $bc1finished = -1 if ($mess =~ m/^Error:/); 87 # escape backslashes so they don't vanish from printed filenames 88 $mess =~ s/\\/\\\\/g; 83 89 &webpageutil::status_location($args,$mess,$tmpname,$bc1finished); 84 90 … … 96 102 97 103 &main(); 98 99 100 101 102 -
branches/New_Config_Format-branch/gsdl/cgi-bin/webpage_delcol.pl
r841 r1279 1 #! /usr/local/bin/perl5-w1 #!perl -w 2 2 3 3 ########################################################################### … … 30 30 use CGI; 31 31 use GSDLHOME; 32 use Fcntl ':flock';33 32 34 33 require util; … … 73 72 &util::rm_r($col_dir); 74 73 75 # delete from collections.txt76 my $collist_filename77 = &util::filename_cat($ENV{'GSDLHOME'},"etc","collections.txt");78 if (open(CLIN,"<$collist_filename"))79 {80 if (flock(CLIN,LOCK_EX))81 {82 my @keep_dirnames = ();83 while (defined($line=<CLIN>))84 {85 chop $line;86 push(@keep_dirnames,$line) if ($line ne $dirname);87 }88 close(CLIN);89 90 if (open(CLIN,">$collist_filename"))91 {92 print CLIN join("\n",@keep_dirnames), "\n";93 }94 95 flock(CLIN,LOCK_UN);96 close(CLIN);97 }98 else99 {100 # problem locking file101 my $mess = "Unable to lock collection list configuration";102 $mess .= " file: $collist_filename";103 &webpageutil::error_location($args,$mess);104 return;105 }106 }107 else108 {109 # problem opening file for reading in110 111 my $mess = "Unable to open for input the collection list";112 $mess .= " configuration file: $collist_filename";113 &webpageutil::error_location($args,$mess);114 return;115 }116 74 } 117 75 elsif ($delete_area eq "import") … … 140 98 my $mess_url = "$args->{'httpbuild'}&bca=mess"; 141 99 $mess_url .= "&bc1dirname=$dirname" if ($delete_area ne "all"); 142 print " Content: text/html\n\n$mess_url&head=_headdone_&mess=_messdonedelcol_\n\n";100 print "Location: $mess_url&head=_headdone_&mess=_messdonedelcol_\n\n"; 143 101 return; 144 102 -
branches/New_Config_Format-branch/gsdl/cgi-bin/webpage_editcol.pl
r724 r1279 1 #! /usr/local/bin/perl5-w1 #!perl -w 2 2 3 3 ########################################################################### … … 28 28 # This program is a webpage wrapper for saving an edited config file 29 29 30 package webpage_editcol; 31 30 32 use CGI; 31 33 use GSDLHOME; 32 use Fcntl ':flock';34 use gflock; 33 35 34 36 require util; … … 70 72 if (open(CFGOUT,">$cfg_filename")) 71 73 { 72 if (flock(CFGOUT,LOCK_EX)) 73 { 74 if (&gflock::lock (webpage_editcol::CFGOUT)) { 74 75 my $cfg_text = $args->{'bc1cfgfile'}; 75 76 print CFGOUT "$cfg_text"; 76 flock(CFGOUT,LOCK_UN);77 &gflock::unlock (webpage_editcol::CFGOUT); 77 78 close(CFGOUT); 78 79 } -
branches/New_Config_Format-branch/gsdl/cgi-bin/webpage_mkcol.pl
r724 r1279 1 #! /usr/local/bin/perl5-w1 #!perl -w 2 2 3 3 ########################################################################### … … 28 28 # This program is a webpage wrapper to the mkcol.pl process 29 29 30 package webpage_mkcol; 31 30 32 use CGI; 31 33 use GSDLHOME; 32 use Fcntl ':flock';34 use gflock; 33 35 34 36 require util; … … 41 43 my %args = (); 42 44 45 open (FILE, '>d:\gsdl\logout.txt') || die; 46 43 47 foreach $p ($cgi->param()) 44 48 { 45 49 $args{$p} = $cgi->param($p); 46 } 47 50 51 print FILE "webpage_mkcol.pl - $p -> $args{$p}\n"; 52 } 53 54 close FILE; 48 55 return \%args; 49 56 } … … 85 92 else 86 93 { 87 # clean up input for heuristic that derives directory name for a new collection 94 # clean up input for heuristic that derives directory name for a 95 # new collection 88 96 $fullname =~ s/\s+/ /g; 89 97 $fullname =~ tr/[A-Z]/[a-z]/; … … 149 157 my $acronyms = $args->{'bc1acronyms'}; 150 158 151 my $cmd = "mkcol.pl"; 159 my $cmd = "perl "; 160 $cmd .= &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script", "mkcol.pl"); 152 161 $cmd .= " -title \"$fullname\""; 153 162 $cmd .= " -creator $contact_email"; 154 163 $cmd .= " -about \"$about_desc\""; 155 $cmd .= " -plugins \"GMLPlug ${src_format}Plug ArcPlug RecPlug\""; 164 $cmd .= " -plugin \"GMLPlug\""; 165 $cmd .= " -plugin \"${src_format}Plug\""; 166 $cmd .= " -plugin \"ArcPlug\""; 167 $cmd .= " -plugin \"RecPlug\""; 156 168 ### $cmd .= " -refine \"$refine_plugs\""; 157 169 $cmd .= " $unique_dirname"; 170 158 171 my $status = system($cmd); 159 172 $status /= 256; … … 162 175 { 163 176 # append copydir, file_or_url and input_dir to end of collect.cfg 177 # we'll also append DocumentUseHTML if processing HTML docs 164 178 my $cfg_filename 165 179 = &util::filename_cat($ENV{'GSDLHOME'},"collect",$unique_dirname, … … 167 181 if (open(CFGAPP,">>$cfg_filename")) 168 182 { 169 if (flock(CFGAPP,LOCK_EX)) 170 { 183 if (&gflock::lock (webpage_mkcol::CFGAPP)) { 171 184 print CFGAPP "\n"; 185 186 if ($src_format eq "HTML") { 187 print CFGAPP "format\tDocumentUseHTML\ttrue\n\n"; 188 } 189 172 190 print CFGAPP "building\tfileorurl\t$file_or_url\n"; 173 191 print CFGAPP "building\tinputdir\t$input_dir\n"; 174 192 print CFGAPP "building\tcopydir\t\t$copy_dir\n"; 175 193 print CFGAPP "building\tingsdlarea\t$in_gsdl_area\n"; 176 flock(CFGAPP,LOCK_UN);194 &gflock::unlock (webpage_mkcol::CFGAPP); 177 195 close(CFGAPP); 178 196 } … … 195 213 return; 196 214 } 197 198 199 # append dirname to end of collection config file200 my $collist_filename201 = &util::filename_cat($ENV{'GSDLHOME'},"etc","collections.txt");202 if (open(CLAPP,">>$collist_filename"))203 {204 if (flock(CLAPP,LOCK_EX))205 {206 print CLAPP "$unique_dirname\n";207 flock(CLAPP,LOCK_UN);208 close(CLAPP);209 }210 else211 {212 # problem locking file213 my $mess = "Unable to lock collection list";214 $mess .= " configuration file: $collist_filename";215 &webpageutil::error_location($args,$mess);216 close(CLAPP);217 return;218 }219 }220 else221 {222 # problem223 my $mess = "Unable to append to collection list";224 $mess .= " configuration file: $collist_filename";225 &webpageutil::error_location($args,$mess);226 return;227 }228 229 215 } 230 216 else … … 248 234 249 235 &main(); 250 251 252 253 254 -
branches/New_Config_Format-branch/gsdl/collect/modelcol/etc/collect.cfg
r815 r1279 6 6 indexes document:text 7 7 defaultindex document:text 8 plugin GMLPlug 9 plugin TEXTPlug 10 plugin ArcPlug 11 plugin RecPlug 8 9 **plugins** 12 10 13 11 classify AZList metadata=Title 14 12 15 collectionmeta collectionname "**collection**" 13 collectionmeta collectionname "**title**" 14 collectionmeta iconcollection "" 15 collectionmeta collectionextra "**about**" 16 16 collectionmeta .document:text "documents" -
branches/New_Config_Format-branch/gsdl/docs/TODO
r1036 r1279 1 1 2 2 configuration/installation: 3 4 - iconcollection fields in collect.cfg are dependant on httpprefix5 6 - set up setup.bash/setup.bat etc during configuration (so GSDLHOME7 is full path and script can be run from anywhere)8 3 9 - autoconfigure/InstallShield to ask where cgi-bin directory is?10 11 4 unix: 12 5 13 - builddemo.sh and eveything in bin/script must be executable 14 15 - maybe look at editing all perl scripts during configuration to 16 get #!/usr/bin/... line pointing to correct place. definitely 17 wants to default to /usr/bin/perl instead of /usr/local/bin/perl5 6 - look into getting perl scripts to run correctly on any operating 7 system (i.e. the #! stuff) -- those in cgi-bin particularly need 8 to work on windows too (#!perl on windows, #!/use/bin/perl on 9 linux) -- perlrun manpage 18 10 19 11 - add fastcgi to distribution … … 21 13 windows: 22 14 23 - use Installshield to create packages (maybe use 'package for the 24 web') of: 25 - full source code with building capability 26 - server and cd-rom executables with building capability 27 - server and cd-rom executables only 15 - use Installshield to create windows packages - wait for George to 16 decide what he's going to do about InstallShield 28 17 29 - use same executable for both cd-rom executables 18 - call server version of cd-rom executable 'standard' and other 19 version 'backup' (or maybe 'gold' and 'silver'?) 30 20 31 - version string in fnord.cpp should be changed when a new version32 is released - maybe the support.htm file too21 - fix up Local Library - somehow need to have option of old server 22 and single-user (or Gold and Silver?) within same executable. 33 23 34 write perl script for updating distribution35 24 36 25 tidy up text versions of macro files 37 26 38 Write a perl script to go through a translated macro file and generate 39 appropriate icons 40 41 add german interface 27 look further into creating images containing non-latin1 characters 42 28 43 29 create default collection images at build time with gimp script 44 45 convert crappy old scheme gimp scripts to perl46 30 47 31 fix query caching - do caching in receptionist, finish off cross collection … … 53 37 add to 54 38 55 get remaining plugins tidied up and using passed in options - file56 extension option for all plugins57 58 get all plugins to use multiread object and throw away the specialized GB59 plugins60 61 39 write a gzip/bzip/zip/tar plugin and take any remaining gzip stuff out of 62 40 rest of plugins 63 41 64 tidy up classifiers, make collection-specific ones more object oriented, 65 add section and compact options instead of using separate classifiers - get 66 classifiers using same option passing code as plugins now use 42 look at speeding up acronym extraction code, add more options 67 43 68 44 create a general classifier for doing stuff like NPepaList.pm does. should … … 70 46 etc. 71 47 72 sort out arrows/paging of browserclasses (for queryaction too!) 73 -DocumentBottomArrows?? - want arrows at bottom as well as top of pages for 74 gberg type collections 48 for gsdl-3.0 75 49 76 tidy up automatic help text - need to work out type of collection at build 77 time - get rid of the hacky HelpNoDocs, HelpBibDocs and HelpBookDocs config 78 file entries 50 - extend configuration file syntax - tidy up all the format stuff - 51 replace DocumentImages, DocumentTitles and DocumentHeading with 52 DocumentColumn stuff (develop New_Config_Format-branch CVS branch) 79 53 80 fix up collection specific metadata - content negotiation?? 54 - tidy up classifiers, make collection-specific ones more object oriented 55 (probably create classifier base class), add section and compact 56 options instead of using separate classifiers - get classifiers using 57 same option passing code as plugins now use 81 58 82 append to init and error logs instead of overwriting 59 - sort out arrows/paging of browserclasses (for queryaction too!) 60 DocumentBottomArrows?? - want arrows at bottom as well as top of pages 61 for gberg type collections 83 62 84 implement a more robust way of dealing with the way browsers encode form 85 arguments when you don't want them to - check that 86 _decodedcompressedoptions_ has been set up correctly everywhere 63 - tidy up automatic help text - need to work out type of collection at 64 build time - get rid of the hacky HelpNoDocs, HelpBibDocs and 65 HelpBookDocs config file entries 87 66 88 extend configuration file syntax - tidy up all the format stuff 67 - fix up collection specific metadata - content negotiation?? 68 "chapters" = "Kapiteln" 69 "section titles" = "Sektionstiteln" 70 "entire books" = "ganzen Büchern" 89 71 90 replace DocumentImages, DocumentTitles and DocumentHeading with 91 DocumentIcon (values of true, false and formatstring - true may be part of 92 formatstring) 72 - add ability to use a separate formatstring for each index when 73 displaying query results 93 74 94 fix up formattools - bug preventing nested If/Or - check that no 'here' 95 pointers can run past 'end' 75 - make interface languages and encodings easier to add. defining 76 languages and encodings should be done in main.cfg (or collect.cfg for 77 collection specific control). should also define: 78 - which encodings a given language may use -- i.e. the preferences page 79 shouldn't let you select an encoding that doesn't work with the 80 currently selected language 81 - which encoding is the default for a given language 82 - which language is the default. 96 83 97 get numwords (and maybe other stats?) working in collection info - maybe98 set as macros99 84 100 85 tidy things up so that get_collectinfo is only called once per collection 101 (at init time for fastcgi) - it's currently being called all over the place 102 103 get BrowseFilter EndResults option to accept -1 86 (at init time for fastcgi) - it's currently being called all over the 87 place. maybe load collection info into recpt.collectinfo structure. load in 88 as required for each collection so structure would slowly fill up with all 89 collections when using fastcgi 104 90 105 91 add Language metadata to all documents by default?? 106 92 107 fix the way the interface language preference is implemented - should check 108 somewhere that current language matches one of those specified in config 109 file 93 usage page - Matthias Dalmeier 110 94 111 bug when classification is empty. CL number still gets incremented so 112 formatstrings don't match as expected 95 create a usage page from ftp logs (build on ftp_stats.pl script) 113 96 114 usage page 115 116 if document has only one level - e.g. TEXTPlug or HTMLPlug; top level type 117 should be Invisible so that tables of contents aren't displayed 118 119 add browserclasses to statusaction 120 121 add ability to use a separate formatstring for each index when displaying 122 query results 123 124 rebuild fao1 and fao2 with fixed up version of HTMLPlug (no multiple copies 125 of images 126 127 rebuild Davids collections: 128 - whist 129 - musvid 130 - ohist 97 tidy up ohist to remove need for public_html/ohist stuff 131 98 132 99 WebPlug - optimize to run reasonably quickly? - Currently works (I think) … … 135 102 build a small collection 136 103 137 look into possibility of clearing highlighting whenever you go to browse138 etc. i.e. highlighting only works when coming directly from a search139 140 replace mk_all_dir function with perl module - see if speed improvements141 are worthwhile142 143 104 update collections - set up auto-updating where needed 144 105 - csbib … … 146 107 - tcc - mail updating 147 108 - niupepa 148 149 add option to buildcol.pl to force documents to be paged/hierarchical. need 150 to use it for niupepa collection 109 - gberg 151 110 152 111 sort documents between importing and building 153 112 154 fix plugins option to mkcol.pl 113 get polling for new collections to work when using fastcgi 155 114 156 get polling for new collections to work when using fastcgi - should also 157 produce error message when unable to read collect dir (rather than just 158 exiting) 115 ipc and unesco collections have no 'about' text (maybe others too). 159 116 160 what to do with Makefiles for collection specific receptionists (like 161 cstr), use configure? 117 compiler warnings 162 118 163 check out mgs declaration of error() 119 windows cd-rom version 164 120 165 call server version of cd-rom executable 'standard' and other version 166 'backup' 121 - message in browser selection box to say that IE isn't compatible 122 with 'silver' version (instead of simply greying out selection of 123 IE as currently happens). 167 124 168 put download stuff onto ftp 125 - look into Belgium bug ("Netscape was unable to create a network 126 socket connection... " -- NT 4.0 -- no internet connection -- run 127 programs/accessories/communication/internet connection wizard, 128 answer LAN to all questions -- bug appears to be present if you 129 get above error message when attempting to access 127.0.0.1 -- 130 look into testing for this problem from InstallShield, maybe try 131 reading from 127.0.0.1 and see if it times out? 169 132 170 fix up publications page - maybe just use an index.html type thing on rose 133 look into need for _LITTLE_ENDIAN flag in mg 171 134 172 look into server security 135 make all external nzdl.org pages plain html rather than macro pages. remove 136 all related images from distribution 173 137 174 fix up compiler warnings (on titoki and rose) 138 ohists RealAudio server appears to be broken 175 139 176 ipc collection has no 'about' text 140 capability to view actual BibTeX entries of csbib (and maybe other?) 141 collections 177 142 178 sort out bbc collections - find real import stuff - delete multiple copies 179 that are laying around 143 scripts for installing w3mir - a .bat version of davids install.sh files 180 144 181 tidy up cstr - image on left above all 5 buttons - title on right above 182 goto line 145 implement proper unicode sorting within classifiers 183 146 184 play with csbib - appear to only get 5 matches for 'references' query on 185 'the' - some indexes also appear to only work some of the time 147 get file locking to work on non GSDL_USE_IOS_H compilers (VC++ 6.0) 186 148 149 produce an error message when no "built" collections are available 150 (currently only produce an error when no collections at all are available) 151 152 have another go at getting gsdl_system() function to work properly on 153 windows 95 (for end-user collection building) 154 -
branches/New_Config_Format-branch/gsdl/etc/VERSION
r1040 r1279 1 gsdl version: 2.132 cvs tag: gsdl- 2133 build version: 2. 01 gsdl version: x.xx 2 cvs tag: gsdl-x_xx-distribution 3 build version: 2.1 -
branches/New_Config_Format-branch/gsdl/etc/main.cfg
r1035 r1279 1 1 maintainer greenstone@cs.waikato.ac.nz 2 2 3 macrofiles style.dm base.dm query.dm help.dm pref.dm \ 3 about.dm home.dm document.dm status.dm \ 4 authen.dm users.dm html.dm english.dm \ 5 english2.dm chinese.dm maori.dm people.dm \ 6 tech.dm prescrpt.dm mg.dm rw.dm build.dm \ 7 extlink.dm gsdlsoft.dm delhistory.dm german.dm 4 about.dm document.dm status.dm \ 5 home.dm \ 6 authen.dm users.dm html.dm build.dm extlink.dm delhistory.dm \ 7 gsdl.dm gsdlsoft.dm prescrpt.dm mg.dm \ 8 english.dm chinese.dm french.dm german.dm maori.dm \ 9 english2.dm french2.dm arabic.dm spanish.dm 10 8 11 status enabled 9 12 usecookies true … … 12 15 macroprecedence c,v,l 13 16 cgiarg shortname=v longname=version multiplechar=false argdefault=0 \ 14 defaultstatus=weak savedarginfo= can17 defaultstatus=weak savedarginfo=must 15 18 16 19 cgiarg shortname=a argdefault=p -
branches/New_Config_Format-branch/gsdl/lib/cfgread.cpp
r1076 r1279 28 28 /* 29 29 $Log$ 30 Revision 1.8.2.1 2000/07/12 22:20:52 sjboddie 31 merged changes to trunk into New_Config_Format branch 32 33 Revision 1.9 2000/07/05 21:49:22 sjboddie 34 Receptionist now caches collection information to avoid making multiple 35 get_collectinfo calls to collection server 36 30 37 Revision 1.8 2000/04/06 19:57:57 cs025 31 38 Correcting a correction - reinstated all lib files due to silly … … 56 63 57 64 #include "cfgread.h" 58 59 void collectioninfo_t::clear () {60 gsdl_gsdlhome.clear();61 gsdl_gdbmhome.clear();62 }63 65 64 66 int write_ini_line (ofstream &fileout, const text_t &key, const text_t value) { -
branches/New_Config_Format-branch/gsdl/lib/cfgread.h
r1076 r1279 41 41 #endif 42 42 43 struct collectioninfo_t {44 void clear ();45 collectioninfo_t () {clear();}46 47 text_t gsdl_gsdlhome;48 text_t gsdl_gdbmhome;49 };50 51 typedef map<text_t, collectioninfo_t, lttext_t> colinfo_tmap;52 53 43 // return 0 on success, -1 on failure 54 44 int write_ini_line (ofstream &fileout, const text_t &key, const text_t value); -
branches/New_Config_Format-branch/gsdl/lib/display.cpp
r1076 r1279 28 28 /* 29 29 $Log$ 30 Revision 1.19.2.1 2000/07/12 22:20:53 sjboddie 31 merged changes to trunk into New_Config_Format branch 32 33 Revision 1.21 2000/06/18 22:56:55 sjboddie 34 fixed a bug that I'd introduced earlier when attempting to get things 35 compiling on VC++ 6.0 - the gsdl-2.22 release (and possibly 2.21) was 36 affected and wouldn't have displayed chinese and Arabic characters 37 correctly 38 39 Revision 1.20 2000/05/12 03:09:23 sjboddie 40 minor modifications to get web library compiling under VC++ 6.0 41 30 42 Revision 1.19 2000/04/06 19:57:58 cs025 31 43 Correcting a correction - reinstated all lib files due to silly … … 684 696 // bigendian should be set to 1 685 697 // 0 will be returned when the end of the file has been found 686 unsigned short my_uni_get ( istream &fin, int &line,698 unsigned short my_uni_get (unistream &fin, int &line, 687 699 int &isunicode, int &bigendian) { 688 700 unsigned short c = 0; … … 692 704 // get the next two characters 693 705 unsigned char c1 = 0, c2 = 0; 706 694 707 if (!fin.eof()) fin.get(c1); 695 708 if (!fin.eof()) fin.get(c2); … … 766 779 767 780 // open the file 768 ifstream fin(filenamestr); 781 unistream fin (filenamestr); 782 769 783 if (fin.fail()) return -1; // read failed 770 784 -
branches/New_Config_Format-branch/gsdl/lib/display.h
r1076 r1279 64 64 # include <iostream.h> 65 65 # include <fstream.h> 66 67 #define unistream ifstream 68 66 69 #else 67 70 # include <iostream> 68 71 # include <fstream> 72 73 typedef std::basic_ifstream<unsigned char> unistream; 74 69 75 #endif 70 76 … … 82 88 // cyclic macros (a includes b and b includes a) 83 89 #define MAXRECURSIONDEPTH 30 84 85 90 86 91 // class prototypes -
branches/New_Config_Format-branch/gsdl/lib/fileutil.cpp
r1076 r1279 28 28 /* 29 29 $Log$ 30 Revision 1.14.2.1 2000/07/12 22:20:54 sjboddie 31 merged changes to trunk into New_Config_Format branch 32 33 Revision 1.16 2000/05/12 03:09:22 sjboddie 34 minor modifications to get web library compiling under VC++ 6.0 35 36 Revision 1.15 2000/05/04 08:27:28 sjboddie 37 modifications for windows ports of GCC 38 30 39 Revision 1.14 2000/04/06 19:57:59 cs025 31 40 Correcting a correction - reinstated all lib files due to silly … … 118 127 path2.erase (path2.begin(), here); 119 128 120 // return the concatenation of the two strings 121 return path1 + path2; 129 text_t fullpath = path1 + path2; 130 131 // make sure all the right slashes are used 132 here = fullpath.begin(); 133 end = fullpath.end(); 134 while (here != end) { 135 #ifdef __WIN32__ 136 if (*here == '/') *here = '\\'; 137 #else 138 if (*here == '\\') *here = '/'; 139 #endif 140 here ++; 141 } 142 return fullpath; 122 143 } 123 144 … … 139 160 bool file_exists (const text_t &filename) { 140 161 char *cstr = filename.getcstr(); 162 #ifdef GSDL_USE_IOS_H 141 163 ifstream filestream (cstr, ios::in | ios::nocreate); 164 #else 165 ifstream filestream (cstr, ios::in); 166 #endif 142 167 delete cstr; 143 168 … … 155 180 bool file_writable (const text_t &filename) { 156 181 char *cstr = filename.getcstr(); 182 #ifdef GSDL_USE_IOS_H 157 183 ifstream filestream (cstr, ios::out | ios::nocreate); 184 #else 185 ifstream filestream (cstr, ios::out); 186 #endif 158 187 delete cstr; 159 188 … … 168 197 } 169 198 170 #if defined __WIN32__199 #if defined(__WIN32__) && !defined(__GNUC__) 171 200 172 201 #include <windows.h> 173 202 174 BOOLread_dir (const text_t &dirname, text_tarray &filelist) {203 bool read_dir (const text_t &dirname, text_tarray &filelist) { 175 204 176 205 WIN32_FIND_DATA FileData; 177 206 HANDLE hSearch; 178 DWORD dwAttrs;179 207 char *dirpath = dirname.getcstr(); 180 208 strcat (dirpath, "\\*"); 181 182 BOOL finished = false;183 209 184 210 hSearch = FindFirstFile(dirpath, &FileData); -
branches/New_Config_Format-branch/gsdl/lib/gsdlconf.h
r1076 r1279 30 30 #define GSDLCONF_H 31 31 32 #ifndef __WIN32__ 32 #if defined(__WIN32__) 33 #include "../win32cfg.h" 34 #else 33 35 #include "../config.h" 34 36 #endif … … 78 80 #endif 79 81 82 // mktemp 83 84 #if !defined(__WIN32__) || defined(__GNUC__) 85 #include <unistd.h> 86 #define GSDL_MKTEMP(str) mktemp(str) 87 #else 88 #include <io.h> 89 #define GSDL_MKTEMP(str) _mktemp(str) 90 #endif 91 92 80 93 81 94 // file locking 82 95 83 96 #if defined(__WIN32__) 97 98 #if !defined(LK_UNLOCK) && defined(LK_UNLCK) 99 #define LK_UNLOCK LK_UNLCK 100 #endif 101 102 #if defined (GSDL_USE_IOS_H) 84 103 #include <io.h> 85 104 #include <sys/locking.h> 105 106 #if defined(__GNUC__) 107 #define GSDL_GET_FILEDESC(str) str.filedesc() 108 #else 86 109 #define GSDL_GET_FILEDESC(str) str.fd() 110 #endif 111 87 112 #define GSDL_UNLOCK_FILE(fd) _locking(fd, LK_UNLCK, 200) 88 113 #define GSDL_LOCK_FILE(fd) lock_val = _locking(fd, LK_NBLCK, 200) 114 115 #else 116 117 // when using <fstream> (i.e. VC++ 6.0) I can't work out how 118 // to return a filedesc. File locking won't currently work 119 // for those windows compilers requiring GSDL_USE_IOS_H to 120 // not be set -- Stefan. 121 #define GSDL_GET_FILEDESC(str) 1 122 #define GSDL_LOCK_FILE(fd) lock_val = 0 123 #define GSDL_UNLOCK_FILE(fd) 0 124 #endif 89 125 90 126 #else -
branches/New_Config_Format-branch/gsdl/lib/gsdltools.cpp
r1076 r1279 28 28 /* 29 29 $Log$ 30 Revision 1.3.2.1 2000/07/12 22:20:55 sjboddie 31 merged changes to trunk into New_Config_Format branch 32 33 Revision 1.5 2000/05/19 04:56:01 sjboddie 34 added gsdl_system function for spawning off new processes under windows 35 36 Revision 1.4 2000/05/04 05:16:23 sjboddie 37 Moved dm_safe from htmlutils to gsdltools. Also made it escape '\' 38 characters to prevent their mysterious disapearance from things like 39 windows filenames when they get passed through the macro expander. 40 30 41 Revision 1.3 2000/04/06 19:58:01 cs025 31 42 Correcting a correction - reinstated all lib files due to silly … … 49 60 } 50 61 62 text_t dm_safe (const text_t &instring) { 51 63 64 text_t outstring; 65 text_t::const_iterator here = instring.begin(); 66 text_t::const_iterator end = instring.end(); 67 while (here != end) { 68 if (*here == '_' || *here == '\\') outstring.push_back('\\'); 69 outstring.push_back(*here); 70 here ++; 71 } 72 return outstring; 73 } 74 75 // gsdl_system spawns a completely separate program (i.e. the calling 76 // program continues and terminates normally). Arguments containing special 77 // characters (e.g. '&') should be quoted with "" 78 79 // on unix systems youcan get the same effext as this function by doing a 80 // system call and putting the spawned process in the background 81 // (e.g. system (funcname options &); 82 83 #if defined (__WIN32__) 84 #include <windows.h> 85 void gsdl_system (char *cmd, ostream &logout) { 86 87 STARTUPINFO ps = {sizeof(STARTUPINFO), NULL, NULL, NULL, 88 0, 0, 0, 0, 0, 0, 89 0, 0, 90 0, 0, NULL, 91 NULL, NULL, NULL}; 92 PROCESS_INFORMATION pi; 93 BOOL res = CreateProcess(NULL, 94 cmd, 95 NULL, 96 NULL, 97 FALSE, 98 DETACHED_PROCESS, 99 NULL, 100 NULL, 101 &ps, 102 &pi); 103 if (!res) { 104 logout << "Failed to start " << cmd << " process, error code " << GetLastError(); 105 } 106 107 CloseHandle(pi.hProcess); 108 CloseHandle(pi.hThread); 109 } 110 111 #endif -
branches/New_Config_Format-branch/gsdl/lib/gsdltools.h
r1076 r1279 38 38 bool littleEndian(); 39 39 40 // escapes '\' and '_' characters with '\' 41 // note that single '\' characters occurring 42 // naturally within text (or filenames!!) will 43 // be removed by the dm macro language 44 text_t dm_safe (const text_t &instring); 45 46 47 // gsdl_system spawns a completely separate program (i.e. the calling 48 // program continues and terminates normally). Arguments containing special 49 // characters (e.g. '&') should be quoted with "" 50 51 // on unix systems youcan get the same effext as this function by doing a 52 // system call and putting the spawned process in the background 53 // (e.g. system (funcname options &); 54 #if defined (__WIN32__) 55 void gsdl_system (char *cmd, ostream &logout); 40 56 #endif 57 58 #endif -
branches/New_Config_Format-branch/gsdl/lib/gsdlunicode.cpp
r1076 r1279 28 28 /* 29 29 $Log$ 30 Revision 1.12.2.1 2000/07/12 22:20:55 sjboddie 31 merged changes to trunk into New_Config_Format branch 32 33 Revision 1.14 2000/06/23 05:03:29 nzdl 34 fixed a couple of compiler warnings created by the new encoding stuff 35 36 Revision 1.13 2000/06/23 03:21:38 sjboddie 37 Created converter classes for simple 8 bit encodings that use a 38 simple textual map file. Instances of these classes are used to handle 39 the Windows 1256 (Arabic) encoding. 40 30 41 Revision 1.12 2000/04/06 19:58:02 cs025 31 42 Correcting a correction - reinstated all lib files due to silly … … 70 81 #include <stdio.h> 71 82 83 #if defined(GSDL_USE_OBJECTSPACE) 84 # include <ospace\std\iostream> 85 # include <ospace\std\fstream> 86 #elif defined(GSDL_USE_IOS_H) 87 # include <iostream.h> 88 # include <fstream.h> 89 #else 90 # include <iostream> 91 # include <fstream> 92 #endif 72 93 73 94 … … 551 572 else status = unfinished; 552 573 } 574 575 576 bool simplemapconvert::loadmapfile (bool in) { 577 if (loaded) return true; 578 if (mapfile.empty()) return false; 579 580 char *cfilename = mapfile.getcstr(); 581 #ifdef GSDL_USE_IOS_H 582 ifstream mapfilein (cfilename, ios::in | ios::nocreate); 583 #else 584 ifstream mapfilein (cfilename, ios::in); 585 #endif 586 delete cfilename; 587 if (!mapfilein) return false; 588 589 char cline[2048]; 590 text_t line; 591 592 while (!mapfilein.eof()) { 593 mapfilein.getline (cline, 2048); 594 line.clear(); 595 line.appendcstr (cline); 596 if (line.empty()) continue; 597 // remove comments 598 text_t::iterator end = line.end(); 599 text_t::iterator here = findchar (line.begin(), end, '#'); 600 if (here != end) { 601 line.erase (here, end); 602 if (line.empty()) continue; 603 } 604 605 text_tarray parts; 606 splitchar (line.begin(), line.end(), '\t', parts); 607 608 // do some simple sanity checks 609 if (parts.size() < 2) continue; 610 text_t::iterator begin1 = parts[0].begin(); 611 text_t::iterator begin2 = parts[1].begin(); 612 if (*begin1 != '0' || *(begin1+1) != 'x') continue; 613 if (*begin2 != '0' || *(begin2+1) != 'x') continue; 614 char *from = parts[0].getcstr(); 615 char *to = parts[1].getcstr(); 616 unsigned int f = 0, t = 0; 617 sscanf (from, "%i", &f); 618 sscanf (to, "%i", &t); 619 delete from; 620 delete to; 621 622 if (in) mapping[(unsigned short)f] = (unsigned short)t; 623 else mapping[(unsigned short)t] = (unsigned short)f; 624 } 625 626 loaded = true; 627 return true; 628 } 629 630 unsigned short simplemapconvert::convert (unsigned short c, bool in) { 631 632 if (!loaded) 633 if (!loadmapfile(in)) return absentc; 634 635 return mapping[c]; 636 } 637 638 639 void simplemapinconvertclass::convert (text_t &output, status_t &status) { 640 output.clear(); 641 642 if (start == NULL || len == 0) { 643 status = finished; 644 return; 645 } 646 647 // don't want any funny sign conversions happening 648 unsigned char *here = (unsigned char *)start; 649 while (len > 0) { 650 651 if (*here < 0x80) 652 output.push_back (*here); // append this character 653 else 654 output.push_back (converter.convert(*here, true)); 655 656 ++here; 657 --len; 658 } 659 660 start = (char *)here; // save current position 661 status = finished; 662 } 663 664 665 void simplemapoutconvertclass::convert (char *output, size_t maxlen, 666 size_t &len, status_t &status) { 667 668 if (input == NULL || output == NULL) { 669 status = finished; 670 return; 671 } 672 673 // don't want any funny sign conversions happening 674 unsigned char *uoutput = (unsigned char *)output; 675 text_t::iterator textend = input->end(); 676 len = 0; 677 while ((len < maxlen) && (texthere != textend)) { 678 679 if (*texthere < 0x80) *uoutput = (unsigned char)(*texthere); 680 else *uoutput = converter.convert (*texthere, false); 681 682 ++uoutput; 683 ++len; 684 ++texthere; 685 } 686 687 if (texthere == textend) status = finished; 688 else status = unfinished; 689 } -
branches/New_Config_Format-branch/gsdl/lib/gsdlunicode.h
r1076 r1279 215 215 }; 216 216 217 218 // Simple input and output converter classes for use with 8 bit encodings 219 // using simple textual map files. Map files should contain (at least) two 220 // tab-separated fields. The first field is the mapped value and the second 221 // field is the unicode value. 222 223 struct ltus_t 224 { 225 bool operator()(const unsigned short &t1, const unsigned short &t2) const 226 { return t1 < t2; } 227 }; 228 229 230 class simplemapconvert { 231 public: 232 simplemapconvert () {absentc=0; loaded=false;} 233 unsigned short convert (unsigned short c, bool in); 234 void setmapfile (const text_t &themapfile) {mapfile = themapfile;} 235 236 protected: 237 bool loadmapfile (bool in); 238 239 map <unsigned short, unsigned short, ltus_t> mapping; 240 bool loaded; 241 text_t mapfile; 242 unsigned short absentc; 243 }; 244 245 246 class simplemapinconvertclass : public inconvertclass { 247 public: 248 virtual ~simplemapinconvertclass () {} 249 250 void convert (text_t &output, status_t &status); 251 252 void setmapfile (const text_t &themapfile) {converter.setmapfile(themapfile);} 253 254 protected: 255 simplemapconvert converter; 256 }; 257 258 class simplemapoutconvertclass : public rzwsoutconvertclass { 259 public: 260 virtual ~simplemapoutconvertclass () {} 261 262 void convert (char *output, size_t maxlen, 263 size_t &len, status_t &status); 264 265 void setmapfile (const text_t &themapfile) {converter.setmapfile(themapfile);} 266 267 protected: 268 simplemapconvert converter; 269 }; 270 271 272 273 217 274 #endif -
branches/New_Config_Format-branch/gsdl/lib/text_t.cpp
r1076 r1279 28 28 /* 29 29 $Log$ 30 Revision 1.17.2.1 2000/07/12 22:20:56 sjboddie 31 merged changes to trunk into New_Config_Format branch 32 33 Revision 1.18 2000/04/14 02:50:12 sjboddie 34 added text_t versions of joinchar to work with sets and lists 35 30 36 Revision 1.17 2000/04/06 19:58:03 cs025 31 37 Correcting a correction - reinstated all lib files due to silly … … 434 440 { 435 441 if (!first) outtext.push_back (c); 442 first = false; 443 outtext += *here; 444 here++; 445 } 446 } 447 448 void joinchar (const text_tlist &inlist, text_t c, text_t &outtext) 449 { 450 outtext.clear (); 451 452 text_tlist::const_iterator here = inlist.begin (); 453 text_tlist::const_iterator end = inlist.end (); 454 bool first = true; 455 while (here != end) 456 { 457 if (!first) outtext += c; 458 first = false; 459 outtext += *here; 460 here++; 461 } 462 } 463 464 void joinchar (const text_tset &inlist, text_t c, text_t &outtext) 465 { 466 outtext.clear (); 467 468 text_tset::const_iterator here = inlist.begin (); 469 text_tset::const_iterator end = inlist.end (); 470 bool first = true; 471 while (here != end) 472 { 473 if (!first) outtext += c; 436 474 first = false; 437 475 outtext += *here; -
branches/New_Config_Format-branch/gsdl/lib/text_t.h
r1076 r1279 238 238 void joinchar (const text_tlist &inlist, unsigned short c, text_t &outtext); 239 239 void joinchar (const text_tarray &inlist, unsigned short c, text_t &outtext); 240 void joinchar (const text_tset &inlist, text_t c, text_t &outtext); 241 void joinchar (const text_tlist &inlist, text_t c, text_t &outtext); 240 242 void joinchar (const text_tarray &inlist, text_t c, text_t &outtext); 241 243 -
branches/New_Config_Format-branch/gsdl/lib/win32.mak
r1076 r1279 25 25 ########################################################################### 26 26 27 GSDLHOME = d:\home\dl\gsdl28 STLPATH = d:\home\dl\stl\stlport27 GSDLHOME = c:\gsdl 28 STLPATH = c:\stlport 29 29 30 30 AR = lib -
branches/New_Config_Format-branch/gsdl/macros/about.dm
r876 r1279 9 9 # don't want link to 'about' page 10 10 _imagecollection_ {_If_("_iconcollection_" ne "", 11 <img src="_iconcollection_" border=0>, <br><br><h2>_collectionname_</h2>} 11 <img src="_iconcollection_" border=0>,<br><br><h2>_collectionname_</h2>)} 12 _imagecollection_ [v=1] {<br><br><h2>_collectionname_</h2>} 12 13 13 14 ####################################################################### -
branches/New_Config_Format-branch/gsdl/macros/authen.dm
r876 r1279 11 11 _content_ { 12 12 <br><br><br><br> 13 _messagestatus_14 15 13 <form name="login" method="get" action="_gwcgi_"> 16 14 <input type=hidden name="e" value="_If_(_cgiarger_,_cgiarger_,_decodedcompressedoptions_)"> 17 15 _hiddenargs_ 16 <center><table width=_pagewidth_> 17 <tr><td> 18 _messagestatus_ 19 </td></tr> 18 20 19 <table border=0> 20 <tr><td>_textusername_</td><td><input type="text" name="un" value="_cgiargun_" size=10></td></tr> 21 <tr><td>_textpassword_</td><td><input type="password" name="pw" size=10></td></tr> 22 <tr><td></td><td><input type="submit" value="sign in"></td></tr> 21 <tr><td> 22 <table><td>_textusername_</td> 23 <td><input type="text" name="un" value="_cgiargun_" size=10></td> 24 <td></td></tr> 25 <tr><td>_textpassword_</td> 26 <td><input type="password" name="pw" size=10></td> 27 <td><input type="submit" value="sign in"></td> 28 </tr> 29 </table> 30 <td></tr> 23 31 </table> 24 32 </form> -
branches/New_Config_Format-branch/gsdl/macros/base.dm
r1019 r1279 6 6 7 7 ########## 8 9 # won't need this once old versions of library are no longer used10 _decodedcompressedoptions_ {_compressedoptions_}11 12 8 13 9 _htmlextra_ {} … … 27 23 _imagethispage_ {} 28 24 _iconcollection_ {} 29 _imagecollection_ {_If_("_iconcollection_" ne "",<a href="_httppagex_(about)"><img src="_iconcollection_" border=0></a>)} 25 _collectionname_ {} 26 27 _imagecollection_ {_If_("_iconcollection_" ne "", 28 <a href="_httppageabout_"><img src="_iconcollection_" border=0></a>, 29 _imagecollectionv_} 30 _imagecollection_ [v=1] {_imagecollectionv_} 31 _imagecollectionv_ {_If_(_collectionname_,<br><br><h2><a href="_httppageabout_">_collectionname_</a></h2>)} 30 32 31 33 ####################################################################### … … 50 52 _Datewidth_ {_widthtdatex_} 51 53 _Subjectwidth_ {_widthtsubjx_} 54 _Towidth_ {_widthttox_} 55 _Fromwidth_ {_widthtfromx_} 52 56 _Organizationwidth_ {_widthtorgx_} 53 57 _Howtowidth_ {_widththowx_} … … 75 79 _jselection_ {} 76 80 _nselection_ {} 77 81 #granularity selection for mgpp 82 _gselection_ {} 78 83 ####################################################################### 79 84 # navigation bar images … … 88 93 89 94 # image macros for all the classifications currently supported by 90 # this receptionist. i.e. title, author, subject, series, date, 91 # howto, and organization (and search) 95 # this receptionist. 96 # 97 # image macros for to and from added by gwp on 2000 june 13 92 98 93 99 _imagesearch_ {<a href="_httpquery_" … … 137 143 border="0" alt="_textimageSubject_"></a>} 138 144 _imageSubject_[v=1] {<a href="_httpbrowseSubject_">_textimageSubject_</a><br> 145 } 146 147 _imageTo_ {<a href="_httpbrowseTo_" 148 onMouseover = "img\_on('to')" 149 onMouseout = "img\_off('to')"><img name="to" 150 src="_httpiconttoof_" width="_widthttox_" height="_heightttox_" 151 border="0" alt="_textimageTo_"></a>} 152 _imageTo_[v=1] {<a href="_httpbrowseTo_">_textimageTo_</a><br> 153 } 154 155 _imageFrom_ {<a href="_httpbrowseFrom_" 156 onMouseover = "img\_on('from')" 157 onMouseout = "img\_off('from')"><img name="from" 158 src="_httpicontfromof_" width="_widthtfromx_" height="_heighttfromx_" 159 border="0" alt="_textimageFrom_"></a>} 160 _imageFrom_[v=1] {<a href="_httpbrowseFrom_">_textimageFrom_</a><br> 139 161 } 140 162 … … 283 305 } 284 306 307 _javaTo_ { 308 to\_on = new Image(_widthttox_, _heightttox_); 309 to\_on.src = "_httpiconttoon_"; 310 to\_off = new Image(_widthttox_, _heightttox_); 311 to\_off.src = "_httpiconttoof_"; 312 } 313 314 _javaFrom_ { 315 from\_on = new Image(_widthtfromx_, _heighttfromx_); 316 from\_on.src = "_httpicontfromon_"; 317 from\_off = new Image(_widthtfromx_, _heighttfromx_); 318 from\_off.src = "_httpicontfromof_"; 319 } 320 285 321 _javaHowto_ { 286 322 how\_on = new Image(_widththowx_, _heightthowx_); … … 323 359 ####################################################################### 324 360 325 _mailaddr_ { nzdl@nzdl.org}361 _mailaddr_ {greenstone@cs.waikato.ac.nz} 326 362 327 363 _gsdltop_ {_top} … … 336 372 _httpdocimg_ {_httpcollimg_/_thisOID_} 337 373 338 _httpcollection_ {_httpprefix_/collect/_cgiargc_}374 _httpcollection_ {_httpprefix_/collect/_cgiargc_} 339 375 340 376 _httppagex_ {_gwcgi_?e=_compressedoptions_&a=p&p=_1_} … … 348 384 349 385 _httpgreenstone_ {_httppagex_(gsdl)} 386 _httpdownload_ {http://www.nzdl.org/download} 387 _httppublications_ {_httpdownload_/greenstone/publications} 350 388 351 389 _httpcurrentdocument_ {_gwcgi_?e=_compressedoptions_&cl=_cgiargcl_&d=_cgiargd_} … … 512 550 513 551 _icontabSubjectgreen_ {<img 514 src="_httpicontsubjgr_" height=_heighttsubjx_ width= widthtsubjx_ border=0>}552 src="_httpicontsubjgr_" height=_heighttsubjx_ width=_widthtsubjx_ border=0>} 515 553 _icontabSubjectgreen_[v=1] {_texticontabsubjectgreen_} 554 555 _icontabTogreen_ {<img 556 src="_httpiconttogr_" height=_heightttox_ width=_widthttox_ border=0>} 557 _icontabTogreen_[v=1] {_texticontabtogreen_} 558 559 _icontabFromgreen_ {<img 560 src="_httpicontfromgr_" height=_heighttfromx_ width=_widthtfromx_ border=0>} 561 _icontabFromgreen_[v=1] {_texticontabfromgreen_} 516 562 517 563 _icontabHowtogreen_ {<img … … 528 574 529 575 _icontabOrganizationgreen_ {<img 530 src="_httpicontorggr_" height=_heighttorg gr_ width=_widthtorggr_ border=0>}576 src="_httpicontorggr_" height=_heighttorgx_ width=_widthtorgx_ border=0>} 531 577 _icontabOrganizationgreen_[v=1] {_texticontaborggreen_} 532 578 -
branches/New_Config_Format-branch/gsdl/macros/build.dm
r725 r1279 10 10 <table width=100%> 11 11 <tr> 12 <td><img src=" /gsdl/images/gsdl_height.gif" width=2 height=77></td>12 <td><img src="_httpimg_/spacer.gif" width=2 height=77></td> 13 13 <td>_iconblankbar_ 14 14 <center><h2>_1_</h2></center> … … 44 44 } 45 45 46 _httpiconstop_ {_httpimg_/stop.gif} 46 47 47 48 _iconwizardnext_{<img src="_httpiconmore_" align=absbottom … … 73 74 _bcargfileorurl_ {file} 74 75 _bcarginputdir_ {} 75 _bcargcopydir_ { }76 _bcargcopydir_ {yes} 76 77 _bcargingsdlarea_ {no} 77 78 _bcargacronyms_ {off} … … 287 288 This process is structured as a series of Web pages, overseen by the 288 289 new-collection "wizard." The wizard bar at the bottom of the page 289 shows you the sequence sof pages to be completed. You can return to290 a previous lypage by clicking on the corresponding item in the wizard bar.290 shows you the sequence of pages to be completed. You can return to 291 a previous page by clicking on the corresponding item in the wizard bar. 291 292 </td> 292 293 </tr> … … 454 455 \} 455 456 \} 456 457 457 simulate_get_action("_httpbuild_&bca=newcol"); 458 458 \} … … 654 654 Note, once a collection has been built it 655 655 is not necessary for the source data to remain in the Greenstone 656 collection area -- the collection can be safely access , browsed656 collection area -- the collection can be safely accessed, browsed 657 657 and searched without this. If you wish, however, to make changes 658 to the collection and then rebuilt it then 659 the source data must still be avialable. 658 to the collection and then rebuild, the source data must still be available. 660 659 </font> 661 660 </td> … … 697 696 698 697 var cgi_prefix = "webpage_mkcol.pl"; 699 cgi_prefix += "?gsdlhome=" + escape("_gsdlhome_"); 700 cgi_prefix += "&httpbuild=" + escape("_httpbuild_"); 698 cgi_prefix += "?httpbuild=" + escape("_httpbuild_"); 701 699 cgi_prefix += "&bc1refine=" + escape(bc1refine); 702 700 … … 861 859 \{ 862 860 var cgi_prefix = "webpage_editcol.pl"; 863 cgi_prefix += "?gsdlhome=" + escape("_gsdlhome_"); 864 cgi_prefix += "&httpbuild=" + escape("_httpbuild_"); 861 cgi_prefix += "?httpbuild=" + escape("_httpbuild_"); 865 862 cgi_prefix += "&bc1cfgfile=" + escape(form.bc1cfgfile.value); 866 863 … … 906 903 907 904 <tr> 908 <td>Colle tion to edit:</td>905 <td>Collection to edit:</td> 909 906 <td colspan=3> 910 907 _fullnamemenu_ … … 1027 1024 1028 1025 var cgi_prefix = "_httpbuild_&bca=buildcol"; 1029 cgi_prefix += "&gsdlhome=" + escape("_gsdlhome_");1030 1026 cgi_prefix += "&httpbuild=" + escape("_httpbuild_"); 1031 1027 cgi_prefix += "&wizard=buildframe"; … … 1043 1039 1044 1040 var cgi_prefix = "_httpbuild_&bca=buildcol"; 1045 cgi_prefix += "&gsdlhome=" + escape("_gsdlhome_");1046 1041 cgi_prefix += "&httpbuild=" + escape("_httpbuild_"); 1047 1042 cgi_prefix += "&wizard=buildcol"; … … 1164 1159 1165 1160 1161 # not sure why we need 3 frames here when one appears to always be blank 1162 # - Stefan 1163 #_contentbuildframe_ { 1164 1165 #<frameset rows="*,150,*" border=0> 1166 # <noframes><body bgcolor="#ffffff"> 1167 # <p>You must have a frame enabled browser to view this.</p> 1168 # </body> 1169 # </noframes> 1170 # <frame src="_httpbuild_&bca=buildcol&wizard=buildexec&bc1dirname=_bcargdirname_&bc1tmpname=_bcargtmpname_" name=infoframe> 1171 # <frame src="_httpbuild_&bca=buildstatus&bc1tmpname=_bcargtmpname_" name=execframe> 1172 # <frame src="_httpbuild_&bca=blankpage" name=blankframe> 1173 #</frameset> 1174 #} 1175 1166 1176 _contentbuildframe_ { 1167 1177 1168 <frameset rows=" *,150,*" border=0>1178 <frameset rows="200,150" border=0> 1169 1179 <noframes><body bgcolor="#ffffff"> 1170 1180 <p>You must have a frame enabled browser to view this.</p> … … 1173 1183 <frame src="_httpbuild_&bca=buildcol&wizard=buildexec&bc1dirname=_bcargdirname_&bc1tmpname=_bcargtmpname_" name=infoframe> 1174 1184 <frame src="_httpbuild_&bca=buildstatus&bc1tmpname=_bcargtmpname_" name=execframe> 1175 <frame src="_httpbuild_&bca=blankpage" name=blankframe>1176 1185 </frameset> 1177 1186 } … … 1189 1198 1190 1199 <!-- Hide code from non-js browsers 1191 var timer = 5;1200 var timer = 10; 1192 1201 function restart_count_down() \{ 1193 timer= 5;1202 timer=10; 1194 1203 setTimeout("count_down()",1000); 1195 1204 \} … … 1210 1219 function update_status_page() \{ 1211 1220 var cgi_cmd = "webpage_buildstatus.pl"; 1212 cgi_cmd += "?gsdlhome=" + escape("_gsdlhome_"); 1213 cgi_cmd += "&httpbuild=" + escape("_httpbuild_"); 1221 cgi_cmd += "?httpbuild=" + escape("_httpbuild_"); 1214 1222 cgi_cmd += "&bc1dirname=" + escape("_bcargdirname_"); 1215 1223 cgi_cmd += "&bc1tmpname=" + escape("_bcargtmpname_"); … … 1235 1243 \} 1236 1244 1237 cgi_cmd += "&gsdlhome=" + escape("_gsdlhome_");1238 1245 cgi_cmd += "&httpbuild=" + escape("_httpbuild_"); 1239 1246 cgi_cmd += "&bc1dirname=" + escape("_bcargdirname_"); … … 1358 1365 \{ 1359 1366 var cgi_prefix = "webpage_delcol.pl"; 1360 cgi_prefix += "?gsdlhome=" + escape("_gsdlhome_"); 1361 cgi_prefix += "&httpbuild=" + escape("_httpbuild_"); 1367 cgi_prefix += "?httpbuild=" + escape("_httpbuild_"); 1362 1368 1363 1369 simulate_get_action(cgi_prefix); … … 1394 1400 1395 1401 <tr> 1396 <td>Colle tion to delete:</td>1402 <td>Collection to delete:</td> 1397 1403 <td colspan=3> 1398 1404 _fullnamemenu_ -
branches/New_Config_Format-branch/gsdl/macros/document.dm
r944 r1279 155 155 _iconSubjectpage_ [v=1] {<h2>_texticonhsubj_</h2>} 156 156 157 _iconTopage_ {<img src="_httpiconhto_" width=_widthhto_ 158 height=_heighthto_} 159 _iconTopage_ [v=1] {<h2>_texticonhto_</h2>} 160 161 _iconFrompage_ {<img src="_httpiconhfrom_" width=_widthhfrom_ 162 height=_heighthfrom_} 163 _iconFrompage_ [v=1] {<h2>_texticonhfrom_</h2>} 164 157 165 _iconSeriespage_ {<img src="_httpiconhser_" width=_widthhser_ 158 166 height=_heighthser_} … … 229 237 _tab_ {<td>_icontab_</td>} 230 238 231 _iconcontracttoc_ {<img name="concon" src="_httpiconeconcof_" width=_widtheconcx_ height=_heighteconc of_ alt="_texticoncontracttoc_" border=0>}239 _iconcontracttoc_ {<img name="concon" src="_httpiconeconcof_" width=_widtheconcx_ height=_heighteconcx_ alt="_texticoncontracttoc_" border=0>} 232 240 _iconcontracttoc_[v=1] {_texticoncontracttoc_} 233 241 234 _iconexpandtoc_ {<img name="expcon" src="_httpiconeexpcof_" width=_widtheexp x_ height=_heighteexpcx_ alt="_texticonexpandtoc_" border=0>}242 _iconexpandtoc_ {<img name="expcon" src="_httpiconeexpcof_" width=_widtheexpcx_ height=_heighteexpcx_ alt="_texticonexpandtoc_" border=0>} 235 243 _iconexpandtoc_[v=1] {_texticonexpandtoc_} 236 244 -
branches/New_Config_Format-branch/gsdl/macros/english.dm
r1032 r1279 72 72 _textimageDate_ {Browse by date} 73 73 _textimageSubject_ {Browse by subject category} 74 _textimageTo_ {Browse by To field} 75 _textimageFrom_ {Browse by From field} 74 76 _textimageOrganization_ {Browse by organization} 75 77 _textimageHowto_ {Browse how to categories} … … 85 87 _texticontablistgreen_ {Listing} 86 88 _texticontabsubjectgreen_{Subjects} 89 _texticontabtogreen_{To} 90 _texticontabfromgreen_{From} 87 91 _texticontaborggreen_{Organization} 88 92 _texticontabhowgreen_{How to} … … 116 120 _textmonth12_ {December} 117 121 122 _Document_ {Document} 123 _Section_ {Section} 124 _Paragraph_ {Paragraph} 125 118 126 _magazines_ {Magazines} 119 127 128 _nzdlpagefooter_ {<p>_iconblankbar_ 129 <p><a href="http://www.nzdl.org">New Zealand Digital Library Project</a> 130 <br><a href="http://www.cs.waikato.ac.nz/cs">Department of Computer Science</a>, 131 <a href="http://www.waikato.ac.nz">University of Waikato</a>, 132 New Zealand} 120 133 121 134 #------------------------------------------------------------ … … 174 187 _heighttsubjx_ {17} 175 188 189 ## "to" ## nav_bar_button ## tto ## 190 _httpiconttogr_ {_httpimg_/ttogr.gif} 191 _httpiconttoon_ {_httpimg_/ttoon.gif} 192 _httpiconttoof_ {_httpimg_/ttoof.gif} 193 _widthttox_ {87} 194 _heightttox_ {17} 195 196 ## "from" ## nav_bar_button ## tfrom ## 197 _httpicontfromgr_ {_httpimg_/tfromgr.gif} 198 _httpicontfromon_ {_httpimg_/tfromon.gif} 199 _httpicontfromof_ {_httpimg_/tfromof.gif} 200 _widthtfromx_ {87} 201 _heighttfromx_ {17} 202 176 203 ## "organization" ## nav_bar_button ## torg ## 177 204 _httpicontorggr_{_httpimg_/torggr.gif} … … 269 296 _textCreatorpage_ {_texticonhauth_} 270 297 _textSubjectpage_ {_texticonhsubj_} 298 _textTopage_ {_texticonhto_} 299 _textFrompage_ {_texticonhfrom_} 271 300 _textSeriespage_ {_texticonhser_} 272 301 _textDatepage_ {_texticonhdate_} … … 279 308 _texticonhauth_ {Authors A-Z} 280 309 _texticonhsubj_ {Subjects} 310 _texticonhto_ {To} 311 _texticonhfrom_ {From} 281 312 _texticonhser_ {Series} 282 313 _texticonhdate_ {Dates} … … 330 361 _httpiconhauth_ {_httpimg_/h\_auth.gif} 331 362 _widthhauth_ {200} 363 _heighthauth_ {57} 332 364 333 365 ## "subjects" ## green_title ## h_subj ## … … 335 367 _widthhsubj_ {200} 336 368 _heighthsubj_ {57} 369 370 ## "to" ## green_title ## h_to ## 371 _httpiconhto_ {_httpimg_/h\_to.gif} 372 _widthhto_ {200} 373 _heighthto_ {57} 374 375 ## "from" ## green_title ## h_from ## 376 _httpiconhfrom_ {_httpimg_/h\_from.gif} 377 _widthhfrom_ {200} 378 _heighthfrom_ {57} 337 379 338 380 ## "series" ## green_title ## h_ser ## … … 458 500 _textselect_ {_If_(_cgiargb_,_textadvancedsearch_,_textsimplesearch_)} 459 501 460 _textsimplesearch_ {Search for _If_(_hselection_, _hselection_)_If_(_jselection_,_textjselect_)_If_(_ nselection_, in _nselection_ language)502 _textsimplesearch_ {Search for _If_(_hselection_, _hselection_)_If_(_jselection_,_textjselect_)_If_(_gselection_, at _gselection_ level)_If_(_nselection_, in _nselection_ language) 461 503 which contain _querytypeselection_ of the words} 462 504 463 _textadvancedsearch_ {Search_If_(_hselection_, _hselection_, _defaultindextext_)_If_(_jselection_,_textjselect_)_If_(_ nselection_, in _nselection_ language)505 _textadvancedsearch_ {Search_If_(_hselection_, _hselection_, _defaultindextext_)_If_(_jselection_,_textjselect_)_If_(_gselection_, at _gselection_ level)_If_(_nselection_, in _nselection_ language) 464 506 using _querytypeselection_ query} 465 507 … … 500 542 ## "display" ## hand_made ## 501 543 _httpicondisplay_ {_httpimg_/display.gif} 502 _widthdisplay {60}544 _widthdisplay_ {60} 503 545 _heightdisplay_ {20} 504 546 … … 538 580 _textlangeng_ {English} 539 581 _textlanggerman_ {German} 582 _textlangfrench_ {French} 583 _textlangspanish_ {Spanish} 540 584 _textlangmaori_ {M_amn_ori} 541 585 _textlangchinese_ {Chinese} 586 _textlangarabic_ {Arabic} 542 587 _textgraphical_ {Graphical} 543 588 _texttextual_ {Textual} … … 605 650 _textDateshort_ {access publications by date} 606 651 _textSubjectshort_ {access publications by subject} 652 _textToshort_ {access publications by To field} 653 _textFromshort_ {access publications by From field} 607 654 _textTitleshort_ {access publications by title} 608 655 _textBrowseshort_ {browse publications} … … 642 689 pressing the <i>subjects</i> button. This brings up a list of subjects, 643 690 represented by bookshelves. } 691 692 _textTolong_ { <p>You can <i>access publications by To field</i> by 693 pressing the <i>to</i> button. This brings up a list of addressees. } 694 695 _textFromlong_ { <p>You can <i>access publications by From field</i> by 696 pressing the <i>from</i> button. This brings up a list of senders. } 644 697 645 698 _textSerieslong_ { <p>You can <i>access publications by series</i> by -
branches/New_Config_Format-branch/gsdl/macros/english2.dm
r1034 r1279 23 23 _colnotbuilt_ {Collection not built.} 24 24 25 _textp eople_ {People}25 _textpagetitle_ {Greenstone Digital Library} 26 26 _textfb_ {Feedback} 27 _textpub_ {Publications}28 _texttec_ {Technology}29 _textrw_ {Related Work}30 27 _textinfosheet_ {Info Sheet} 31 _textscreenshots_ {Screen Shots}32 _textnpepainfosheet_ {Niupepa Info Sheet}33 _textpagetitle_ {Greenstone Digital Library}34 _textprojhead_ {The New Zealand Digital Library Project}35 28 29 _textprojhead_ {The Greenstone software and <br>The New Zealand Digital Library Project} 36 30 _textprojinfo_ { 37 <h4>The NZDL system</h4> 38 39 <p> The New Zealand Digital Library system comprises several demonstration 40 collections -- computer science technical reports and bibliographies, 41 literary works, humanitarian and development information, magazines -- and 42 makes them available over the Web through full-text interfaces. Behind the 43 query interface lies a huge collection providing gigabytes of information. 44 We hope you find what you want, or at least something intriguing! 45 46 <h4>The Greenstone software</h4> 47 48 <p> The Greenstone Digital Library software provides a new way of 49 organizing information and making it available over the Internet. A 50 <i>collection</i> of information comprises several (typically several 51 thousand, or even several million) <i>documents</i>, which share a uniform 52 searching and browsing interface. The collections in a library are 53 organized in a different way--though they share a strong family 54 resemblance. Although primarily designed for access over the Web, 55 Greenstone collections can be made available, in precisely the same form, 56 on CD-ROM for standalone PCs. Greenstone is open-source software, 57 available under the terms of the Gnu public license. 58 <p>The following websites are among those currently using Greenstone. <i>Note that these 59 sites are under development.</i> 60 <ul> 61 <li><a href="http://moby.cisti.nrc.ca/~nzdl/cgi-bin/library">CISTI</a> 62 <li><a href="http://gene.rutgers.edu/cgi-bin/library">Rutgers University</a> 63 <li><a href="http://csdl1.mdx.ac.uk/">Middlesex University</a> 64 <li><a href="http://laraine.unidata.ucar.edu/projects/coohl/htdig/cgi-bin/library">Unidata</a> 65 </ul> 66 <h4>The research</h4> 67 68 <p> The goal of our research program is to explore the potential of 69 internet-based digital libraries. Our vision is to develop systems that 70 automatically impose structure on anarchic, uncatalogued, distributed 71 repositories of information, thereby providing information consumers with 72 effective tools to locate what they need and to peruse it conveniently and 73 comfortably. Our research objectives are to 74 75 <ul> 76 <li> develop technology for creating and automatically 77 maintaining collections; 78 <li> monitor usage to study library users' needs; 79 <li> look at novel interfaces that cater to a wide spectrum of users; 80 <li> find ways to abstract layout and bibliographic information 81 from document files; 82 <li> use this information to enhance presentation and for 83 bibliometric research; 84 <li> assess potential subject areas for public-domain collections; 85 <li> survey and critique other digital library projects. 86 </ul> 31 <p> 32 The Greenstone Digital Library software provides a new way of 33 organizing information and making it available over the Internet or on 34 CD-ROM. It is open-source software, available under the terms of the 35 GNU General Public License. 36 <p> 37 A digital library is made up of a set of collections. Each collection of 38 information comprises several (typically several thousand, or even 39 several million) documents, which share a uniform searching and 40 browsing interface. Collections can be organized in many different 41 ways while retaining a strong family resemblance. 42 <p> 43 The 44 <a href="http://www.nzdl.org">New Zealand Digital Library Project</a> 45 is a research programme at The University of Waikato whose aim is to 46 develop the underlying technology for digital libraries and make it 47 available publicly so that others can use it to create their own 48 collections. 49 Greenstone was created to further this objective. 50 Further details are available from 51 <a href="http://www.nzdl.org">http://www.nzdl.org</a> 87 52 } 88 53 89 _textotherinfo_ { 90 <table border=0 cellpadding=5><tr valign=top> 91 <td width=50%> 92 <h4>Global Help Projects vzw</h4> 54 _textpoem_ { 55 <br><h2>Kia papapounamu te moana</h2> 93 56 94 <a href="http://www.globalprojects.org">Global Help Projects</a> is a 95 registered charity responsible for the Humanity Libraries Project that 96 provides universal low-cost information access through co-operation between 97 UN Agencies, universities and NGOs. Global Help Projects collaborate 98 extensively with the NZDL project, and use the Greenstone software. 99 </td><td width=50%> 57 <p>kia hora te marino, 58 <br>kia tere te karohirohi, 59 <br>kia papapounamu te moana 100 60 101 <h4>DigiLib Systems Limited</h4> 102 103 <p><a href="http://www.digilibs.com/">DigiLib Systems Limited</a> is an 104 innovative software company that creates international digital libraries. 105 As a major contributor to the Greenstone Digital Library Software they are 106 able to build, customize, and extend digital libraries to meet exacting 107 needs. Please <a href="mailto:contact@digilibs.com">contact</a> them for 108 an obligation free quote. </td></tr></table>} 109 110 _textpoem_ { 111 <br><h2 align=left>Kia papapounamu te moana</h2> 112 113 <p>kia hora te marino, 114 <br>kia tere te karohirohi, 115 <br>kia papapounamu te moana 116 117 <p>may peace and calmness surround you, 118 <br>may you reside in the warmth of a summer's haze, 119 <br>may the ocean of your travels be as smooth as the polished greenstone. 61 <p>may peace and calmness surround you, 62 <br>may you reside in the warmth of a summer's haze, 63 <br>may the ocean of your travels be as smooth as the polished greenstone. 120 64 } 121 65 122 _textgreenstone_ { <p><br> Greenstone is a semi-precious stone that (like 123 this software) is sourced in New Zealand. In traditional Maori society it 124 was the most highly prized and sought after of all substances. It can 125 absorb and hold <i>wairua</i>, which is a spirit or life force, and is 126 endowed with traditional virtues that make it an appropriate emblem for a 66 _textgreenstone_ { 67 <p>Greenstone is a semi-precious stone that (like this software) is sourced in New Zealand. In traditional Maori society it was the most highly prized and sought after of all substances. It can absorb and hold <i>wairua</i>, which is a spirit or life force, and is endowed with traditional virtues that make it an appropriate emblem for a 127 68 public-domain digital library project. Its lustre shows charity; its 128 69 translucence, honesty; its toughness, courage; and the sharp edge it can … … 134 75 symbolizing the leading edge of technology. 135 76 136 <p><a href="mailto:greenstone@cs.waikato.ac.nz">Greenstone Digital Library Software</a>137 <br><a href="http://www.cs.waikato.ac.nz/cs">Computer Science Department</a>,138 <a href="http://www.waikato.ac.nz">University of Waikato</a>, New Zealand139 140 <br>October 1999141 77 } 142 78 … … 155 91 _widthselcolgr_ {537} 156 92 _heightselcolgr_ {17} 157 158 159 160 ###################################################################### 161 # 'people' page 162 package people 163 ###################################################################### 164 165 166 #------------------------------------------------------------ 167 # text macros 168 #------------------------------------------------------------ 169 170 _textpagetitle_ {NZDL: People} 171 172 _textsmallrs_ {Related Staff} 173 174 _textsawnzdl_ {Staff associated with the New Zealand Digital Library 175 project are:} 176 _texttrsaawp_ {These research students and software support people are associated with the project:} 177 178 _textstafftable_ { 179 <table> 180 <tr> 181 <td align=right valign=top width=100><a href="http://www.cs.waikato.ac.nz/~ihw">Ian Witten</a></td> 182 <td _1_ align=left valign=top>Project leader; co-author of <a href="http://www.cs.mu.oz.au/mg/"><i>Managing Gigabytes</i></a></td> 183 </tr> 184 <tr> 185 <td align=right valign=top><a href="http://www.cs.waikato.ac.nz/cs/Staff/mark-d.-apperley-.html">Mark Apperley</a></td> 186 <td _1_ align=left valign=top>User interfaces for readers</td> 187 </tr> 188 <tr> 189 <td align=right valign=top><a href="http://www.cs.waikato.ac.nz/cs/Staff/david-bainbridge.html">David Bainbridge</a></td> 190 <td _1_ align=left valign=top>Musical and Web-based collections; optical music recognition</td> 191 </tr> 192 <tr> 193 <td align=right valign=top><a 194 href="http://www.cs.waikato.ac.nz/cs/Staff/sally-jo-cunningham.html">Sally Jo Cunningham</a></td> 195 <td _1_ align=left valign=top>Collections and usage studies</td> 196 </tr> 197 <tr> 198 <td align=right valign=top><a href="http://www.cs.waikato.ac.nz/cs/Staff/steve-jones.html">Steve Jones</a></td> 199 <td _1_ align=left valign=top>Phrase-based interfaces, collaborative browsing, usage analysis</td> 200 </tr> 201 <tr> 202 <td align=right valign=top><a 203 href="http://www.cs.waikato.ac.nz/cs/Staff/te-taka-keegan.html">Te Taka Keegan 204 </a></td> 205 <td _1_ align=left valign=top>Maori language systems</td> 206 </tr> 207 <td align=right valign=top><a 208 href="http://www.cs.waikato.ac.nz/Staff/malika-mahoui.html">Malika 209 Mahoui</a></td> 210 <td _1_ align=left valign=top>Text mining, Arabic interfaces</td> 211 </tr> 212 </table> 213 } 214 215 _textgstable_ { 216 <table> 217 <tr> 218 <td align=right valign=top>George Buchanan</a></td> 219 <td _1_ align=left valign=top>Systems support</td> 220 </tr> 221 <tr> 222 <td align=right valign=top><a href="http://www.cs.waikato.ac.nz/~sjboddie">Stefan Boddie</a></td> 223 <td _1_ align=left valign=top>Systems support</td> 224 </tr> 225 <tr> 226 <td align=right valign=top><a href="http://www.cs.waikato.ac.nz/~rjmcnab">Rodger McNab</a></td> 227 <td _1_ align=left valign=top>Systems support</td> 228 </tr> 229 <tr> 230 <td align=right valign=top>YingYing Wen</a></td> 231 <td _1_ align=left valign=top>Text mining, Chinese libraries</td> 232 </tr> 233 <tr> 234 <td align=right valign=top>Stuart Yeates</a></td> 235 <td _1_ align=left valign=top>Text mining, acronym extraction</td> 236 </tr> 237 </table> 238 } 239 240 _textsmallcont_ {Other Contributors} 241 _texttpcsp_ {These people have contributed strongly to the project:} 242 243 _textconttable_ { 244 <table> 245 <tr> 246 <td align=right valign=top width=100>Mark Abrahams</td> 247 <td _1_ align=left valign=top>Client-side browsing interfaces using Java</td> 248 </tr> 249 <tr> 250 <td align=right valign=top width=100><a href="http://www.cosc.canterbury.ac.nz/~tim">Tim Bell</a></td> 251 <td _1_ align=left valign=top>Co-author of <a href="http://www.cs.mu.oz.au/mg/"><i>Managing Gigabytes</i></a></td> 252 </tr> 253 <tr> 254 <td align=right valign=top>Matt Humphrey</td> 255 <td _1_ align=left valign=top>Information visualization in the digital library</td> 256 </tr> 257 <tr> 258 <td align=right valign=top><a 259 href="http://www.cs.waikato.ac.nz/~singlis">Stuart Inglis</a></td> 260 <td _1_ align=left valign=top>Document image analysis and optical character recognition</td> 261 </tr> 262 <tr> 263 <td align=right valign=top>Trent Mankelow</a></td> 264 <td _1_ align=left valign=top>School Journal prototype</td> 265 </tr> 266 <tr> 267 <td align=right valign=top><a href="http://www.cosc.canterbury.ac.nz/~bruce">Bruce McKenzie</a></td> 268 <td _1_ align=left valign=top>Original interface to MG</td> 269 </tr> 270 <tr> 271 <td align=right valign=top><a href="http://www.cs.mu.oz.au/~alistair">Alistair Moffat</a></td> 272 <td _1_ align=left valign=top>Co-author of <a href="http://www.cs.mu.oz.au/mg/"><i>Managing Gigabytes</i></a>, 273 created the MG software</td> 274 </tr> 275 <tr> 276 <td align=right valign=top>Todd Reed</td> 277 <td _1_ align=left valign=top>PostScript to text conversion, user interface, WWW server, index building, FTP</td> 278 </tr> 279 <tr> 280 <td align=right valign=top><a 281 href="http://www.cs.waikato.ac.nz/cs/Staff/don-a.-smith.html">Don Smith</a></td> 282 <td _1_ align=left valign=top>Special needs of libraries for mathematical and theoretical materials</td> 283 </tr> 284 <tr> 285 <td align=right valign=top>Che Tamahori</td> 286 <td _1_ align=left valign=top>Designer of New Zealand Digital Library Web 287 pages</td> 288 </tr> 289 <tr> 290 <td align=right valign=top><a 291 href="http://www.cs.waikato.ac.nz/~wjt">Bill Teahan</a></td> 292 <td _1_ align=left valign=top>Language modeling</td> 293 </tr> 294 <tr> 295 <td align=right valign=top>Mahendra Vallabh</td> 296 <td _1_ align=left valign=top>Original FTP script</td> 297 </tr> 298 <tr> 299 <td align=right valign=top><a 300 href="http://www.cs.waikato.ac.nz/cs/Staff/lloyd-a.-smith.html">Lloyd Smith</a></td> 301 <td _1_ align=left valign=top>Music collections and music retrieval</td> 302 </tr> 303 <tr> 304 <td align=right valign=top>John Venable</td> 305 <td _1_ align=left valign=top>Requirements for digital libraries, and collections for information systems</td> 306 </tr> 307 </table> 308 } 309 310 _textaffiliates_ {There are several affiliates at other universities:} 311 312 _textaffiliatetable_ { 313 <table> 314 <tr> 315 <td align=right valign=top>Elke Duenker</td> 316 <td _1_ align=left valign=top>Cross-cultural issues</td> 317 </tr> 318 <tr> 319 <td align=right valign=top><a href="http://www.cs.waikato.ac.nz/~cgn/ 320 ">Craig Nevill-Manning</a></td> 321 <td _1_ align=left valign=top>PostScript to text conversion, user 322 interface, WWW server, index 323 building, FTP</td> 324 </tr> 325 <tr> 326 <td align=right valign=top>Nina Reeves</td> 327 <td _1_ align=left valign=top>Librarians and library users</td> 328 </tr> 329 <tr> 330 <td align=right valign=top>Yin Leng Theng</td> 331 <td _1_ align=left valign=top>Digital libraries for schools</td> 332 </tr> 333 <tr> 334 <td align=right valign=top>Harold Thimbleby</td> 335 <td _1_ align=left valign=top>User interfaces for digital 336 libraries</td> 337 </tr> 338 </table> 339 } 340 341 342 #------------------------------------------------------------ 343 # icons 344 #------------------------------------------------------------ 345 346 ## "people" ## green_title ## h_people ## 347 _httpiconhpeople_ {_httpimg_/h\_people.gif} 348 _widthhpeople_ {200} 349 _heighthpeople_ {57} 350 351 352 353 ###################################################################### 354 # 'technology' page 355 package technology 356 ###################################################################### 357 358 359 #------------------------------------------------------------ 360 # text macros 361 #------------------------------------------------------------ 362 363 _textpagetitle_ {NZDL: Technology} 364 365 _content_ { 366 _iconblankbar_ 367 <p>There are several freely available technologies underlying the New Zealand 368 Digital Library: 369 <ul> 370 <li><a href="_httppagex_(gsdlsoft)"><i>Greenstone</i></a>, the digital 371 library system that generates each and every page of this website.<p> 372 373 <li><a href="_httppagex_(prescript)"><i>PreScript</i></a>, a system 374 that converts PostScript to plain ASCII or HTML, detects paragraph boundaries, 375 removes hyphenation, and interprets many ligatures.<p> 376 377 <li><a href="_httppagex_(mg)"><i>MG</i></a>, an enhancement of the <a 378 href="http://www.cs.mu.oz.au/mg"><i>Managing Gigabytes</i></a> full-text 379 retrieval system, that provides flexible stemming methods, weighting terms, 380 term frequencies, merged indexes, machine independent indexes, and a port to 381 MSDOS.<p> 382 383 <li><a href="http://www.cs.waikato.ac.nz/sequitur"><i>Sequitur</i></a>, a 384 method for inferring compositional hierarchies from strings by detecting 385 repetition and factoring it out of the string by forming rules in a 386 grammar. The rules can be composed of non-terminals, giving rise to a 387 hierarchy. Sequitur is useful for recognizing lexical structure in strings, 388 and excels at very long sequences.<p> 389 390 <li><a href="http://www.nzdl.org/Kea"><i>Kea</i></a>, a program for 391 automatically extracting keyphrases from the full text of documents. Candidate 392 keyphrases are identified using rudimentary lexical processing, features are 393 computed for each candidate, and machine learning is used to generate a 394 classifier that determines which candidates should be assigned as 395 keyphrases. <p> 396 397 <li><a href="http://www.cs.waikato.ac.nz/~stevej/Research/Phrasier/"><i>Phrasier</i></a>, a 398 tool to support information seeking activities in a digital library. Its novel design 399 reflects the fact that reading, writing, browsing and searching activities are rarely 400 carried out independently of each other. They overlap and interleave in ways which have 401 not been effectively supported by conventional information retrieval interfaces. Consequenly 402 Phrasier blurs the distinction between writing a document and finding material related to it; 403 between reading a document and finding others on the same or similar topics; between keyword 404 searching and subject browsing. <p> 405 406 </ul> 407 408 <br> 409 } 410 411 412 #------------------------------------------------------------ 413 # icons 414 #------------------------------------------------------------ 415 416 ## "technology" ## green_title ## h_tech ## 417 _httpiconhtech_ {_httpimg_/h\_tech.gif} 418 _widthhtech_ {200} 419 _heighthtech_ {57} 420 421 422 423 ###################################################################### 424 # 'status' pages 425 package status 426 ###################################################################### 427 428 429 #------------------------------------------------------------ 430 # text macros 431 #------------------------------------------------------------ 432 433 _textframebrowser_ {You must have a frame enabled browser to view this.} 434 _textusermanage_ {User management} 435 _textlistusers_ {list users} 436 _textaddusers_ {add a new user} 437 438 _textinfo_ {Information} 439 _textgeneral_ {general} 440 _textarguments_ {arguments} 441 _textactions_ {actions} 442 _textprotocols_ {protocols} 443 444 _textcollections_ {Collections} 445 _textnewcoll_ {new collection} 446 _texteditcoll_ {edit collection} 447 _textbuildcoll_ {build collection} 448 _textdeletecoll_ {delete collection} 449 450 _textlogs_ {Logs} 451 _textinitlog_ {init log} 452 _texterrorlog_ {error log} 453 454 _textreturnhome_ {Return to home page} 455 456 _titlewelcome_ { Maintenance and Administration } 457 458 _welcome_ { 459 460 <p> Maintenance and administration services available include: 461 view on-line logs; 462 create, maintain and update collections; 463 and access technical information such as CGI arguments. 464 These services are accessed using the 465 side navigation bar on the lefthand side of the page. 466 } 467 468 469 #------------------------------------------------------------ 470 # icons 471 #------------------------------------------------------------ 472 473 474 475 ###################################################################### 476 # html package 477 package html 478 ###################################################################### 479 480 481 #------------------------------------------------------------ 482 # text macros 483 #------------------------------------------------------------ 484 485 _textframebrowser_ {You must have a frame enabled browser to view this.} 486 487 488 #------------------------------------------------------------ 489 # icons 490 #------------------------------------------------------------ 93 _altselcolgr_ {"Select a collection"} 491 94 492 95 -
branches/New_Config_Format-branch/gsdl/macros/german.dm
r1071 r1279 380 380 381 381 ## "EXPANDIEREN 382 DES TEXTS" ## document_button ## eallt ##382 # DES TEXTS" ## document_button ## eallt ## 383 383 _httpiconealltof_ [l=de] {_httpimg_/de/ealltof.gif} 384 384 _httpiconeallton_ [l=de] {_httpimg_/de/eallton.gif} … … 387 387 388 388 ## "KONTRAKTIONDES 389 INHALTS" ## document_button ## econc ##389 # INHALTS" ## document_button ## econc ## 390 390 _httpiconeconcof_ [l=de] {_httpimg_/de/econcof.gif} 391 391 _httpiconeconcon_ [l=de] {_httpimg_/de/econcon.gif} … … 394 394 395 395 ## "SEPARATES 396 FENSTER" ## document_button ## edtch ##396 # FENSTER" ## document_button ## edtch ## 397 397 _httpiconedtchof_ [l=de] {_httpimg_/de/edtchof.gif} 398 398 _httpiconedtchon_ [l=de] {_httpimg_/de/edtchon.gif} … … 401 401 402 402 ## "EXPANDIEREN 403 DES INHALTS" ## document_button ## eexpc ##403 #DES INHALTS" ## document_button ## eexpc ## 404 404 _httpiconeexpcof_ [l=de] {_httpimg_/de/eexpcof.gif} 405 405 _httpiconeexpcon_ [l=de] {_httpimg_/de/eexpcon.gif} … … 408 408 409 409 ## "KONTRAKTION 410 DES TEXTS" ## document_button ## etsec ##410 # DES TEXTS" ## document_button ## etsec ## 411 411 _httpiconetsecof_ [l=de] {_httpimg_/de/etsecof.gif} 412 412 _httpiconetsecon_ [l=de] {_httpimg_/de/etsecon.gif} … … 421 421 422 422 ## " KEINE 423 HERVORHEBUNG" ## document_button ## enhl ##423 #HERVORHEBUNG" ## document_button ## enhl ## 424 424 _httpiconenhlof_ [l=de] {_httpimg_/de/enhlof.gif} 425 425 _httpiconenhlon_ [l=de] {_httpimg_/de/enhlon.gif} … … 508 508 ## "sichtung" ## hand_made ## 509 509 _httpicondisplay_ [l=de] {_httpimg_/display.gif} 510 _widthdisplay {60}510 _widthdisplay_ [l=de] {60} 511 511 _heightdisplay_ [l=de] {20} 512 512 -
branches/New_Config_Format-branch/gsdl/macros/gsdlsoft.dm
r1049 r1279 25 25 _iconblankbar_ 26 26 27 <h 4>The Greenstone software</h4>27 <h2>The Greenstone software</h2> 28 28 29 <p> The Greenstone Digital Library software provides a new way of 30 organizing information and making it available over the Internet. A 31 <i>collection</i> of information comprises several (typically several 32 thousand, or even several million) <i>documents</i>, which share a uniform 33 searching and browsing interface. The collections in a library are 34 organized in a different way--though they share a strong family 35 resemblance. Although primarily designed for access over the Web, 36 Greenstone collections can be made available, in precisely the same form, 37 on CD-ROM for standalone PCs. Greenstone is open-source software, 38 available under the terms of the Gnu public license. Documentation is 39 available in the form of <i><a 40 href="http://www.nzdl.org/download/greenstone/publications/gsdl_manual.pdf">The Greenstone 41 Digital Library Software</a></i> manual. 29 <p> 30 This page explains how to download and install the 31 <a href="_httppagex_(gsdl)">Greenstone Digital Library software</a>. 32 <p> 33 Greenstone is open-source software. 34 It is distributed under the terms of the 35 <a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a>. 36 Documentation is available in the form of 37 <i><a href="_gsdl:httpgsdlmanual_">The Greenstone Digital Library Software manual</a></i>. 38 39 <h4>Downloading Greenstone</h4> 40 <p> 41 <a 42 href="http://www.nzdl.org/download/greenstone/gsdl-2.13.tar.gz"><i>gsdl-2.13.tar.gz</i></a> 43 <i>(4.6 Mb)</i> contains the latest distribution of Greenstone. 44 <p> 45 <a href="http://www.nzdl.org/download/greenstone/publications/gsdl_manual.pdf">gsdl_manual.pdf</a></i> (570 Kb) contains the manual in PDF format. 42 46 43 47 <h4>Installing Greenstone</h4> … … 45 49 <p> To install on unix systems: 46 50 47 <ul> <li>Download the <a 48 href="http://www.nzdl.org/download/greenstone/gsdl-2.13.tar.gz"><i>gsdl-2.13</i></a> 49 distribution <i>(4.6 Mb)</i>. <li>Extract the gzipped tar archive <i>(tar 50 xvzf gsdl-2.13.tar.gz)</i>. <li>In the resulting gsdl directory type 51 <i>./configure</i>. When the configure script has finished running type 52 <i>make</i>, then <i>make install</i>. <li><i>make install</i> copies the 51 <ul> 52 <li>Download the 53 <a href="http://www.nzdl.org/download/greenstone/gsdl-2.13.tar.gz"><i>gsdl-2.13</i></a> 54 distribution <i>(4.6 Mb)</i>. 55 <li>Extract the gzipped tar archive <i>(tar xvzf gsdl-2.13.tar.gz)</i>. 56 <li>In the resulting gsdl directory type <i>./configure</i>. 57 When the configure script has finished running type <i>make</i>, 58 then <i>make install</i>. 59 <li><i>make install</i> copies the 53 60 compiled executable file into the gsdl/cgi-bin directory by default. To run 54 61 the library as a cgi script move the executable and the gsdlsite.cfg 55 configuration file to your systems cgi-bin directory. <li>The gsdlsite.cfg 62 configuration file to your systems cgi-bin directory. 63 <li>The gsdlsite.cfg 56 64 configuration file must be edited to suit your site. The gsdlhome entry 57 65 will need to be set to point to your gsdl directory. Other fields that may 58 66 need changing are httpprefix (the web path to the gsdl directory) and 59 httpimg (the path to gsdl/images). <li>To build the demonstration 67 httpimg (the path to gsdl/images). 68 <li>To build the demonstration 60 69 collection that comes with the distribution run the builddemo.sh script 61 from within the gsdl directory. <li>For more information on using the 70 from within the gsdl directory. 71 <li>For more information on using the 62 72 Greenstone software, download <i><a 63 73 href="http://www.nzdl.org/download/greenstone/publications/gsdl_manual.pdf">The Greenstone … … 105 115 Please report bugs or installation problems to <a href="mailto:greenstone@cs.waikato.ac.nz">greenstone@cs.waikato.ac.nz</a> 106 116 117 _nzdlpagefooter_ 118 <br>April 2000 107 119 } -
branches/New_Config_Format-branch/gsdl/macros/home.dm
r1049 r1279 1 1 package home 2 3 _httpmusiclibrary_ {http://nzdl2.cs.waikato.ac.nz/cgi-bin/gwmm?c=meldex&a=page&p=coltitle}4 2 5 3 ####################################################################### … … 14 12 _javalinks_ [v=1] {} 15 13 16 17 18 14 ####################################################################### 19 15 # icons 20 16 ####################################################################### 21 17 22 _iconnzdl_ { 23 <img src="_httpiconnzdl_" width=_widthnzdl_ height=_heightnzdl_>} 18 _iconnzdl_ {<img src="_httpiconnzdl_" width=_widthnzdl_ height=_heightnzdl_ alt="The New Zealand Digital Library">} 24 19 _icongbull_ {<img src="_httpicongbull_">} 25 20 _iconpdf_ {<img src="_httpiconpdf_">} 26 _iconselectcollection_ {<img src="_httpiconselcolgr_" width=_widthselcolgr_ height=_heightselcolgr_ >}21 _iconselectcollection_ {<img src="_httpiconselcolgr_" width=_widthselcolgr_ height=_heightselcolgr_ alt=_altselcolgr_>} 27 22 _iconmusiclibrary_ {<img src="_httpicontmusic_" border=1 alt="meldex music library">} 28 23 … … 45 40 _pagetitle_ {_textpagetitle_} 46 41 _imagethispage_ {} 47 _imagecollection_ { <center>_iconnzdl_</center>}42 _imagecollection_ { } 48 43 49 44 _content_ { 50 <center>_iconselectcollection_</center><br> 51 _homeextra_ 52 <center>_iconblankbar_</center> 45 <center> 46 <p>_iconselectcollection_ 47 </center> 48 <p>_homeextra_ 49 50 <center> 51 <p>_iconblankbar_ 52 </center> 53 <p><center><h2>_textprojhead_</h2></center> 54 55 <table border=0 cellpadding=5> 56 57 <tr valign=top> 58 <td> 59 <p>_icongbull_ <a href="mailto:_mailaddr_">_textfb_</a> 60 <p>_icongbull_ <a href="http://www.nzdl.org">NZDL</a> 61 <p>_icongbull_ <a href="_httppagex_(gsdl)">Greenstone</a> 62 <p>_iconpdf_ <a href="_gsdl:httpgsdlmanual_">Manual</a></i> 63 <p>_iconpdf_ <a href="_httppublications_/NZDLtext.pdf">_textinfosheet_</a> 64 <p><a href="_httppagestatus_"><img src="_httpimg_/tabspace.gif" width=60 height=20 border=0></a> 65 </td> 66 <td>_textprojinfo_</td> 67 </tr></table> 68 69 <p>_iconblankbar_ 70 <table> 71 <tr valign=top> 72 <td>_textpoem_</td> 73 <td>_imagegreenstone_</td> 74 </tr></table> 75 <p>_textgreenstone_ 53 76 54 77 <p> 55 <table> 56 <tr><td colspan=2><center><h2>_textprojhead_</h2></center></td></tr> 57 <tr valign=top><td> 58 59 <table border=0 cellpadding=5> 60 <tr valign=top><td rowspan=10 width=32> </td> 61 <tr valign=top><td>_icongbull_</td><td><a href="mailto:_mailaddr_">_textfb_</a></td></tr> 62 <tr valign=top><td>_icongbull_</td><td><a href="_httppagex_(people)">_textpeople_</a><br></td></tr> 63 <tr valign=top><td>_icongbull_</td><td><a href="http://www.cs.waikato.ac.nz/~nzdl/publications/">_textpub_</a><br></td></tr> 64 <tr valign=top><td>_icongbull_</td><td><a href="_httppagex_(rw)">_textrw_</a><br></td></tr> 65 <tr valign=top><td>_icongbull_</td><td><a href="_httppagex_(technology)">_texttec_</a><br></td></tr> 66 <tr valign=top><td>_iconpdf_</td><td><a 67 href="http://www.nzdl.org/download/greenstone/publications/NZDLtext.pdf">_textinfosheet_</a></td></tr> 68 <tr valign=top><td>_iconpdf_</td><td><a 69 href="http://www.nzdl.org/download/greenstone/publications/NZDLpictures.pdf">_textscreenshots_</a></td></tr> 70 <tr valign=top><td>_iconpdf_</td><td><a 71 href="http://www.nzdl.org/download/greenstone/publications/Niupepa.pdf">_textnpepainfosheet_</a></td></tr> 72 <tr valign=top><td colspan=2><a href="_httppagestatus_"><img src="_httpimg_/tabspace.gif" width=60 height=20 border=0></a></td></tr> 73 74 </table> 75 76 </td> 77 <td> 78 79 <table border=0 cellpadding=5> 80 <tr><td> 81 _textprojinfo_ 82 </td></tr></table> 83 </td></tr></table> 84 _textotherinfo_ 85 _iconblankbar_ 86 <table><tr valign=top> 87 <td>_textpoem_</td> 88 <td>_imagegreenstone_</td> 89 </tr> 90 <tr><td colspan=2>_textgreenstone_</td> 91 </tr> 92 </table> 78 <p>_iconblankbar_ 79 <p>Greenstone software by <a href="http://www.nzdl.org">The New Zealand Digital Library Project</a>, 80 <br><a href="http://www.cs.waikato.ac.nz/cs">Department of Computer Science</a>, 81 <a href="http://www.waikato.ac.nz">University of Waikato</a>, 82 New Zealand 93 83 } 94 84 95 96 #######################################################################97 # English language text macros98 #######################################################################99 100 # moved to english.dm101 102 103 104 105 106 107 -
branches/New_Config_Format-branch/gsdl/macros/maori.dm
r1057 r1279 374 374 375 375 ###################################################################### 376 # 'prefere ces' page376 # 'preferences' page 377 377 package preferences 378 378 ###################################################################### … … 406 406 407 407 408 ###################################################################### 409 # 'people' page 410 package people 411 ###################################################################### 412 413 #------------------------------------------------------------ 414 # text macros 415 #------------------------------------------------------------ 416 417 418 #------------------------------------------------------------ 419 # icons 420 #------------------------------------------------------------ 421 422 423 ###################################################################### 424 # 'technology' page 425 package technology 426 ###################################################################### 427 428 #------------------------------------------------------------ 429 # text macros 430 #------------------------------------------------------------ 431 432 _textpagetitle_ {NZDL: Technology} 433 434 435 #------------------------------------------------------------ 436 # icons 437 #------------------------------------------------------------ 438 439 440 ###################################################################### 441 # 'status' pages 442 package status 443 ###################################################################### 444 445 #------------------------------------------------------------ 446 # text macros 447 #------------------------------------------------------------ 448 449 450 #------------------------------------------------------------ 451 # icons 452 #------------------------------------------------------------ 453 454 455 ###################################################################### 456 # html package 457 package html 458 ###################################################################### 459 460 #------------------------------------------------------------ 461 # text macros 462 #------------------------------------------------------------ 463 464 465 #------------------------------------------------------------ 466 # icons 467 #------------------------------------------------------------ 468 469 470 ###################################################################### 471 # external link package 472 package extlink 473 ###################################################################### 474 475 #------------------------------------------------------------ 476 # text macros 477 #------------------------------------------------------------ 478 479 480 #------------------------------------------------------------ 481 # icons 482 #------------------------------------------------------------ 483 484 485 ###################################################################### 486 # authentication page 487 package authen 488 ###################################################################### 489 490 #------------------------------------------------------------ 491 # text macros 492 #------------------------------------------------------------ 493 494 495 #------------------------------------------------------------ 496 # icons 497 #------------------------------------------------------------ 498 499 500 408 409 -
branches/New_Config_Format-branch/gsdl/macros/pref.dm
r1032 r1279 253 253 } 254 254 255 _caseoption_ [l=ar] {} 256 255 257 _fcoption_ { 256 258 <input type=checkbox name=fc onClick="updatefc();"_If_("_cgiargfc_" eq "1", checked)> … … 327 329 _enlanguageoption_ {<option value="en"_If_("_cgiargl_",, selected)_If_("_cgiargl_" eq "en", selected)>_textlangeng_} 328 330 _delanguageoption_ {<option value="de"_If_("_cgiargl_" eq "de", selected)>_textlanggerman_} 331 _frlanguageoption_ {<option value="fr"_If_("_cgiargl_" eq "fr", selected)>_textlangfrench_} 332 _eslanguageoption_ {<option value="es"_If_("_cgiargl_" eq "es", selected)>_textlangspanish_} 329 333 _milanguageoption_ {<option value="mi"_If_("_cgiargl_" eq "mi", selected)>_textlangmaori_} 330 334 _zhlanguageoption_ {<option value="zh"_If_("_cgiargl_" eq "zh", selected)>_textlangchinese_} 335 _arlanguageoption_ {<option value="ar"_If_("_cgiargl_" eq "ar", selected)>_textlangarabic_} 331 336 332 337 _encodingoption_ { … … 336 341 <option value="u" _If_("_cgiargw_" eq "u",selected)>UTF-8 337 342 <option value="g" _If_("_cgiargw_" eq "g",selected)>GBK 343 <option value="a" _If_("_cgiargw_" eq "a",selected)>Arabic (windows 1256) 338 344 </select> 339 345 } -
branches/New_Config_Format-branch/gsdl/macros/prescrpt.dm
r1049 r1279 42 42 _content_ { 43 43 _iconblankbar_ 44 <p><i>PreScript</i> offers: 44 <p> 45 <i>PreScript</i> is a utility for extracting text from PostScfript files. 46 PreScript offers: 45 47 46 48 <dl> -
branches/New_Config_Format-branch/gsdl/macros/query.dm
r964 r1279 31 31 # don't want alt text here 32 32 _iconnext_{<img src="_httpiconmore_" width=_widthmore_ height=_heightmore_ border=0 align=top>} 33 _iconnext_ [v=1] {} 33 34 _iconprev_{<img src="_httpiconless_" width=_widthless_ height=_heightless_ border=0 align=top>} 35 _iconprev_ [v=1] {} 34 36 35 37 ####################################################################### -
branches/New_Config_Format-branch/gsdl/macros/status.dm
r931 r1279 22 22 <table width=100%> 23 23 <tr> 24 <td><img src=" /gsdl/images/spacer.gif" width=2 height=77></td>24 <td><img src="_httpimg_/spacer.gif" width=2 height=77></td> 25 25 <td>_iconblankbar_ 26 26 <center><h2>_1_</h2></center> … … 57 57 _select_ { 58 58 <a href="_httppagehome_" target=_top border=0><img src="_httpimg_/gsdl.gif"></a> 59 <p> 60 <a href="_gwcgi_?e=_compressedoptions_&a=status&sp=welcome" target=infoframe>_textadminhome_</a> 61 <a href="_httppagehome_" target=\_top>_textreturnhome_</a> 62 59 63 60 64 _If_("_cgiarguma_" ne "\_cgiarguma\_", … … 68 72 <a href="_gwcgi_?e=_compressedoptions_&a=status&sp=argumentinfo" target=infoframe>_textarguments_</a><br> 69 73 <a href="_gwcgi_?e=_compressedoptions_&a=status&sp=actioninfo" target=infoframe>_textactions_</a><br> 74 <a href="_gwcgi_?e=_compressedoptions_&a=status&sp=browserinfo" target=infoframe>_textbrowsers_</a><br> 70 75 <a href="_gwcgi_?e=_compressedoptions_&a=status&sp=protocolinfo" target=infoframe>_textprotocols_</a> 71 76 … … 80 85 <a href="_gwcgi_?e=_compressedoptions_&a=status&sp=initlog" target=infoframe>_textinitlog_</a><br> 81 86 <a href="_gwcgi_?e=_compressedoptions_&a=status&sp=errorlog" target=infoframe>_texterrorlog_</a> 82 83 <p>84 <a href="_httppagehome_" target=_top>_textreturnhome_</a>85 87 } 86 88 87 89 90 _textframebrowser_ {You must have a frame enabled browser to view this.} 91 _textusermanage_ {User management} 92 _textlistusers_ {list users} 93 _textaddusers_ {add a new user} 94 95 _textinfo_ {Information} 96 _textgeneral_ {general} 97 _textarguments_ {arguments} 98 _textactions_ {actions} 99 _textbrowsers_ {browsers} 100 _textprotocols_ {protocols} 101 102 _textcollections_ {Collection management} 103 _textnewcoll_ {create new collection} 104 _texteditcoll_ {edit collection} 105 _textbuildcoll_ {build collection} 106 _textdeletecoll_ {delete collection} 107 108 _textlogs_ {Logs} 109 _textinitlog_ {init log} 110 _texterrorlog_ {error log} 111 112 _textadminhome_ {admin home} 113 _textreturnhome_ {Greenstone home} 114 115 _titlewelcome_ { Maintenance and Administration } 116 117 _welcome_ { 118 119 <center> 120 <table width=_pagewidth_><tr><td> 121 Maintenance and administration services available include: 122 <ul> 123 <li>view on-line logs 124 <li>create, maintain and update collections 125 <li>access technical information such as CGI arguments 126 </ul> 127 These services are accessed using the side navigation bar on the 128 lefthand side of the page. 129 <p> 130 _iconblankbar_ 131 </td></tr> 132 <tr><th align=left><br>Collection Status</th></tr> 133 <tr><td> 134 <font color=gray> 135 Collections will only appear as "running" if their build.cfg 136 files exist, are readable, contain a valid builddate field (i.e. > 0), 137 and are in the collection's index directory (i.e. NOT the building 138 directory). 139 <p> 140 click <i>abbrev.</i> for information on a collection 141 <br> 142 click <i>collection</i> to view a collection 143 </font> 144 </td></tr> 145 </table> 146 </center> 147 } -
branches/New_Config_Format-branch/gsdl/macros/users.dm
r876 r1279 87 87 </font></td></tr> 88 88 <tr><td>comment</td><td colspan=2><input type="text" name="umc" value="_users:usersargc_" size=50></td></tr> 89 <tr></td><td><td><input type="submit" name=beu value="submit"></td></tr> 89 <tr><td></td><td colspan=2><input type="submit" name=beu value="submit"> 90 <input type="submit" name=uma value="cancel"></td></tr> 90 91 </table> 91 92 </form> -
branches/New_Config_Format-branch/gsdl/packages/mg/lib/WIN32.MAK
r1000 r1279 25 25 ########################################################################### 26 26 27 GSDLHOME = d:\home\dl\gsdl27 GSDLHOME = c:\gsdl 28 28 29 29 AR = lib … … 32 32 33 33 DEFS = -DQUIET -DHAVE_CONFIG_H -D__WIN32__ -D_LITTLE_ENDIAN 34 INCLUDES = -I$(GSDLHOME)\packages\mg\lib -I$(GSDLHOME)\packages\mg 34 INCLUDES = -I$(GSDLHOME)\packages\mg\lib -I$(GSDLHOME)\packages\mg \ 35 -I$(GSDLHOME) 35 36 36 37 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) -
branches/New_Config_Format-branch/gsdl/packages/mg/src/text/WIN32.MAK
r1000 r1279 25 25 ########################################################################### 26 26 27 GSDLHOME = d:\home\dl\gsdl27 GSDLHOME = c:\gsdl 28 28 29 29 CC = cl … … 32 32 -D__WIN32__ -D_LITTLE_ENDIAN 33 33 INCLUDES = -I$(GSDLHOME)\packages\mg\src\text -I$(GSDLHOME)\packages\mg \ 34 -I$(GSDLHOME)\packages\mg\lib 34 -I$(GSDLHOME)\packages\mg\lib -I$(GSDLHOME) 35 35 LDFLAGS = 36 36 -
branches/New_Config_Format-branch/gsdl/packages/mg/src/text/bool_parser.c
r531 r1279 1 #ifndef lint 2 static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; 3 #endif 4 #define YYBYACC 1 5 #define YYMAJOR 1 6 #define YY MINOR 97 #define yyclearin (yychar=(-1)) 8 #define yyerrok (yyerrflag=0)9 #define YYRECOVERING (yyerrflag!=0) 10 # define YYPREFIX "yy"11 #line 25 "bool_parser.y" 1 2 /* A Bison parser, made from bool_parser.y 3 by GNU Bison version 1.27 4 */ 5 6 #define YYBISON 1 /* Identify Bison output. */ 7 8 #define TERM 257 9 10 #line 24 "bool_parser.y" 11 12 12 13 13 #include "sysfuncs.h" … … 48 48 static u_long invf_ptr; 49 49 static u_long invf_len; 50 #line 65 "bool_parser.y" 50 51 #line 66 "bool_parser.y" 51 52 typedef union { 52 53 char *text; 53 54 bool_tree_node *node; 54 55 } YYSTYPE; 55 #line 55 "y.tab.c" 56 #define TERM 257 57 #define YYERRCODE 256 58 short yylhs[] = { -1, 59 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 60 4, 4, 61 }; 62 short yylen[] = { 2, 63 1, 1, 3, 1, 1, 1, 2, 3, 2, 1, 64 3, 1, 65 }; 66 short yydefred[] = { 0, 67 2, 0, 4, 5, 0, 0, 6, 10, 0, 0, 68 0, 7, 0, 9, 0, 3, 8, 0, 69 }; 70 short yydgoto[] = { 6, 71 7, 8, 9, 10, 72 }; 73 short yysindex[] = { -32, 74 0, -32, 0, 0, -32, 0, 0, 0, -33, -118, 75 -37, 0, -32, 0, -32, 0, 0, -33, 76 }; 77 short yyrindex[] = { 0, 78 0, 0, 0, 0, 0, 0, 0, 0, 2, 12, 79 0, 0, 0, 0, 0, 0, 0, 3, 80 }; 81 short yygindex[] = { 0, 82 0, 6, -2, 14, 83 }; 84 #define YYTABLESIZE 225 85 short yytable[] = { 5, 86 5, 12, 11, 16, 13, 15, 2, 2, 3, 3, 87 12, 1, 18, 0, 14, 11, 0, 0, 17, 0, 88 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 89 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90 0, 0, 12, 11, 0, 0, 0, 0, 0, 0, 91 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 93 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 95 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98 0, 0, 0, 0, 0, 12, 11, 0, 0, 0, 99 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108 0, 0, 0, 1, 1, 109 }; 110 short yycheck[] = { 33, 111 33, 0, 0, 41, 38, 124, 40, 40, 42, 42, 112 5, 0, 15, -1, 9, 2, -1, -1, 13, -1, 113 -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, 114 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 115 -1, -1, 41, 41, -1, -1, -1, -1, -1, -1, 116 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 117 -1, 95, 95, -1, -1, -1, -1, -1, -1, -1, 118 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 119 -1, -1, -1, -1, -1, -1, 124, -1, -1, -1, 120 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 121 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 122 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 123 -1, -1, -1, -1, -1, 124, 124, -1, -1, -1, 124 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 125 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 126 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 127 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 128 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 129 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 130 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 131 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 132 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 133 -1, -1, -1, 257, 257, 134 }; 135 #define YYFINAL 6 136 #ifndef YYDEBUG 137 #define YYDEBUG 0 138 #endif 139 #define YYMAXTOKEN 257 140 #if YYDEBUG 141 char *yyname[] = { 142 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 143 "'!'",0,0,0,0,"'&'",0,"'('","')'","'*'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 144 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'_'",0,0,0,0,0, 145 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,0,0,0,0,0,0,0,0,0,0,0, 146 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 147 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 148 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 149 "TERM", 150 }; 151 char *yyrule[] = { 152 "$accept : query", 153 "query : or", 154 "term : TERM", 155 "term : '(' or ')'", 156 "term : '*'", 157 "term : '_'", 158 "not : term", 159 "not : '!' not", 160 "and : and '&' not", 161 "and : and not", 162 "and : not", 163 "or : or '|' and", 164 "or : and", 165 }; 166 #endif 167 #ifdef YYSTACKSIZE 56 #include <stdio.h> 57 58 #ifndef __cplusplus 59 #ifndef __STDC__ 60 #define const 61 #endif 62 #endif 63 64 65 66 #define YYFINAL 20 67 #define YYFLAG -32768 68 #define YYNTBASE 11 69 70 #define YYTRANSLATE(x) ((unsigned)(x) <= 257 ? yytranslate[x] : 16) 71 72 static const char yytranslate[] = { 0, 73 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 74 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 75 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 76 2, 2, 8, 2, 2, 2, 2, 9, 2, 4, 77 5, 6, 2, 2, 2, 2, 2, 2, 2, 2, 78 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 79 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 80 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 81 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 82 2, 2, 2, 2, 7, 2, 2, 2, 2, 2, 83 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 84 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 85 2, 2, 2, 10, 2, 2, 2, 2, 2, 2, 86 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 87 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 88 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 89 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 90 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 91 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 92 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 93 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 94 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 95 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 96 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 97 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 98 2, 2, 2, 2, 2, 1, 3 99 }; 100 101 #if YYDEBUG != 0 102 static const short yyprhs[] = { 0, 103 0, 2, 4, 8, 10, 12, 14, 17, 21, 24, 104 26, 30 105 }; 106 107 static const short yyrhs[] = { 15, 108 0, 3, 0, 4, 15, 5, 0, 6, 0, 7, 109 0, 12, 0, 8, 13, 0, 14, 9, 13, 0, 110 14, 13, 0, 13, 0, 15, 10, 14, 0, 14, 111 0 112 }; 113 114 #endif 115 116 #if YYDEBUG != 0 117 static const short yyrline[] = { 0, 118 76, 80, 81, 82, 83, 86, 87, 90, 91, 92, 119 95, 96 120 }; 121 #endif 122 123 124 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE) 125 126 static const char * const yytname[] = { "$","error","$undefined.","TERM","'('", 127 "')'","'*'","'_'","'!'","'&'","'|'","query","term","not","and","or", NULL 128 }; 129 #endif 130 131 static const short yyr1[] = { 0, 132 11, 12, 12, 12, 12, 13, 13, 14, 14, 14, 133 15, 15 134 }; 135 136 static const short yyr2[] = { 0, 137 1, 1, 3, 1, 1, 1, 2, 3, 2, 1, 138 3, 1 139 }; 140 141 static const short yydefact[] = { 0, 142 2, 0, 4, 5, 0, 6, 10, 12, 1, 0, 143 7, 0, 9, 0, 3, 8, 11, 0, 0, 0 144 }; 145 146 static const short yydefgoto[] = { 18, 147 6, 7, 8, 9 148 }; 149 150 static const short yypact[] = { 10, 151 -32768, 10,-32768,-32768, 10,-32768,-32768, 2, -9, 14, 152 -32768, 10,-32768, 10,-32768,-32768, 2, 4, 15,-32768 153 }; 154 155 static const short yypgoto[] = {-32768, 156 -32768, -5, -12, 18 157 }; 158 159 160 #define YYLAST 24 161 162 163 static const short yytable[] = { 11, 164 14, 17, 13, 19, 1, 2, 16, 3, 4, 5, 165 12, 13, 1, 2, 20, 3, 4, 5, 15, 10, 166 0, 0, 0, 14 167 }; 168 169 static const short yycheck[] = { 5, 170 10, 14, 8, 0, 3, 4, 12, 6, 7, 8, 171 9, 17, 3, 4, 0, 6, 7, 8, 5, 2, 172 -1, -1, -1, 10 173 }; 174 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ 175 #line 3 "/usr/share/bison.simple" 176 /* This file comes from bison-1.27. */ 177 178 /* Skeleton output parser for bison, 179 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. 180 181 This program is free software; you can redistribute it and/or modify 182 it under the terms of the GNU General Public License as published by 183 the Free Software Foundation; either version 2, or (at your option) 184 any later version. 185 186 This program is distributed in the hope that it will be useful, 187 but WITHOUT ANY WARRANTY; without even the implied warranty of 188 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 189 GNU General Public License for more details. 190 191 You should have received a copy of the GNU General Public License 192 along with this program; if not, write to the Free Software 193 Foundation, Inc., 59 Temple Place - Suite 330, 194 Boston, MA 02111-1307, USA. */ 195 196 /* As a special exception, when this file is copied by Bison into a 197 Bison output file, you may use that output file without restriction. 198 This special exception was added by the Free Software Foundation 199 in version 1.24 of Bison. */ 200 201 /* This is the parser code that is written into each bison parser 202 when the %semantic_parser declaration is not specified in the grammar. 203 It was written by Richard Stallman by simplifying the hairy parser 204 used when %semantic_parser is specified. */ 205 206 #ifndef YYSTACK_USE_ALLOCA 207 #ifdef alloca 208 #define YYSTACK_USE_ALLOCA 209 #else /* alloca not defined */ 210 #ifdef __GNUC__ 211 #define YYSTACK_USE_ALLOCA 212 #define alloca __builtin_alloca 213 #else /* not GNU C. */ 214 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) 215 #define YYSTACK_USE_ALLOCA 216 #include <alloca.h> 217 #else /* not sparc */ 218 /* We think this test detects Watcom and Microsoft C. */ 219 /* This used to test MSDOS, but that is a bad idea 220 since that symbol is in the user namespace. */ 221 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) 222 #if 0 /* No need for malloc.h, which pollutes the namespace; 223 instead, just don't use alloca. */ 224 #include <malloc.h> 225 #endif 226 #else /* not MSDOS, or __TURBOC__ */ 227 #if defined(_AIX) 228 /* I don't know what this was needed for, but it pollutes the namespace. 229 So I turned it off. rms, 2 May 1997. */ 230 /* #include <malloc.h> */ 231 #pragma alloca 232 #define YYSTACK_USE_ALLOCA 233 #else /* not MSDOS, or __TURBOC__, or _AIX */ 234 #if 0 235 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, 236 and on HPUX 10. Eventually we can turn this on. */ 237 #define YYSTACK_USE_ALLOCA 238 #define alloca __builtin_alloca 239 #endif /* __hpux */ 240 #endif 241 #endif /* not _AIX */ 242 #endif /* not MSDOS, or __TURBOC__ */ 243 #endif /* not sparc */ 244 #endif /* not GNU C */ 245 #endif /* alloca not defined */ 246 #endif /* YYSTACK_USE_ALLOCA not defined */ 247 248 #ifdef YYSTACK_USE_ALLOCA 249 #define YYSTACK_ALLOC alloca 250 #else 251 #define YYSTACK_ALLOC malloc 252 #endif 253 254 /* Note: there must be only one dollar sign in this file. 255 It is replaced by the list of actions, each action 256 as one case of the switch. */ 257 258 #define yyerrok (yyerrstatus = 0) 259 #define yyclearin (yychar = YYEMPTY) 260 #define YYEMPTY -2 261 #define YYEOF 0 262 #define YYACCEPT goto yyacceptlab 263 #define YYABORT goto yyabortlab 264 #define YYERROR goto yyerrlab1 265 /* Like YYERROR except do call yyerror. 266 This remains here temporarily to ease the 267 transition to the new meaning of YYERROR, for GCC. 268 Once GCC version 2 has supplanted version 1, this can go. */ 269 #define YYFAIL goto yyerrlab 270 #define YYRECOVERING() (!!yyerrstatus) 271 #define YYBACKUP(token, value) \ 272 do \ 273 if (yychar == YYEMPTY && yylen == 1) \ 274 { yychar = (token), yylval = (value); \ 275 yychar1 = YYTRANSLATE (yychar); \ 276 YYPOPSTACK; \ 277 goto yybackup; \ 278 } \ 279 else \ 280 { yyerror ("syntax error: cannot back up"); YYERROR; } \ 281 while (0) 282 283 #define YYTERROR 1 284 #define YYERRCODE 256 285 286 #ifndef YYPURE 287 #define YYLEX yylex() 288 #endif 289 290 #ifdef YYPURE 291 #ifdef YYLSP_NEEDED 292 #ifdef YYLEX_PARAM 293 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) 294 #else 295 #define YYLEX yylex(&yylval, &yylloc) 296 #endif 297 #else /* not YYLSP_NEEDED */ 298 #ifdef YYLEX_PARAM 299 #define YYLEX yylex(&yylval, YYLEX_PARAM) 300 #else 301 #define YYLEX yylex(&yylval) 302 #endif 303 #endif /* not YYLSP_NEEDED */ 304 #endif 305 306 /* If nonreentrant, generate the variables here */ 307 308 #ifndef YYPURE 309 310 int yychar; /* the lookahead symbol */ 311 YYSTYPE yylval; /* the semantic value of the */ 312 /* lookahead symbol */ 313 314 #ifdef YYLSP_NEEDED 315 YYLTYPE yylloc; /* location data for the lookahead */ 316 /* symbol */ 317 #endif 318 319 int yynerrs; /* number of parse errors so far */ 320 #endif /* not YYPURE */ 321 322 #if YYDEBUG != 0 323 int yydebug; /* nonzero means print parse trace */ 324 /* Since this is uninitialized, it does not stop multiple parsers 325 from coexisting. */ 326 #endif 327 328 /* YYINITDEPTH indicates the initial size of the parser's stacks */ 329 330 #ifndef YYINITDEPTH 331 #define YYINITDEPTH 200 332 #endif 333 334 /* YYMAXDEPTH is the maximum size the stacks can grow to 335 (effective only if the built-in stack extension method is used). */ 336 337 #if YYMAXDEPTH == 0 168 338 #undef YYMAXDEPTH 169 #define YYMAXDEPTH YYSTACKSIZE 339 #endif 340 341 #ifndef YYMAXDEPTH 342 #define YYMAXDEPTH 10000 343 #endif 344 345 346 /* Define __yy_memcpy. Note that the size argument 347 should be passed with type unsigned int, because that is what the non-GCC 348 definitions require. With GCC, __builtin_memcpy takes an arg 349 of type size_t, but it can handle unsigned int. */ 350 351 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ 352 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) 353 #else /* not GNU C or C++ */ 354 #ifndef __cplusplus 355 356 /* This is the most reliable way to avoid incompatibilities 357 in available built-in functions on various systems. */ 358 static void 359 __yy_memcpy (to, from, count) 360 char *to; 361 char *from; 362 unsigned int count; 363 { 364 register char *f = from; 365 register char *t = to; 366 register int i = count; 367 368 while (i-- > 0) 369 *t++ = *f++; 370 } 371 372 #else /* __cplusplus */ 373 374 /* This is the most reliable way to avoid incompatibilities 375 in available built-in functions on various systems. */ 376 static void 377 __yy_memcpy (char *to, char *from, unsigned int count) 378 { 379 register char *t = to; 380 register char *f = from; 381 register int i = count; 382 383 while (i-- > 0) 384 *t++ = *f++; 385 } 386 387 #endif 388 #endif 389 390 391 #line 216 "/usr/share/bison.simple" 392 393 /* The user can define YYPARSE_PARAM as the name of an argument to be passed 394 into yyparse. The argument should have type void *. 395 It should actually point to an object. 396 Grammar actions can access the variable by casting it 397 to the proper pointer type. */ 398 399 #ifdef YYPARSE_PARAM 400 #ifdef __cplusplus 401 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM 402 #define YYPARSE_PARAM_DECL 403 #else /* not __cplusplus */ 404 #define YYPARSE_PARAM_ARG YYPARSE_PARAM 405 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; 406 #endif /* not __cplusplus */ 407 #else /* not YYPARSE_PARAM */ 408 #define YYPARSE_PARAM_ARG 409 #define YYPARSE_PARAM_DECL 410 #endif /* not YYPARSE_PARAM */ 411 412 /* Prevent warning if -Wstrict-prototypes. */ 413 #ifdef __GNUC__ 414 #ifdef YYPARSE_PARAM 415 int yyparse (void *); 170 416 #else 171 #ifdef YYMAXDEPTH 172 #define YYSTACKSIZE YYMAXDEPTH 417 int yyparse (void); 418 #endif 419 #endif 420 421 int 422 yyparse(YYPARSE_PARAM_ARG) 423 YYPARSE_PARAM_DECL 424 { 425 register int yystate; 426 register int yyn; 427 register short *yyssp; 428 register YYSTYPE *yyvsp; 429 int yyerrstatus; /* number of tokens to shift before error messages enabled */ 430 int yychar1 = 0; /* lookahead token as an internal (translated) token number */ 431 432 short yyssa[YYINITDEPTH]; /* the state stack */ 433 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ 434 435 short *yyss = yyssa; /* refer to the stacks thru separate pointers */ 436 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ 437 438 #ifdef YYLSP_NEEDED 439 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ 440 YYLTYPE *yyls = yylsa; 441 YYLTYPE *yylsp; 442 443 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) 173 444 #else 174 #define YYSTACKSIZE 500 175 #define YYMAXDEPTH 500 176 #endif 177 #endif 178 int yydebug; 179 int yynerrs; 180 int yyerrflag; 181 int yychar; 182 short *yyssp; 183 YYSTYPE *yyvsp; 184 YYSTYPE yyval; 185 YYSTYPE yylval; 186 short yyss[YYSTACKSIZE]; 187 YYSTYPE yyvs[YYSTACKSIZE]; 188 #define yystacksize YYSTACKSIZE 445 #define YYPOPSTACK (yyvsp--, yyssp--) 446 #endif 447 448 int yystacksize = YYINITDEPTH; 449 int yyfree_stacks = 0; 450 451 #ifdef YYPURE 452 int yychar; 453 YYSTYPE yylval; 454 int yynerrs; 455 #ifdef YYLSP_NEEDED 456 YYLTYPE yylloc; 457 #endif 458 #endif 459 460 YYSTYPE yyval; /* the variable used to return */ 461 /* semantic values from the action */ 462 /* routines */ 463 464 int yylen; 465 466 #if YYDEBUG != 0 467 if (yydebug) 468 fprintf(stderr, "Starting parse\n"); 469 #endif 470 471 yystate = 0; 472 yyerrstatus = 0; 473 yynerrs = 0; 474 yychar = YYEMPTY; /* Cause a token to be read. */ 475 476 /* Initialize stack pointers. 477 Waste one element of value and location stack 478 so that they stay on the same level as the state stack. 479 The wasted elements are never initialized. */ 480 481 yyssp = yyss - 1; 482 yyvsp = yyvs; 483 #ifdef YYLSP_NEEDED 484 yylsp = yyls; 485 #endif 486 487 /* Push a new state, which is found in yystate . */ 488 /* In all cases, when you get here, the value and location stacks 489 have just been pushed. so pushing a state here evens the stacks. */ 490 yynewstate: 491 492 *++yyssp = yystate; 493 494 if (yyssp >= yyss + yystacksize - 1) 495 { 496 /* Give user a chance to reallocate the stack */ 497 /* Use copies of these so that the &'s don't force the real ones into memory. */ 498 YYSTYPE *yyvs1 = yyvs; 499 short *yyss1 = yyss; 500 #ifdef YYLSP_NEEDED 501 YYLTYPE *yyls1 = yyls; 502 #endif 503 504 /* Get the current used size of the three stacks, in elements. */ 505 int size = yyssp - yyss + 1; 506 507 #ifdef yyoverflow 508 /* Each stack pointer address is followed by the size of 509 the data in use in that stack, in bytes. */ 510 #ifdef YYLSP_NEEDED 511 /* This used to be a conditional around just the two extra args, 512 but that might be undefined if yyoverflow is a macro. */ 513 yyoverflow("parser stack overflow", 514 &yyss1, size * sizeof (*yyssp), 515 &yyvs1, size * sizeof (*yyvsp), 516 &yyls1, size * sizeof (*yylsp), 517 &yystacksize); 518 #else 519 yyoverflow("parser stack overflow", 520 &yyss1, size * sizeof (*yyssp), 521 &yyvs1, size * sizeof (*yyvsp), 522 &yystacksize); 523 #endif 524 525 yyss = yyss1; yyvs = yyvs1; 526 #ifdef YYLSP_NEEDED 527 yyls = yyls1; 528 #endif 529 #else /* no yyoverflow */ 530 /* Extend the stack our own way. */ 531 if (yystacksize >= YYMAXDEPTH) 532 { 533 yyerror("parser stack overflow"); 534 if (yyfree_stacks) 535 { 536 free (yyss); 537 free (yyvs); 538 #ifdef YYLSP_NEEDED 539 free (yyls); 540 #endif 541 } 542 return 2; 543 } 544 yystacksize *= 2; 545 if (yystacksize > YYMAXDEPTH) 546 yystacksize = YYMAXDEPTH; 547 #ifndef YYSTACK_USE_ALLOCA 548 yyfree_stacks = 1; 549 #endif 550 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); 551 __yy_memcpy ((char *)yyss, (char *)yyss1, 552 size * (unsigned int) sizeof (*yyssp)); 553 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); 554 __yy_memcpy ((char *)yyvs, (char *)yyvs1, 555 size * (unsigned int) sizeof (*yyvsp)); 556 #ifdef YYLSP_NEEDED 557 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); 558 __yy_memcpy ((char *)yyls, (char *)yyls1, 559 size * (unsigned int) sizeof (*yylsp)); 560 #endif 561 #endif /* no yyoverflow */ 562 563 yyssp = yyss + size - 1; 564 yyvsp = yyvs + size - 1; 565 #ifdef YYLSP_NEEDED 566 yylsp = yyls + size - 1; 567 #endif 568 569 #if YYDEBUG != 0 570 if (yydebug) 571 fprintf(stderr, "Stack size increased to %d\n", yystacksize); 572 #endif 573 574 if (yyssp >= yyss + yystacksize - 1) 575 YYABORT; 576 } 577 578 #if YYDEBUG != 0 579 if (yydebug) 580 fprintf(stderr, "Entering state %d\n", yystate); 581 #endif 582 583 goto yybackup; 584 yybackup: 585 586 /* Do appropriate processing given the current state. */ 587 /* Read a lookahead token if we need one and don't already have one. */ 588 /* yyresume: */ 589 590 /* First try to decide what to do without reference to lookahead token. */ 591 592 yyn = yypact[yystate]; 593 if (yyn == YYFLAG) 594 goto yydefault; 595 596 /* Not known => get a lookahead token if don't already have one. */ 597 598 /* yychar is either YYEMPTY or YYEOF 599 or a valid token in external form. */ 600 601 if (yychar == YYEMPTY) 602 { 603 #if YYDEBUG != 0 604 if (yydebug) 605 fprintf(stderr, "Reading a token: "); 606 #endif 607 yychar = YYLEX; 608 } 609 610 /* Convert token to internal form (in yychar1) for indexing tables with */ 611 612 if (yychar <= 0) /* This means end of input. */ 613 { 614 yychar1 = 0; 615 yychar = YYEOF; /* Don't call YYLEX any more */ 616 617 #if YYDEBUG != 0 618 if (yydebug) 619 fprintf(stderr, "Now at end of input.\n"); 620 #endif 621 } 622 else 623 { 624 yychar1 = YYTRANSLATE(yychar); 625 626 #if YYDEBUG != 0 627 if (yydebug) 628 { 629 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); 630 /* Give the individual parser a way to print the precise meaning 631 of a token, for further debugging info. */ 632 #ifdef YYPRINT 633 YYPRINT (stderr, yychar, yylval); 634 #endif 635 fprintf (stderr, ")\n"); 636 } 637 #endif 638 } 639 640 yyn += yychar1; 641 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) 642 goto yydefault; 643 644 yyn = yytable[yyn]; 645 646 /* yyn is what to do for this token type in this state. 647 Negative => reduce, -yyn is rule number. 648 Positive => shift, yyn is new state. 649 New state is final state => don't bother to shift, 650 just return success. 651 0, or most negative number => error. */ 652 653 if (yyn < 0) 654 { 655 if (yyn == YYFLAG) 656 goto yyerrlab; 657 yyn = -yyn; 658 goto yyreduce; 659 } 660 else if (yyn == 0) 661 goto yyerrlab; 662 663 if (yyn == YYFINAL) 664 YYACCEPT; 665 666 /* Shift the lookahead token. */ 667 668 #if YYDEBUG != 0 669 if (yydebug) 670 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); 671 #endif 672 673 /* Discard the token being shifted unless it is eof. */ 674 if (yychar != YYEOF) 675 yychar = YYEMPTY; 676 677 *++yyvsp = yylval; 678 #ifdef YYLSP_NEEDED 679 *++yylsp = yylloc; 680 #endif 681 682 /* count tokens shifted since error; after three, turn off error status. */ 683 if (yyerrstatus) yyerrstatus--; 684 685 yystate = yyn; 686 goto yynewstate; 687 688 /* Do the default action for the current state. */ 689 yydefault: 690 691 yyn = yydefact[yystate]; 692 if (yyn == 0) 693 goto yyerrlab; 694 695 /* Do a reduction. yyn is the number of a rule to reduce with. */ 696 yyreduce: 697 yylen = yyr2[yyn]; 698 if (yylen > 0) 699 yyval = yyvsp[1-yylen]; /* implement default value of the action */ 700 701 #if YYDEBUG != 0 702 if (yydebug) 703 { 704 int i; 705 706 fprintf (stderr, "Reducing via rule %d (line %d), ", 707 yyn, yyrline[yyn]); 708 709 /* Print the symbols being reduced, and their result. */ 710 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) 711 fprintf (stderr, "%s ", yytname[yyrhs[i]]); 712 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); 713 } 714 #endif 715 716 717 switch (yyn) { 718 719 case 1: 720 #line 76 "bool_parser.y" 721 { tree_base = yyvsp[0].node;; 722 break;} 723 case 2: 724 #line 80 "bool_parser.y" 725 { yyval.node = CreateBoolTermNode(term_list, yyvsp[0].text, 1, word_num, count, doc_count, invf_ptr, invf_len, stemmer_num); ; 726 break;} 727 case 3: 728 #line 81 "bool_parser.y" 729 { yyval.node = yyvsp[-1].node; ; 730 break;} 731 case 4: 732 #line 82 "bool_parser.y" 733 { yyval.node = CreateBoolTreeNode(N_all, NULL, NULL); ; 734 break;} 735 case 5: 736 #line 83 "bool_parser.y" 737 { yyval.node = CreateBoolTreeNode(N_none, NULL, NULL); ; 738 break;} 739 case 7: 740 #line 87 "bool_parser.y" 741 { yyval.node = CreateBoolTreeNode(N_not, yyvsp[0].node, NULL); ; 742 break;} 743 case 8: 744 #line 90 "bool_parser.y" 745 { yyval.node = CreateBoolTreeNode(N_and, yyvsp[-2].node, yyvsp[0].node); ; 746 break;} 747 case 9: 748 #line 91 "bool_parser.y" 749 { yyval.node = CreateBoolTreeNode(N_and, yyvsp[-1].node, yyvsp[0].node); ; 750 break;} 751 case 11: 752 #line 95 "bool_parser.y" 753 { yyval.node = CreateBoolTreeNode(N_or, yyvsp[-2].node, yyvsp[0].node); ; 754 break;} 755 } 756 /* the action file gets copied in in place of this dollarsign */ 757 #line 542 "/usr/share/bison.simple" 758 759 760 yyvsp -= yylen; 761 yyssp -= yylen; 762 #ifdef YYLSP_NEEDED 763 yylsp -= yylen; 764 #endif 765 766 #if YYDEBUG != 0 767 if (yydebug) 768 { 769 short *ssp1 = yyss - 1; 770 fprintf (stderr, "state stack now"); 771 while (ssp1 != yyssp) 772 fprintf (stderr, " %d", *++ssp1); 773 fprintf (stderr, "\n"); 774 } 775 #endif 776 777 *++yyvsp = yyval; 778 779 #ifdef YYLSP_NEEDED 780 yylsp++; 781 if (yylen == 0) 782 { 783 yylsp->first_line = yylloc.first_line; 784 yylsp->first_column = yylloc.first_column; 785 yylsp->last_line = (yylsp-1)->last_line; 786 yylsp->last_column = (yylsp-1)->last_column; 787 yylsp->text = 0; 788 } 789 else 790 { 791 yylsp->last_line = (yylsp+yylen-1)->last_line; 792 yylsp->last_column = (yylsp+yylen-1)->last_column; 793 } 794 #endif 795 796 /* Now "shift" the result of the reduction. 797 Determine what state that goes to, 798 based on the state we popped back to 799 and the rule number reduced by. */ 800 801 yyn = yyr1[yyn]; 802 803 yystate = yypgoto[yyn - YYNTBASE] + *yyssp; 804 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) 805 yystate = yytable[yystate]; 806 else 807 yystate = yydefgoto[yyn - YYNTBASE]; 808 809 goto yynewstate; 810 811 yyerrlab: /* here on detecting error */ 812 813 if (! yyerrstatus) 814 /* If not already recovering from an error, report this error. */ 815 { 816 ++yynerrs; 817 818 #ifdef YYERROR_VERBOSE 819 yyn = yypact[yystate]; 820 821 if (yyn > YYFLAG && yyn < YYLAST) 822 { 823 int size = 0; 824 char *msg; 825 int x, count; 826 827 count = 0; 828 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ 829 for (x = (yyn < 0 ? -yyn : 0); 830 x < (sizeof(yytname) / sizeof(char *)); x++) 831 if (yycheck[x + yyn] == x) 832 size += strlen(yytname[x]) + 15, count++; 833 msg = (char *) malloc(size + 15); 834 if (msg != 0) 835 { 836 strcpy(msg, "parse error"); 837 838 if (count < 5) 839 { 840 count = 0; 841 for (x = (yyn < 0 ? -yyn : 0); 842 x < (sizeof(yytname) / sizeof(char *)); x++) 843 if (yycheck[x + yyn] == x) 844 { 845 strcat(msg, count == 0 ? ", expecting `" : " or `"); 846 strcat(msg, yytname[x]); 847 strcat(msg, "'"); 848 count++; 849 } 850 } 851 yyerror(msg); 852 free(msg); 853 } 854 else 855 yyerror ("parse error; also virtual memory exceeded"); 856 } 857 else 858 #endif /* YYERROR_VERBOSE */ 859 yyerror("parse error"); 860 } 861 862 goto yyerrlab1; 863 yyerrlab1: /* here on error raised explicitly by an action */ 864 865 if (yyerrstatus == 3) 866 { 867 /* if just tried and failed to reuse lookahead token after an error, discard it. */ 868 869 /* return failure if at end of input */ 870 if (yychar == YYEOF) 871 YYABORT; 872 873 #if YYDEBUG != 0 874 if (yydebug) 875 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); 876 #endif 877 878 yychar = YYEMPTY; 879 } 880 881 /* Else will try to reuse lookahead token 882 after shifting the error token. */ 883 884 yyerrstatus = 3; /* Each real token shifted decrements this */ 885 886 goto yyerrhandle; 887 888 yyerrdefault: /* current state does not do anything special for the error token. */ 889 890 #if 0 891 /* This is wrong; only states that explicitly want error tokens 892 should shift them. */ 893 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ 894 if (yyn) goto yydefault; 895 #endif 896 897 yyerrpop: /* pop the current state because it cannot handle the error token */ 898 899 if (yyssp == yyss) YYABORT; 900 yyvsp--; 901 yystate = *--yyssp; 902 #ifdef YYLSP_NEEDED 903 yylsp--; 904 #endif 905 906 #if YYDEBUG != 0 907 if (yydebug) 908 { 909 short *ssp1 = yyss - 1; 910 fprintf (stderr, "Error: state stack now"); 911 while (ssp1 != yyssp) 912 fprintf (stderr, " %d", *++ssp1); 913 fprintf (stderr, "\n"); 914 } 915 #endif 916 917 yyerrhandle: 918 919 yyn = yypact[yystate]; 920 if (yyn == YYFLAG) 921 goto yyerrdefault; 922 923 yyn += YYTERROR; 924 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) 925 goto yyerrdefault; 926 927 yyn = yytable[yyn]; 928 if (yyn < 0) 929 { 930 if (yyn == YYFLAG) 931 goto yyerrpop; 932 yyn = -yyn; 933 goto yyreduce; 934 } 935 else if (yyn == 0) 936 goto yyerrpop; 937 938 if (yyn == YYFINAL) 939 YYACCEPT; 940 941 #if YYDEBUG != 0 942 if (yydebug) 943 fprintf(stderr, "Shifting error token, "); 944 #endif 945 946 *++yyvsp = yylval; 947 #ifdef YYLSP_NEEDED 948 *++yylsp = yylloc; 949 #endif 950 951 yystate = yyn; 952 goto yynewstate; 953 954 yyacceptlab: 955 /* YYACCEPT comes here. */ 956 if (yyfree_stacks) 957 { 958 free (yyss); 959 free (yyvs); 960 #ifdef YYLSP_NEEDED 961 free (yyls); 962 #endif 963 } 964 return 0; 965 966 yyabortlab: 967 /* YYABORT comes here. */ 968 if (yyfree_stacks) 969 { 970 free (yyss); 971 free (yyvs); 972 #ifdef YYLSP_NEEDED 973 free (yyls); 974 #endif 975 } 976 return 1; 977 } 189 978 #line 99 "bool_parser.y" 979 190 980 191 981 /* Bison on one mips machine defined "const" to be nothing but … … 381 1171 bool_tree_node * 382 1172 ParseBool(char *query_line, int query_len, 383 TermList **the_term_list, int the_stemmer_num, int the_stem_method, 384 int *res, 1173 TermList **the_term_list, int the_stemmer_num, int the_stem_method, int *res, 385 1174 stemmed_dict * the_sd, int is_indexed, /* [RPAP - Jan 97: Stem Index Change] */ 386 1175 QueryTermList **the_query_term_list) /* [RPAP - Feb 97: Term Frequency] */ … … 407 1196 408 1197 409 #line 407 "y.tab.c"410 #define YYABORT goto yyabort411 #define YYREJECT goto yyabort412 #define YYACCEPT goto yyaccept413 #define YYERROR goto yyerrlab414 int415 yyparse()416 {417 register int yym, yyn, yystate;418 #if YYDEBUG419 register char *yys;420 extern char *getenv();421 422 if (yys = getenv("YYDEBUG"))423 {424 yyn = *yys;425 if (yyn >= '0' && yyn <= '9')426 yydebug = yyn - '0';427 }428 #endif429 430 yynerrs = 0;431 yyerrflag = 0;432 yychar = (-1);433 434 yyssp = yyss;435 yyvsp = yyvs;436 *yyssp = yystate = 0;437 438 yyloop:439 if (yyn = yydefred[yystate]) goto yyreduce;440 if (yychar < 0)441 {442 if ((yychar = yylex()) < 0) yychar = 0;443 #if YYDEBUG444 if (yydebug)445 {446 yys = 0;447 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];448 if (!yys) yys = "illegal-symbol";449 printf("%sdebug: state %d, reading %d (%s)\n",450 YYPREFIX, yystate, yychar, yys);451 }452 #endif453 }454 if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&455 yyn <= YYTABLESIZE && yycheck[yyn] == yychar)456 {457 #if YYDEBUG458 if (yydebug)459 printf("%sdebug: state %d, shifting to state %d\n",460 YYPREFIX, yystate, yytable[yyn]);461 #endif462 if (yyssp >= yyss + yystacksize - 1)463 {464 goto yyoverflow;465 }466 *++yyssp = yystate = yytable[yyn];467 *++yyvsp = yylval;468 yychar = (-1);469 if (yyerrflag > 0) --yyerrflag;470 goto yyloop;471 }472 if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&473 yyn <= YYTABLESIZE && yycheck[yyn] == yychar)474 {475 yyn = yytable[yyn];476 goto yyreduce;477 }478 if (yyerrflag) goto yyinrecovery;479 #ifdef lint480 goto yynewerror;481 #endif482 yynewerror:483 yyerror("syntax error");484 #ifdef lint485 goto yyerrlab;486 #endif487 yyerrlab:488 ++yynerrs;489 yyinrecovery:490 if (yyerrflag < 3)491 {492 yyerrflag = 3;493 for (;;)494 {495 if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&496 yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)497 {498 #if YYDEBUG499 if (yydebug)500 printf("%sdebug: state %d, error recovery shifting\501 to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);502 #endif503 if (yyssp >= yyss + yystacksize - 1)504 {505 goto yyoverflow;506 }507 *++yyssp = yystate = yytable[yyn];508 *++yyvsp = yylval;509 goto yyloop;510 }511 else512 {513 #if YYDEBUG514 if (yydebug)515 printf("%sdebug: error recovery discarding state %d\n",516 YYPREFIX, *yyssp);517 #endif518 if (yyssp <= yyss) goto yyabort;519 --yyssp;520 --yyvsp;521 }522 }523 }524 else525 {526 if (yychar == 0) goto yyabort;527 #if YYDEBUG528 if (yydebug)529 {530 yys = 0;531 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];532 if (!yys) yys = "illegal-symbol";533 printf("%sdebug: state %d, error recovery discards token %d (%s)\n",534 YYPREFIX, yystate, yychar, yys);535 }536 #endif537 yychar = (-1);538 goto yyloop;539 }540 yyreduce:541 #if YYDEBUG542 if (yydebug)543 printf("%sdebug: state %d, reducing by rule %d (%s)\n",544 YYPREFIX, yystate, yyn, yyrule[yyn]);545 #endif546 yym = yylen[yyn];547 yyval = yyvsp[1-yym];548 switch (yyn)549 {550 case 1:551 #line 75 "bool_parser.y"552 { tree_base = yyvsp[0].node;}553 break;554 case 2:555 #line 79 "bool_parser.y"556 { yyval.node = CreateBoolTermNode(term_list, yyvsp[0].text, 1, word_num, count, doc_count, invf_ptr, invf_len, stemmer_num); }557 break;558 case 3:559 #line 80 "bool_parser.y"560 { yyval.node = yyvsp[-1].node; }561 break;562 case 4:563 #line 81 "bool_parser.y"564 { yyval.node = CreateBoolTreeNode(N_all, NULL, NULL); }565 break;566 case 5:567 #line 82 "bool_parser.y"568 { yyval.node = CreateBoolTreeNode(N_none, NULL, NULL); }569 break;570 case 7:571 #line 86 "bool_parser.y"572 { yyval.node = CreateBoolTreeNode(N_not, yyvsp[0].node, NULL); }573 break;574 case 8:575 #line 89 "bool_parser.y"576 { yyval.node = CreateBoolTreeNode(N_and, yyvsp[-2].node, yyvsp[0].node); }577 break;578 case 9:579 #line 90 "bool_parser.y"580 { yyval.node = CreateBoolTreeNode(N_and, yyvsp[-1].node, yyvsp[0].node); }581 break;582 case 11:583 #line 94 "bool_parser.y"584 { yyval.node = CreateBoolTreeNode(N_or, yyvsp[-2].node, yyvsp[0].node); }585 break;586 #line 584 "y.tab.c"587 }588 yyssp -= yym;589 yystate = *yyssp;590 yyvsp -= yym;591 yym = yylhs[yyn];592 if (yystate == 0 && yym == 0)593 {594 #if YYDEBUG595 if (yydebug)596 printf("%sdebug: after reduction, shifting from state 0 to\597 state %d\n", YYPREFIX, YYFINAL);598 #endif599 yystate = YYFINAL;600 *++yyssp = YYFINAL;601 *++yyvsp = yyval;602 if (yychar < 0)603 {604 if ((yychar = yylex()) < 0) yychar = 0;605 #if YYDEBUG606 if (yydebug)607 {608 yys = 0;609 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];610 if (!yys) yys = "illegal-symbol";611 printf("%sdebug: state %d, reading %d (%s)\n",612 YYPREFIX, YYFINAL, yychar, yys);613 }614 #endif615 }616 if (yychar == 0) goto yyaccept;617 goto yyloop;618 }619 if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&620 yyn <= YYTABLESIZE && yycheck[yyn] == yystate)621 yystate = yytable[yyn];622 else623 yystate = yydgoto[yym];624 #if YYDEBUG625 if (yydebug)626 printf("%sdebug: after reduction, shifting from state %d \627 to state %d\n", YYPREFIX, *yyssp, yystate);628 #endif629 if (yyssp >= yyss + yystacksize - 1)630 {631 goto yyoverflow;632 }633 *++yyssp = yystate;634 *++yyvsp = yyval;635 goto yyloop;636 yyoverflow:637 yyerror("yacc stack overflow");638 yyabort:639 return (1);640 yyaccept:641 return (0);642 }643 -
branches/New_Config_Format-branch/gsdl/packages/mg/sysfuncs.h
r821 r1279 194 194 195 195 /* On MSDOS, there are missing things from <sys/stat.h>. */ 196 #if def __MSDOS__196 #if defined(__MSDOS__) 197 197 #define S_ISUID 0 198 198 #define S_ISGID 0 199 199 #define S_ISVTX 0 200 #endif 201 202 #if defined(__GNUC__) && defined(__WIN32__) 203 #include <limits.h> 200 204 #endif 201 205 -
branches/New_Config_Format-branch/gsdl/perllib/classify/AZSectionList.pm
r741 r1279 30 30 # instead of just top level metadata 31 31 32 # options are:33 # metadata=Metadata34 35 32 # the only change is to the classify() subroutine which 36 33 # must now iterate through each section, adding each … … 39 36 package AZSectionList; 40 37 38 use AZList; 41 39 use sorttools; 42 40 43 sub new { 44 my ($class, @options) = @_; 45 46 my ($metaname); 47 foreach $option (@options) { 48 if ($option =~ /^metadata=(.*)$/i) { 49 $metaname = $1; 50 } 51 } 52 53 if (!defined $metaname) { 54 die "AZSectionList used with no metadata name to classify by\n"; 55 } 56 57 return bless { 58 'list'=>{}, 59 'metaname' => $metaname 60 }, $class; 61 } 62 63 sub init { 64 my $self = shift (@_); 65 66 $self->{'list'} = {}; 41 sub BEGIN { 42 @ISA = ('AZList'); 67 43 } 68 44 … … 103 79 } 104 80 105 sub get_classify_info {106 my $self = shift (@_);107 108 my @classlist = sort {$self->{'list'}->{$a} cmp $self->{'list'}->{$b};}109 keys %{$self->{'list'}};110 111 return $self->splitlist (\@classlist);112 }113 114 sub get_entry {115 my $self = shift (@_);116 my ($title, $childtype, $thistype) = @_;117 118 # organise into classification structure119 my %classifyinfo = ('childtype'=>$childtype,120 'Title'=>$title,121 'contains'=>[]);122 $classifyinfo{'thistype'} = $thistype123 if defined $thistype && $thistype =~ /\w/;124 125 return \%classifyinfo;126 }127 128 # splitlist takes an ordered list of classifications (@$classlistref) and splits it129 # up into alphabetical sub-sections.130 sub splitlist {131 my $self = shift (@_);132 my ($classlistref) = @_;133 my $classhash = {};134 135 # top level136 my $childtype = "HList";137 if (scalar (@$classlistref) <= 39) {$childtype = "VList";}138 my $classifyinfo = $self->get_entry ($self->{'metaname'}, $childtype, "Invisible");139 140 # don't need to do any splitting if there are less than 39 (max + min -1) classifications141 if ((scalar @$classlistref) <= 39) {142 foreach $subOID (@$classlistref) {143 push (@{$classifyinfo->{'contains'}}, {'OID'=>$subOID});144 }145 return $classifyinfo;146 }147 148 # first split up the list into separate A-Z and 0-9 classifications149 foreach $classification (@$classlistref) {150 my $title = $self->{'list'}->{$classification};151 $title =~ s/^(.).*$/$1/;152 $title =~ tr/[a-z]/[A-Z]/;153 if ($title =~ /^[0-9]$/) {$title = '0-9';}154 elsif ($title !~ /^[A-Z]$/) {155 print STDERR "AZSectionList: WARNING $classification has badly " .156 "formatted title ($title)\n";157 }158 $classhash->{$title} = [] unless defined $classhash->{$title};159 push (@{$classhash->{$title}}, $classification);160 }161 $classhash = $self->compactlist ($classhash);162 163 my @tmparr = ();164 foreach $subsection (sort keys (%$classhash)) {165 push (@tmparr, $subsection);166 }167 168 # if there's a 0-9 section it will have been sorted to the beginning169 # but we want it at the end170 if ($tmparr[0] eq '0-9') {171 shift @tmparr;172 push (@tmparr, '0-9');173 }174 175 foreach $subclass (@tmparr) {176 my $tempclassify = $self->get_entry($subclass, "VList");177 foreach $subsubOID (@{$classhash->{$subclass}}) {178 push (@{$tempclassify->{'contains'}}, {'OID'=>$subsubOID});179 }180 push (@{$classifyinfo->{'contains'}}, $tempclassify);181 }182 183 return $classifyinfo;184 }185 186 sub compactlist {187 my $self = shift (@_);188 my ($classhashref) = @_;189 my $compactedhash = {};190 my @currentOIDs = ();191 my $currentfirstletter = "";192 my $currentlastletter = "";193 my $lastkey = "";194 195 # minimum and maximum documents to be displayed per page.196 # the actual maximum will be max + (min-1).197 # the smallest sub-section is a single letter at present198 # so in this case there may be many times max documents199 # displayed on a page.200 my $min = 10;201 my $max = 30;202 203 foreach $subsection (sort keys %$classhashref) {204 if ($subsection eq '0-9') {205 @{$compactedhash->{$subsection}} = @{$classhashref->{$subsection}};206 next;207 }208 $currentfirstletter = $subsection if $currentfirstletter eq "";209 if ((scalar (@currentOIDs) < $min) ||210 ((scalar (@currentOIDs) + scalar (@{$classhashref->{$subsection}})) <= $max)) {211 push (@currentOIDs, @{$classhashref->{$subsection}});212 $currentlastletter = $subsection;213 } else {214 215 if ($currentfirstletter eq $currentlastletter) {216 @{$compactedhash->{$currentfirstletter}} = @currentOIDs;217 $lastkey = $currentfirstletter;218 } else {219 @{$compactedhash->{"$currentfirstletter-$currentlastletter"}} = @currentOIDs;220 $lastkey = "$currentfirstletter-$currentlastletter";221 }222 if (scalar (@{$classhashref->{$subsection}}) >= $max) {223 $compactedhash->{$subsection} = $classhashref->{$subsection};224 @currentOIDs = ();225 $currentfirstletter = "";226 $lastkey = $subsection;227 } else {228 @currentOIDs = @{$classhashref->{$subsection}};229 $currentfirstletter = $subsection;230 $currentlastletter = $subsection;231 }232 }233 }234 235 # add final OIDs to last sub-classification if there aren't many otherwise236 # add final sub-classification237 if (scalar (@currentOIDs) < $min) {238 my ($newkey) = $lastkey =~ /^(.)/;239 @currentOIDs = (@{$compactedhash->{$lastkey}}, @currentOIDs);240 delete $compactedhash->{$lastkey};241 @{$compactedhash->{"$newkey-$currentlastletter"}} = @currentOIDs;242 } else {243 if ($currentfirstletter eq $currentlastletter) {244 @{$compactedhash->{$currentfirstletter}} = @currentOIDs;245 } else {246 @{$compactedhash->{"$currentfirstletter-$currentlastletter"}} = @currentOIDs;247 }248 }249 250 return $compactedhash;251 }252 81 253 82 1; -
branches/New_Config_Format-branch/gsdl/perllib/classify/List.pm
r677 r1279 144 144 sub get_classify_info { 145 145 my $self = shift (@_); 146 my ($no_thistype) = @_; 147 $no_thistype = 0 unless defined $no_thistype; 146 148 147 149 my @list = (); … … 156 158 157 159 # organise into classification structure 158 my %classifyinfo = ('thistype'=>'Invisible', 159 'childtype'=>'VList', 160 my %classifyinfo = ('childtype'=>'VList', 160 161 'Title'=>$self->{'title'}, 161 162 'contains'=>[]); 163 $classifyinfo{'thistype'} = 'Invisible' unless $no_thistype; 164 162 165 foreach $OID (@list) { 163 166 push (@{$classifyinfo{'contains'}}, {'OID'=>$OID}); -
branches/New_Config_Format-branch/gsdl/perllib/classify/SectionList.pm
r838 r1279 27 27 # (excluding top level) rather than just top level document 28 28 # itself 29 # options are:30 # metadata=Metaname -- (optional) all documents with Metaname metadata31 # will be included in list. if not included all documents32 # will be included in list.33 # sort=Meta -- (optional) sort documents in list alphabetically by34 # Meta. by default it will sort by Metaname, if neither35 # are set documents will be in build (random) order.36 # Meta may be Filename to sort by original filename or37 # nosort to force not to sort38 # title=Title -- (optional) the title field for this classification.39 # if not included title field will be Metaname.40 # if metadata is also not included title will be 'List'41 29 42 30 package SectionList; 43 31 32 use List; 44 33 use sorttools; 45 34 46 sub new { 47 my ($class, @options) = @_; 48 49 my $list = []; 50 my ($metaname, $title, $sortname); 51 52 foreach $option (@options) { 53 if ($option =~ /^metadata=(.*)$/i) { 54 $metaname = $1; 55 $list = {}; 56 } elsif ($option =~ /^title=(.*)$/i) { 57 $title = $1; 58 } elsif ($option =~ /^sort=(.*)$/i) { 59 $sortname = $1; 60 } 61 } 62 63 if (!defined $title) { 64 if (defined $metaname) { 65 $title = $metaname; 66 } else { 67 $title = 'List'; 68 } 69 } 70 71 if (defined $sortname && $sortname =~ /^nosort$/i) { 72 $sortname = undef; 73 } elsif (!defined $sortname && defined $metaname) { 74 $sortname = $metaname; 75 } 76 77 return bless { 78 'list'=>$list, 79 'metaname' => $metaname, 80 'title' => $title, 81 'sortname' => $sortname 82 }, $class; 83 } 84 85 sub init { 86 my $self = shift (@_); 87 88 if (defined $self->{'sortname'}) { 89 $self->{'list'} = {}; 90 } else { 91 $self->{'list'} = []; 92 } 35 sub BEGIN { 36 @ISA = ('List'); 93 37 } 94 38 95 39 sub classify { 96 40 my $self = shift (@_); 97 my ($doc_obj, @options) = @_;41 my ($doc_obj, @options) = @_; 98 42 99 43 my $thissection = undef; … … 175 119 } 176 120 177 sub get_classify_info {178 my $self = shift (@_);179 180 my @list = ();181 if (defined $self->{'sortname'}) {182 if (keys %{$self->{'list'}}) {183 @list = sort {$self->{'list'}->{$a}184 cmp $self->{'list'}->{$b};} keys %{$self->{'list'}};185 }186 } else {187 @list = @{$self->{'list'}};188 }189 190 # organise into classification structure191 my %classifyinfo = ('thistype'=>'Invisible',192 'childtype'=>'VList',193 'Title'=>$self->{'title'},194 'contains'=>[]);195 foreach $OID (@list) {196 push (@{$classifyinfo{'contains'}}, {'OID'=>$OID});197 }198 199 return \%classifyinfo;200 }201 202 203 121 1; -
branches/New_Config_Format-branch/gsdl/perllib/doc.pm
r846 r1279 24 24 ########################################################################### 25 25 26 # class to hold documents26 # base class to hold documents 27 27 28 28 package doc; 29 29 30 use basedoc;31 32 30 BEGIN { 33 @ISA = ('basedoc'); 34 } 31 die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'}; 32 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/dynamic/lib/site_perl/5.005/i686-linux"); 33 } 34 35 use unicode; 36 use util; 37 use ghtml; 38 ##use hashdoc; 35 39 36 40 # the document type may be indexed_doc, nonindexed_doc, or … … 39 43 sub new { 40 44 my $class = shift (@_); 41 my ($source_filename, $doc_type) = @_; 42 43 my $self = new basedoc(); 45 46 my $self = bless {'associated_files'=>[], 47 'subsection_order'=>[], 48 'next_subsection'=>1, 49 'subsections'=>{}, 50 'metadata'=>[], 51 'text'=>""}, $class; 44 52 45 53 # $self->set_source_filename ($source_filename) if defined $source_filename; 46 push (@{$self->{'metadata'}}, ["gsdlsourcefilename", &unicode::ascii2utf8($source_filename)]) 47 if defined $source_filename; 54 push (@{$self->{'metadata'}}, ["gsdlsourcefilename", $source_filename]) if defined $source_filename; 48 55 # $self->set_doc_type ($doc_type) if defined $doc_type; 49 push (@{$self->{'metadata'}}, ["gsdldoctype", &unicode::ascii2utf8($doc_type)]) 50 if defined $doc_type; 51 52 bless($self,$class); 56 push (@{$self->{'metadata'}}, ["gsdldoctype", $doc_type]) if defined $doc_type; 57 53 58 return $self; 54 59 } 55 60 61 # clone the $self object 62 sub duplicate { 63 my $self = shift (@_); 64 65 my $newobj = {}; 66 67 foreach $k (keys %$self) { 68 $newobj->{$k} = &clone ($self->{$k}); 69 } 70 71 bless $newobj, ref($self); 72 return $newobj; 73 } 74 75 sub clone { 76 my ($from) = @_; 77 my $type = ref ($from); 78 79 if ($type eq "HASH") { 80 my $to = {}; 81 foreach $key (keys %$from) { 82 $to->{$key} = &clone ($from->{$key}); 83 } 84 return $to; 85 } elsif ($type eq "ARRAY") { 86 my $to = []; 87 foreach $v (@$from) { 88 push (@$to, &clone ($v)); 89 } 90 return $to; 91 } else { 92 return $from; 93 } 94 } 95 96 97 sub set_source_filename { 98 my $self = shift (@_); 99 my ($source_filename) = @_; 100 101 $self->set_metadata_element ($self->get_top_section(), 102 "gsdlsourcefilename", 103 $source_filename); 104 } 105 106 # returns the source_filename as it was provided 107 sub get_source_filename { 108 my $self = shift (@_); 109 110 return $self->get_metadata_element ($self->get_top_section(), "gsdlsourcefilename"); 111 } 112 113 sub set_doc_type { 114 my $self = shift (@_); 115 my ($doc_type) = @_; 116 117 $self->set_metadata_element ($self->get_top_section(), 118 "gsdldoctype", 119 $doc_type); 120 } 121 122 # returns the source_filename as it was provided 123 # the default of "indexed_doc" is used if no document 124 # type was provided 125 sub get_doc_type { 126 my $self = shift (@_); 127 128 my $doc_type = $self->get_metadata_element ($self->get_top_section(), "gsdldoctype"); 129 return $doc_type if (defined $doc_type); 130 return "indexed_doc"; 131 } 132 133 sub _escape_text { 134 my ($text) = @_; 135 136 # special characters in the gml encoding 137 $text =~ s/&/&/g; # this has to be first... 138 $text =~ s/</</g; 139 $text =~ s/>/>/g; 140 $text =~ s/\"/"/g; 141 142 return $text; 143 } 144 145 146 sub buffer_section { 147 my $self = shift (@_); 148 my ($section, $suppress_subject_info) = @_; 149 150 $suppress_subject_info = 0 unless defined $suppress_subject_info; 151 my ($all_text,$data, $subsection); 152 153 my $section_ptr = $self->_lookup_section ($section); 154 my ($section_num) = $section =~ /(\d+)$/; 155 156 return "" unless defined $section_ptr; 157 158 # output the section header (including the section number 159 # and metadata) 160 161 $all_text = "<gsdlsection"; 162 $all_text .= " gsdlnum=\"$section_num\"" if defined $section_num; 163 foreach $data (@{$section_ptr->{'metadata'}}) { 164 $all_text .= " $data->[0]=\"" . &_escape_text($data->[1]) . "\"" 165 unless $suppress_subject_info && $data->[0] eq "Subject"; 166 } 167 $all_text .= ">"; 168 169 # output the text 170 $all_text .= &_escape_text($section_ptr->{'text'}); 171 172 # output all the subsections 173 foreach $subsection (@{$section_ptr->{'subsection_order'}}) { 174 $all_text .= $self->buffer_section("$section.$subsection", $suppress_subject_info); 175 } 176 177 # output the closing tag 178 $all_text .= "</gsdlsection>\n"; 179 180 return $all_text; 181 } 182 183 sub output_section { 184 my $self = shift (@_); 185 my ($handle, $section, $suppress_subject_info) = @_; 186 187 my $all_text = $self->buffer_section($section, $suppress_subject_info); 188 print $handle $all_text; 189 } 190 191 # look up the reference to the a particular section 192 sub _lookup_section { 193 my $self = shift (@_); 194 my ($section) = @_; 195 196 my ($num); 197 my $sectionref = $self; 198 199 while (defined $section && $section ne "") { 200 ($num, $section) = $section =~ /^\.?(\d+)(.*)$/; 201 $num =~ s/^0+(\d)/$1/; # remove leading 0s 202 $section = "" unless defined $section; 203 204 if (defined $num && defined $sectionref->{'subsections'}->{$num}) { 205 $sectionref = $sectionref->{'subsections'}->{$num}; 206 } else { 207 return undef; 208 } 209 } 210 211 return $sectionref; 212 } 213 214 sub _calc_OID { 215 my $self = shift (@_); 216 my ($filename) = @_; 217 218 my $osexe = &util::get_os_exe(); 219 220 my $hashfile_exe = &util::filename_cat($ENV{'GSDLHOME'},"bin", 221 $ENV{'GSDLOS'},"hashfile$osexe"); 222 my $result = "NULL"; 223 224 if (-e "$hashfile_exe") { 225 $result = `$hashfile_exe \"$filename\"`; 226 ($result) = $result =~ /:\s*([0-9a-f]+)/i; 227 228 } else { 229 print STDERR "doc::_calc_OID $hashfile_exe could not be found\n"; 230 } 231 232 return "HASH$result"; 233 } 234 235 # methods dealing with OID, not groups of them. 236 237 # if $OID is not provided one is calculated from hashing the 238 # current contents of the document 239 # An OID are actually stored as metadata of the document 240 sub set_OID { 241 my $self = shift (@_); 242 my ($OID) = @_; 243 244 # if an OID wasn't provided then feed this document to 245 # hashfile.exe 246 if (!defined $OID) { 247 $OID = "NULL"; 248 my $tmp_filename = &util::get_tmp_filename(); 249 if (!open (OUTFILE, ">$tmp_filename")) { 250 print STDERR "doc::set_OID could not write to $tmp_filename\n"; 251 } else { 252 $self->output_section('OUTFILE', $self->get_top_section(), 1); 253 close (OUTFILE); 254 255 $OID = $self->_calc_OID ($tmp_filename); 256 &util::rm ($tmp_filename); 257 } 258 } 259 260 $self->set_metadata_element ($self->get_top_section(), "Identifier", $OID); 261 } 262 263 # this uses hashdoc (embedded c thingy) which is faster but still 264 # needs a little work to be suffiently stable 265 sub ___set_OID { 266 my $self = shift (@_); 267 my ($OID) = @_; 268 269 # if an OID wasn't provided then calculate hash value based on document 270 if (!defined $OID) 271 { 272 my $hash_text = $self->buffer_section($self->get_top_section(), 1); 273 my $hash_len = length($hash_text); 274 275 $OID = &hashdoc::buffer($hash_text,$hash_len); 276 } 277 278 $self->set_metadata_element ($self->get_top_section(), "Identifier", $OID); 279 } 280 281 # returns the OID for this document 282 sub get_OID { 283 my $self = shift (@_); 284 my $OID = $self->get_metadata_element ($self->get_top_section(), "Identifier"); 285 return $OID if (defined $OID); 286 return "NULL"; 287 } 288 289 sub delete_OID { 290 my $self = shift (@_); 291 292 $self->set_metadata_element ($self->get_top_section(), "Identifier", "NULL"); 293 } 294 295 296 # methods for manipulating section names 297 298 # returns the name of the top-most section (the top 299 # level of the document 300 sub get_top_section { 301 my $self = shift (@_); 302 303 return ""; 304 } 305 306 # returns a section 307 sub get_parent_section { 308 my $self = shift (@_); 309 my ($section) = @_; 310 311 $section =~ s/(^|\.)\d+$//; 312 313 return $section; 314 } 315 316 # returns the first child section (or the end child 317 # if there isn't any) 318 sub get_begin_child { 319 my $self = shift (@_); 320 my ($section) = @_; 321 322 my $section_ptr = $self->_lookup_section($section); 323 return "" unless defined $section_ptr; 324 325 if (defined $section_ptr->{'subsection_order'}->[0]) { 326 return "$section.$section_ptr->{'subsection_order'}->[0]"; 327 } 328 329 return $self->get_end_child ($section); 330 } 331 332 # returns the next child of a parent section 333 sub get_next_child { 334 my $self = shift (@_); 335 my ($section) = @_; 336 337 my $parent_section = $self->get_parent_section($section); 338 my $parent_section_ptr = $self->_lookup_section($parent_section); 339 return undef unless defined $parent_section_ptr; 340 341 my ($section_num) = $section =~ /(\d+)$/; 342 return undef unless defined $section_num; 343 344 my $i = 0; 345 my $section_order = $parent_section_ptr->{'subsection_order'}; 346 while ($i < scalar(@$section_order)) { 347 last if $section_order->[$i] eq $section_num; 348 $i++; 349 } 350 351 $i++; # the next child 352 if ($i < scalar(@$section_order)) { 353 return $section_order->[$i] if $parent_section eq ""; 354 return "$parent_section.$section_order->[$i]"; 355 } 356 357 # no more sections in this level 358 return undef; 359 } 360 361 # returns a reference to a list of children 362 sub get_children { 363 my $self = shift (@_); 364 my ($section) = @_; 365 366 my $section_ptr = $self->_lookup_section($section); 367 return [] unless defined $section_ptr; 368 369 my @children = @{$section_ptr->{'subsection_order'}}; 370 371 map {$_ = "$section.$_"; $_ =~ s/^\.+//;} @children; 372 return \@children; 373 } 374 375 # returns the child section one past the last one (which 376 # is coded as "0") 377 sub get_end_child { 378 my $self = shift (@_); 379 my ($section) = @_; 380 381 return $section . ".0" unless $section eq ""; 382 return "0"; 383 } 384 385 # returns the next section in book order 386 sub get_next_section { 387 my $self = shift (@_); 388 my ($section) = @_; 389 390 return undef unless defined $section; 391 392 my $section_ptr = $self->_lookup_section($section); 393 return undef unless defined $section_ptr; 394 395 # first try to find first child 396 if (defined $section_ptr->{'subsection_order'}->[0]) { 397 return $section_ptr->{'subsection_order'}->[0] if ($section eq ""); 398 return "$section.$section_ptr->{'subsection_order'}->[0]"; 399 } 400 401 do { 402 # try to find sibling 403 my $next_child = $self->get_next_child ($section); 404 return $next_child if (defined $next_child); 405 406 # move up one level 407 $section = $self->get_parent_section ($section); 408 } while $section =~ /\d/; 409 410 return undef; 411 } 412 413 sub is_leaf_section { 414 my $self = shift (@_); 415 my ($section) = @_; 416 417 my $section_ptr = $self->_lookup_section($section); 418 return 1 unless defined $section_ptr; 419 420 return (scalar (@{$section_ptr->{'subsection_order'}}) == 0); 421 } 422 423 # methods for dealing with sections 424 425 # returns the name of the inserted section 426 sub insert_section { 427 my $self = shift (@_); 428 my ($before_section) = @_; 429 430 # get the child to insert before and its parent section 431 my $parent_section = ""; 432 my $before_child = "0"; 433 my @before_section = split (/\./, $before_section); 434 if (scalar(@before_section) > 0) { 435 $before_child = pop (@before_section); 436 $parent_section = join (".", @before_section); 437 } 438 439 my $parent_section_ptr = $self->_lookup_section($parent_section); 440 if (!defined $parent_section_ptr) { 441 print STDERR "doc::insert_section couldn't find parent section " . 442 "$parent_section\n"; 443 return; 444 } 445 446 # get the next section number 447 my $section_num = $parent_section_ptr->{'next_subsection'}++; 448 449 my $i = 0; 450 while ($i < scalar(@{$parent_section_ptr->{'subsection_order'}}) && 451 $parent_section_ptr->{'subsection_order'}->[$i] ne $before_child) { 452 $i++; 453 } 454 455 # insert the section number into the order list 456 splice (@{$parent_section_ptr->{'subsection_order'}}, $i, 0, $section_num); 457 458 # add this section to the parent section 459 my $section_ptr = {'subsection_order'=>[], 460 'next_subsection'=>1, 461 'subsections'=>{}, 462 'metadata'=>[], 463 'text'=>""}; 464 $parent_section_ptr->{'subsections'}->{$section_num} = $section_ptr; 465 466 # work out the full section number 467 my $section = $parent_section; 468 $section .= "." unless $section eq ""; 469 $section .= $section_num; 470 471 return $section; 472 } 473 474 # creates a pre-named section 475 sub create_named_section { 476 my $self = shift (@_); 477 my ($mastersection) = @_; 478 479 my ($num); 480 my $section = $mastersection; 481 my $sectionref = $self; 482 483 #### print STDERR "*** mastersection = $mastersection\n"; 484 485 while ($section ne "") { 486 ($num, $section) = $section =~ /^\.?(\d+)(.*)$/; 487 $num =~ s/^0+(\d)/$1/; # remove leading 0s 488 $section = "" unless defined $section; 489 490 if (defined $num) { 491 if (!defined $sectionref->{'subsections'}->{$num}) { 492 push (@{$sectionref->{'subsection_order'}}, $num); 493 $sectionref->{'subsections'}->{$num} = {'subsection_order'=>[], 494 'next_subsection'=>1, 495 'subsections'=>{}, 496 'metadata'=>[], 497 'text'=>""}; 498 if ($num >= $sectionref->{'next_subsection'}) { 499 $sectionref->{'next_subsection'} = $num + 1; 500 } 501 } 502 $sectionref = $sectionref->{'subsections'}->{$num}; 503 504 } else { 505 print STDERR "doc::create_named_section couldn't create section "; 506 print STDERR "$mastersection\n"; 507 last; 508 } 509 } 510 } 511 512 # returns a reference to a list of subsections 513 sub list_subsections { 514 my $self = shift (@_); 515 my ($section) = @_; 516 517 my $section_ptr = $self->_lookup_section ($section); 518 if (!defined $section_ptr) { 519 print STDERR "doc::list_subsections couldn't find section $section\n"; 520 return []; 521 } 522 523 return [@{$section_ptr->{'subsection_order'}}]; 524 } 525 526 sub delete_section { 527 my $self = shift (@_); 528 my ($section) = @_; 529 530 # my $section_ptr = {'subsection_order'=>[], 531 # 'next_subsection'=>1, 532 # 'subsections'=>{}, 533 # 'metadata'=>[], 534 # 'text'=>""}; 535 536 # if this is the top section reset everything 537 if ($section eq "") { 538 $self->{'subsection_order'} = []; 539 $self->{'subsections'} = {}; 540 $self->{'metadata'} = []; 541 $self->{'text'} = ""; 542 return; 543 } 544 545 # find the parent of the section to delete 546 my $parent_section = ""; 547 my $child = "0"; 548 my @section = split (/\./, $section); 549 if (scalar(@section) > 0) { 550 $child = pop (@section); 551 $parent_section = join (".", @section); 552 } 553 554 my $parent_section_ptr = $self->_lookup_section($parent_section); 555 if (!defined $parent_section_ptr) { 556 print STDERR "doc::delete_section couldn't find parent section " . 557 "$parent_section\n"; 558 return; 559 } 560 561 # remove this section from the subsection_order list 562 my $i = 0; 563 while ($i < scalar (@{$parent_section_ptr->{'subsection_order'}})) { 564 if ($parent_section_ptr->{'subsection_order'}->[$i] eq $child) { 565 splice (@{$parent_section_ptr->{'subsection_order'}}, $i, 1); 566 last; 567 } 568 $i++; 569 } 570 571 # remove this section from the subsection hash 572 if (defined ($parent_section_ptr->{'subsections'}->{$child})) { 573 undef $parent_section_ptr->{'subsections'}->{$child}; 574 } 575 } 576 577 #-- 56 578 # methods for dealing with metadata 57 579 … … 60 582 # are for metadata which can have more than one value. 61 583 62 # set_metadata_element assumes the value is in (extended) ascii form. 63 # For text which hash been already converted to the UTF-8 format use 64 # set_utf8_metadata_element. 584 # returns the first metadata value which matches field 585 sub get_metadata_element { 586 my $self = shift (@_); 587 my ($section, $field) = @_; 588 my ($data); 589 590 my $section_ptr = $self->_lookup_section($section); 591 if (!defined $section_ptr) { 592 print STDERR "doc::get_metadata_element couldn't find section " . 593 "$section\n"; 594 return; 595 } 596 597 foreach $data (@{$section_ptr->{'metadata'}}) { 598 return $data->[1] if (scalar(@$data) >= 2 && $data->[0] eq $field); 599 } 600 601 return undef; # was not found 602 } 603 604 605 # returns a list of the form [value1, value2, ...] 606 sub get_metadata { 607 my $self = shift (@_); 608 my ($section, $field) = @_; 609 my ($data); 610 611 my $section_ptr = $self->_lookup_section($section); 612 if (!defined $section_ptr) { 613 print STDERR "doc::get_metadata couldn't find section " . 614 "$section\n"; 615 return; 616 } 617 618 my @metadata = (); 619 foreach $data (@{$section_ptr->{'metadata'}}) { 620 push (@metadata, $data->[1]) if ($data->[0] eq $field); 621 } 622 623 return \@metadata; 624 } 625 626 # returns a list of the form [[field,value],[field,value],...] 627 sub get_all_metadata { 628 my $self = shift (@_); 629 my ($section) = @_; 630 631 my $section_ptr = $self->_lookup_section($section); 632 if (!defined $section_ptr) { 633 print STDERR "doc::get_all_metadata couldn't find section " . 634 "$section\n"; 635 return; 636 } 637 638 return $section_ptr->{'metadata'}; 639 } 640 641 # $value is optional 642 sub delete_metadata { 643 my $self = shift (@_); 644 my ($section, $field, $value) = @_; 645 646 my $section_ptr = $self->_lookup_section($section); 647 if (!defined $section_ptr) { 648 print STDERR "doc::delete_metadata couldn't find section " . 649 "$section\n"; 650 return; 651 } 652 653 my $i = 0; 654 while ($i < scalar (@{$section_ptr->{'metadata'}})) { 655 if (($section_ptr->{'metadata'}->[$i]->[0] eq $field) && 656 (!defined $value || $section_ptr->{'metadata'}->[$i]->[1] eq $value)) { 657 splice (@{$section_ptr->{'metadata'}}, $i, 1); 658 } else { 659 $i++; 660 } 661 } 662 } 663 664 sub delete_all_metadata { 665 my $self = shift (@_); 666 my ($section) = @_; 667 668 my $section_ptr = $self->_lookup_section($section); 669 if (!defined $section_ptr) { 670 print STDERR "doc::delete_all_metadata couldn't find section " . 671 "$section\n"; 672 return; 673 } 674 675 $section_ptr->{'metadata'} = []; 676 } 677 65 678 sub set_metadata_element { 66 679 my $self = shift (@_); … … 112 725 # methods for dealing with text 113 726 727 # returns the text for a section 728 sub get_text { 729 my $self = shift (@_); 730 my ($section) = @_; 731 732 my $section_ptr = $self->_lookup_section($section); 733 if (!defined $section_ptr) { 734 print STDERR "doc::get_text couldn't find section " . 735 "$section\n"; 736 return ""; 737 } 738 739 return $section_ptr->{'text'}; 740 } 741 742 # returns the (utf-8 encoded) length of the text for a section 743 sub get_text_length { 744 my $self = shift (@_); 745 my ($section) = @_; 746 747 my $section_ptr = $self->_lookup_section($section); 748 if (!defined $section_ptr) { 749 print STDERR "doc::get_text_length couldn't find section " . 750 "$section\n"; 751 return 0; 752 } 753 754 return length ($section_ptr->{'text'}); 755 } 756 757 sub delete_text { 758 my $self = shift (@_); 759 my ($section) = @_; 760 761 my $section_ptr = $self->_lookup_section($section); 762 if (!defined $section_ptr) { 763 print STDERR "doc::delete_text couldn't find section " . 764 "$section\n"; 765 return; 766 } 767 768 $section_ptr->{'text'} = ""; 769 } 770 114 771 # add_text assumes the text is in (extended) ascii form. For 115 772 # text which has been already converted to the UTF-8 format … … 143 800 144 801 802 # methods for dealing with associated files 803 804 # a file is associated with a document, NOT a section. 805 # if section is defined it is noted in the data structure 806 # only so that files associated from a particular section 807 # may be removed later (using delete_section_assoc_files) 808 sub associate_file { 809 my $self = shift (@_); 810 my ($real_filename, $assoc_filename, $mime_type, $section) = @_; 811 $mime_type = &ghtml::guess_mime_type ($real_filename) unless defined $mime_type; 812 813 # remove all associated files with the same name 814 $self->delete_assoc_file ($assoc_filename); 815 816 push (@{$self->{'associated_files'}}, 817 [$real_filename, $assoc_filename, $mime_type, $section]); 818 } 819 820 # returns a list of associated files in the form 821 # [[real_filename, assoc_filename, mimetype], ...] 822 sub get_assoc_files { 823 my $self = shift (@_); 824 825 return $self->{'associated_files'}; 826 } 827 828 sub delete_section_assoc_files { 829 my $self = shift (@_); 830 my ($section) = @_; 831 832 my $i=0; 833 while ($i < scalar (@{$self->{'associated_files'}})) { 834 if (defined $self->{'associated_files'}->[$i]->[3] && 835 $self->{'associated_files'}->[$i]->[3] eq $section) { 836 splice (@{$self->{'associated_files'}}, $i, 1); 837 } else { 838 $i++; 839 } 840 } 841 } 842 843 sub delete_assoc_file { 844 my $self = shift (@_); 845 my ($assoc_filename) = @_; 846 847 my $i=0; 848 while ($i < scalar (@{$self->{'associated_files'}})) { 849 if ($self->{'associated_files'}->[$i]->[1] eq $assoc_filename) { 850 splice (@{$self->{'associated_files'}}, $i, 1); 851 } else { 852 $i++; 853 } 854 } 855 } 856 857 sub reset_nextsection_ptr { 858 my $self = shift (@_); 859 my ($section) = @_; 860 861 my $section_ptr = $self->_lookup_section($section); 862 $section_ptr->{'next_subsection'} = 1; 863 } 864 145 865 1; -
branches/New_Config_Format-branch/gsdl/perllib/gb.pm
r537 r1279 163 163 164 164 return 0 unless open (MAPFILE, "$ENV{'GSDLHOME'}/unicode/$filename"); 165 binmode (MAPFILE); # f$#@!!! windows 165 166 166 167 $translations{$encoding} = [@array256]; -
branches/New_Config_Format-branch/gsdl/perllib/ghtml.pm
r1010 r1279 34 34 sub htmlsafe 35 35 { 36 $_[0] =~ s/&/&/og; 37 $_[0] =~ s/</</og; 38 $_[0] =~ s/>/>/og; 36 $_[0] =~ s/&/&/osg; 37 $_[0] =~ s/</</osg; 38 $_[0] =~ s/>/>/osg; 39 $_[0] =~ s/\"/"/osg; 39 40 } 40 41 … … 45 46 sub urlsafe 46 47 { 47 $_[0] =~ s/[\x09\x20\x22\x3c\x3e\x5b\x5c\x5d\x5e\x60\x7b\x7c\x7d\x7e\?\=\&\+_\/]/sprintf("%%%2x", ord($&))/g e;48 $_[0] =~ s/[\x09\x20\x22\x3c\x3e\x5b\x5c\x5d\x5e\x60\x7b\x7c\x7d\x7e\?\=\&\+_\/]/sprintf("%%%2x", ord($&))/gse; 48 49 } 49 50 … … 56 57 sub dmsafe { 57 58 my ($s) = $_[0]; 58 $s =~ s/&/&/og; # for html 59 $s =~ s/</</og; # for html 60 $s =~ s/>/>/og; # for html 61 $s =~ s/\_/_/og; # for dm (we have a convention of starting macros with _ 62 $s =~ s/\"/"/og; # for html (don't want to be interpreted as a quote) 63 $s =~ s/\{/{/og; # for dm blocks 64 $s =~ s/\}/}/og; # for dm blocks 59 $s =~ s/&/&/osg; # for html 60 $s =~ s/</</osg; # for html 61 $s =~ s/>/>/osg; # for html 62 $s =~ s/\_/_/osg; # for dm (we have a convention of starting macros with _ 63 $s =~ s/\"/"/osg; # for html (don't want to be interpreted as a quote) 64 $s =~ s/\{/{/osg; # for dm blocks 65 $s =~ s/\}/}/osg; # for dm blocks 66 $s =~ s/\\/\/osg; # for dm (dm removes naturally occurring backquotes) 65 67 return $s; 66 68 } … … 170 172 # args: the text that you want to convert 171 173 172 $_[0] =~ s/&([^;]+);/&getcharequiv($1,0)/g e;174 $_[0] =~ s/&([^;]+);/&getcharequiv($1,0)/gse; 173 175 } 174 176 … … 177 179 # args: the text that you want to convert 178 180 179 $_[0] =~ s/&([^;]+);/&getcharequiv($1,1)/g e;181 $_[0] =~ s/&([^;]+);/&getcharequiv($1,1)/gse; 180 182