Last change
on this file since 32158 was 29681, checked in by Jeremy Symon, 9 years ago |
Fix site template (just use the localsite config - will need to be changed to be more reliable in case localsite was renamed)
|
File size:
618 bytes
|
Line | |
---|
1 | package Greenstone::Site;
|
---|
2 |
|
---|
3 | use strict;
|
---|
4 | use warnings;
|
---|
5 | use utf8;
|
---|
6 | use Greenstone::Directory;
|
---|
7 | use Greenstone::XML::Tidy;
|
---|
8 | use parent 'Greenstone::Directory';
|
---|
9 |
|
---|
10 | my $dir = "sites";
|
---|
11 |
|
---|
12 | sub new {
|
---|
13 | return Greenstone::Directory::new ($dir, @_);
|
---|
14 | }
|
---|
15 |
|
---|
16 | sub list {
|
---|
17 | return Greenstone::Directory::list $dir;
|
---|
18 | }
|
---|
19 |
|
---|
20 | my $configTemplate;
|
---|
21 |
|
---|
22 | sub create {
|
---|
23 | my $self = shift;
|
---|
24 | $self->SUPER::create or return 0;
|
---|
25 | my $dir = $self->dir;
|
---|
26 | mkdir "$dir/collect" or die "Failed to create collections directory: $!\n";
|
---|
27 | my $config = read_xml "$dir/../localsite/siteConfig.xml";
|
---|
28 | return write_xml $config, "$dir/siteConfig.xml";
|
---|
29 | }
|
---|
30 |
|
---|
31 | 1;
|
---|
32 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.