Changeset 85 for trunk/gsdl/perllib
- Timestamp:
- 1998-12-21T15:12:32+13:00 (26 years ago)
- Location:
- trunk/gsdl/perllib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/doc.pm
r74 r85 53 53 54 54 # returns the source_filename as it was provided 55 # the default of "indexed_doc" is used if no document 56 # type was provided 55 57 sub get_doc_type { 56 58 my $self = shift (@_); 57 59 58 return $self->get_metadata_element ($self->get_top_section(), "gsdldoctype"); 60 my $doc_type = $self->get_metadata_element ($self->get_top_section(), "gsdldoctype"); 61 return $doc_type if (defined $doc_type); 62 return "indexed_doc"; 63 } 64 65 sub _escape_text { 66 my ($text) = @_; 67 68 # special characters in the gml encoding 69 $text =~ s/&/&/g; # this has to be first... 70 $text =~ s/</</g; 71 $text =~ s/>/>/g; 72 $text =~ s/\"/"/g; 73 74 return $text; 59 75 } 60 76 … … 75 91 print $handle " gsdlnum=\"$section_num\"" if defined $section_num; 76 92 foreach $data (@{$section_ptr->{'metadata'}}) { 77 print $handle " $data->[0]=\" $data->[1]\""93 print $handle " $data->[0]=\"" . &_escape_text($data->[1]) . "\"" 78 94 unless $suppress_subject_info && $data->[0] eq "Subject"; 79 95 } … … 81 97 82 98 # output the text 83 print $handle $section_ptr->{'text'};99 print $handle &_escape_text($section_ptr->{'text'}); 84 100 85 101 # output all the subsections … … 166 182 sub get_OID { 167 183 my $self = shift (@_); 168 169 return $self->get_metadata_element ($self->get_top_section(), "Identifier"); 184 my $OID = $self->get_metadata_element ($self->get_top_section(), "Identifier"); 185 return $OID if (defined $OID); 186 return "NULL"; 170 187 } 171 188 -
trunk/gsdl/perllib/mgbuilder.pm
r81 r85 269 269 my $indexexparr = []; 270 270 my ($level, $fields, $subcollection) = split (":", $index); 271 my (@subcollections) = split /,/, $subcollection; 271 my @subcollections = (); 272 @subcollections = split /,/, $subcollection if (defined $subcollection); 272 273 273 274 foreach $subcollection (@subcollections) { … … 359 360 &util::mk_all_dir ($textdir); 360 361 361 # assume little-endian for now :-) 362 my $fulldbname = &util::filename_cat ($textdir, "$self->{'collection'}.ldb"); 362 # get db name 363 my $dbext = ".bdb"; 364 $dbext = ".ldb" if &util::is_little_endian(); 365 my $fulldbname = &util::filename_cat ($textdir, "$self->{'collection'}$dbext"); 363 366 $fulldbname =~ s/\//\\/g if ($ENV{'GSDLOS'} =~ /^windows$/i); 367 364 368 my $exedir = "$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}"; 365 369 my $exe = &util::get_os_exe ();
Note:
See TracChangeset
for help on using the changeset viewer.