01: package fitnesse.components;
02:
03: import java.util.Set;
04:
05: import fitnesse.wiki.PageCrawler;
06: import fitnesse.wiki.WikiPage;
07:
08: public class CrawlingTagManager implements TagManager {
09:
10: private static final TagManager instance = new CrawlingTagManager();
11:
12: public static TagManager getInstance() {
13: return instance;
14: }
15:
16: public void recordTagsForPage(WikiPage page) {
17: //Ignored. Everything is done in pagesForTags.
18: }
19:
20: public Set pagesForTags(WikiPage root, String[] tags,
21: boolean anyTags, boolean noTags) throws Exception {
22: PageCrawler crawler = root.getPageCrawler();
23: TagMatchingListener tagMatchingListener = new TagMatchingListener(
24: tags, anyTags, noTags);
25: crawler.traverse(root, tagMatchingListener);
26: return tagMatchingListener.getPages();
27: }
28:
29: public void clearIndex() {
30: }
31:
32: public void removeExistingTagsForPage(WikiPage wikiPage) {
33: }
34:
35: }
|