Package fitnesse.wiki

Examples of fitnesse.wiki.PageCrawler


      return tag.getAttributeEx(mAttribute).getValue().startsWith(mValue);
    }
  }

  public boolean pageHasAttribute(String fullPathOfPage, String attribute) throws Exception {
    PageCrawler crawler = FitnesseFixtureContext.root.getPageCrawler();
    WikiPage page = crawler.getPage(PathParser.parse(fullPathOfPage));
    PageData data = page.getData();
    return data.hasAttribute(attribute);
  }
View Full Code Here


  protected String getRelativeName() {
    return relativeName;
  }

  protected String getRelativeName(WikiTestPage testPage) {
    PageCrawler pageCrawler = getPage().getPageCrawler();
    String relativeName = pageCrawler.getRelativeName(testPage.getSourcePage());
    if ("".equals(relativeName)) {
      relativeName = String.format("(%s)", testPage.getName());
    }
    return relativeName;
  }
View Full Code Here

    return response;
  }

  protected void loadPage(String pageName, FitNesseContext context) {
    WikiPagePath path = PathParser.parse(pageName);
    PageCrawler crawler = context.root.getPageCrawler();
    page = crawler.getPage(path);
    if (page != null)
      pageData = page.getData();
  }
View Full Code Here

    WikiPage root = InMemoryPage.makeRoot("RooT");
    WikiPageUtil.addPage(root, PathParser.parse("ProjectOne"),
            "!path path2\n" +
                    "!path path 3");
    WikiPageUtil.addPage(root, PathParser.parse("ProjectOne.TesT"), "!path path1");
    PageCrawler pageCrawler = root.getPageCrawler();
    List<String> cp = builder.getClassPath(pageCrawler.getPage(PathParser.parse("ProjectOne.TesT")));
    assertSubString("path1", cp.get(0));
    assertSubString("path2", cp.get(1));
    assertSubString("path 3", cp.get(2));
  }
View Full Code Here

  private String makeClassPathFromSimpleStructure(String path) throws Exception {
    PageData data = root.getData();
    data.setContent("!path " + path);
    root.commit(data);
    PageCrawler crawler = root.getPageCrawler();
    WikiPage page = crawler.getPage(somePagePath, new MockingPageCrawler());
    List<String> classPath = builder.getClassPath(page);
    return StringUtils.join(classPath, System.getProperty("path.separator"));
  }
View Full Code Here

  private WikiPage root;
  private WikiPage page;

  public void pageRenderingSetUp() throws Exception {
    root = InMemoryPage.makeRoot("root");
    PageCrawler crawler = root.getPageCrawler();
  }
View Full Code Here

      addToResponse("</span>");
    }
  }

  private HtmlPage makeHtml() {
    PageCrawler pageCrawler = page.getPageCrawler();
    WikiPagePath fullPath = pageCrawler.getFullPath();
    String fullPathName = PathParser.render(fullPath);
    HtmlPage htmlPage = context.pageFactory.newPage();
    htmlPage.setTitle(getTitle() + ": " + fullPathName);
    htmlPage.setPageTitle(new PageTitle(getTitle(), fullPath, data.getAttribute(PageData.PropertySUITES)));
    htmlPage.setNavTemplate("testNav.vm");
View Full Code Here

    html.put(EditResponder.HELP_TEXT, "");

    WikiPage parentWikiPage = getParentWikiPage(context, request);
    html.put(EditResponder.TEMPLATE_MAP, TemplateUtil.getTemplateMap(parentWikiPage));
    if (request.hasInput(PAGE_TEMPLATE)) {
      PageCrawler crawler = context.root.getPageCrawler();
      String pageTemplate = (String) request.getInput(PAGE_TEMPLATE);
      WikiPage template = crawler.getPage(PathParser.parse(pageTemplate));
      html.put(EditResponder.CONTENT_INPUT_NAME, template.getData().getContent());
      html.put(EditResponder.PAGE_TYPE, PageType.fromWikiPage(template));
      html.put(PAGE_TEMPLATE, pageTemplate);
    } else if (request.hasInput(PAGE_TYPE)) {
      String pageType = (String) request.getInput(PAGE_TYPE);
View Full Code Here

  private WikiPage getParentWikiPage(FitNesseContext context, Request request) {
    //the request resource is already th parent path.
    WikiPagePath parentPath = PathParser.parse(request.getResource());

    //we need a pageBuilder to get the page from the path. The root has a pageBuilder we can use.
    PageCrawler crawler = context.root.getPageCrawler();
    WikiPage page = crawler.getPage(parentPath);
    return page;
  }
View Full Code Here

    String resource = request.getResource();

    String tags = "";
    if(context.root != null){
      WikiPagePath path = PathParser.parse(resource);
      PageCrawler crawler = context.root.getPageCrawler();
      WikiPage wikiPage = crawler.getPage(path);
      if(wikiPage != null) {
        PageData pageData = wikiPage.getData();
        tags = pageData.getAttribute(PageData.PropertySUITES);
      }
    }
View Full Code Here

TOP

Related Classes of fitnesse.wiki.PageCrawler

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.