我的空間,寫我所寫,禪我所藏

          與我一起遨游吧

           

          通過數據庫的設置字段,對流程中的jsp控件進行權限顯示控制,最終以javascript串返回頁面實現

             public static String limitControls(String procdefId,String activityId,String url)throws WfException{
              Connection con = DbConnectionManager.getInstance().getConnection(
                         poolName);
             Statement st = null;
             String value="";
            try {
                 st = con.createStatement();
                 String iSql = "";
                 ///
                 if(activityId!=null&&!"null".equals(activityId)){
                 iSql = "select distinct a.controltype,a.controlname,a.viewtype,c.formname from activitycontrollimits a,activitycontrol c,ASSIGNMENTEVENTAUDITS b where a.limitno=c.limitno and c.actdefid=b.activitydefinitionid and b.ACTIVITYID='"+activityId+"' and url='"+url+"'" ;
                 
                 }
                 ///進去發起頁面 activityid is null
                 else
                 iSql = "select distinct a.controltype,a.controlname,a.viewtype,c.formname from activitycontrollimits a,activitycontrol c where a.limitno=c.limitno and procdefid='"+procdefId+"' and actdefid='null' and url='"+url+"'" ;
                 System.out.println(iSql);
                 ResultSet rs = st.executeQuery(iSql);
                
                 while (rs.next()) {
                  int cType = rs.getInt(3);
                  switch(cType){
                  case 0:value = value+"document.all['"+rs.getString(2)+"'].disabled=true;";
                         break;
                  case 1:
                   if(rs.getInt(1)==3)
                    value = value="self.location='commons/noallow.jsp'";
                   else
                   value = value+"document.all['"+rs.getString(2)+"'].style.display='none';";
                         break;
                  //case 2:value=  value+"document.all['"+rs.getString(2)+"'].style.display='block';";
                        // break;
               
                  default:
                     value = value+"document.all['"+rs.getString(2)+"'].disabled=false;";
                     break;
                  }
                 }
                // if(value.trim().length()==0)
                //  value="self.location='/commons/noallow.jsp'";
               } catch (Exception e) {
                e.printStackTrace();
                 throw new WfException(ErrorInfo.EXT_PROC_MANAGER_ERROR,"生成校驗串失敗!",
                           ErrorInfo.getTrace(e, e.getStackTrace()));
                }    finally {
                  DbConnectionManager.getInstance().freeConnection(poolName, con);
              }
                value= "<script language='javascript'>"+value;
                value = value+"</script>";
              return value; 
             }

          posted on 2007-06-25 15:43 imcb 閱讀(749) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           

          導航

          統計

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 遂溪县| 炎陵县| 乌鲁木齐市| 万载县| 沐川县| 富阳市| 无棣县| 宜春市| 文成县| 延安市| 韶山市| 紫云| 惠来县| 平遥县| 神木县| 沭阳县| 丹巴县| 藁城市| 济南市| 钦州市| 乌苏市| 克什克腾旗| 犍为县| 林芝县| 河北省| 伊金霍洛旗| 宝兴县| 望城县| 九龙坡区| 错那县| 庆城县| 称多县| 定日县| 天全县| 阳朔县| 克山县| 股票| 上饶县| 宜兴市| 西吉县| 赣州市|