private void addImportPropertyToPage(WikiPage page, boolean isRoot, boolean autoUpdate) throws Exception { PageData data = page.getData(); String sourceUrl = FitNesseUtil.URL + "PageOne"; WikiImportProperty importProps = new WikiImportProperty(sourceUrl); importProps.setRoot(isRoot); importProps.setAutoUpdate(autoUpdate); importProps.addTo(data.getProperties()); pageOne.commit(data); }
@Test public void testImportedPageIndication() throws Exception { final WikiPage page = WikiPageUtil.addPage(root, PathParser.parse("SamplePage")); final PageData data = page.getData(); final WikiImportProperty importProperty = new WikiImportProperty("blah"); importProperty.addTo(data.getProperties()); page.commit(data); final String content = requestPage("SamplePage").getContent(); assertSubString("<body class=\"imported\">", content); }
private WikiPage addLocalPageWithImportProperty( WikiPage parentPage, String pageName, boolean isRoot) throws Exception { WikiPage page = parentPage.addChildPage(pageName); PageData data = page.getData(); WikiPagePath pagePath = localRoot.getPageCrawler().getFullPath(page); WikiImportProperty importProps = new WikiImportProperty( "http://localhost:" + FitNesseUtil.port + "/" + PathParser.render(pagePath)); if (isRoot) importProps.setRoot(true); importProps.addTo(data.getProperties()); page.commit(data); return page; }