[782] | 1 | ###########################################################################
|
---|
| 2 | #
|
---|
| 3 | # docprint.pm
|
---|
| 4 | # A component of the Greenstone digital library software
|
---|
| 5 | # from the New Zealand Digital Library Project at the
|
---|
| 6 | # University of Waikato, New Zealand.
|
---|
| 7 | #
|
---|
| 8 | # Copyright (C) 1999 New Zealand Digital Library Project
|
---|
| 9 | #
|
---|
| 10 | # This program is free software; you can redistribute it and/or modify
|
---|
| 11 | # it under the terms of the GNU General Public License as published by
|
---|
| 12 | # the Free Software Foundation; either version 2 of the License, or
|
---|
| 13 | # (at your option) any later version.
|
---|
| 14 | #
|
---|
| 15 | # This program is distributed in the hope that it will be useful,
|
---|
| 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 18 | # GNU General Public License for more details.
|
---|
| 19 | #
|
---|
| 20 | # You should have received a copy of the GNU General Public License
|
---|
| 21 | # along with this program; if not, write to the Free Software
|
---|
| 22 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
| 23 | #
|
---|
| 24 | ###########################################################################
|
---|
| 25 |
|
---|
| 26 | # This document processor prints a document out to STDOUT
|
---|
| 27 |
|
---|
| 28 |
|
---|
| 29 | package docprint;
|
---|
| 30 |
|
---|
| 31 | use arcinfo;
|
---|
| 32 | use docproc;
|
---|
| 33 | use util;
|
---|
| 34 |
|
---|
| 35 |
|
---|
| 36 | sub BEGIN {
|
---|
| 37 | @ISA = ('docproc');
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | sub new {
|
---|
| 41 | my ($class) = @_;
|
---|
| 42 | my $self = new docproc ();
|
---|
| 43 |
|
---|
| 44 | return bless $self, $class;
|
---|
| 45 | }
|
---|
| 46 |
|
---|
| 47 | sub process {
|
---|
| 48 | my $self = shift (@_);
|
---|
| 49 | my ($doc_obj) = @_;
|
---|
| 50 |
|
---|
| 51 | # add associated files as metadata to the document
|
---|
| 52 | my @assoc_files = ();
|
---|
| 53 | foreach $assoc_file (@{$doc_obj->get_assoc_files()}) {
|
---|
| 54 | if (-e $assoc_file->[0]) {
|
---|
| 55 | $doc_obj->add_metadata ($doc_obj->get_top_section(),
|
---|
| 56 | "gsdlassocfile",
|
---|
| 57 | "$assoc_file->[1]:$assoc_file->[2]");
|
---|
| 58 | }
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 | # output document
|
---|
[2267] | 62 | $doc_obj->output_section(STDOUT, $doc_obj->get_top_section(),
|
---|
| 63 | undef, undef, 0);
|
---|
[782] | 64 | }
|
---|
| 65 |
|
---|
| 66 |
|
---|
| 67 | 1;
|
---|