1
# See bottom of file for license and copyright information
4
# ======================================================================
5
# Abstract base class of all configuration components. A configuration
6
# component may be a collection item (a ConfigSection) or an individual Value.
8
# Objects of this class are intended to form a tree with references in
9
# both directions, circular references ahead. But configure isn't
10
# supposed to be run in a persistent environment anyway.
11
package Foswiki::Configure::Item;
18
my $this = bless( {}, $class );
19
$this->{parent} = undef;
22
$this->{warnings} = 0;
33
$mum = $mum->{parent};
39
my ( $this, $desc ) = @_;
41
$this->{desc} .= "$desc\n";
49
die "Implementation required";
53
# Accept an attribute setting for this item (e.g. a key name).
54
# Sort of a generic write accessor.
56
my ( $this, %params ) = @_;
57
foreach my $k ( keys %params ) {
58
$this->{$k} = $params{$k};
63
# Increase a numeric value, recursing up to a parentless item
65
# All item levels have $key defined and initialized
66
# (intended for use with 'warnings' and 'errors')
67
# Parents of items are items (or precisely: can inc())
69
my ( $this, $key ) = @_;
72
$this->{parent}->inc($key) if $this->{parent};
75
sub getSectionObject {
86
# Foswiki - The Free and Open Source Wiki, http://foswiki.org/
88
# Copyright (C) 2008 Foswiki Contributors. All Rights Reserved.
89
# Foswiki Contributors are listed in the AUTHORS file in the root
90
# of this distribution. NOTE: Please extend that file, not this notice.
92
# Additional copyrights apply to some or all of the code in this
95
# Copyright (C) 2000-2006 TWiki Contributors. All Rights Reserved.
96
# TWiki Contributors are listed in the AUTHORS file in the root
97
# of this distribution. NOTE: Please extend that file, not this notice.
99
# This program is free software; you can redistribute it and/or
100
# modify it under the terms of the GNU General Public License
101
# as published by the Free Software Foundation; either version 2
102
# of the License, or (at your option) any later version. For
103
# more details read LICENSE in the root of this distribution.
105
# This program is distributed in the hope that it will be useful,
106
# but WITHOUT ANY WARRANTY; without even the implied warranty of
107
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
109
# As per the GPL, removal of this notice is prohibited.