source: main/tags/2.52/gsdl/perllib/docprint.pm@ 25422

Last change on this file since 25422 was 2267, checked in by davidb, 23 years ago

GML file syntax altered to be XML compliant. This basically meant
turning attribute lists of metadata names (which in Greenstone can
appear multiple times within a tag) into tag names themselves, which
are then explicitly stated in a <metadata>...</metadata> block.

Newly built collection will use the new syntactic form, however the
GMLPlug file is backwards compatible and so will still import in
files in the older GML format.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
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
29package docprint;
30
31use arcinfo;
32use docproc;
33use util;
34
35
36sub BEGIN {
37 @ISA = ('docproc');
38}
39
40sub new {
41 my ($class) = @_;
42 my $self = new docproc ();
43
44 return bless $self, $class;
45}
46
47sub 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
62 $doc_obj->output_section(STDOUT, $doc_obj->get_top_section(),
63 undef, undef, 0);
64}
65
66
671;
Note: See TracBrowser for help on using the repository browser.