Package fitnesse.html.template

Examples of fitnesse.html.template.HtmlPage


  public Response makeResponse(FitNesseContext context, Request request) throws Exception {
    this.context = context;
    loadPage(request.getResource(), context);

    SimpleResponse response = new SimpleResponse();
    HtmlPage html = context.pageFactory.newPage();
    html.setMainTemplate("render.vm");
    html.put("content", new SlimRenderer());
    response.setContent(html.html());
    return response;
  }
View Full Code Here


    return response;
  }

  private String html(FitNesseContext context) {
    HtmlPage page = context.pageFactory.newPage();
    page.addTitles("Stopping tests");
    page.put("testId", testId);
    page.put("runningTestingTracker", SuiteResponder.runningTestingTracker);
    page.setMainTemplate("stopTestPage.vm");
    return page.html();
  }
View Full Code Here

    assertSubString("<a href=\"SamplePage?edit\" accesskey=\"e\">Edit Locally</a>", content);
    assertSubString("<a href=\"blah?responder=edit&amp;redirectToReferer=true&amp;redirectAction=importAndView\">Edit Remotely</a>", content);
  }

  private String getContentAfterSpecialImportHandling() {
    HtmlPage html = new PageFactory(FitNesseUtil.makeTestContext()).newPage();
    WikiImportingResponder.handleImportProperties(html, page);
    html.setNavTemplate("wikiNav.vm");
    html.put("actions", new WikiPageActions(page));
    return html.html();
  }
View Full Code Here

  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");
    htmlPage.put("actions", new WikiPageActions(page));
    htmlPage.setMainTemplate(mainTemplate());
    htmlPage.put("testExecutor", new TestExecutor());
    htmlPage.setFooterTemplate("wikiFooter.vm");
    htmlPage.put("headerContent", new WikiPageHeaderRenderer());
    htmlPage.put("footerContent", new WikiPageFooterRenderer());
    htmlPage.setErrorNavTemplate("errorNavigator");
    htmlPage.put("errorNavOnDocumentReady", false);
    htmlPage.put("multipleTestsRun", isMultipleTestsRun());
    WikiImportingResponder.handleImportProperties(htmlPage, page);

    return htmlPage;
  }
View Full Code Here

    response.setContent(doMakeHtml(context, request));
    return response;
  }

  private String doMakeHtml(FitNesseContext context, Request request) {
    HtmlPage html = context.pageFactory.newPage();
    html.setTitle("New page");

    html.setPageTitle(new PageTitle("New Page", PathParser.parse(request.getResource())));
    html.setMainTemplate("editPage");
    makeEditForm(html, context, request);

    return html.html();
  }
View Full Code Here

    return response;
  }

  private String makePageHtml(FitNesseContext context) {
    HtmlPage page = context.pageFactory.newPage();
    page.setTitle("Merge " + resource);
    page.setPageTitle(new PageTitle("Merge Changes", PathParser.parse(resource)));
    page.setMainTemplate("mergePage");
    page.put("editTime", SaveRecorder.timeStamp());
    page.put("ticketId", SaveRecorder.newTicket());
    page.put("oldContent", HtmlUtil.escapeHTML(existingContent));
    page.put("newContent", newContent);
    addHiddenAttributes(page);
    return page.html();
  }
View Full Code Here

    assertEquals("ab&amp;cd&amp;ef&amp;", HtmlUtil.escapeHTML("ab&cd&ef&"));
  }

  private String getActionsHtml(String pageName) {
    WikiPageUtil.addPage(root, PathParser.parse(pageName), "");
    HtmlPage htmlPage = context.pageFactory.newPage();
    htmlPage.setNavTemplate("wikiNav.vm");
    htmlPage.put("actions", new WikiPageActions(root.getChildPage(pageName)));
    return htmlPage.html();
  }
View Full Code Here

        PageData pageData = wikiPage.getData();
        tags = pageData.getAttribute(PageData.PropertySUITES);
      }
    }
   
    HtmlPage page = context.pageFactory.newPage();

    page.setMainTemplate("refactorForm");
    page.setTitle("Refactor: " + resource);
    page.setPageTitle(new PageTitle("Refactor", PathParser.parse(resource), tags));
    page.put("refactoredRootPage", resource);
    page.put("request", request);
    page.put("type", request.getInput("type"));
    page.put("viewLocation", request.getResource());
    SimpleResponse response = new SimpleResponse();
    response.setContent(page.html());
    return response;
  }
View Full Code Here

    WikiPage page = pageCrawler.getPage(path);
    if (page == null)
      return new NotFoundResponder().makeResponse(context, request);

    String fullPathName = PathParser.render(page.getPageCrawler().getFullPath());
    HtmlPage html = makeHtml(fullPathName, page, context, request);

    SimpleResponse response = new SimpleResponse();
    response.setContent(html.html());

    return response;
  }
View Full Code Here

    return response;
  }

  private HtmlPage makeHtml(String name, WikiPage page, FitNesseContext context, Request request) {
    WikiPage pageVersion = page.getVersion(version);
    HtmlPage html = context.pageFactory.newPage();
    html.setTitle("Version " + version + ": " + name);
    html.setPageTitle(new PageTitle("Version " + version, PathParser.parse(resource), pageVersion.getData().getAttribute(PageData.PropertySUITES)));
    // TODO: subclass actions for specific rollback behaviour.
    html.setNavTemplate("versionNav.vm");
    html.put("rollbackVersion", version);
    html.put("localPath", name);

    List<VersionInfo> versions = new ArrayList<VersionInfo>(page.getVersions());
    Collections.sort(versions);
    Collections.reverse(versions);
    String nextVersion = selectNextVersion(versions, version);
    html.put("nextVersion", nextVersion);
    String previousVersion = selectPreviousVersion(versions, version);
    html.put("previousVersion", previousVersion);

    html.setMainTemplate("wikiPage");
    html.put("content", new VersionRenderer(pageVersion, request));
    return html;
  }
View Full Code Here

TOP

Related Classes of fitnesse.html.template.HtmlPage

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.