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

Last change on this file since 13902 was 12897, checked in by kjdon, 18 years ago

added indexoptions into collect.cfg fields, and stemindexes into build.cfg fields

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 5.3 KB
RevLine 
[537]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
[4]26# reads in a collection configuration file
27
28package colcfg;
29
30use cfgread;
[10475]31use strict;
[4]32
33# the collection configuration file data is stored in the form
34#
35# {'creator'}->string
36# {'public'}->string
[810]37# {'defaultindex'}->string
38# {'importdir'}->string
39# {'archivedir'}->string
40# {'cachedir'}->string
41# {'builddir'}->string
42# {'removeold'}->string
[932]43# {'textcompress'}->string
[1851]44# {'buildtype'}->string
[4192]45# {'maxnumeric'}->string
[6584]46# {'separate_cjk'}->string
[10475]47# {'sections_index_document_metadata'}->string (always, unless_section_metadata_exists)
[810]48# {'maintainer'}->array of strings
[139]49# {'languages'}->array of strings
[69]50# {'indexsubcollections'}->array of strings
[4]51# {'indexes'}->array of strings
[12897]52# {'indexoptions'}->array of strings (stem, casefold, accentfold)
[810]53# {'dontbuild'}->array of strings
54# {'dontgdbm'}->array of strings
[1377]55# {'mirror'}->array of strings
[1572]56# {'phind'}->array of strings
[12326]57# {'plugout'}->array of strings
[1851]58# {'levels'}->array of strings (for mgpp eg Section, Paragraph)
[4767]59# {'searchtype'}->array of strings (for mgpp, form or plain)
[4]60
[810]61# {'subcollection'}->hash of key-value pairs
62
[4818]63# {'acquire'}->array of arrays of strings
[810]64# {'plugin'}->array of arrays of strings
65# {'classify'}->array of arrays of strings
66
[2772]67# {'collectionmeta'}->hash of key->hash of param-value -used
68# for language specification
69# for example, collectionmeta->collectionname->default->demo
70# ->mi->maori demo
71
[4]72sub read_collect_cfg {
73 my ($filename) = @_;
74
75 return &cfgread::read_cfg_file ($filename,
[2711]76 q/^(creator|public|defaultindex|importdir|/ .
[2336]77 q/archivedir|cachedir|builddir|removeold|/ .
[9547]78 q/textcompress|buildtype|no_text|keepold|gzip|/ .
79 q/verbosity|remove_empty_classifications|OIDtype|/ .
80 q/groupsize|maxdocs|debug|mode|saveas|/ .
81 q/sortmeta|removesuffix|removeprefix|create_images|/ .
[9667]82 q/maxnumeric|separate_cjk|language_metadata|/ .
[10475]83 q/no_strip_html|index|sections_index_document_metadata)$/,
[810]84 q/(maintainer|languages|indexsubcollections|/ .
[12897]85 q/indexes|indexoptions|dontbuild|dontgdbm|mirror|levels|plugout|/ .
[9547]86 q/searchtype|searchtypes)$/,
[4767]87 q/^(subcollection|format)$/,
[4818]88 q/^(acquire|plugin|classify)$/,
[2772]89 q/^(collectionmeta)$/);
[4]90}
91
92sub write_collect_cfg {
93 my ($filename, $data) = @_;
[4767]94
[4]95 &cfgread::write_cfg_file($filename, $data,
[2711]96 q/^(creator|public|defaultindex|importdir|/ .
[2336]97 q/archivedir|cachedir|builddir|removeold|/ .
[9547]98 q/textcompress|buildtype|no_text|keepold|gzip|/ .
99 q/verbosity|remove_empty_classifications|OIDtype|/.
100 q/groupsize|maxdocs|debug|mode|saveas|/ .
101 q/sortmeta|removesuffix|removeprefix|create_images|/ .
102 q/maxnumeric|separate_cjk|language_metadata/ .
[10475]103 q/no_strip_html|index|sections_index_document_metadata)$/,
[810]104 q/^(maintainer|languages|indexsubcollections|/ .
[12897]105 q/indexes|indexoptions|dontbuild|dontgdbm|mirror|levels|/.
[9547]106 q/searchtype|searchtypes)$/,
107 q/^(subcollection|format)$/,
[4818]108 q/^(acquire|plugin|classify)$/,
[2772]109 q/^(collectionmeta)$/);
[4]110}
111
112
113# the build configuration file data is stored in the form
114#
115# {'builddate'}->string
[1302]116# {'buildtype'}->string
[4]117# {'metadata'}->array of strings
118# {'languages'}->array of strings
119# {'numdocs'}->string
[10161]120# {'numsections'}->string
[4]121# {'numwords'}->string
122# {'numbytes'}->string
[4192]123# {'maxnumeric'}->string
[1302]124# {'indexfields'}->array of strings
[2479]125# {'indexfieldmap'}->array of strings in the form "field->FI"
126# {'indexmap'} -> array of strings
[4810]127# {'indexlevels'} -> array of strings
[12897]128# {'stemindexes'} -> string (int)
[4810]129# {'textlevel'}->string
[9935]130# {'levelmap'} -> array of strings in the form "level->shortname"
[4]131sub read_build_cfg {
132 my ($filename) = @_;
133
134 return &cfgread::read_cfg_file ($filename,
[12897]135 q/^(builddate|buildtype|numdocs|numsections|numwords|numbytes|maxnumeric|textlevel|indexstem|stemindexes)$/,
136 q/^(indexmap|subcollectionmap|languagemap|notbuilt|indexfields|indexfieldmap|indexlevels|levelmap)$/);
137
[4]138}
139
140sub write_build_cfg {
141 my ($filename, $data) = @_;
142
143 &cfgread::write_cfg_file($filename, $data,
[12897]144 q/^(builddate|buildtype|numdocs|numsections|numwords|numbytes|maxnumeric|textlevel|indexstem|stemindexes)$/,
145 q/^(indexmap|subcollectionmap|languagemap|notbuilt|indexfields|indexfieldmap|indexlevels|levelmap)$/);
[4]146}
147
1481;
[2772]149
Note: See TracBrowser for help on using the repository browser.