Changeset 677 for trunk/gsdl/perllib/mgbuildproc.pm
- Timestamp:
- 1999-10-15T12:36:14+13:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.