01: /**
02: * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, version 2.1, dated February 1999.
03: *
04: * This program is free software; you can redistribute it and/or modify
05: * it under the terms of the latest version of the GNU Lesser General
06: * Public License as published by the Free Software Foundation;
07: *
08: * This program is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11: * GNU Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public License
14: * along with this program (LICENSE.txt); if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16: */package org.jamwiki.utils;
17:
18: import org.jamwiki.WikiConfiguration;
19:
20: /**
21: * Class for controlling "pseudotopics". A pseudotopic is a topic name that maps to
22: * an internal Wikk page, such as Special:RecentChanges and Special:Edit. The
23: * mappings of topic names to redirect URLs are persisted in
24: * <code>/WEB-INF/classes/jamwiki-configuration.xml</code>.
25: *
26: * @see org.jamwiki.WikiConfiguration
27: */
28: public class PseudoTopicHandler {
29:
30: /** Logger */
31: private static final WikiLogger logger = WikiLogger
32: .getLogger(PseudoTopicHandler.class.getName());
33:
34: /**
35: *
36: */
37: private PseudoTopicHandler() {
38: }
39:
40: /**
41: * Return true if there is a mapping for the given topic
42: *
43: * @param pseudotopicName The name of the pseudo-topic that is being tested
44: * for existence.
45: * @return <code>true</code> if a pseudo-topic with the specified name
46: * exists, <code>false</code> otherwise.
47: */
48: public static boolean isPseudoTopic(String pseudotopicName) {
49: return WikiConfiguration.getInstance().getPseudotopics()
50: .contains(pseudotopicName);
51: }
52: }
|