Changeset 1279


Ignore:
Timestamp:
2000-07-13T10:21:53+12:00 (21 years ago)
Author:
sjboddie
Message:

merged changes to trunk into New_Config_Format branch

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  
    5454    print STDERR "   -keepold              will not destroy the current contents of the\n";
    5555    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";
    5761}
    5862
     
    6165{
    6266    my ($verbosity, $archivedir, $cachedir, $builddir, $maxdocs,
    63     $debug, $mode, $indexname, $keepold, $allclassifications);
     67    $debug, $mode, $indexname, $keepold, $allclassifications,
     68    $create_images);
    6469    if (!parsargv::parse(\@ARGV,
    6570             'verbosity/\d+/2', \$verbosity,
     
    7277             'index/.*/', \$indexname,
    7378             'keepold', \$keepold,
    74              'allclassifications', \$allclassifications)) {
     79             'allclassifications', \$allclassifications,
     80             'create_images', \$create_images)) {
    7581    &print_usage();
    7682    die "\n";
     
    8591    # read the configuration file
    8692    $textindex = "section:text";
    87     $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc/collect.cfg");
     93    $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg");
    8894    if (-e $configfilename) {
    8995    $collectcfg = &colcfg::read_collect_cfg ($configfilename);
     
    101107    }
    102108   
     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
    103118    # fill in the default archives and building directories if none
    104119    # were supplied, turn all \ into / and remove trailing /
     
    177192}
    178193
    179 
     194sub 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  
    5555
    5656sub print_usage {
    57     print STDERR "\n  usage: $0 [options] macrofile\n\n";
     57    print STDERR "\n  usage: $0 [options]\n\n";
    5858    print STDERR "  options:\n";
    5959    print STDERR "   -cfg_file file        configuration file containing one or more\n";
     
    136136    chomp $image_dir;
    137137    }
     138
     139    # replace any '\n' occurring in text with carriage return
     140    $text =~ s/\\n/\n/gi;
    138141   
    139142    if ($cfg_file =~ /\w/) {
  • branches/New_Config_Format-branch/gsdl/bin/script/gimp/title_icon.pl

    r1037 r1279  
    4646
    4747
    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);
     48local ($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);
    5252
    5353sub print_usage {
     
    5757    print STDERR "                          sets of the following options - use to create\n";
    5858    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";
    5961    print STDERR "   -image_dir directory   directory to create images in [`pwd`]\n";
    6062    print STDERR "                          this should be full path to existing directory\n";
     
    8385    print STDERR "   -fontslant             [r]\n";
    8486    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";
    8689}
    8790
     
    8992    $image_dir = "./";
    9093    $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);
    9497    $stripecolor = $gsdl_green;
    95     $stripewidth = 40;
     98    $stripewidth = int (40 * $size);
    9699    $stripe_alignment = "left";
    97100    $i_transparency = 60;
     
    99102    $text_alignment = "left";
    100103    $filename = "";
    101     $textspace_x = 3;
    102     $textspace_y = 3;
     104    $textspace_x = int (3 * $size);
     105    $textspace_y = int (3 * $size);
    103106    $bgcolor = $gsdl_green;
    104107    $fontcolor = $black;
    105     $fontsize = 17;
    106     $minfontsize = 10;
     108    $fontsize = int (17 * $size);
     109    $minfontsize = int (10 * $size);
    107110    $fontname = "lucida";
    108111    $fontweight = "medium";
     
    116119    if (!parsargv::parse(\@ARGV,
    117120             'cfg_file/.*/', \$cfg_file,
     121             'size/\d+/1', \$size,
    118122             'image_dir/.*/./', \$image_dir,
    119123             'imagefile/.*/', \$imagefile,
     
    138142             'fontslant/.*/r', \$fontslant,
    139143             'fontwidth/.*/*', \$fontwidth,
    140              'fontspacing/.*/*', \$fontspacing)) {
     144             'fontspacing/.*/*', \$fontspacing,
     145             'dont_wrap', \$dont_wrap)) {
    141146    &print_usage();
    142147    die "title_icon.pl: incorrect options\n";
     
    148153    chomp $image_dir;
    149154    }
    150    
     155
    151156    if ($cfg_file =~ /\w/) {
    152157   
     
    177182
    178183sub produce_image {
     184
     185    &adjust_args ();
     186    &wrap_text () unless $dont_wrap;
    179187
    180188    my $use_image = 0;
     
    338346    return 1;
    339347}
     348
     349# adjust arguments that are effected by the size argument
     350sub 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
     361sub 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}
    340380   
    341381sub query {
  • branches/New_Config_Format-branch/gsdl/bin/script/gsw3mir.pl

    r845 r1279  
    1 #!/usr/local/bin/perl5 -w
     1#!/usr/bin/perl -w
    22
    33###########################################################################
  • branches/New_Config_Format-branch/gsdl/bin/script/import.pl

    r1031 r1279  
    5656    print STDERR "                          directory -- use with care\n";
    5757    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";
    5860    print STDERR "   -maxdocs number        Maximum number of documents to import\n";
    5961    print STDERR "   -groupsize number      Number of GML documents to group into one file\n";
     
    135137
    136138    # load all the plugins
    137     $pluginfo = &plugin::load_plugins ($plugins);
     139    $pluginfo = &plugin::load_plugins ($plugins, $verbosity);
    138140    if (scalar(@$pluginfo) == 0) {
    139141    print STDERR "No plugins were loaded.\n";
  • branches/New_Config_Format-branch/gsdl/bin/script/mkcol.pl

    r1031 r1279  
    5151    print STDERR "   -title text         The title for the collection\n";
    5252    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";
    5455    print STDERR "   -refine   list      Space separated list of perl plugin modules to use\n";
    5556
     
    106107        $line =~ s/\*\*title\*\*/$title/g;
    107108        $line =~ s/\*\*about\*\*/$about/g;
    108         $line =~ s/\*\*plugins\*\*/$plugins/g;
     109        $line =~ s/\*\*plugins\*\*/$pluginstring/g;
    109110        $line =~ s/\*\*refine\*\*/$refine/g;
    110111
     
    119120
    120121
    121 my (@indexes, @indexestext);
     122my (@indexes, @indexestext, @plugin);
    122123
    123124# get and check options
     
    132133               'title/.+/', \$title,
    133134               'about/.+/', \$about,
    134                'plugins/.+/GMLPlug TEXTPlug ArcPlug RecPlug/', \$plugins,
     135               'plugin/.+', \@plugin,
    135136               'refine/.+/', \$refine
    136137               )) {
     
    138139    die "\n";
    139140}
    140    
     141
     142# load default plugins if none were on command line   
     143if (!scalar(@plugin)) {
     144    @plugin = (GMLPlug,TEXTPlug,ArcPlug,RecPlug);
     145}
     146
    141147# get and check the collection name
    142148($collection) = @ARGV;
     
    195201}
    196202
     203$pluginstring = "";
     204foreach $plugin (@plugin) {
     205    $pluginstring .= "plugin         $plugin\n";
     206}
    197207
    198208# make sure the model collection exists
  • branches/New_Config_Format-branch/gsdl/bin/script/newsrc.pl

    r546 r1279  
    1 #!/usr/local/bin/perl5 -w
     1#!/usr/bin/perl -w
    22
    33###########################################################################
  • branches/New_Config_Format-branch/gsdl/bin/script/togb.pl

    r630 r1279  
    1 #!/usr/local/bin/perl5 -w
     1#!/usr/bin/perl -w
    22
    33###########################################################################
     
    3636if (!parsargv::parse(\@ARGV,
    3737             'unicode', \$unicode,
    38              'extended', \$extended,
     38             'iso_8859_1', \$iso_8859_1,
    3939             'gb', \$gb)) {
    4040    print STDERR "\n  usage: $0 [options]\n\n";
    4141    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";
     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";
    4545    die "\n";
    4646}
    4747
    4848$encoding = "utf8" if $unicode;
    49 $encoding = "extended" if $extended;
     49$encoding = "iso_8859_1" if $iso_8859_1;
    5050$encoding = "gb" if $gb;
    5151
  • branches/New_Config_Format-branch/gsdl/bin/script/touc.pl

    r630 r1279  
    1 #!/usr/local/bin/perl5 -w
     1#!/usr/bin/perl -w
    22
    33###########################################################################
     
    3636if (!parsargv::parse(\@ARGV,
    3737             'unicode', \$unicode,
    38              'extended', \$extended,
     38             'iso_8859_1', \$iso_8859_1,
     39             'iso_8859_6', \$iso_8859_6,
     40             'windows_1256', \$windows_1256,
    3941             'gb', \$gb)) {
    4042    print STDERR "\n  usage: $0 [options]\n\n";
    4143    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";
    4549    die "\n";
    4650}
    4751
    4852$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;
    5056$encoding = "gb" if $gb;
    5157
  • branches/New_Config_Format-branch/gsdl/bin/script/toutf8.pl

    r630 r1279  
    1 #!/usr/local/bin/perl5 -w
     1#!/usr/bin/perl -w
    22
    33###########################################################################
     
    3636if (!parsargv::parse(\@ARGV,
    3737             'unicode', \$unicode,
    38              'extended', \$extended,
     38             'iso_8859_1', \$iso_8859_1,
     39             'iso_8859_6', \$iso_8859_6,
     40             'windows_1256', \$windows_1256,
    3941             'gb', \$gb)) {
    4042    print STDERR "\n  usage: $0 [options]\n\n";
    4143    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";
    4549    die "\n";
    4650}
    4751
    4852$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;
    5056$encoding = "gb" if $gb;
    5157
  • branches/New_Config_Format-branch/gsdl/bin/script/translate.pl

    r1062 r1279  
    5454        'Ouml' => chr (214),
    5555        '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));
    5769
    5870my $hand_made = 0;
     
    137149    # process all the images
    138150
    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;
    141152
    142153    # add language parameter to each macro
     
    150161
    151162    my $origtext = $text;
     163    $text =~ s/&(\d{3,4});/chr($1)/ge;
    152164    $text =~ s/&([^;]*);/$rmap{$1}/g;
    153165
     
    204216    } elsif ($image_type eq "green_title") {
    205217
    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
    207223    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";
    209225    $options .= " -fontsize 26 -fontweight bold";
    210226    `$ENV{'GSDLHOME'}/bin/script/gimp/title_icon.pl $options`;
    211227
    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);
    217232
    218233    } elsif ($image_type eq "hand_made") {
     
    226241    }
    227242
    228     return "\n\#\# \"$text\" \#\# $image_type \#\# $image_name \#\#$image_macros";
     243    return "\n\#\# \"$origtext\" \#\# $image_type \#\# $image_name \#\#$image_macros";
    229244}
    230245
     
    233248
    234249    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;
    236251}
    237252
  • branches/New_Config_Format-branch/gsdl/cgi-bin/gsdlsite.cfg

    r1038 r1279  
    33
    44# points to the GSDLHOME directory
    5 gsdlhome    /home/gsdl
     5gsdlhome    **GSDLHOME**
    66
    77# 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
    911
    1012# this is the http address of the directory which
    1113# 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
     16httpimg     /images
    1317
    1418# 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 -w
     1#!perl -w
    22
    33###########################################################################
     
    3232#   an already running cgi program.
    3333
    34 use Fcntl ':flock';
     34package webpage_buildcol;
     35
    3536use File::Basename;
     37use GSDLHOME;
     38use gflock;
    3639
    3740my $args;
     
    4649        my ($variable,$assignment) = ($1,$3);
    4750        $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    }
    7352    }
    7453}
     
    8463    if (open(TMPOUT,">$full_tmpname"))
    8564    {
    86     if (flock(TMPOUT,LOCK_EX))
    87     {
     65    if (&gflock::lock (webpage_buildcol::TMPOUT)) {
    8866        print TMPOUT $text;
    8967        close(TMPOUT);
    90         flock(TMPOUT,LOCK_UN);
    91     }
    92     else
    93     {
     68        &gflock::unlock (webpage_buildcol::TMPOUT);
     69
     70    } else {
    9471        # Problem locking file
    9572        my $mess = "Unable to lock temporary communication file:";
     
    11895    my $full_importname = &util::filename_cat($full_dirname,"import");
    11996
    120     my $log_filename = &util::filename_cat($ENV{'GSDLHOME'},"log","$dirname.bld");
     97    my $log_filename = &util::filename_cat($ENV{'GSDLHOME'},"etc","$dirname.bld");
    12198    if (!open (LOGOUT, ">$log_filename"))
    12299    {
     
    140117    if ($copy_dir =~ m/^yes$/i)
    141118    {
    142         my $download_cmd = "";
     119        my $download_cmd = "perl " . &util::filename_cat ($ENV{'GSDLHOME'}, "bin", "script");
    143120        my $file_or_url  = $building_cfg_text->{'building'}->{'fileorurl'};
    144121       
     
    146123        {
    147124        # run urlcopy.pl to download files
    148         $download_cmd = "urlcopy.pl ";
     125        $download_cmd = " urlcopy.pl ";
    149126        my @urls = split("\n",$input_dir);
    150127        my $u;
     
    161138        $input_dir =~ s/^\s+//;
    162139        $input_dir =~ s/\s+$//;
    163         $download_cmd = "filecopy.pl $input_dir";
     140        $download_cmd = " filecopy.pl $input_dir";
    164141        }
    165142       
     
    194171    }
    195172
    196     if ($copy_dir =~ /^no$/i)
     173    if ((defined $copy_dir) && ($copy_dir =~ /^no$/i))
    197174    {
    198175    # link it
     
    221198    {
    222199    # 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";
    224203   
    225204    if(!open(IMPORTOUT,"$import_cmd 2>&1 |"))
     
    254233
    255234    # Build operation
    256     my $build_cmd = "";
     235    my $build_cmd = "perl " .
     236        &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script", "buildcol.pl");
    257237    if (($do_import eq "true")
    258238        || (($do_import eq "false") && (-e $full_archivename)))
    259239    {
    260         $build_cmd = "buildcol.pl $dirname";
     240        $build_cmd .= " $dirname";
    261241    }
    262242    else
    263243    {
    264 
    265         $build_cmd = "buildcol.pl";
    266244        $build_cmd .= " -archivedir $full_importname";
    267245        $build_cmd .= " -cachedir $full_archivename";
     
    354332    = &util::filename_cat($full_dirname,"etc","collect.cfg");
    355333
    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
    378341}
    379342
    380343&main();
    381 
    382 
    383 
    384 
    385 
  • branches/New_Config_Format-branch/gsdl/cgi-bin/webpage_buildstatus.pl

    r724 r1279  
    1 #!/usr/local/bin/perl5 -w
     1#!perl -w
    22
    33###########################################################################
     
    3131use CGI;
    3232use GSDLHOME;
    33 use Fcntl ':flock';
    3433
    3534require util;
     
    6665    }
    6766
    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);
    7074
    7175    if (open(TMPIN,"<$full_tmpname"))
     
    8185    $bc1finished = 1 if ($mess eq "Done");
    8286    $bc1finished = -1 if ($mess =~ m/^Error:/);
     87    # escape backslashes so they don't vanish from printed filenames
     88    $mess =~ s/\\/\\\\/g;
    8389    &webpageutil::status_location($args,$mess,$tmpname,$bc1finished);
    8490
     
    96102
    97103&main();
    98 
    99 
    100 
    101 
    102 
  • branches/New_Config_Format-branch/gsdl/cgi-bin/webpage_delcol.pl

    r841 r1279  
    1 #!/usr/local/bin/perl5 -w
     1#!perl -w
    22
    33###########################################################################
     
    3030use CGI;
    3131use GSDLHOME;
    32 use Fcntl ':flock';
    3332
    3433require util;
     
    7372    &util::rm_r($col_dir);
    7473
    75     # delete from collections.txt
    76     my $collist_filename
    77         = &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         else
    99         {
    100         # problem locking file
    101         my $mess = "Unable to lock collection list configuration";
    102         $mess .= " file: $collist_filename";
    103         &webpageutil::error_location($args,$mess);
    104         return;
    105         }
    106     }
    107     else
    108     {
    109         # problem opening file for reading in
    110 
    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     }
    11674    }
    11775    elsif ($delete_area eq "import")
     
    14098    my $mess_url = "$args->{'httpbuild'}&bca=mess";
    14199    $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";
    143101    return;
    144102
  • branches/New_Config_Format-branch/gsdl/cgi-bin/webpage_editcol.pl

    r724 r1279  
    1 #!/usr/local/bin/perl5 -w
     1#!perl -w
    22
    33###########################################################################
     
    2828# This program is a webpage wrapper for saving an edited config file
    2929
     30package webpage_editcol;
     31
    3032use CGI;
    3133use GSDLHOME;
    32 use Fcntl ':flock';
     34use gflock;
    3335
    3436require util;
     
    7072    if (open(CFGOUT,">$cfg_filename"))
    7173    {
    72     if (flock(CFGOUT,LOCK_EX))
    73     {
     74    if (&gflock::lock (webpage_editcol::CFGOUT)) {
    7475        my $cfg_text = $args->{'bc1cfgfile'};
    7576        print CFGOUT "$cfg_text";
    76         flock(CFGOUT,LOCK_UN);
     77        &gflock::unlock (webpage_editcol::CFGOUT);
    7778        close(CFGOUT);
    7879    }
  • branches/New_Config_Format-branch/gsdl/cgi-bin/webpage_mkcol.pl

    r724 r1279  
    1 #!/usr/local/bin/perl5 -w
     1#!perl -w
    22
    33###########################################################################
     
    2828# This program is a webpage wrapper to the mkcol.pl process
    2929
     30package webpage_mkcol;
     31
    3032use CGI;
    3133use GSDLHOME;
    32 use Fcntl ':flock';
     34use gflock;
    3335
    3436require util;
     
    4143    my %args = ();
    4244   
     45    open (FILE, '>d:\gsdl\logout.txt') || die;
     46
    4347    foreach $p ($cgi->param())
    4448    {
    4549    $args{$p} = $cgi->param($p);
    46     }
    47 
     50
     51    print FILE "webpage_mkcol.pl - $p -> $args{$p}\n";
     52    }
     53
     54    close FILE;
    4855    return \%args;
    4956}
     
    8592    else
    8693    {
    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
    8896    $fullname =~ s/\s+/ /g;
    8997    $fullname =~ tr/[A-Z]/[a-z]/;
     
    149157    my $acronyms      = $args->{'bc1acronyms'};
    150158
    151     my $cmd = "mkcol.pl";
     159    my $cmd = "perl ";
     160    $cmd .= &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script", "mkcol.pl");
    152161    $cmd .= " -title   \"$fullname\"";
    153162    $cmd .= " -creator $contact_email";
    154163    $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\"";
    156168### $cmd .= " -refine  \"$refine_plugs\"";
    157169    $cmd .= " $unique_dirname";
     170
    158171    my $status = system($cmd);
    159172    $status /= 256;
     
    162175    {
    163176        # append copydir, file_or_url and input_dir to end of collect.cfg
     177        # we'll also append DocumentUseHTML if processing HTML docs
    164178        my $cfg_filename
    165179        = &util::filename_cat($ENV{'GSDLHOME'},"collect",$unique_dirname,
     
    167181        if (open(CFGAPP,">>$cfg_filename"))
    168182        {
    169         if (flock(CFGAPP,LOCK_EX))
    170         {
     183        if (&gflock::lock (webpage_mkcol::CFGAPP)) {
    171184            print CFGAPP "\n";
     185
     186            if ($src_format eq "HTML") {
     187            print CFGAPP "format\tDocumentUseHTML\ttrue\n\n";
     188            }
     189
    172190            print CFGAPP "building\tfileorurl\t$file_or_url\n";
    173191            print CFGAPP "building\tinputdir\t$input_dir\n";
    174192            print CFGAPP "building\tcopydir\t\t$copy_dir\n";
    175193            print CFGAPP "building\tingsdlarea\t$in_gsdl_area\n";
    176             flock(CFGAPP,LOCK_UN);
     194            &gflock::unlock (webpage_mkcol::CFGAPP);
    177195            close(CFGAPP);
    178196        }
     
    195213        return;
    196214        }
    197 
    198 
    199         # append dirname to end of collection config file
    200         my $collist_filename
    201         = &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         else
    211         {
    212             # problem locking file
    213             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         else
    221         {
    222         # problem
    223         my $mess = "Unable to append to collection list";
    224         $mess .= " configuration file: $collist_filename";
    225         &webpageutil::error_location($args,$mess);
    226         return;
    227         }
    228        
    229215    }
    230216    else
     
    248234
    249235&main();
    250 
    251 
    252 
    253 
    254 
  • branches/New_Config_Format-branch/gsdl/collect/modelcol/etc/collect.cfg

    r815 r1279  
    66indexes        document:text
    77defaultindex   document:text
    8 plugin         GMLPlug
    9 plugin         TEXTPlug
    10 plugin         ArcPlug
    11 plugin         RecPlug
     8
     9**plugins**
    1210
    1311classify       AZList metadata=Title
    1412
    15 collectionmeta collectionname    "**collection**"
     13collectionmeta collectionname    "**title**"
     14collectionmeta iconcollection    ""
     15collectionmeta collectionextra   "**about**"
    1616collectionmeta .document:text    "documents"
  • branches/New_Config_Format-branch/gsdl/docs/TODO

    r1036 r1279  
    11
    22configuration/installation:
    3 
    4     - iconcollection fields in collect.cfg are dependant on httpprefix
    5 
    6     - set up setup.bash/setup.bat etc during configuration (so GSDLHOME
    7       is full path and script can be run from anywhere)
    83   
    9     - autoconfigure/InstallShield to ask where cgi-bin directory is?
    10 
    114unix:
    125
    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
    1810
    1911    - add fastcgi to distribution
     
    2113windows:
    2214
    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
    2817
    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'?)
    3020
    31     - version string in fnord.cpp should be changed when a new version
    32           is released - maybe the support.htm file too
     21    - fix up Local Library - somehow need to have option of old server
     22          and single-user (or Gold and Silver?) within same executable.
    3323
    34 write perl script for updating distribution
    3524
    3625tidy up text versions of macro files
    3726
    38 Write a perl script to go through a translated macro file and generate
    39 appropriate icons
    40 
    41 add german interface
     27look further into creating images containing non-latin1 characters
    4228
    4329create default collection images at build time with gimp script
    44 
    45 convert crappy old scheme gimp scripts to perl
    4630
    4731fix query caching - do caching in receptionist, finish off cross collection
     
    5337add to
    5438
    55 get remaining plugins tidied up and using passed in options - file
    56 extension option for all plugins
    57 
    58 get all plugins to use multiread object and throw away the specialized GB
    59 plugins
    60 
    6139write a gzip/bzip/zip/tar plugin and take any remaining gzip stuff out of
    6240rest of plugins
    6341
    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
     42look at speeding up acronym extraction code, add more options
    6743
    6844create a general classifier for doing stuff like NPepaList.pm does. should
     
    7046etc.
    7147
    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
     48for gsdl-3.0
    7549
    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)
    7953
    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
    8158
    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
    8362
    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
    8766
    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&uuml;chern"
    8971
    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
    9374
    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.
    9683
    97 get numwords (and maybe other stats?) working in collection info - maybe
    98 set as macros
    9984
    10085tidy 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
     87place. maybe load collection info into recpt.collectinfo structure. load in
     88as required for each collection so structure would slowly fill up with all
     89collections when using fastcgi
    10490
    10591add Language metadata to all documents by default??
    10692
    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
     93usage page - Matthias Dalmeier
    11094
    111 bug when classification is empty. CL number still gets incremented so
    112 formatstrings don't match as expected
     95create a usage page from ftp logs (build on ftp_stats.pl script)
    11396
    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
     97tidy up ohist to remove need for public_html/ohist stuff
    13198
    13299WebPlug - optimize to run reasonably quickly? - Currently works (I think)
     
    135102build a small collection
    136103
    137 look into possibility of clearing highlighting whenever you go to browse
    138 etc.  i.e. highlighting only works when coming directly from a search
    139 
    140 replace mk_all_dir function with perl module - see if speed improvements
    141 are worthwhile
    142 
    143104update collections - set up auto-updating where needed
    144105        - csbib
     
    146107    - tcc - mail updating
    147108    - 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
    151110
    152111sort documents between importing and building
    153112
    154 fix plugins option to mkcol.pl
     113get polling for new collections to work when using fastcgi
    155114
    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)
     115ipc and unesco collections have no 'about' text (maybe others too).
    159116
    160 what to do with Makefiles for collection specific receptionists (like
    161 cstr), use configure?
     117compiler warnings
    162118
    163 check out mgs declaration of error()
     119windows cd-rom version
    164120
    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).
    167124
    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?
    169132
    170 fix up publications page - maybe just use an index.html type thing on rose
     133look into need for _LITTLE_ENDIAN flag in mg
    171134
    172 look into server security
     135make all external nzdl.org pages plain html rather than macro pages. remove
     136all related images from distribution
    173137
    174 fix up compiler warnings (on titoki and rose)
     138ohists RealAudio server appears to be broken
    175139
    176 ipc collection has no 'about' text
     140capability to view actual BibTeX entries of csbib (and maybe other?)
     141collections
    177142
    178 sort out bbc collections - find real import stuff - delete multiple copies
    179 that are laying around
     143scripts for installing w3mir - a .bat version of davids install.sh files
    180144
    181 tidy up cstr - image on left above all 5 buttons - title on right above
    182 goto line
     145implement proper unicode sorting within classifiers
    183146
    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
     147get file locking to work on non GSDL_USE_IOS_H compilers (VC++ 6.0)
    186148
     149produce an error message when no "built" collections are available
     150(currently only produce an error when no collections at all are available)
     151
     152have another go at getting gsdl_system() function to work properly on
     153windows 95 (for end-user collection building)
     154
  • branches/New_Config_Format-branch/gsdl/etc/VERSION

    r1040 r1279  
    1 gsdl version: 2.13
    2 cvs tag: gsdl-213
    3 build version: 2.0
     1gsdl version: x.xx
     2cvs tag: gsdl-x_xx-distribution
     3build version: 2.1
  • branches/New_Config_Format-branch/gsdl/etc/main.cfg

    r1035 r1279  
    11maintainer      greenstone@cs.waikato.ac.nz
     2
    23macrofiles      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
    811status          enabled
    912usecookies      true
     
    1215macroprecedence c,v,l
    1316cgiarg          shortname=v longname=version multiplechar=false argdefault=0 \
    14                 defaultstatus=weak savedarginfo=can
     17                defaultstatus=weak savedarginfo=must
    1518
    1619cgiarg          shortname=a argdefault=p
  • branches/New_Config_Format-branch/gsdl/lib/cfgread.cpp

    r1076 r1279  
    2828/*
    2929   $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
    3037   Revision 1.8  2000/04/06 19:57:57  cs025
    3138   Correcting a correction - reinstated all lib files due to silly
     
    5663
    5764#include "cfgread.h"
    58 
    59 void collectioninfo_t::clear () {
    60   gsdl_gsdlhome.clear();
    61   gsdl_gdbmhome.clear();
    62 }
    6365
    6466int write_ini_line (ofstream &fileout, const text_t &key, const text_t value) {
  • branches/New_Config_Format-branch/gsdl/lib/cfgread.h

    r1076 r1279  
    4141#endif
    4242
    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 
    5343// return 0 on success, -1 on failure
    5444int write_ini_line (ofstream &fileout, const text_t &key, const text_t value);
  • branches/New_Config_Format-branch/gsdl/lib/display.cpp

    r1076 r1279  
    2828/*
    2929   $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
    3042   Revision 1.19  2000/04/06 19:57:58  cs025
    3143   Correcting a correction - reinstated all lib files due to silly
     
    684696// bigendian should be set to 1
    685697// 0 will be returned when the end of the file has been found
    686 unsigned short my_uni_get (istream &fin, int &line,
     698unsigned short my_uni_get (unistream &fin, int &line,
    687699               int &isunicode, int &bigendian) {
    688700  unsigned short c = 0;
     
    692704    // get the next two characters
    693705    unsigned char c1 = 0, c2 = 0;
     706   
    694707    if (!fin.eof()) fin.get(c1);
    695708    if (!fin.eof()) fin.get(c2);
     
    766779 
    767780  // open the file
    768   ifstream fin(filenamestr);
     781  unistream fin (filenamestr);
     782
    769783  if (fin.fail()) return -1; // read failed
    770784
  • branches/New_Config_Format-branch/gsdl/lib/display.h

    r1076 r1279  
    6464#  include <iostream.h>
    6565#  include <fstream.h>
     66
     67#define unistream ifstream
     68
    6669#else
    6770#  include <iostream>
    6871#  include <fstream>
     72
     73typedef std::basic_ifstream<unsigned char> unistream;
     74
    6975#endif
    7076
     
    8288// cyclic macros (a includes b and b includes a)
    8389#define MAXRECURSIONDEPTH 30
    84 
    8590
    8691// class prototypes
  • branches/New_Config_Format-branch/gsdl/lib/fileutil.cpp

    r1076 r1279  
    2828/*
    2929   $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
    3039   Revision 1.14  2000/04/06 19:57:59  cs025
    3140   Correcting a correction - reinstated all lib files due to silly
     
    118127  path2.erase (path2.begin(), here);
    119128 
    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;
    122143}
    123144
     
    139160bool file_exists (const text_t &filename) {
    140161  char *cstr = filename.getcstr();
     162#ifdef GSDL_USE_IOS_H
    141163  ifstream filestream (cstr, ios::in | ios::nocreate);
     164#else
     165  ifstream filestream (cstr, ios::in);
     166#endif
    142167  delete cstr;
    143168
     
    155180bool file_writable (const text_t &filename) {
    156181  char *cstr = filename.getcstr();
     182#ifdef GSDL_USE_IOS_H
    157183  ifstream filestream (cstr, ios::out | ios::nocreate);
     184#else
     185  ifstream filestream (cstr, ios::out);
     186#endif
    158187  delete cstr;
    159188
     
    168197}
    169198
    170 #if defined __WIN32__
     199#if defined(__WIN32__) && !defined(__GNUC__)
    171200
    172201#include <windows.h>
    173202
    174 BOOL read_dir (const text_t &dirname, text_tarray &filelist) {
     203bool read_dir (const text_t &dirname, text_tarray &filelist) {
    175204 
    176205  WIN32_FIND_DATA FileData; 
    177206  HANDLE hSearch;
    178   DWORD dwAttrs;
    179207  char *dirpath = dirname.getcstr();
    180208  strcat (dirpath, "\\*");
    181 
    182   BOOL finished = false;
    183209 
    184210  hSearch = FindFirstFile(dirpath, &FileData);
  • branches/New_Config_Format-branch/gsdl/lib/gsdlconf.h

    r1076 r1279  
    3030#define GSDLCONF_H
    3131
    32 #ifndef __WIN32__
     32#if defined(__WIN32__)
     33#include "../win32cfg.h"
     34#else
    3335#include "../config.h"
    3436#endif
     
    7880#endif
    7981
     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
    8093
    8194// file locking
    8295
    8396#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)
    84103#include <io.h>
    85104#include <sys/locking.h>
     105
     106#if defined(__GNUC__)
     107#define GSDL_GET_FILEDESC(str) str.filedesc()
     108#else
    86109#define GSDL_GET_FILEDESC(str) str.fd()
     110#endif
     111
    87112#define GSDL_UNLOCK_FILE(fd) _locking(fd, LK_UNLCK, 200)
    88113#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
    89125
    90126#else
  • branches/New_Config_Format-branch/gsdl/lib/gsdltools.cpp

    r1076 r1279  
    2828/*
    2929   $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
    3041   Revision 1.3  2000/04/06 19:58:01  cs025
    3142   Correcting a correction - reinstated all lib files due to silly
     
    4960}
    5061
     62text_t dm_safe (const text_t &instring) {
    5163
     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>
     85void 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  
    3838bool littleEndian();
    3939
     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
     44text_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__)
     55void gsdl_system (char *cmd, ostream &logout);
    4056#endif
     57
     58#endif
  • branches/New_Config_Format-branch/gsdl/lib/gsdlunicode.cpp

    r1076 r1279  
    2828/*
    2929   $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
    3041   Revision 1.12  2000/04/06 19:58:02  cs025
    3142   Correcting a correction - reinstated all lib files due to silly
     
    7081#include <stdio.h>
    7182
     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
    7293
    7394
     
    551572  else status = unfinished;
    552573}
     574
     575
     576bool 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
     630unsigned 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
     639void 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
     665void 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  
    215215};
    216216
     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
     223struct ltus_t
     224{
     225  bool operator()(const unsigned short &t1, const unsigned short &t2) const
     226  { return t1 < t2; }
     227};
     228
     229
     230class simplemapconvert {
     231public:
     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
     236protected:
     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
     246class simplemapinconvertclass : public inconvertclass {
     247public:
     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 
     254protected:
     255  simplemapconvert converter;
     256};
     257
     258class simplemapoutconvertclass : public rzwsoutconvertclass {
     259public:
     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 
     267protected:
     268  simplemapconvert converter;
     269};
     270
     271
     272
     273
    217274#endif
  • branches/New_Config_Format-branch/gsdl/lib/text_t.cpp

    r1076 r1279  
    2828/*
    2929   $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
    3036   Revision 1.17  2000/04/06 19:58:03  cs025
    3137   Correcting a correction - reinstated all lib files due to silly
     
    434440    {
    435441      if (!first) outtext.push_back (c);
     442      first = false;
     443      outtext += *here;
     444      here++;
     445    }
     446}
     447
     448void 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
     464void 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;
    436474      first = false;
    437475      outtext += *here;
  • branches/New_Config_Format-branch/gsdl/lib/text_t.h

    r1076 r1279  
    238238void joinchar (const text_tlist &inlist, unsigned short c, text_t &outtext);
    239239void joinchar (const text_tarray &inlist, unsigned short c, text_t &outtext);
     240void joinchar (const text_tset &inlist, text_t c, text_t &outtext);
     241void joinchar (const text_tlist &inlist, text_t c, text_t &outtext);
    240242void joinchar (const text_tarray &inlist, text_t c, text_t &outtext);
    241243
  • branches/New_Config_Format-branch/gsdl/lib/win32.mak

    r1076 r1279  
    2525###########################################################################
    2626
    27 GSDLHOME = d:\home\dl\gsdl
    28 STLPATH = d:\home\dl\stl\stlport
     27GSDLHOME = c:\gsdl
     28STLPATH = c:\stlport
    2929
    3030AR = lib
  • branches/New_Config_Format-branch/gsdl/macros/about.dm

    r876 r1279  
    99# don't want link to 'about' page
    1010_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>}
    1213
    1314#######################################################################
  • branches/New_Config_Format-branch/gsdl/macros/authen.dm

    r876 r1279  
    1111_content_ {
    1212<br><br><br><br>
    13 _messagestatus_
    14 
    1513<form name="login" method="get" action="_gwcgi_">
    1614<input type=hidden name="e" value="_If_(_cgiarger_,_cgiarger_,_decodedcompressedoptions_)">
    1715_hiddenargs_
     16<center><table width=_pagewidth_>
     17<tr><td>
     18_messagestatus_
     19</td></tr>
    1820
    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>
    2331</table>
    2432</form>
  • branches/New_Config_Format-branch/gsdl/macros/base.dm

    r1019 r1279  
    66
    77##########
    8 
    9 # won't need this once old versions of library are no longer used
    10 _decodedcompressedoptions_ {_compressedoptions_}
    11 
    128
    139_htmlextra_ {}
     
    2723_imagethispage_ {}
    2824_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>)}
    3032
    3133#######################################################################
     
    5052_Datewidth_ {_widthtdatex_}
    5153_Subjectwidth_ {_widthtsubjx_}
     54_Towidth_ {_widthttox_}
     55_Fromwidth_ {_widthtfromx_}
    5256_Organizationwidth_ {_widthtorgx_}
    5357_Howtowidth_ {_widththowx_}
     
    7579_jselection_ {}
    7680_nselection_ {}
    77 
     81#granularity selection for mgpp
     82_gselection_ {}
    7883#######################################################################
    7984# navigation bar images
     
    8893
    8994# 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
    9298
    9399_imagesearch_ {<a href="_httpquery_"
     
    137143        border="0" alt="_textimageSubject_"></a>}
    138144_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>
    139161}
    140162
     
    283305}
    284306
     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
    285321_javaHowto_ {
    286322    how\_on = new Image(_widththowx_, _heightthowx_);         
     
    323359#######################################################################
    324360
    325 _mailaddr_ {nzdl@nzdl.org}
     361_mailaddr_ {greenstone@cs.waikato.ac.nz}
    326362
    327363_gsdltop_ {_top}
     
    336372_httpdocimg_ {_httpcollimg_/_thisOID_}
    337373
    338 _httpcollection_{_httpprefix_/collect/_cgiargc_}
     374_httpcollection_ {_httpprefix_/collect/_cgiargc_}
    339375
    340376_httppagex_ {_gwcgi_?e=_compressedoptions_&a=p&p=_1_}
     
    348384
    349385_httpgreenstone_ {_httppagex_(gsdl)}
     386_httpdownload_ {http://www.nzdl.org/download}
     387_httppublications_ {_httpdownload_/greenstone/publications}
    350388
    351389_httpcurrentdocument_ {_gwcgi_?e=_compressedoptions_&cl=_cgiargcl_&d=_cgiargd_}
     
    512550
    513551_icontabSubjectgreen_ {<img
    514 src="_httpicontsubjgr_" height=_heighttsubjx_ width=widthtsubjx_ border=0>}
     552src="_httpicontsubjgr_" height=_heighttsubjx_ width=_widthtsubjx_ border=0>}
    515553_icontabSubjectgreen_[v=1] {_texticontabsubjectgreen_}
     554
     555_icontabTogreen_ {<img
     556src="_httpiconttogr_" height=_heightttox_ width=_widthttox_ border=0>}
     557_icontabTogreen_[v=1] {_texticontabtogreen_}
     558
     559_icontabFromgreen_ {<img
     560src="_httpicontfromgr_" height=_heighttfromx_ width=_widthtfromx_ border=0>}
     561_icontabFromgreen_[v=1] {_texticontabfromgreen_}
    516562
    517563_icontabHowtogreen_ {<img
     
    528574
    529575_icontabOrganizationgreen_ {<img
    530 src="_httpicontorggr_" height=_heighttorggr_ width=_widthtorggr_ border=0>}
     576src="_httpicontorggr_" height=_heighttorgx_ width=_widthtorgx_ border=0>}
    531577_icontabOrganizationgreen_[v=1] {_texticontaborggreen_}
    532578
  • branches/New_Config_Format-branch/gsdl/macros/build.dm

    r725 r1279  
    1010<table width=100%>
    1111  <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>
    1313    <td>_iconblankbar_
    1414        <center><h2>_1_</h2></center>
     
    4444}
    4545
     46_httpiconstop_ {_httpimg_/stop.gif}
    4647
    4748_iconwizardnext_{<img src="_httpiconmore_" align=absbottom
     
    7374_bcargfileorurl_    {file}
    7475_bcarginputdir_     {}
    75 _bcargcopydir_      {}
     76_bcargcopydir_      {yes}
    7677_bcargingsdlarea_   {no}
    7778_bcargacronyms_     {off}
     
    287288       This process is structured as a series of Web pages, overseen by the
    288289    new-collection &quot;wizard.&quot  The wizard bar at the bottom of the page
    289     shows you the sequences of pages to be completed.  You can return to
    290     a previously page 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.
    291292  </td>
    292293</tr>
     
    454455          \}
    455456      \}
    456 
    457457        simulate_get_action("_httpbuild_&bca=newcol");
    458458   \}
     
    654654    Note, once a collection has been built it
    655655    is not necessary for the source data to remain in the Greenstone
    656     collection area -- the collection can be safely access, browsed
     656    collection area -- the collection can be safely accessed, browsed
    657657    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.
    660659     </font>
    661660  </td>
     
    697696
    698697    var cgi_prefix = "webpage_mkcol.pl";
    699     cgi_prefix += "?gsdlhome=" + escape("_gsdlhome_");
    700     cgi_prefix += "&httpbuild=" + escape("_httpbuild_");
     698    cgi_prefix += "?httpbuild=" + escape("_httpbuild_");
    701699    cgi_prefix += "&bc1refine=" + escape(bc1refine);
    702700
     
    861859    \{
    862860        var cgi_prefix = "webpage_editcol.pl";
    863         cgi_prefix += "?gsdlhome=" + escape("_gsdlhome_");
    864         cgi_prefix += "&httpbuild=" + escape("_httpbuild_");
     861        cgi_prefix += "?httpbuild=" + escape("_httpbuild_");
    865862        cgi_prefix += "&bc1cfgfile=" + escape(form.bc1cfgfile.value);
    866863
     
    906903
    907904<tr>
    908   <td>Colletion to edit:</td>
     905  <td>Collection to edit:</td>
    909906  <td colspan=3>
    910907     _fullnamemenu_
     
    10271024
    10281025    var cgi_prefix = "_httpbuild_&bca=buildcol";
    1029     cgi_prefix += "&gsdlhome=" + escape("_gsdlhome_");
    10301026    cgi_prefix += "&httpbuild=" + escape("_httpbuild_");
    10311027    cgi_prefix += "&wizard=buildframe";
     
    10431039
    10441040    var cgi_prefix = "_httpbuild_&bca=buildcol";
    1045     cgi_prefix += "&gsdlhome=" + escape("_gsdlhome_");
    10461041    cgi_prefix += "&httpbuild=" + escape("_httpbuild_");
    10471042    cgi_prefix += "&wizard=buildcol";
     
    11641159
    11651160
     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
    11661176_contentbuildframe_ {
    11671177
    1168 <frameset rows="*,150,*" border=0>
     1178<frameset rows="200,150" border=0>
    11691179  <noframes><body bgcolor="#ffffff">
    11701180  <p>You must have a frame enabled browser to view this.</p>
     
    11731183  <frame src="_httpbuild_&bca=buildcol&wizard=buildexec&bc1dirname=_bcargdirname_&bc1tmpname=_bcargtmpname_" name=infoframe>
    11741184  <frame src="_httpbuild_&bca=buildstatus&bc1tmpname=_bcargtmpname_" name=execframe>
    1175   <frame src="_httpbuild_&bca=blankpage" name=blankframe>
    11761185</frameset>
    11771186}
     
    11891198
    11901199   <!-- Hide code from non-js browsers
    1191    var timer = 5;
     1200   var timer = 10;
    11921201   function restart_count_down() \{
    1193     timer=5;
     1202    timer=10;
    11941203    setTimeout("count_down()",1000);
    11951204   \}
     
    12101219   function update_status_page() \{
    12111220    var cgi_cmd = "webpage_buildstatus.pl";
    1212     cgi_cmd += "?gsdlhome=" + escape("_gsdlhome_");
    1213     cgi_cmd += "&httpbuild=" + escape("_httpbuild_");
     1221    cgi_cmd += "?httpbuild=" + escape("_httpbuild_");
    12141222    cgi_cmd += "&bc1dirname=" + escape("_bcargdirname_");
    12151223    cgi_cmd += "&bc1tmpname=" + escape("_bcargtmpname_");
     
    12351243           \}
    12361244
    1237          cgi_cmd += "&gsdlhome=" + escape("_gsdlhome_");
    12381245         cgi_cmd += "&httpbuild=" + escape("_httpbuild_");
    12391246         cgi_cmd += "&bc1dirname=" + escape("_bcargdirname_");
     
    13581365      \{
    13591366        var cgi_prefix = "webpage_delcol.pl";
    1360         cgi_prefix += "?gsdlhome=" + escape("_gsdlhome_");
    1361         cgi_prefix += "&httpbuild=" + escape("_httpbuild_");
     1367        cgi_prefix += "?httpbuild=" + escape("_httpbuild_");
    13621368
    13631369            simulate_get_action(cgi_prefix);
     
    13941400
    13951401<tr>
    1396   <td>Colletion to delete:</td>
     1402  <td>Collection to delete:</td>
    13971403  <td colspan=3>
    13981404     _fullnamemenu_
  • branches/New_Config_Format-branch/gsdl/macros/document.dm

    r944 r1279  
    155155_iconSubjectpage_ [v=1] {<h2>_texticonhsubj_</h2>}
    156156
     157_iconTopage_ {<img src="_httpiconhto_" width=_widthhto_
     158height=_heighthto_}
     159_iconTopage_ [v=1] {<h2>_texticonhto_</h2>}
     160
     161_iconFrompage_ {<img src="_httpiconhfrom_" width=_widthhfrom_
     162height=_heighthfrom_}
     163_iconFrompage_ [v=1] {<h2>_texticonhfrom_</h2>}
     164
    157165_iconSeriespage_ {<img src="_httpiconhser_" width=_widthhser_
    158166height=_heighthser_}
     
    229237_tab_ {<td>_icontab_</td>}
    230238
    231 _iconcontracttoc_ {<img name="concon" src="_httpiconeconcof_" width=_widtheconcx_ height=_heighteconcof_ alt="_texticoncontracttoc_" border=0>}
     239_iconcontracttoc_ {<img name="concon" src="_httpiconeconcof_" width=_widtheconcx_ height=_heighteconcx_ alt="_texticoncontracttoc_" border=0>}
    232240_iconcontracttoc_[v=1] {_texticoncontracttoc_}
    233241
    234 _iconexpandtoc_ {<img name="expcon" src="_httpiconeexpcof_" width=_widtheexpx_ height=_heighteexpcx_ alt="_texticonexpandtoc_" border=0>}
     242_iconexpandtoc_ {<img name="expcon" src="_httpiconeexpcof_" width=_widtheexpcx_ height=_heighteexpcx_ alt="_texticonexpandtoc_" border=0>}
    235243_iconexpandtoc_[v=1] {_texticonexpandtoc_}
    236244
  • branches/New_Config_Format-branch/gsdl/macros/english.dm

    r1032 r1279  
    7272_textimageDate_ {Browse by date}
    7373_textimageSubject_ {Browse by subject category}
     74_textimageTo_ {Browse by To field}
     75_textimageFrom_ {Browse by From field}
    7476_textimageOrganization_ {Browse by organization}
    7577_textimageHowto_ {Browse how to categories}
     
    8587_texticontablistgreen_ {Listing}
    8688_texticontabsubjectgreen_{Subjects}
     89_texticontabtogreen_{To}
     90_texticontabfromgreen_{From}
    8791_texticontaborggreen_{Organization}
    8892_texticontabhowgreen_{How to}
     
    116120_textmonth12_ {December}
    117121
     122_Document_ {Document}
     123_Section_ {Section}
     124_Paragraph_ {Paragraph}
     125
    118126_magazines_ {Magazines}
    119127
     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>,
     132New Zealand}
    120133
    121134#------------------------------------------------------------
     
    174187_heighttsubjx_ {17}
    175188
     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
    176203## "organization" ## nav_bar_button ## torg ##
    177204_httpicontorggr_{_httpimg_/torggr.gif}
     
    269296_textCreatorpage_ {_texticonhauth_}
    270297_textSubjectpage_ {_texticonhsubj_}
     298_textTopage_ {_texticonhto_}
     299_textFrompage_ {_texticonhfrom_}
    271300_textSeriespage_ {_texticonhser_}
    272301_textDatepage_ {_texticonhdate_}
     
    279308_texticonhauth_ {Authors A-Z}
    280309_texticonhsubj_ {Subjects}
     310_texticonhto_ {To}
     311_texticonhfrom_ {From}
    281312_texticonhser_ {Series}
    282313_texticonhdate_ {Dates}
     
    330361_httpiconhauth_ {_httpimg_/h\_auth.gif}
    331362_widthhauth_ {200}
     363_heighthauth_ {57}
    332364
    333365## "subjects" ## green_title ## h_subj ##
     
    335367_widthhsubj_ {200}
    336368_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}
    337379
    338380## "series" ## green_title ## h_ser ##
     
    458500_textselect_ {_If_(_cgiargb_,_textadvancedsearch_,_textsimplesearch_)}
    459501
    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)
    461503which contain _querytypeselection_ of the words}
    462504
    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)
    464506using _querytypeselection_ query}
    465507
     
    500542## "display" ## hand_made ##
    501543_httpicondisplay_ {_httpimg_/display.gif}
    502 _widthdisplay {60}
     544_widthdisplay_ {60}
    503545_heightdisplay_ {20}
    504546
     
    538580_textlangeng_ {English}
    539581_textlanggerman_ {German}
     582_textlangfrench_ {French}
     583_textlangspanish_ {Spanish}
    540584_textlangmaori_ {M_amn_ori}
    541585_textlangchinese_ {Chinese}
     586_textlangarabic_ {Arabic}
    542587_textgraphical_ {Graphical}
    543588_texttextual_ {Textual}
     
    605650_textDateshort_ {access publications by date}
    606651_textSubjectshort_ {access publications by subject}
     652_textToshort_ {access publications by To field}
     653_textFromshort_ {access publications by From field}
    607654_textTitleshort_ {access publications by title}
    608655_textBrowseshort_ {browse publications}
     
    642689pressing the <i>subjects</i> button.  This brings up a list of subjects,
    643690represented by bookshelves.  }
     691
     692_textTolong_ { <p>You can <i>access publications by To field</i> by
     693pressing 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
     696pressing the <i>from</i> button.  This brings up a list of senders.  }
    644697
    645698_textSerieslong_ { <p>You can <i>access publications by series</i> by
  • branches/New_Config_Format-branch/gsdl/macros/english2.dm

    r1034 r1279  
    2323_colnotbuilt_ {Collection not built.}
    2424
    25 _textpeople_ {People}
     25_textpagetitle_ {Greenstone Digital Library}
    2626_textfb_ {Feedback}
    27 _textpub_ {Publications}
    28 _texttec_ {Technology}
    29 _textrw_ {Related Work}
    3027_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}
    3528
     29_textprojhead_ {The Greenstone software and <br>The New Zealand Digital Library Project}
    3630_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>
     32The Greenstone Digital Library software provides a new way of
     33organizing information and making it available over the Internet or on
     34CD-ROM. It is open-source software, available under the terms of the
     35GNU General Public License.
     36<p>
     37A digital library is made up of a set of collections. Each collection of
     38information comprises several (typically several thousand, or even
     39several million) documents, which share a uniform searching and
     40browsing interface. Collections can be organized in many different
     41ways while retaining a strong family resemblance.
     42<p>
     43The
     44<a href="http://www.nzdl.org">New Zealand Digital Library Project</a>
     45is a research programme at The University of Waikato whose aim is to
     46develop the underlying technology for digital libraries and make it
     47available publicly so that others can use it to create their own
     48collections.
     49Greenstone was created to further this objective.
     50Further details are available from 
     51<a href="http://www.nzdl.org">http://www.nzdl.org</a>
    8752}
    8853
    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>
    9356
    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
    10060
    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.
    12064}
    12165
    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
    12768public-domain digital library project.  Its lustre shows charity; its
    12869translucence, honesty; its toughness, courage; and the sharp edge it can
     
    13475symbolizing the leading edge of technology.
    13576
    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 Zealand
    139 
    140 <br>October 1999
    14177}
    14278
     
    15591_widthselcolgr_ {537}
    15692_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"}
    49194
    49295
  • branches/New_Config_Format-branch/gsdl/macros/german.dm

    r1071 r1279  
    380380
    381381## "EXPANDIEREN
    382   DES TEXTS" ## document_button ## eallt ##
     382#  DES TEXTS" ## document_button ## eallt ##
    383383_httpiconealltof_ [l=de] {_httpimg_/de/ealltof.gif}
    384384_httpiconeallton_ [l=de] {_httpimg_/de/eallton.gif}
     
    387387
    388388## "KONTRAKTIONDES
    389         INHALTS" ## document_button ## econc ##
     389#        INHALTS" ## document_button ## econc ##
    390390_httpiconeconcof_ [l=de] {_httpimg_/de/econcof.gif}
    391391_httpiconeconcon_ [l=de] {_httpimg_/de/econcon.gif}
     
    394394
    395395## "SEPARATES
    396   FENSTER" ## document_button ## edtch ##
     396#  FENSTER" ## document_button ## edtch ##
    397397_httpiconedtchof_ [l=de] {_httpimg_/de/edtchof.gif}
    398398_httpiconedtchon_ [l=de] {_httpimg_/de/edtchon.gif}
     
    401401
    402402## "EXPANDIEREN
    403 DES INHALTS" ## document_button ## eexpc ##
     403#DES INHALTS" ## document_button ## eexpc ##
    404404_httpiconeexpcof_ [l=de] {_httpimg_/de/eexpcof.gif}
    405405_httpiconeexpcon_ [l=de] {_httpimg_/de/eexpcon.gif}
     
    408408
    409409## "KONTRAKTION
    410    DES TEXTS" ## document_button ## etsec ##
     410#   DES TEXTS" ## document_button ## etsec ##
    411411_httpiconetsecof_ [l=de] {_httpimg_/de/etsecof.gif}
    412412_httpiconetsecon_ [l=de] {_httpimg_/de/etsecon.gif}
     
    421421
    422422## "         KEINE
    423 HERVORHEBUNG" ## document_button ## enhl ##
     423#HERVORHEBUNG" ## document_button ## enhl ##
    424424_httpiconenhlof_ [l=de] {_httpimg_/de/enhlof.gif}
    425425_httpiconenhlon_ [l=de] {_httpimg_/de/enhlon.gif}
     
    508508## "sichtung" ## hand_made ##
    509509_httpicondisplay_ [l=de] {_httpimg_/display.gif}
    510 _widthdisplay {60}
     510_widthdisplay_ [l=de] {60}
    511511_heightdisplay_ [l=de] {20}
    512512
  • branches/New_Config_Format-branch/gsdl/macros/gsdlsoft.dm

    r1049 r1279  
    2525_iconblankbar_
    2626
    27 <h4>The Greenstone software</h4>
     27<h2>The Greenstone software</h2>
    2828
    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>
     30This page explains how to download and install the
     31<a href="_httppagex_(gsdl)">Greenstone Digital Library software</a>.
     32<p>
     33Greenstone is open-source software.
     34It is distributed under the terms of the
     35<a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a>.
     36Documentation 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
     42href="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.
    4246
    4347<h4>Installing Greenstone</h4>
     
    4549<p> To install on unix systems:
    4650
    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>
     54distribution <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>.
     57When the configure script has finished running type <i>make</i>,
     58then <i>make install</i>.
     59<li><i>make install</i> copies the
    5360compiled executable file into the gsdl/cgi-bin directory by default. To run
    5461the 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
     62configuration file to your systems cgi-bin directory.
     63<li>The gsdlsite.cfg
    5664configuration file must be edited to suit your site. The gsdlhome entry
    5765will need to be set to point to your gsdl directory. Other fields that may
    5866need changing are httpprefix (the web path to the gsdl directory) and
    59 httpimg (the path to gsdl/images).  <li>To build the demonstration
     67httpimg (the path to gsdl/images).
     68<li>To build the demonstration
    6069collection that comes with the distribution run the builddemo.sh script
    61 from within the gsdl directory.  <li>For more information on using the
     70from within the gsdl directory.
     71<li>For more information on using the
    6272Greenstone software, download <i><a
    6373href="http://www.nzdl.org/download/greenstone/publications/gsdl_manual.pdf">The Greenstone
     
    105115Please report bugs or installation problems to <a href="mailto:greenstone@cs.waikato.ac.nz">greenstone@cs.waikato.ac.nz</a>
    106116
     117_nzdlpagefooter_
     118<br>April 2000
    107119}
  • branches/New_Config_Format-branch/gsdl/macros/home.dm

    r1049 r1279  
    11package home
    2 
    3 _httpmusiclibrary_ {http://nzdl2.cs.waikato.ac.nz/cgi-bin/gwmm?c=meldex&a=page&p=coltitle}
    42
    53#######################################################################
     
    1412_javalinks_ [v=1] {}
    1513
    16 
    17 
    1814#######################################################################
    1915# icons
    2016#######################################################################
    2117
    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">}
    2419_icongbull_ {<img src="_httpicongbull_">}
    2520_iconpdf_ {<img src="_httpiconpdf_">}
    26 _iconselectcollection_ {<img src="_httpiconselcolgr_" width=_widthselcolgr_ height=_heightselcolgr_>}
     21_iconselectcollection_ {<img src="_httpiconselcolgr_" width=_widthselcolgr_ height=_heightselcolgr_ alt=_altselcolgr_>}
    2722_iconmusiclibrary_ {<img src="_httpicontmusic_" border=1 alt="meldex music library">}
    2823
     
    4540_pagetitle_ {_textpagetitle_}
    4641_imagethispage_ {}
    47 _imagecollection_ {<center>_iconnzdl_</center>}
     42_imagecollection_ { }
    4843
    4944_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_
    5376
    5477<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>,
     82New Zealand
    9383}
    9484
    95 
    96 #######################################################################
    97 # English language text macros
    98 #######################################################################
    99 
    100 # moved to english.dm
    101 
    102 
    103 
    104 
    105 
    106 
    107 
  • branches/New_Config_Format-branch/gsdl/macros/maori.dm

    r1057 r1279  
    374374
    375375######################################################################
    376 # 'prefereces' page
     376# 'preferences' page
    377377package preferences
    378378######################################################################
     
    406406
    407407
    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  
    253253}
    254254
     255_caseoption_ [l=ar] {}
     256
    255257_fcoption_ {
    256258<input type=checkbox name=fc onClick="updatefc();"_If_("_cgiargfc_" eq "1", checked)>
     
    327329_enlanguageoption_ {<option value="en"_If_("_cgiargl_",, selected)_If_("_cgiargl_" eq "en", selected)>_textlangeng_}
    328330_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_}
    329333_milanguageoption_ {<option value="mi"_If_("_cgiargl_" eq "mi", selected)>_textlangmaori_}
    330334_zhlanguageoption_ {<option value="zh"_If_("_cgiargl_" eq "zh", selected)>_textlangchinese_}
     335_arlanguageoption_ {<option value="ar"_If_("_cgiargl_" eq "ar", selected)>_textlangarabic_}
    331336
    332337_encodingoption_ {
     
    336341  <option value="u" _If_("_cgiargw_" eq "u",selected)>UTF-8
    337342  <option value="g" _If_("_cgiargw_" eq "g",selected)>GBK
     343  <option value="a" _If_("_cgiargw_" eq "a",selected)>Arabic (windows 1256)
    338344</select>
    339345}
  • branches/New_Config_Format-branch/gsdl/macros/prescrpt.dm

    r1049 r1279  
    4242_content_ {
    4343_iconblankbar_
    44 <p><i>PreScript</i> offers:
     44<p>
     45<i>PreScript</i> is a utility for extracting text from PostScfript files.
     46PreScript offers:
    4547
    4648<dl>
  • branches/New_Config_Format-branch/gsdl/macros/query.dm

    r964 r1279  
    3131# don't want alt text here
    3232_iconnext_{<img src="_httpiconmore_" width=_widthmore_ height=_heightmore_ border=0 align=top>}
     33_iconnext_ [v=1] {}
    3334_iconprev_{<img src="_httpiconless_" width=_widthless_ height=_heightless_ border=0 align=top>}
     35_iconprev_ [v=1] {}
    3436
    3537#######################################################################
  • branches/New_Config_Format-branch/gsdl/macros/status.dm

    r931 r1279  
    2222<table width=100%>
    2323  <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>
    2525    <td>_iconblankbar_
    2626        <center><h2>_1_</h2></center>
     
    5757_select_ {
    5858<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
    5963
    6064_If_("_cgiarguma_" ne "\_cgiarguma\_",
     
    6872<a href="_gwcgi_?e=_compressedoptions_&a=status&sp=argumentinfo" target=infoframe>_textarguments_</a><br>
    6973<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>
    7075<a href="_gwcgi_?e=_compressedoptions_&a=status&sp=protocolinfo" target=infoframe>_textprotocols_</a>
    7176
     
    8085<a href="_gwcgi_?e=_compressedoptions_&a=status&sp=initlog" target=infoframe>_textinitlog_</a><br>
    8186<a href="_gwcgi_?e=_compressedoptions_&a=status&sp=errorlog" target=infoframe>_texterrorlog_</a>
    82 
    83 <p>
    84 <a href="_httppagehome_" target=_top>_textreturnhome_</a>
    8587}
    8688
    8789
     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>
     121Maintenance 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>
     127These services are accessed using the side navigation bar on the
     128lefthand 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>
     135Collections will only appear as &quot;running&quot; if their build.cfg
     136files exist, are readable, contain a valid builddate field (i.e. > 0),
     137and are in the collection's index directory (i.e. NOT the building
     138directory).
     139<p>
     140click <i>abbrev.</i> for information on a collection
     141<br>
     142click <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  
    8787</font></td></tr>
    8888<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>
    9091</table>
    9192</form>
  • branches/New_Config_Format-branch/gsdl/packages/mg/lib/WIN32.MAK

    r1000 r1279  
    2525###########################################################################
    2626 
    27 GSDLHOME = d:\home\dl\gsdl
     27GSDLHOME = c:\gsdl
    2828
    2929AR = lib
     
    3232
    3333DEFS = -DQUIET -DHAVE_CONFIG_H -D__WIN32__ -D_LITTLE_ENDIAN
    34 INCLUDES = -I$(GSDLHOME)\packages\mg\lib -I$(GSDLHOME)\packages\mg
     34INCLUDES = -I$(GSDLHOME)\packages\mg\lib -I$(GSDLHOME)\packages\mg \
     35           -I$(GSDLHOME)
    3536
    3637COMPILE = $(CC) -c $(DEFS) $(INCLUDES)
  • branches/New_Config_Format-branch/gsdl/packages/mg/src/text/WIN32.MAK

    r1000 r1279  
    2525###########################################################################
    2626
    27 GSDLHOME = d:\home\dl\gsdl
     27GSDLHOME = c:\gsdl
    2828
    2929CC = cl
     
    3232       -D__WIN32__ -D_LITTLE_ENDIAN
    3333INCLUDES = -I$(GSDLHOME)\packages\mg\src\text -I$(GSDLHOME)\packages\mg \
    34        -I$(GSDLHOME)\packages\mg\lib
     34       -I$(GSDLHOME)\packages\mg\lib -I$(GSDLHOME)
    3535LDFLAGS =
    3636
  • 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 YYMINOR 9
    7 #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
    1212 
    1313#include "sysfuncs.h"
     
    4848static u_long invf_ptr;
    4949static u_long invf_len;
    50 #line 65 "bool_parser.y"
     50
     51#line 66 "bool_parser.y"
    5152typedef union {
    5253  char *text;
    5354  bool_tree_node *node;
    5455} 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
     72static 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
     102static const short yyprhs[] = {     0,
     103     0,     2,     4,     8,    10,    12,    14,    17,    21,    24,
     104    26,    30
     105};
     106
     107static 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
     117static 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
     126static const char * const yytname[] = {   "$","error","$undefined.","TERM","'('",
     127"')'","'*'","'_'","'!'","'&'","'|'","query","term","not","and","or", NULL
     128};
     129#endif
     130
     131static const short yyr1[] = {     0,
     132    11,    12,    12,    12,    12,    13,    13,    14,    14,    14,
     133    15,    15
     134};
     135
     136static const short yyr2[] = {     0,
     137     1,     1,     3,     1,     1,     1,     2,     3,     2,     1,
     138     3,     1
     139};
     140
     141static 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
     146static const short yydefgoto[] = {    18,
     147     6,     7,     8,     9
     148};
     149
     150static 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
     155static const short yypgoto[] = {-32768,
     156-32768,    -5,   -12,    18
     157};
     158
     159
     160#define YYLAST      24
     161
     162
     163static 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
     169static 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) \
     272do                              \
     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; }  \
     281while (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
     310int yychar;         /*  the lookahead symbol        */
     311YYSTYPE yylval;         /*  the semantic value of the       */
     312                /*  lookahead symbol            */
     313
     314#ifdef YYLSP_NEEDED
     315YYLTYPE yylloc;         /*  location data for the lookahead */
     316                /*  symbol              */
     317#endif
     318
     319int yynerrs;            /*  number of parse errors so far       */
     320#endif  /* not YYPURE */
     321
     322#if YYDEBUG != 0
     323int 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
    168338#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.  */
     358static 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.  */
     376static 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
     415int yyparse (void *);
    170416#else
    171 #ifdef YYMAXDEPTH
    172 #define YYSTACKSIZE YYMAXDEPTH
     417int yyparse (void);
     418#endif
     419#endif
     420
     421int
     422yyparse(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--)
    173444#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.  */
     490yynewstate:
     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.  */
     689yydefault:
     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.  */
     696yyreduce:
     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
     719case 1:
     720#line 76 "bool_parser.y"
     721{ tree_base = yyvsp[0].node;;
     722    break;}
     723case 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;}
     727case 3:
     728#line 81 "bool_parser.y"
     729{ yyval.node = yyvsp[-1].node; ;
     730    break;}
     731case 4:
     732#line 82 "bool_parser.y"
     733{ yyval.node = CreateBoolTreeNode(N_all, NULL, NULL); ;
     734    break;}
     735case 5:
     736#line 83 "bool_parser.y"
     737{ yyval.node = CreateBoolTreeNode(N_none, NULL, NULL); ;
     738    break;}
     739case 7:
     740#line 87 "bool_parser.y"
     741{ yyval.node = CreateBoolTreeNode(N_not, yyvsp[0].node, NULL); ;
     742    break;}
     743case 8:
     744#line 90 "bool_parser.y"
     745{ yyval.node = CreateBoolTreeNode(N_and, yyvsp[-2].node, yyvsp[0].node); ;
     746    break;}
     747case 9:
     748#line 91 "bool_parser.y"
     749{ yyval.node = CreateBoolTreeNode(N_and, yyvsp[-1].node, yyvsp[0].node); ;
     750    break;}
     751case 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
     811yyerrlab:   /* 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;
     863yyerrlab1:   /* 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
     888yyerrdefault:  /* 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
     897yyerrpop:   /* 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
     917yyerrhandle:
     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}
    189978#line 99 "bool_parser.y"
     979
    190980 
    191981/* Bison on one mips machine defined "const" to be nothing but
     
    3811171bool_tree_node *
    3821172ParseBool(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,
    3851174      stemmed_dict * the_sd, int is_indexed,   /* [RPAP - Jan 97: Stem Index Change] */
    3861175      QueryTermList **the_query_term_list)  /* [RPAP - Feb 97: Term Frequency] */
     
    4071196 
    4081197
    409 #line 407 "y.tab.c"
    410 #define YYABORT goto yyabort
    411 #define YYREJECT goto yyabort
    412 #define YYACCEPT goto yyaccept
    413 #define YYERROR goto yyerrlab
    414 int
    415 yyparse()
    416 {
    417     register int yym, yyn, yystate;
    418 #if YYDEBUG
    419     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 #endif
    429 
    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 YYDEBUG
    444         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 #endif
    453     }
    454     if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
    455             yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
    456     {
    457 #if YYDEBUG
    458         if (yydebug)
    459             printf("%sdebug: state %d, shifting to state %d\n",
    460                     YYPREFIX, yystate, yytable[yyn]);
    461 #endif
    462         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 lint
    480     goto yynewerror;
    481 #endif
    482 yynewerror:
    483     yyerror("syntax error");
    484 #ifdef lint
    485     goto yyerrlab;
    486 #endif
    487 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 YYDEBUG
    499                 if (yydebug)
    500                     printf("%sdebug: state %d, error recovery shifting\
    501  to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
    502 #endif
    503                 if (yyssp >= yyss + yystacksize - 1)
    504                 {
    505                     goto yyoverflow;
    506                 }
    507                 *++yyssp = yystate = yytable[yyn];
    508                 *++yyvsp = yylval;
    509                 goto yyloop;
    510             }
    511             else
    512             {
    513 #if YYDEBUG
    514                 if (yydebug)
    515                     printf("%sdebug: error recovery discarding state %d\n",
    516                             YYPREFIX, *yyssp);
    517 #endif
    518                 if (yyssp <= yyss) goto yyabort;
    519                 --yyssp;
    520                 --yyvsp;
    521             }
    522         }
    523     }
    524     else
    525     {
    526         if (yychar == 0) goto yyabort;
    527 #if YYDEBUG
    528         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 #endif
    537         yychar = (-1);
    538         goto yyloop;
    539     }
    540 yyreduce:
    541 #if YYDEBUG
    542     if (yydebug)
    543         printf("%sdebug: state %d, reducing by rule %d (%s)\n",
    544                 YYPREFIX, yystate, yyn, yyrule[yyn]);
    545 #endif
    546     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 YYDEBUG
    595         if (yydebug)
    596             printf("%sdebug: after reduction, shifting from state 0 to\
    597  state %d\n", YYPREFIX, YYFINAL);
    598 #endif
    599         yystate = YYFINAL;
    600         *++yyssp = YYFINAL;
    601         *++yyvsp = yyval;
    602         if (yychar < 0)
    603         {
    604             if ((yychar = yylex()) < 0) yychar = 0;
    605 #if YYDEBUG
    606             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 #endif
    615         }
    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     else
    623         yystate = yydgoto[yym];
    624 #if YYDEBUG
    625     if (yydebug)
    626         printf("%sdebug: after reduction, shifting from state %d \
    627 to state %d\n", YYPREFIX, *yyssp, yystate);
    628 #endif
    629     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  
    194194
    195195/* On MSDOS, there are missing things from <sys/stat.h>.  */
    196 #ifdef __MSDOS__
     196#if defined(__MSDOS__)
    197197#define S_ISUID 0
    198198#define S_ISGID 0
    199199#define S_ISVTX 0
     200#endif
     201
     202#if defined(__GNUC__) && defined(__WIN32__)
     203#include <limits.h>
    200204#endif
    201205
  • branches/New_Config_Format-branch/gsdl/perllib/classify/AZSectionList.pm

    r741 r1279  
    3030# instead of just top level metadata
    3131
    32 # options are:
    33 # metadata=Metadata
    34 
    3532# the only change is to the classify() subroutine which
    3633# must now iterate through each section, adding each
     
    3936package AZSectionList;
    4037
     38use AZList;
    4139use sorttools;
    4240
    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'} = {};
     41sub BEGIN {
     42    @ISA = ('AZList');
    6743}
    6844
     
    10379}
    10480
    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 structure
    119     my %classifyinfo = ('childtype'=>$childtype,
    120             'Title'=>$title,
    121             'contains'=>[]);
    122     $classifyinfo{'thistype'} = $thistype
    123     if defined $thistype && $thistype =~ /\w/;
    124 
    125     return \%classifyinfo;
    126 }
    127 
    128 # splitlist takes an ordered list of classifications (@$classlistref) and splits it
    129 # up into alphabetical sub-sections.
    130 sub splitlist {
    131     my $self = shift (@_);
    132     my ($classlistref) = @_;
    133     my $classhash = {};
    134 
    135     # top level
    136     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) classifications
    141     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 classifications
    149     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 beginning
    169     # but we want it at the end
    170     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 present
    198     # so in this case there may be many times max documents
    199     # 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 otherwise
    236     # add final sub-classification
    237     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 }
    25281
    253821;
  • branches/New_Config_Format-branch/gsdl/perllib/classify/List.pm

    r677 r1279  
    144144sub get_classify_info {
    145145    my $self = shift (@_);
     146    my ($no_thistype) = @_;
     147    $no_thistype = 0 unless defined $no_thistype;
    146148
    147149    my @list = ();
     
    156158
    157159    # organise into classification structure
    158     my %classifyinfo = ('thistype'=>'Invisible',
    159             'childtype'=>'VList',
     160    my %classifyinfo = ('childtype'=>'VList',
    160161            'Title'=>$self->{'title'},
    161162            'contains'=>[]);
     163    $classifyinfo{'thistype'} = 'Invisible' unless $no_thistype;
     164
    162165    foreach $OID (@list) {
    163166    push (@{$classifyinfo{'contains'}}, {'OID'=>$OID});
  • branches/New_Config_Format-branch/gsdl/perllib/classify/SectionList.pm

    r838 r1279  
    2727# (excluding top level) rather than just top level document
    2828# itself
    29 # options are:
    30 # metadata=Metaname -- (optional) all documents with Metaname metadata
    31 #                      will be included in list. if not included all documents
    32 #                      will be included in list.
    33 # sort=Meta         -- (optional) sort documents in list alphabetically by
    34 #                      Meta. by default it will sort by Metaname, if neither
    35 #                      are set documents will be in build (random) order.
    36 #                      Meta may be Filename to sort by original filename or
    37 #                      nosort to force not to sort
    38 # 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'
    4129
    4230package SectionList;
    4331
     32use List;
    4433use sorttools;
    4534
    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     }
     35sub BEGIN {
     36    @ISA = ('List');
    9337}
    9438
    9539sub classify {
    9640    my $self = shift (@_);
    97     my ($doc_obj,@options) = @_;
     41    my ($doc_obj, @options) = @_;
    9842   
    9943    my $thissection = undef;
     
    175119}
    176120
    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 structure
    191     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 
    2031211;
  • branches/New_Config_Format-branch/gsdl/perllib/doc.pm

    r846 r1279  
    2424###########################################################################
    2525
    26 # class to hold documents
     26# base class to hold documents
    2727
    2828package doc;
    2929
    30 use basedoc;
    31 
    3230BEGIN {
    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
     35use unicode;
     36use util;
     37use ghtml;
     38##use hashdoc;
    3539
    3640# the document type may be indexed_doc, nonindexed_doc, or
     
    3943sub new {
    4044    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;
    4452
    4553#    $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;
    4855#    $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
    5358    return $self;
    5459}
    5560
     61# clone the $self object
     62sub 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
     75sub 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
     97sub 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
     107sub get_source_filename {
     108    my $self = shift (@_);
     109
     110    return $self->get_metadata_element ($self->get_top_section(), "gsdlsourcefilename");
     111}
     112
     113sub 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
     125sub 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
     133sub _escape_text {
     134    my ($text) = @_;
     135
     136    # special characters in the gml encoding
     137    $text =~ s/&/&amp;/g; # this has to be first...
     138    $text =~ s/</&lt;/g;
     139    $text =~ s/>/&gt;/g;
     140    $text =~ s/\"/&quot;/g;
     141
     142    return $text;
     143}
     144
     145
     146sub 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
     183sub 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
     192sub _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
     214sub _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
     240sub 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
     265sub ___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
     282sub 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
     289sub 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
     300sub get_top_section {
     301    my $self = shift (@_);
     302   
     303    return "";
     304}
     305
     306# returns a section
     307sub 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)
     318sub 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
     333sub 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
     362sub 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")
     377sub 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
     386sub 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
     413sub 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
     426sub 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
     475sub 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
     513sub 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
     526sub 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#--
    56578# methods for dealing with metadata
    57579
     
    60582# are for metadata which can have more than one value.
    61583
    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
     585sub 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, ...]
     606sub 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],...]
     627sub 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
     642sub 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
     664sub 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
    65678sub set_metadata_element {
    66679    my $self = shift (@_);
     
    112725# methods for dealing with text
    113726
     727# returns the text for a section
     728sub 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
     743sub 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
     757sub 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
    114771# add_text assumes the text is in (extended) ascii form. For
    115772# text which has been already converted to the UTF-8 format
     
    143800
    144801
     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)
     808sub 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], ...]
     822sub get_assoc_files {
     823    my $self = shift (@_);
     824
     825    return $self->{'associated_files'};
     826}
     827
     828sub 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
     843sub 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
     857sub 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
    1458651;
  • branches/New_Config_Format-branch/gsdl/perllib/gb.pm

    r537 r1279  
    163163
    164164    return 0 unless open (MAPFILE, "$ENV{'GSDLHOME'}/unicode/$filename");
     165    binmode (MAPFILE); # f$#@!!! windows
    165166
    166167    $translations{$encoding} = [@array256];
  • branches/New_Config_Format-branch/gsdl/perllib/ghtml.pm

    r1010 r1279  
    3434sub htmlsafe
    3535{
    36     $_[0] =~ s/&/&amp;/og;
    37     $_[0] =~ s/</&lt;/og;
    38     $_[0] =~ s/>/&gt;/og;
     36    $_[0] =~ s/&/&amp;/osg;
     37    $_[0] =~ s/</&lt;/osg;
     38    $_[0] =~ s/>/&gt;/osg;
     39    $_[0] =~ s/\"/&quot;/osg;
    3940}
    4041
     
    4546sub urlsafe
    4647{
    47     $_[0] =~ s/[\x09\x20\x22\x3c\x3e\x5b\x5c\x5d\x5e\x60\x7b\x7c\x7d\x7e\?\=\&\+_\/]/sprintf("%%%2x", ord($&))/ge;
     48    $_[0] =~ s/[\x09\x20\x22\x3c\x3e\x5b\x5c\x5d\x5e\x60\x7b\x7c\x7d\x7e\?\=\&\+_\/]/sprintf("%%%2x", ord($&))/gse;
    4849}
    4950
     
    5657sub dmsafe {
    5758    my ($s) = $_[0];
    58     $s =~ s/&/&amp;/og; # for html
    59     $s =~ s/</&lt;/og;  # for html
    60     $s =~ s/>/&gt;/og;  # for html
    61     $s =~ s/\_/&#095;/og; # for dm (we have a convention of starting macros with _
    62     $s =~ s/\"/&quot;/og; # for html (don't want to be interpreted as a quote)
    63     $s =~ s/\{/&#123;/og; # for dm blocks
    64     $s =~ s/\}/&#125;/og; # for dm blocks
     59    $s =~ s/&/&amp;/osg; # for html
     60    $s =~ s/</&lt;/osg;  # for html
     61    $s =~ s/>/&gt;/osg;  # for html
     62    $s =~ s/\_/&#095;/osg; # for dm (we have a convention of starting macros with _
     63    $s =~ s/\"/&quot;/osg; # for html (don't want to be interpreted as a quote)
     64    $s =~ s/\{/&#123;/osg; # for dm blocks
     65    $s =~ s/\}/&#125;/osg; # for dm blocks
     66    $s =~ s/\\/&#092;/osg; # for dm (dm removes naturally occurring backquotes)
    6567    return $s;
    6668}
     
    170172    # args: the text that you want to convert
    171173
    172     $_[0] =~ s/&([^;]+);/&getcharequiv($1,0)/ge;
     174    $_[0] =~ s/&([^;]+);/&getcharequiv($1,0)/gse;
    173175}
    174176
     
    177179    # args: the text that you want to convert
    178180
    179     $_[0] =~ s/&([^;]+);/&getcharequiv($1,1)/ge;
     181    $_[0] =~ s/&([^;]+);/&getcharequiv($1,1)/gse;
    180182