01: // Copyright (C) 2003,2004,2005 by Object Mentor, Inc. All rights reserved.
02: // Released under the terms of the GNU General Public License version 2 or later.
03: package fitnesse.wiki;
04:
05: //TODO rename me
06: public class VirtualEnabledPageCrawler implements
07: PageCrawlerDeadEndStrategy {
08: public WikiPage getPageAfterDeadEnd(WikiPage context,
09: WikiPagePath restOfPath, PageCrawler crawler)
10: throws Exception {
11: String name = restOfPath.getFirst();
12: restOfPath = restOfPath.getRest();
13: if (context.hasExtension(VirtualCouplingExtension.NAME)) {
14: VirtualCouplingExtension extension = (VirtualCouplingExtension) context
15: .getExtension(VirtualCouplingExtension.NAME);
16: WikiPage coupling = extension.getVirtualCoupling();
17: WikiPage child = coupling.getChildPage(name);
18: if (child != null)
19: return crawler.getPage(child, restOfPath);
20: else
21: return null;
22: } else
23: return null;
24:
25: }
26: }
|