1 | # reads in a collection configuration file
|
---|
2 |
|
---|
3 | package colcfg;
|
---|
4 |
|
---|
5 | use 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 | # {'languages'}->array of strings
|
---|
16 | # {'subcollection'}->hash of key-value pairs
|
---|
17 | # {'indexsubcollections'}->array of strings
|
---|
18 | # {'indexes'}->array of strings
|
---|
19 | # {'defaultindex'}->string
|
---|
20 | # {'plugins'}->array of strings
|
---|
21 |
|
---|
22 | sub read_collect_cfg {
|
---|
23 | my ($filename) = @_;
|
---|
24 |
|
---|
25 | return &cfgread::read_cfg_file ($filename,
|
---|
26 | '^(creator|public|beta|key|defaultindex|importdir|' .
|
---|
27 | 'archivedir|cachedir|builddir|textindex|removeold)$',
|
---|
28 | '^(maintainer|languages|indexsubcollections|indexes|plugins)$',
|
---|
29 | '^(subcollection)$');
|
---|
30 | }
|
---|
31 |
|
---|
32 | sub write_collect_cfg {
|
---|
33 | my ($filename, $data) = @_;
|
---|
34 |
|
---|
35 | &cfgread::write_cfg_file($filename, $data,
|
---|
36 | '^(creator|public|beta|key|defaultindex|importdir|' .
|
---|
37 | 'archivedir|cachedir|builddir|textindex|removeold)$',
|
---|
38 | '^(maintainer|languages|indexsubcollections|indexes|plugins)$',
|
---|
39 | '^(subcollection)$');
|
---|
40 | }
|
---|
41 |
|
---|
42 |
|
---|
43 | # the build configuration file data is stored in the form
|
---|
44 | #
|
---|
45 | # {'builddate'}->string
|
---|
46 | # {'metadata'}->array of strings
|
---|
47 | # {'languages'}->array of strings
|
---|
48 | # {'numdocs'}->string
|
---|
49 | # {'numwords'}->string
|
---|
50 | # {'numbytes'}->string
|
---|
51 |
|
---|
52 | sub read_build_cfg {
|
---|
53 | my ($filename) = @_;
|
---|
54 |
|
---|
55 | return &cfgread::read_cfg_file ($filename,
|
---|
56 | '^(builddate|numdocs|numwords|numbytes)$',
|
---|
57 | '^(metadata|languages)$');
|
---|
58 | }
|
---|
59 |
|
---|
60 | sub write_build_cfg {
|
---|
61 | my ($filename, $data) = @_;
|
---|
62 |
|
---|
63 | &cfgread::write_cfg_file($filename, $data,
|
---|
64 | '^(builddate|numdocs|numwords|numbytes)$',
|
---|
65 | '^(metadata|languages)$');
|
---|
66 | }
|
---|
67 |
|
---|
68 |
|
---|
69 | 1;
|
---|