コード例 #1
0
  // 修改工作组
  public String updateGroupRule() {
    int id = getParaIntValue("id");
    String name = getParaValue("name");
    String desciption = getParaValue("description");
    String[] temp = getParaArrayValue("checkbox");

    StringBuffer ids = new StringBuffer();
    if (temp != null) {
      for (int i = 0; i < temp.length; i++) {
        ids.append(temp[i] + ",");
      }
    }
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Date date = new Date();
    User user = (User) session.getAttribute(SessionConstant.CURRENT_USER);
    CompGroupRule vo = new CompGroupRule();
    vo.setId(id);
    vo.setName(name);

    vo.setDescription(desciption);
    vo.setRuleId(ids.toString());
    vo.setLastModifiedBy(user.getName());
    vo.setLastModifiedTime(sdf.format(date));
    CompGroupRuleDao dao = new CompGroupRuleDao();
    dao.update(vo);
    return null;
  }
コード例 #2
0
  // 保存工作组
  public String saveGroupRule() {
    String name = getParaValue("name");
    String desciption = getParaValue("description");
    String[] id = getParaArrayValue("checkbox");
    String ids = "";
    if (ids != null) {
      for (int i = 0; i < id.length; i++) {
        ids = ids + id[i] + ",";
      }
    }
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Date date = new Date();
    User user = (User) session.getAttribute(SessionConstant.CURRENT_USER);
    CompGroupRule vo = new CompGroupRule();
    vo.setName(name);

    vo.setDescription(desciption);
    vo.setRuleId(ids);
    vo.setCreatedBy(user.getName());
    vo.setCreatedTime(sdf.format(date));
    vo.setLastModifiedBy(user.getName());
    vo.setLastModifiedTime(sdf.format(date));
    CompGroupRuleDao dao = new CompGroupRuleDao();
    dao.save(vo);
    return null;
  }
コード例 #3
0
 // 修改策略
 public String editStrategy() {
   String id = getParaValue("id");
   CompGroupRuleDao dao = new CompGroupRuleDao();
   List list = dao.loadAll();
   CompStrategyDao strategyDao = new CompStrategyDao();
   CompStrategy vo = (CompStrategy) strategyDao.findByID(id);
   request.setAttribute("list", list);
   request.setAttribute("vo", vo);
   return "/config/vpntelnet/compliance/editStrategy.jsp";
 }
コード例 #4
0
 // 显示具体某个组的详细规则
 public String pureRuleList() {
   String id = getParaValue("id");
   CompGroupRuleDao groupRuleDao = new CompGroupRuleDao();
   CompGroupRule rule = (CompGroupRule) groupRuleDao.findByID(id);
   groupRuleDao.close();
   CompRuleDao dao = new CompRuleDao();
   String temp = rule.getRuleId();
   String ids = temp.substring(0, temp.lastIndexOf(","));
   List list = dao.findByCondition(" where ID in(" + ids + ")");
   request.setAttribute("list", list);
   return "/config/vpntelnet/compliance/pureRuleList.jsp";
 }
コード例 #5
0
  // 编辑规则组信息
  public String editGroupRule() {
    String id = getParaValue("id");
    CompRuleDao dao = new CompRuleDao();
    List list = dao.loadAll();
    CompGroupRuleDao groupRuleDao = new CompGroupRuleDao();

    CompGroupRule rule = (CompGroupRule) groupRuleDao.findByID(id);
    groupRuleDao.close();
    request.setAttribute("list", list);
    request.setAttribute("compGroupRule", rule);
    return "/config/vpntelnet/compliance/editGroupRule.jsp";
  }
コード例 #6
0
 public String deleteGroupRule() {
   String[] ids = getParaArrayValue("checkbox");
   if (ids != null && ids.length > 0) {
     CompGroupRuleDao dao = new CompGroupRuleDao();
     try {
       dao.delete(ids);
     } catch (Exception e) {
       e.printStackTrace();
     } finally {
       dao.close();
     }
   }
   return groupRuleList();
 }
コード例 #7
0
 public String createStrategy() {
   CompGroupRuleDao dao = new CompGroupRuleDao();
   List list = dao.loadAll();
   request.setAttribute("list", list);
   return "/config/vpntelnet/compliance/createStrategy.jsp";
 }