示例#1
0
 // Return IP addr used by LCAP.  If specified by (misleadingly named)
 // localIPAddress prop, might not really be our address (if we are
 // behind NAT).
 String getLcapIPAddr() {
   String ip = CurrentConfig.getParam(PARAM_LOCAL_IP);
   if (ip == null || ip.length() <= 0) {
     return getLocalIPAddr();
   }
   return ip;
 }
示例#2
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;
  }
示例#3
0
 /** Set the session timeout to the configured value */
 protected void setSessionTimeout(HttpSession session) {
   Configuration config = CurrentConfig.getCurrentConfig();
   setSessionTimeout(
       session, config.getTimeInterval(PARAM_UI_SESSION_TIMEOUT, DEFAULT_UI_SESSION_TIMEOUT));
 }
示例#4
0
 public MultiPartRequest getMultiPartRequest() throws FormDataTooLongException, IOException {
   int maxUpload =
       CurrentConfig.getIntParam(PARAM_MAX_UPLOAD_FILE_SIZE, DEFAULT_MAX_UPLOAD_FILE_SIZE);
   return getMultiPartRequest(maxUpload);
 }