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

Last change on this file since 75 was 69, checked in by sjboddie, 26 years ago

Sub-collection indexes may now be defined within the collect.cfg file as
subcollection blah1 Title/blah/i
subcollection blah2 !Title/blah/i
indexsubcollections blah1 blah2 blah1,blah2
indexes section:text document:text
This example would create section:text and document:text indexes for:

  1. the blah1 subcollection (i.e those documents whose Title field contains 'blah')
  2. the blah2 subcollection (i.e. those documents whose Title field doesn't contain 'blah')
  3. both subcollections (i.e. all documents)

The field to match the regular expression against (Title in this example) may be
any valid metadata tag or 'filename'.
The regular expression (blah in this example) may be any valid perl regular expression.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1# reads in a collection configuration file
2
3package colcfg;
4
5use cfgread;
6
7
8# the collection configuration file data is stored in the form
9#
10# {'creator'}->string
11# {'maintainer'}->array of strings
12# {'public'}->string
13# {'beta'}->string
14# {'key'}->string
15# {'subcollection'}->hash of key-value pairs
16# {'indexsubcollections'}->array of strings
17# {'indexes'}->array of strings
18# {'defaultindex'}->string
19# {'plugins'}->array of strings
20
21sub read_collect_cfg {
22 my ($filename) = @_;
23
24 return &cfgread::read_cfg_file ($filename,
25 '^(creator|public|beta|key|defaultindex)$',
26 '^(maintainer|indexsubcollections|indexes|plugins)$',
27 '^(subcollection)$');
28}
29
30sub write_collect_cfg {
31 my ($filename, $data) = @_;
32
33 &cfgread::write_cfg_file($filename, $data,
34 '^(creator|public|beta|key|defaultindex)$',
35 '^(maintainer|subcollection|indexsubcollections|indexes|plugins)$',
36 '^(subcollection)$');
37}
38
39
40# the build configuration file data is stored in the form
41#
42# {'builddate'}->string
43# {'metadata'}->array of strings
44# {'languages'}->array of strings
45# {'numdocs'}->string
46# {'numwords'}->string
47# {'numbytes'}->string
48
49sub read_build_cfg {
50 my ($filename) = @_;
51
52 return &cfgread::read_cfg_file ($filename,
53 '^(builddate|numdocs|numwords|numbytes)$',
54 '^(metadata|languages)$');
55}
56
57sub write_build_cfg {
58 my ($filename, $data) = @_;
59
60 &cfgread::write_cfg_file($filename, $data,
61 '^(builddate|numdocs|numwords|numbytes)$',
62 '^(metadata|languages)$');
63}
64
65
661;
Note: See TracBrowser for help on using the repository browser.