예제 #1
0
 public List<String> getUlstSystemCss() {
   List<String> lstResults = new UniqueArrayList<String>();
   List<String> lstCss = Config.getInstance().getUlstGlobalCss();
   if (lstCss != null) lstResults.addAll(lstCss);
   lstCss = Config.getInstance().getUlstLocalCss(this);
   if (lstCss != null) lstResults.addAll(lstCss);
   return lstResults;
 }
예제 #2
0
 public List<JavascriptFileBean> getLstSystemJavascriptFiles() {
   List<JavascriptFileBean> lstResult = new UniqueArrayList<JavascriptFileBean>();
   List<JavascriptFileBean> lstJsTmp = Config.getInstance().getLstDefaultGlobalJavascriptFiles();
   if (lstJsTmp != null) lstResult.addAll(lstJsTmp);
   lstJsTmp = Config.getInstance().getLstGlobalJavascriptFiles();
   if (lstJsTmp != null) lstResult.addAll(lstJsTmp);
   lstJsTmp = Config.getInstance().getLstLocalJavascript(this);
   if (lstJsTmp != null) lstResult.addAll(lstJsTmp);
   if (shouldIncludeAutoCreatedJs && this.jsFileForConfigFile != null)
     lstResult.add(this.jsFileForConfigFile);
   return lstResult;
 }
예제 #3
0
파일: PageType.java 프로젝트: qxo/wabacus
 private String showBackButtonInPage() {
   StringBuffer resultBuf = new StringBuffer();
   String clickevent = rrequest.getStringAttribute("BACK_ACTION_EVENT", "");
   if (rrequest.getLstAncestorUrls() != null
       && rrequest.getLstAncestorUrls().size() > 0
       && clickevent.equals("")) {
     if (this.pagebean.getButtonsBean() != null
         && this.pagebean.getButtonsBean().getcertainTypeButton(BackButton.class) != null) {
       return "";
     }
     BackButton buttonObj =
         (BackButton)
             Config.getInstance()
                 .getResourceButton(
                     rrequest,
                     rrequest.getPagebean(),
                     Consts.BACK_BUTTON_DEFAULT,
                     BackButton.class);
     resultBuf.append("<table height='3'><tr><td>&nbsp;</td></tr></table>");
     resultBuf
         .append("<table width='100%' align='center'><tr><td align=\"center\">")
         .append(buttonObj.showButton(rrequest, null))
         .append("</td></tr></table>");
   }
   return resultBuf.toString();
 }
 public String getScrollstyle() {
   if (scrollstyle == null || scrollstyle.trim().equals("")) {
     String scrollstyleTmp =
         Config.getInstance()
             .getSystemConfigValue("default-scrollstyle", Consts_Private.SCROLLSTYLE_NORMAL)
             .toLowerCase();
     if (!Consts_Private.lstAllScrollStyles.contains(scrollstyleTmp)) {
       throw new WabacusRuntimeException(
           "在wabacus.cfg.xml的default-scrollstyle属性中配置的值" + scrollstyleTmp + "不支持");
     }
     return scrollstyleTmp;
   }
   return scrollstyle;
 }
  public void doEnd(ReportRequest rrequest) {
    Date operateTime1 = new Date();
    java.text.DateFormat format1 = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    String operateTime = format1.format(operateTime1);
    String userid = rrequest.getRequest().getSession().getAttribute("userId").toString();
    String remoteAddr = rrequest.getRequest().getSession().getAttribute("remoteAddr").toString();
    String logintime = rrequest.getRequest().getSession().getAttribute("loginTime").toString();
    // String opt= rrequest.getRequest().getAttribute("operateTime").toString();
    String menuName = rrequest.getPagebean().getId();
    //		String pageid=rrequest.getPagebean().getId();
    //		System.out.println(menuName);
    //		System.out.println(pageid);

    /*if(menuName.equalsIgnoreCase("eventType")){
    	menuName="事件类型管理";
    }
    else{
    	System.out.println("没执行if语句");
    }*/

    final Connection conn = Config.getInstance().getDataSource("").getConnection();
    PreparedStatement pstmt = null;
    try {

      String sql =
          "insert into LogInfo(UserId,LoginTime,MenuName,OperateTime,UserIp) values(?,?,?,?,?)";
      pstmt = conn.prepareStatement(sql);
      pstmt.setString(1, userid);
      pstmt.setString(2, logintime);
      pstmt.setString(3, menuName);
      pstmt.setString(4, operateTime);
      pstmt.setString(5, remoteAddr);
      pstmt.executeUpdate();
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      try {
        pstmt.close();
      } catch (SQLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
  }
예제 #6
0
 protected Object doGetResultSet(
     SPDataSetValueBean spBean, Object typeObj, StringBuffer systemParamsBuf) {
   log.debug(systemParamsBuf.toString());
   String procedure = spBean.getProcedure();
   if (rbean.getInterceptor() != null) {
     Object obj = rbean.getInterceptor().beforeLoadData(rrequest, rbean, typeObj, procedure);
     if (!(obj instanceof String)) {
       return obj;
     }
     procedure = (String) obj;
   }
   if (Config.show_sql) log.info("Execute sql: " + procedure);
   CallableStatement cstmt = null;
   try {
     cstmt =
         rrequest
             .getConnection(spBean.getOwnerSpProvider().getDatasource())
             .prepareCall(procedure);
     AbsDatabaseType dbtype = rrequest.getDbType(spBean.getOwnerSpProvider().getDatasource());
     VarcharType varcharObj =
         (VarcharType) Config.getInstance().getDataTypeByClass(VarcharType.class);
     int idx = 1;
     if (spBean.getLstStoreProcedureParams() != null
         && spBean.getLstStoreProcedureParams().size() > 0) {
       for (String paramTmp : spBean.getLstStoreProcedureParams()) {
         if (WabacusAssistant.getInstance()
             .isGetRequestContextValue(paramTmp)) { // 从request/session中取值
           varcharObj.setPreparedStatementValue(
               idx,
               WabacusAssistant.getInstance().getRequestContextStringValue(rrequest, paramTmp, ""),
               cstmt,
               dbtype);
         } else if (Tools.isDefineKey("condition", paramTmp)) {
           setConditionValue(
               rrequest,
               spBean,
               cstmt,
               dbtype,
               idx,
               Tools.getRealKeyByDefine("condition", paramTmp),
               varcharObj);
         } else {
           varcharObj.setPreparedStatementValue(idx, paramTmp, cstmt, dbtype);
         }
         idx++;
       }
     }
     if (spBean.getOwnerSpProvider().isUseSystemParams()) {
       if (systemParamsBuf == null) systemParamsBuf = new StringBuffer();
       cstmt.setString(idx++, systemParamsBuf.toString()); // 如果是查询报表数据,将系统参数传入
     }
     if (dbtype instanceof Oracle) {
       cstmt.registerOutParameter(idx, OracleTypes.CURSOR);
     }
     rrequest.addUsedStatement(cstmt);
     cstmt.executeQuery();
     ResultSet rs = null;
     if (dbtype instanceof Oracle) {
       rs = (ResultSet) cstmt.getObject(idx);
     } else {
       rs = cstmt.getResultSet();
     }
     return rs;
   } catch (SQLException e) {
     throw new WabacusRuntimeException(
         "从数据库取报表" + rbean.getPath() + "数据时执行SQL:" + procedure + "失败", e);
   }
 }