コード例 #1
0
 /** Display a message in lieu of the normal page */
 protected void displayMsgInLieuOfPage(String msg) throws IOException {
   // TODO: Look at HTML
   Page page = newPage();
   Composite warning = new Composite();
   warning.add(msg);
   warning.add("<br>");
   page.add(warning);
   layoutFooter(page);
   page.write(resp.getWriter());
 }
コード例 #2
0
 protected Page addBarePageHeading(Page page) {
   // FIXME: Move the following fragment elsewhere
   // It causes the doctype statement to appear in the middle,
   // after the <body> tag.
   page.add("<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">");
   page.addHeader("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
   page.addHeader("<meta http-equiv=\"content-type\" content=\"text/html;charset=ISO-8859-1\">");
   page.addHeader("<link rel=\"shortcut icon\" href=\"/favicon.ico\" type=\"image/x-icon\" />");
   return page;
 }
コード例 #3
0
 // Called when a servlet doesn't get the parameters it expects/needs
 protected void paramError() throws IOException {
   // FIXME: As of 2006-03-15 this method and its only caller checkParam() are not called from
   // anywhere
   PrintWriter wrtr = resp.getWriter();
   Page page = new Page();
   // add referer, params, msg to contact lockss unless from old bookmark
   // or manually entered url
   page.add("Parameter error");
   page.write(wrtr);
 }
コード例 #4
0
  /** Common page setup. */
  protected Page newPage() {
    // Compute heading
    String heading = getHeading();
    if (heading == null) {
      heading = "Box Administration";
    }

    // Create page and layout header
    Page page = ServletUtil.doNewPage(getPageTitle(), isFramed());
    Iterator inNavIterator;
    if (myServletDescr().hasNoNavTable()) {
      inNavIterator = CollectionUtil.EMPTY_ITERATOR;
    } else {
      inNavIterator =
          new FilterIterator(
              new ObjectArrayIterator(getServletDescrs()),
              new Predicate() {
                public boolean evaluate(Object obj) {
                  return isServletInNav((ServletDescr) obj);
                }
              });
    }
    ServletUtil.layoutHeader(
        this,
        page,
        heading,
        isLargeLogo(),
        getMachineName(),
        getLockssApp().getStartDate(),
        inNavIterator);
    String warnMsg = CurrentConfig.getParam(PARAM_UI_WARNING);
    if (warnMsg != null) {
      Composite warning = new Composite();
      warning.add("<center><font color=red size=+1>");
      warning.add(warnMsg);
      warning.add("</font></center><br>");
      page.add(warning);
    }
    return page;
  }