Changeset 8361
- Timestamp:
- 2004-10-18T14:59:51+13:00 (20 years ago)
- Location:
- trunk/gsdl
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/buildcol.pl
r7950 r8361 57 57 58 58 my $arguments = 59 [ { 'name' => " allclassifications",60 'desc' => "{buildcol. allclassifications}",61 'type' => "flag", 62 'reqd' => "no", 63 'modegli' => " 2" },59 [ { 'name' => "remove_empty_classifications", 60 'desc' => "{buildcol.remove_empty_classifications}", 61 'type' => "flag", 62 'reqd' => "no", 63 'modegli' => "3" }, 64 64 { 'name' => "archivedir", 65 65 'desc' => "{buildcol.archivedir}", … … 164 164 { 165 165 my ($verbosity, $archivedir, $cachedir, $builddir, $maxdocs, 166 $debug, $mode, $indexname, $keepold, $ allclassifications,166 $debug, $mode, $indexname, $keepold, $remove_empty_classifications, 167 167 $create_images, $collectdir, $out, $buildtype, $textindex, 168 168 $no_strip_html, $no_text, $faillog, $gli); … … 186 186 'no_text', \$no_text, 187 187 'keepold', \$keepold, 188 ' allclassifications', \$allclassifications,188 'remove_empty_classifications', \$remove_empty_classifications, 189 189 'create_images', \$create_images, 190 190 'collectdir/.*/', \$collectdir, … … 298 298 } 299 299 } 300 if (defined $collectcfg->{' allclassifications'} && $allclassifications == 0) {301 if ($collectcfg->{' allclassifications'} =~ /^true$/i) {302 $ allclassifications = 1;300 if (defined $collectcfg->{'remove_empty_classifications'} && $remove_empty_classifications == 0) { 301 if ($collectcfg->{'remove_empty_classifications'} =~ /^true$/i) { 302 $remove_empty_classifications = 1; 303 303 } 304 304 } … … 397 397 eval("\$builder = new $buildertype(\$collection, " . 398 398 "\$realarchivedir, \$realbuilddir, \$verbosity, " . 399 "\$maxdocs, \$debug, \$keepold, \$ allclassifications, " .399 "\$maxdocs, \$debug, \$keepold, \$remove_empty_classifications, " . 400 400 "\$out, \$no_text, \$faillog, \$gli)"); 401 401 die "$@" if $@; -
trunk/gsdl/perllib/classify.pm
r8275 r8361 153 153 # to the gdbm 154 154 sub output_classify_info { 155 my ($classifiers, $handle, $ allclassifications, $gli) = @_;155 my ($classifiers, $handle, $remove_empty_classifications, $gli) = @_; 156 156 # $handle = "main::STDOUT"; 157 157 … … 172 172 } 173 173 174 &print_classify_info ($handle, $classifyinfo, "", $ allclassifications);174 &print_classify_info ($handle, $classifyinfo, "", $remove_empty_classifications); 175 175 } 176 176 177 177 sub print_classify_info { 178 my ($handle, $classifyinfo, $OID, $ allclassifications) = @_;178 my ($handle, $classifyinfo, $OID, $remove_empty_classifications) = @_; 179 179 180 180 $OID =~ s/^\.+//; # just for good luck … … 184 184 185 185 # don't want empty classifications 186 if ($allclassifications || &check_contents ($classifyinfo) > 0) {186 return if ($remove_empty_classifications && &check_contents ($classifyinfo) == 0); 187 187 188 188 $OID = $classifyinfo->{'classifyOID'} if defined ($classifyinfo->{'classifyOID'}); 189 189 190 my $outputtext = "[$OID]\n"; 191 $outputtext .= "<doctype>classify\n"; 192 $outputtext .= "<hastxt>0\n"; 193 $outputtext .= "<childtype>$classifyinfo->{'childtype'}\n" 194 if defined $classifyinfo->{'childtype'}; 195 $outputtext .= "<Title>$classifyinfo->{'Title'}\n" 196 if defined $classifyinfo->{'Title'}; 197 $outputtext .= "<numleafdocs>$classifyinfo->{'numleafdocs'}\n" 198 if defined $classifyinfo->{'numleafdocs'}; 199 $outputtext .= "<thistype>$classifyinfo->{'thistype'}\n" 200 if defined $classifyinfo->{'thistype'}; 201 $outputtext .= "<parameters>$classifyinfo->{'parameters'}\n" 202 if defined $classifyinfo->{'parameters'}; 203 $outputtext .= "<supportsmemberof>$classifyinfo->{'supportsmemberof'}\n" 204 if defined $classifyinfo->{'supportsmemberof'}; 190 my $outputtext = "[$OID]\n"; 191 $outputtext .= "<doctype>classify\n"; 192 $outputtext .= "<hastxt>0\n"; 193 $outputtext .= "<childtype>$classifyinfo->{'childtype'}\n" 194 if defined $classifyinfo->{'childtype'}; 195 $outputtext .= "<Title>$classifyinfo->{'Title'}\n" 196 if defined $classifyinfo->{'Title'}; 197 $outputtext .= "<numleafdocs>$classifyinfo->{'numleafdocs'}\n" 198 if defined $classifyinfo->{'numleafdocs'}; 199 $outputtext .= "<thistype>$classifyinfo->{'thistype'}\n" 200 if defined $classifyinfo->{'thistype'}; 201 $outputtext .= "<parameters>$classifyinfo->{'parameters'}\n" 202 if defined $classifyinfo->{'parameters'}; 203 $outputtext .= "<supportsmemberof>$classifyinfo->{'supportsmemberof'}\n" 204 if defined $classifyinfo->{'supportsmemberof'}; 205 206 my $contains_text = "<contains>"; 207 my $mdoffset_text = "<mdoffset>"; 208 209 my $next_subOID = 1; 210 my $first = 1; 211 foreach $tempinfo (@{$classifyinfo->{'contains'}}) { 212 # empty contents were made undefined by clean_contents() 213 next unless defined $tempinfo; 205 214 206 my $contains_text = "<contains>"; 207 my $mdoffset_text = "<mdoffset>"; 215 if (!defined ($tempinfo->{'classifyOID'}) || 216 $tempinfo->{'classifyOID'} ne "oai") { 217 $contains_text .= ";" unless $first; 218 } 219 $mdoffset_text .= ";" unless $first; 220 $first = 0; 208 221 209 my $next_subOID = 1; 210 my $first = 1; 211 foreach $tempinfo (@{$classifyinfo->{'contains'}}) { 212 # empty contents were made undefined by clean_contents() 213 next unless defined $tempinfo; 214 215 if (!defined ($tempinfo->{'classifyOID'}) || 216 $tempinfo->{'classifyOID'} ne "oai") { 217 $contains_text .= ";" unless $first; 222 if (defined ($tempinfo->{'classifyOID'})) { 223 if ($tempinfo->{'classifyOID'} ne "oai") { 224 $contains_text .= $tempinfo->{'classifyOID'}; 218 225 } 219 $mdoffset_text .= ";" unless $first; 220 $first = 0; 221 222 if (defined ($tempinfo->{'classifyOID'})) { 223 if ($tempinfo->{'classifyOID'} ne "oai") { 224 $contains_text .= $tempinfo->{'classifyOID'}; 225 } 226 &print_classify_info ($handle, $tempinfo, $tempinfo->{'classifyOID'}, 227 $allclassifications); 228 } elsif (defined ($tempinfo->{'OID'})) { 229 $contains_text .= $tempinfo->{'OID'}; 230 $mdoffset_text .= $tempinfo->{'offset'} 231 if (defined ($tempinfo->{'offset'})) 226 &print_classify_info ($handle, $tempinfo, $tempinfo->{'classifyOID'}, 227 $remove_empty_classifications); 228 } elsif (defined ($tempinfo->{'OID'})) { 229 $contains_text .= $tempinfo->{'OID'}; 230 $mdoffset_text .= $tempinfo->{'offset'} 231 if (defined ($tempinfo->{'offset'})) 232 232 # note: we don't want to print the contents of the books 233 233 } else { … … 236 236 # so no bookshelf icon appears, top-level, along with the 237 237 # applet 238 238 239 239 if (!defined ($tempinfo->{'Title'}) || $tempinfo->{'Title'} ne "Collage") { 240 240 $contains_text .= "\".$next_subOID"; 241 241 } 242 242 243 243 &print_classify_info ($handle, $tempinfo, "$OID.$next_subOID", 244 $ allclassifications);244 $remove_empty_classifications); 245 245 $next_subOID++; 246 246 } 247 248 249 250 251 252 253 254 255 256 257 258 } 247 } 248 249 $outputtext .= "$contains_text\n"; 250 $outputtext .= "<mdtype>$classifyinfo->{'mdtype'}\n" 251 if defined $classifyinfo->{'mdtype'}; 252 $outputtext .= "$mdoffset_text\n" 253 if ($mdoffset_text !~ m/^<mdoffset>;+$/); 254 255 $outputtext .= '-' x 70 . "\n"; 256 257 print $handle $outputtext; 258 259 259 } 260 260 -
trunk/gsdl/perllib/mgbuilder.pm
r7904 r8361 61 61 sub new { 62 62 my ($class, $collection, $source_dir, $build_dir, $verbosity, 63 $maxdocs, $debug, $keepold, $ allclassifications,63 $maxdocs, $debug, $keepold, $remove_empty_classifications, 64 64 $outhandle, $no_text, $failhandle, $gli) = @_; 65 65 … … 76 76 'debug'=>$debug, 77 77 'keepold'=>$keepold, 78 ' allclassifications'=>$allclassifications,78 'remove_empty_classifications'=>$remove_empty_classifications, 79 79 'outhandle'=>$outhandle, 80 80 'no_text'=>$no_text, … … 815 815 # output classification information 816 816 &classify::output_classify_info ($self->{'classifiers'}, $handle, 817 $self->{' allclassifications'},817 $self->{'remove_empty_classifications'}, 818 818 $self->{'gli'}); 819 819 -
trunk/gsdl/perllib/mgppbuilder.pm
r7953 r8361 111 111 112 112 my ($collection, $source_dir, $build_dir, $verbosity, 113 $maxdocs, $debug, $keepold, $ allclassifications,113 $maxdocs, $debug, $keepold, $remove_empty_classifications, 114 114 $outhandle, $no_text, $gli) = @_; 115 115 … … 125 125 'debug'=>$debug, 126 126 'keepold'=>$keepold, 127 ' allclassifications'=>$allclassifications,127 'remove_empty_classifications'=>$remove_empty_classifications, 128 128 'outhandle'=>$outhandle, 129 129 'no_text'=>$no_text, … … 938 938 # output classification information 939 939 &classify::output_classify_info ($self->{'classifiers'}, $handle, 940 $self->{' allclassifications'},940 $self->{'remove_empty_classifications'}, 941 941 $self->{'gli'}); 942 942 -
trunk/gsdl/perllib/strings.rb
r8252 r8361 53 53 54 54 # -- buildcol.pl -- 55 56 buildcol.allclassifications:Don't remove empty classifications.57 55 58 56 buildcol.archivedir:Where the archives live. … … 99 97 100 98 buildcol.params:[options] collection-name 99 100 buildcol.remove_empty_classifications:Hide empty classifiers and classification nodes (those that contain no documents). 101 101 102 102 buildcol.unlinked_col_images:Collection images may not be linked correctly.
Note:
See TracChangeset
for help on using the changeset viewer.