private boolean isInternalPageThatDoesntExist(String linkPath) { String expandedPath = WikiWordReference.expandPrefix(page, linkPath); WikiPagePath path = PathParser.parse(expandedPath); if (path == null) { return true; } WikiPage start = path.isRelativePath() ? page.getParent() : page; // TODO -AcD- a better way? return !start.getPageCrawler().pageExists(path); }
protected WikiPage createInternalSymbolicPage( String linkPath, String linkName, WikiPage parent) { WikiPagePath path = PathParser.parse(linkPath); if (path == null) { return null; } WikiPage start = (path.isRelativePath()) ? parent.getParent() : parent; // TODO -AcD- a better way? WikiPage wikiPage = start.getPageCrawler().getPage(path); if (wikiPage != null) wikiPage = new SymbolicPage(linkName, wikiPage, parent); return wikiPage; }
private String makePathForSymbolicLink(String linkPath) { WikiPagePath wikiPagePath = PathParser.parse(linkPath); if (wikiPagePath != null) { WikiPage parent = wikiPagePath.isRelativePath() ? page.getParent() : page; PageCrawler crawler = parent.getPageCrawler(); WikiPage target = crawler.getPage(wikiPagePath); WikiPagePath fullPath; if (target != null) { fullPath = target.getPageCrawler().getFullPath(); fullPath.makeAbsolute(); } else fullPath = new WikiPagePath(); return fullPath.toString(); } return null; }
private String makePathForSymbolicLink(String linkPath) throws Exception { WikiPagePath wikiPagePath = PathParser.parse(linkPath); if (wikiPagePath != null) { WikiPage parent = wikiPagePath.isRelativePath() ? page.getParent() : page; // TODO // -AcD- // a // better // way? PageCrawler crawler = parent.getPageCrawler(); WikiPage target = crawler.getPage(parent, wikiPagePath); WikiPagePath fullPath; if (target != null) { fullPath = crawler.getFullPath(target); fullPath.makeAbsolute(); } else fullPath = new WikiPagePath(); return fullPath.toString(); } return null; }