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

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

Removed the "beta" collect.cfg option to avoid awkward questions from
people about what it does (nothing!)

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