Package fitnesse.html.template

Examples of fitnesse.html.template.HtmlPage


  private void setRedirectForDirectory(Response response) {
    response.redirect(context.contextRoot, resource + "/");
  }

  private String makeDirectoryListingPage() {
    HtmlPage page = context.pageFactory.newPage();
    page.setTitle("Files: " + resource);
    //page.header.use(HtmlUtil.makeBreadCrumbsWithPageType(resource, "/", "Files Section"));
    page.setPageTitle(new PageTitle("Files Section", resource, "/"));
    page.put("fileInfoList", makeFileInfo(FileUtil.getDirectoryListing(requestedDirectory)));
    page.setMainTemplate("directoryPage");
    return page.html();
  }
View Full Code Here


  public Response makeResponse(FitNesseContext context, Request request) {
    String resource = request.getResource();
    String filename = (String) request.getInput("filename");
   
    HtmlPage page = context.pageFactory.newPage();
    page.setTitle("Rename " + filename);
    page.setPageTitle(new PageTitle("Rename File", resource + filename, "/"));
    page.setMainTemplate("renameFileConfirmation");
    page.put("filename", filename);
    page.put("resource", resource);

    SimpleResponse response = new SimpleResponse();
    response.setContent(page.html());
    return response;
  }
View Full Code Here

  protected void doSending() throws Exception {
    data = page.getData();

    wikiImportingTraverser = initializeImporter();
    HtmlPage htmlPage = makeHtml();

    htmlPage.render(response.getWriter());

    response.closeAll();
  }
View Full Code Here

    if (request.hasInput("remotePassword"))
      importer.setRemotePassword((String) request.getInput("remotePassword"));
  }

  private HtmlPage makeHtml() throws Exception {
    HtmlPage html = context.pageFactory.newPage();
    String title = "Wiki Import";
    if (wikiImportingTraverser.isUpdate())
      title += " Update";
    String localPathName = PathParser.render(path);
    html.setTitle(title + ": " + localPathName);
    html.setPageTitle(new PageTitle(title, path));
    html.setMainTemplate("wikiImportingPage");
    html.put("isUpdate", wikiImportingTraverser.isUpdate());
    String pageName = PathParser.render(path);
    html.put("pageName", pageName);
    html.put("remoteUrl", importer.remoteUrl());
    html.put("importer", importer);
    html.put("PathParser", PathParser.class);
    html.put("importTraverser", wikiImportingTraverser);
    return html;
  }
View Full Code Here

    return false;
  }

  private Response makeValidResponse(Request request) {
    int count = 0;
    HtmlPage page = context.pageFactory.newPage();
    page.setTitle("History Comparison");
    page.setPageTitle(makePageTitle(request.getResource()));
    if (!testing) {
      page.put("firstFileName", formatDate(firstFileName));
      page.put("secondFileName", formatDate(secondFileName));
      page.put("completeMatch", comparer.allTablesMatch());
      page.put("comparer", comparer);
    }
    page.put("resultContent", comparer.getResultContent());
    page.put("firstTables", comparer.firstTableResults);
    page.put("secondTables", comparer.secondTableResults);
    page.put("count", count);
    page.setMainTemplate("compareHistory");

    SimpleResponse response = new SimpleResponse();
    response.setContent(page.html());
    return response;
  }
View Full Code Here

    response.setContent(makeHtml(context));
    return response;
  }

  private String makeHtml(FitNesseContext context) {
    HtmlPage page = context.pageFactory.newPage();
    page.addTitles("Not Found:" + resource);
    page.put("name", resource);
    page.put("shouldCreate", PathParser.isWikiPath(resource));
    page.setMainTemplate("notFoundPage.vm");
    return page.html();
  }
View Full Code Here

    this.statusCode = statusCode;
  }

  public Response makeResponse(FitNesseContext context, Request request) {
    SimpleResponse response = new SimpleResponse(statusCode);
    HtmlPage html = context.pageFactory.newPage();
    html.addTitles("Error Occured");
    html.setMainTemplate("error");
    html.put("exception", exception);
    if (exception != null)
      html.put("exception", exception);
    if (message != null)
      html.put("message", message);
    response.setContent(html.html());

    return response;
  }
View Full Code Here

  protected PageCrawler getPageCrawler() {
    return root.getPageCrawler();
  }

  protected void doSending() {
    HtmlPage htmlPage = context.pageFactory.newPage();
    htmlPage.setTitle(getTitle());
    htmlPage.setPageTitle(new PageTitle(getTitle()) {
      public String getTitle() {
        return "search";
      }

      public String getLink() {
        return null;
      }
    });
    htmlPage.setMainTemplate("searchResults");

    if (page == null)
      page = context.root.getPageCrawler().getPage(PathParser.parse("FrontPage"));
    if (request.getQueryString() == null || request.getQueryString().equals(""))
      htmlPage.put("request", request.getBody());
    else
      htmlPage.put("request", request.getQueryString());
    htmlPage.put("page", page);
    htmlPage.put("viewLocation", request.getResource());
    htmlPage.setNavTemplate("viewNav");
    htmlPage.put("resultResponder", this);
   
    htmlPage.render(response.getWriter());
   
    response.closeAll();
  }
View Full Code Here

  public static final String[] SPECIAL_ATTRIBUTES = { "SetUp", "TearDown" };

  public Response makeResponse(FitNesseContext context, Request request) {
    SimpleResponse response = new SimpleResponse();

    HtmlPage html = context.pageFactory.newPage();
    html.setMainTemplate("searchForm");
    html.setTitle("Search Form");
    html.setPageTitle(new PageTitle("Search Form"));
    html.put("viewLocation", request.getResource());
    html.setNavTemplate("viewNav");
    html.put("pageTypeAttributes", PageType.values());
    html.put("actionAttributes", SEARCH_ACTION_ATTRIBUTES);
    html.put("navigationAttributes", SEARCH_NAVIGATION_ATTRIBUTES);
    html.put("securityAttributes", SECURITY_ATTRIBUTES);
    html.put("specialAttributes", SPECIAL_ATTRIBUTES);
    html.put("request", request);

    response.setContent(html.html());

    return response;
  }
View Full Code Here

      return makeTestHistoryResponse(testHistory, request, pageName);
    }
  }

  private Response makeTestHistoryResponse(TestHistory testHistory, Request request, String pageName) {
    HtmlPage page = context.pageFactory.newPage();
    page.setTitle("Test History");
    page.setPageTitle(new PageTitle(makePageTitle(pageName)));
    page.setNavTemplate("viewNav");
    page.put("viewLocation", request.getResource());
    page.put("testHistory", testHistory);
    page.setMainTemplate("testHistory");
    SimpleResponse response = new SimpleResponse();
    response.setContent(page.html());
    return response;
  }
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.