Package fitnesse.wiki

Examples of fitnesse.wiki.WikiImportProperty


    importer.parseUrl("http://localhost:" + FitNesseUtil.PORT + "/PageOne");
    importer.setAutoUpdateSetting(true);
    WikiPage importedPage = localRoot.getChildPage("PageOne");
    importer.importWiki(importedPage);

    WikiImportProperty importProp = WikiImportProperty.createFrom(importedPage.getData().getProperties());
    assertTrue(importProp.isAutoUpdate());

    importer.setAutoUpdateSetting(false);
    importer.importWiki(importedPage);

    importProp = WikiImportProperty.createFrom(importedPage.getData().getProperties());
    assertFalse(importProp.isAutoUpdate());
  }
View Full Code Here


  @Test
  public void testAutoUpdate_NewPage() throws Exception {
    importer.setAutoUpdateSetting(true);
    importer.enterChildPage(pageOne, Clock.currentDate());

    WikiImportProperty importProps = WikiImportProperty.createFrom(pageOne.getData().getProperties());
    assertTrue(importProps.isAutoUpdate());
  }
View Full Code Here

    pageOne.commit(data);

    importer.setAutoUpdateSetting(true);
    importer.enterChildPage(pageOne, new Date(0));

    WikiImportProperty importProps = WikiImportProperty.createFrom(pageOne.getData().getProperties());
    assertTrue(importProps.isAutoUpdate());
  }
View Full Code Here

  private WikiPage addLocalPageWithImportProperty(WikiPage parentPage, String pageName, boolean isRoot) throws Exception {
    WikiPage page = parentPage.addChildPage(pageName);
    PageData data = page.getData();

    WikiPagePath pagePath = page.getPageCrawler().getFullPath();
    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;
  }
View Full Code Here

  public static void handleImportProperties(HtmlPage html, WikiPage page) {
    PageData pageData = page.getData();
    if (WikiImportProperty.isImportedSubWiki(pageData)) {
      html.setBodyClass("imported");
      WikiImportProperty importProperty = WikiImportProperty.createFrom(pageData.getProperties());
      html.put("sourceUrl", importProperty.getSourceUrl());
    }
  }
View Full Code Here

  private void filterOrphans(WikiPage context) {
    for (WikiPagePath aPageCatalog : pageCatalog) {
      WikiPagePath wikiPagePath = aPageCatalog;
      WikiPage unrecognizedPage = context.getPageCrawler().getPage(wikiPagePath);
      PageData data = unrecognizedPage.getData();
      WikiImportProperty importProps = WikiImportProperty.createFrom(data.getProperties());

      if (importProps != null && !importProps.isRoot()) {
        orphans.add(wikiPagePath);
      }
    }
  }
View Full Code Here

    relativePath.addNameToEnd(childPage.getName());
    localPath.addNameToEnd(childPage.getName());

    PageData data = childPage.getData();
    WikiPageProperties props = data.getProperties();
    WikiImportProperty importProps = WikiImportProperty.createFrom(props);
    if (importProps != null) {
      Date lastRemoteModification = importProps.getLastRemoteModificationTime();
      if (lastModified.after(lastRemoteModification))
        importRemotePageContent(childPage);
      else {
        unmodifiedCount++;
        configureAutoUpdateSetting(importProps, data, childPage);
View Full Code Here

  }

  public void configureAutoUpdateSetting(WikiPage page) {
    PageData data = page.getData();
    WikiPageProperties props = data.getProperties();
    WikiImportProperty importProps = WikiImportProperty.createFrom(props);
    if (importProps != null)
      configureAutoUpdateSetting(importProps, data, page);
  }
View Full Code Here

      PageData remoteData = new PageXmlizer().deXmlizeData(doc);

      WikiPageProperties remoteProps = remoteData.getProperties();
      remoteProps.remove(PageData.PropertyEDIT);

      WikiImportProperty importProperty = new WikiImportProperty(remoteUrl());
      Date lastModificationTime = remoteProps.getLastModificationTime();
      importProperty.setLastRemoteModificationTime(lastModificationTime);
      importProperty.setAutoUpdate(autoUpdateSetting);
      importProperty.addTo(remoteProps);

      localPage.commit(remoteData);

      importerClient.pageImported(localPage);
    }
View Full Code Here

  public WikiImportingTraverser(WikiImporter wikiImporter, WikiPage page, String remoteWikiUrl) throws IOException {
    this.importer = wikiImporter;
    this.page = page;
    this.data = page.getData();
    this.pagePath = page.getPageCrawler().getFullPath();
    WikiImportProperty importProperty = WikiImportProperty.createFrom(data.getProperties());
    if (importProperty != null) {
      this.remoteWikiUrl = importProperty.getSourceUrl();
      this.isUpdate = true;
      this.isNonRoot = !importProperty.isRoot();
    } else {
      this.remoteWikiUrl = remoteWikiUrl;
      this.isUpdate = false;
      this.isNonRoot = false;
    }
View Full Code Here

TOP

Related Classes of fitnesse.wiki.WikiImportProperty

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.