1
# Module of Foswiki - The Free and Open Source Wiki, http://foswiki.org/
3
# Copyright (C) 2004 Wind River Systems Inc.
4
# Copyright (C) 1999-2006 Foswiki Contributors.
5
# All Rights Reserved. Foswiki Contributors
6
# are listed in the AUTHORS file in the root of this distribution.
7
# NOTE: Please extend that file, not this notice.
9
# This program is free software; you can redistribute it and/or
10
# modify it under the terms of the GNU General Public License
11
# as published by the Free Software Foundation; either version 2
12
# of the License, or (at your option) any later version. For
13
# more details read LICENSE in the root of this distribution.
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.
19
# As per the GPL, removal of this notice is prohibited.
25
---+ package Foswiki::Contrib::MailerContrib::UpData
26
Object that lazy-scans topics to extract
31
package Foswiki::Contrib::MailerContrib::UpData;
36
* =$web= - Web we are building parent relationships for
37
Constructor for a web; initially empty, will lazy-load as topics
43
my ( $class, $session, $web ) = @_;
44
my $this = bless( {}, $class );
46
$this->{session} = $session;
52
---++ getParent($topic) -> string
53
Get the name of the parent topic of the given topic
58
my ( $this, $topic ) = @_;
60
if ( ! defined( $this->{parent}{$topic} )) {
62
Foswiki::Func::readTopic( $this->{web}, $topic );
63
my $parent = $meta->get('TOPICPARENT');
64
$this->{parent}{$topic} = $parent->{name} if $parent;
65
$this->{parent}{$topic} ||= '';
68
return $this->{parent}{$topic};