Changeset 32542 for main/trunk/greenstone2/perllib/plugouts
- Timestamp:
- 2018-10-25T21:17:02+13:00 (6 years ago)
- Location:
- main/trunk/greenstone2/perllib/plugouts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugouts/GreenstoneSQLPlugout.pm
r32541 r32542 52 52 # It's fine: the die() stmts all take place before setting up the super class' begin 53 53 54 # TODO Q: about build_mode: how to detect removeold 54 55 # TODO: deal with -removeold and everything? Or type out instructions for user 55 56 56 57 # TODO Q: what is "group" in GreenstoneXMLPlugout? 57 58 # TODO Q: site_name only exists for GS3. What about GS2? 59 58 60 59 61 my $process_mode_list = … … 216 218 } 217 219 218 # produce files called docsql-<OID>.xml instead of doc.xml220 # Produce files called docsql.xml instead of doc.xml 219 221 sub get_doc_xml_filename { 220 222 my $self = shift (@_); 221 223 my ($doc_obj) = @_; 222 224 223 my $doc_id = $doc_obj->get_OID(); 224 my $filename = $doc_id ? "docsql-".$doc_id.".xml" : "docsql.xml"; 225 return $filename; 226 } 227 225 return "docsql.xml"; 226 } 227 228 # overriding to store doc OID as attribute of top level element: <Archive docoid="oid"> 229 sub output_xml_header { 230 my $self = shift (@_); 231 my ($outhandle, $doc_oid) = @_; 232 233 print $outhandle '<?xml version="1.0" encoding="utf-8" standalone="no"?>' . "\n"; 234 print $outhandle "<!DOCTYPE Archive SYSTEM \"http://greenstone.org/dtd/Archive/1.0/Archive.dtd\">\n"; 235 print $outhandle "<Archive docoid=\"$doc_oid\">\n"; 236 } 237 228 238 # TODO: check arc-inf.db for whether each entry is to be deleted/indexed/reindexed/been indexed 229 239 sub saveas { -
main/trunk/greenstone2/perllib/plugouts/GreenstoneXMLPlugout.pm
r32536 r32542 190 190 # only output the header if we have started a new doc 191 191 if (!$self->is_group() || $self->{'new_doc_dir'}) { 192 $self->output_xml_header($outhandler );192 $self->output_xml_header($outhandler, $doc_obj->get_OID()); 193 193 } 194 194 … … 238 238 sub output_xml_header { 239 239 my $self = shift (@_); 240 my ($outhandle ) = @_;240 my ($outhandle, $doc_oid) = @_; 241 241 242 242 print $outhandle '<?xml version="1.0" encoding="utf-8" standalone="no"?>' . "\n";
Note:
See TracChangeset
for help on using the changeset viewer.