Changeset 677
- Timestamp:
- 1999-10-15T12:36:14+13:00 (25 years ago)
- Location:
- trunk/gsdl/perllib
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/classify/AZList.pm
r618 r677 99 99 sub get_entry { 100 100 my $self = shift (@_); 101 my ($title, $c lassifytype) = @_;101 my ($title, $childtype, $thistype) = @_; 102 102 103 103 # organise into classification structure 104 my %classifyinfo = ('c lassifytype'=>$classifytype,104 my %classifyinfo = ('childtype'=>$childtype, 105 105 'Title'=>$title, 106 106 'contains'=>[]); 107 $classifyinfo{'thistype'} = $thistype 108 if defined $thistype && $thistype =~ /\w/; 107 109 108 110 return \%classifyinfo; … … 117 119 118 120 # top level 119 my $classifyinfo = $self->get_entry ($self->{'title'}, "AZList"); 121 my $childtype = "HList"; 122 if (scalar (@$classlistref) <= 20) {$childtype = "VList";} 123 my $classifyinfo = $self->get_entry ($self->{'metaname'}, $childtype, "Invisible"); 120 124 121 125 # don't need to do any splitting if there are less than 20 classifications … … 154 158 155 159 foreach $subclass (@tmparr) { 156 my $tempclassify = $self->get_entry($subclass, " AZList");160 my $tempclassify = $self->get_entry($subclass, "VList"); 157 161 foreach $subsubOID (@{$classhash->{$subclass}}) { 158 162 push (@{$tempclassify->{'contains'}}, {'OID'=>$subsubOID}); … … 204 208 @currentOIDs = (); 205 209 $currentfirstletter = ""; 210 $lastkey = $subsection; 206 211 } else { 207 212 @currentOIDs = @{$classhashref->{$subsection}}; -
trunk/gsdl/perllib/classify/AZSectionList.pm
r652 r677 224 224 @currentOIDs = (); 225 225 $currentfirstletter = ""; 226 $lastkey = $subsection; 226 227 } else { 227 228 @currentOIDs = @{$classhashref->{$subsection}}; -
trunk/gsdl/perllib/classify/DateList.pm
r537 r677 79 79 sub get_entry { 80 80 my $self = shift (@_); 81 my ($title, $c lassifytype) = @_;81 my ($title, $childtype, $thistype) = @_; 82 82 83 83 # organise into classification structure 84 my %classifyinfo = ('c lassifytype'=>$classifytype,84 my %classifyinfo = ('childtype'=>$childtype, 85 85 'Title'=>$title, 86 86 'contains'=>[]); 87 $classifyinfo{'thistype'} = $thistype 88 if defined $thistype && $thistype =~ /\w/; 87 89 88 90 return \%classifyinfo; … … 97 99 98 100 # top level 99 my $classifyinfo = $self->get_entry ("Date", "DateList"); 101 my $childtype = "HList"; 102 if (scalar (@$classlistref) <= 20) {$childtype = "DateList";} 103 my $classifyinfo = $self->get_entry ("Date", $childtype, "Invisible"); 100 104 101 105 # don't need to do any splitting if there are less than 20 classifications … … 164 168 @currentOIDs = (); 165 169 $currentfirstletter = ""; 170 $lastkey = $subsection; 166 171 } else { 167 172 @currentOIDs = @{$classhashref->{$subsection}}; … … 175 180 # add final sub-classification 176 181 if (scalar (@currentOIDs) < $min) { 177 my ($newkey) = $lastkey =~ /^( .)/;182 my ($newkey) = $lastkey =~ /^(\d\d\d\d)/; 178 183 @currentOIDs = (@{$compactedhash->{$lastkey}}, @currentOIDs); 179 184 delete $compactedhash->{$lastkey}; -
trunk/gsdl/perllib/classify/Hierarchy.pm
r641 r677 151 151 } 152 152 153 154 153 sub get_classify_info { 155 154 my $self = shift (@_); … … 157 156 my $list = $self->{'locatorlist'}; 158 157 159 my $classifyinfo = $self->get_entry ($self->{'title'}, " Hierarchy");158 my $classifyinfo = $self->get_entry ($self->{'title'}, "VList", "Invisible"); 160 159 foreach $OID (keys (%$list)) { 161 my $tempinfo = $self->get_OID_entry ($OID, $classifyinfo, $list->{$OID}->{'title'}, " Hierarchy");160 my $tempinfo = $self->get_OID_entry ($OID, $classifyinfo, $list->{$OID}->{'title'}, "VList"); 162 161 163 162 if (defined $self->{'sortname'}) { … … 175 174 } 176 175 177 178 176 sub get_OID_entry { 179 177 my $self = shift (@_); … … 205 203 sub get_entry { 206 204 my $self = shift (@_); 207 my ($title, $c lassifytype) = @_;205 my ($title, $childtype, $thistype) = @_; 208 206 209 207 # organise into classification structure 210 my %classifyinfo = ('c lassifytype'=>$classifytype,208 my %classifyinfo = ('childtype'=>$childtype, 211 209 'Title'=>$title, 212 210 'contains'=>[]); 211 $classifyinfo{'thistype'} = $thistype 212 if defined $thistype && $thistype =~ /\w/; 213 213 214 214 return \%classifyinfo; … … 216 216 217 217 218 219 218 1; -
trunk/gsdl/perllib/classify/List.pm
r641 r677 156 156 157 157 # organise into classification structure 158 my %classifyinfo = ('classifytype'=>'List', 158 my %classifyinfo = ('thistype'=>'Invisible', 159 'childtype'=>'VList', 159 160 'Title'=>$self->{'title'}, 160 161 'contains'=>[]); -
trunk/gsdl/perllib/classify/SectionList.pm
r545 r677 172 172 173 173 # organise into classification structure 174 my %classifyinfo = ('classifytype'=>'List', 174 my %classifyinfo = ('thistype'=>'Invisible', 175 'childtype'=>'VList', 175 176 'Title'=>$self->{'title'}, 176 177 'contains'=>[]); -
trunk/gsdl/perllib/mgbuilder.pm
r626 r677 123 123 } 124 124 125 # set the classifytype to use for displaying documents - if the doctype field hasn't126 # been set in the collect.cfg then the receptionist currently defaults to displaying127 # documents as 'Book'128 if (open (COLCFG, $colcfgname)) {129 while (defined ($line = &cfgread::read_cfg_line('mgbuilder::COLCFG'))) {130 if (scalar(@$line) == 2) {131 my $key = shift (@$line);132 if ($key eq "doctype") {133 $self->{'classifytype'} = shift (@$line);134 }135 }136 }137 close (COLCFG);138 }139 140 125 # load up the document processor for building 141 126 # if a buildproc class has been created for this collection, use it -
trunk/gsdl/perllib/mgbuildproc.pm
r544 r677 132 132 } 133 133 134 # use 'Paged' if document has no more than 2 levels 135 # and each section at second level has a number for 136 # Title metadata 137 sub get_document_type { 138 my $self = shift (@_); 139 my ($doc_obj) = @_; 140 141 my $thistype = "VList"; 142 my $childtype = "VList"; 143 my $title; 144 my @tmp = (); 145 146 my $section = $doc_obj->get_top_section (); 147 my $first = 1; 148 while (defined $section) { 149 @tmp = split /\./, $section; 150 if (scalar(@tmp) > 1) { 151 return ($thistype, $childtype); 152 } 153 if (!$first) { 154 $title = $doc_obj->get_metadata_element ($section, "Title"); 155 if (defined $title && $title !~ /^\d+$/) { 156 return ($thistype, $childtype); 157 } 158 } 159 $first = 0; 160 $section = $doc_obj->get_next_section($section); 161 } 162 if ($doc_obj->get_text_length ($doc_obj->get_top_section())) { 163 $thistype = "Paged"; 164 } else { 165 $thistype = "Invisible"; 166 } 167 $childtype = "Paged"; 168 return ($thistype, $childtype); 169 } 170 134 171 sub infodb { 135 172 my $self = shift (@_); … … 146 183 $self->{'num_docs'} += 1 unless ($doctype eq "classification"); 147 184 185 # is this a paged or a hierarchical document 186 my ($thistype, $childtype) = $self->get_document_type ($doc_obj); 187 148 188 my $section = $doc_obj->get_top_section (); 149 189 my $doc_OID = $doc_obj->get_OID(); 190 my $first = 1; 150 191 while (defined $section) { 151 192 # update a few statistics … … 192 233 } 193 234 235 # output document display type 236 if ($first) { 237 print $handle "<thistype>$thistype\n"; 238 } 239 194 240 # output a list of children 195 241 my $children = $doc_obj->get_children ($section); 196 242 if (scalar(@$children) > 0) { 243 print $handle "<childtype>$childtype\n"; 197 244 print $handle "<contains>"; 198 245 my $firstchild = 1; … … 224 271 print $handle '-' x 70, "\n"; 225 272 226 273 $first = 0; 227 274 $section = $doc_obj->get_next_section($section); 228 275 }
Note:
See TracChangeset
for help on using the changeset viewer.