source: trunk/gsdl/perllib/colcfg.pm@ 2341

Last change on this file since 2341 was 2336, checked in by sjboddie, 23 years ago

added a -no_text option to buildcol.pl to allow collections to be built
without storing compressed text (intended for use in collections where
original documents (PDFs or Word docs maybe) are returned instead of the
compressed text)

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1###########################################################################
2#
3# colcfg.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# reads in a collection configuration file
27
28package colcfg;
29
30use cfgread;
31
32
33# the collection configuration file data is stored in the form
34#
35# {'creator'}->string
36# {'public'}->string
37# {'beta'}->string
38# {'defaultindex'}->string
39# {'importdir'}->string
40# {'archivedir'}->string
41# {'cachedir'}->string
42# {'builddir'}->string
43# {'removeold'}->string
44# {'textcompress'}->string
45# {'buildtype'}->string
46
47# {'maintainer'}->array of strings
48# {'languages'}->array of strings
49# {'indexsubcollections'}->array of strings
50# {'indexes'}->array of strings
51# {'dontbuild'}->array of strings
52# {'dontgdbm'}->array of strings
53# {'mirror'}->array of strings
54# {'phind'}->array of strings
55# {'levels'}->array of strings (for mgpp eg Section, Paragraph)
56
57# {'subcollection'}->hash of key-value pairs
58# {'collectionmeta'}->hash of key-value pairs
59
60# {'plugin'}->array of arrays of strings
61# {'classify'}->array of arrays of strings
62
63sub read_collect_cfg {
64 my ($filename) = @_;
65
66 return &cfgread::read_cfg_file ($filename,
67 q/^(creator|public|beta|defaultindex|importdir|/ .
68 q/archivedir|cachedir|builddir|removeold|/ .
69 q/textcompress|buildtype|collectdir|no_text|allclassifications)$/,
70 q/(maintainer|languages|indexsubcollections|/ .
71 q/indexes|dontbuild|dontgdbm|mirror|phind|levels)$/,
72 q/^(subcollection|collectionmeta)$/,
73 q/^(plugin|classify)$/);
74}
75
76sub write_collect_cfg {
77 my ($filename, $data) = @_;
78
79 &cfgread::write_cfg_file($filename, $data,
80 q/^(creator|public|beta|defaultindex|importdir|/ .
81 q/archivedir|cachedir|builddir|removeold|/ .
82 q/textcompress|buildtype|collectdir|no_text|allclassifications)$/,
83 q/^(maintainer|languages|indexsubcollections|/ .
84 q/indexes|dontbuild|dontgdbm|levels)$/,
85 q/^(subcollection|collectionmeta)$/,
86 q/^(plugin|classify)$/);
87}
88
89
90# the build configuration file data is stored in the form
91#
92# {'builddate'}->string
93# {'buildtype'}->string
94# {'metadata'}->array of strings
95# {'languages'}->array of strings
96# {'numdocs'}->string
97# {'numwords'}->string
98# {'numbytes'}->string
99# {'indexfields'}->array of strings
100
101sub read_build_cfg {
102 my ($filename) = @_;
103
104 return &cfgread::read_cfg_file ($filename,
105 q/^(builddate|buildtype|numdocs|numwords|numbytes)$/,
106 q/^(metadata|languages|indexfields)$/);
107}
108
109sub write_build_cfg {
110 my ($filename, $data) = @_;
111
112 &cfgread::write_cfg_file($filename, $data,
113 q/^(builddate|buildtype|numdocs|numwords|numbytes)$/,
114 q/^(metadata|languages|indexfields)$/);
115}
116
117
1181;
Note: See TracBrowser for help on using the repository browser.