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

          與我一起遨游吧

           

          通過數據庫的設置字段,對流程中的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 閱讀(750) 評論(0)  編輯  收藏


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


          網站導航:
           

          導航

          統計

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 全州县| 星子县| 河池市| 灌阳县| 项城市| 丘北县| 丰台区| 诏安县| 灵山县| 浪卡子县| 临沧市| 盈江县| 缙云县| 丽水市| 牟定县| 周宁县| 阿克| 洞口县| 临安市| 彩票| 新田县| 托克逊县| 绥宁县| 墨竹工卡县| 贵溪市| 潢川县| 聂拉木县| 乐东| 太和县| 南陵县| 卢氏县| 夹江县| 涞源县| 赤城县| 乳源| 白银市| 墨脱县| 汨罗市| 定远县| 广西| 永川市|