public void onDataLoad(DataLoadEvent se) {
   Dataset ds = se.getSource();
   String keys = ds.getReqParameters().getParameterValue("query_param_keys");
   String values = null;
   if (keys != null && !keys.equals("")) {
     values = ds.getReqParameters().getParameterValue("query_param_values");
   }
   int userType = 0;
   CpMenuItemVO[] menuitems = null;
   ICpMenuQry service = CpbServiceFacility.getMenuQry();
   try {
     menuitems = service.getMenuItemsByCategory(values);
     if (userType == 2 /* CpUserVO.USERTYPE_SYSADMIN */) {
       // menuitems = service.getMenuItemsByCategory(values);
     } else if (userType == 3 /* CpUserVO.USERTYPE_GROUPADMIN */) {
       // appsNodes =
       // CpbServiceFacility.getFunQryService().getNodeByUser(values,
       // userVo.getCuserid(), "");
     }
   } catch (CpbBusinessException e) {
     // TODO Auto-generated catch block
     LfwLogger.error(e.getMessage(), e);
     throw new LfwRuntimeException(e.getMessage());
   }
   if (ArrayUtils.isEmpty(menuitems)) {
     return;
   }
   new SuperVO2DatasetSerializer().serialize(menuitems, ds, Row.STATE_NORMAL);
   postProcessRowSelect(ds);
 }
Example #2
0
 protected void onVoSave(SuperVO[] pvos) {
   try {
     CpbServiceFacility.getCpSuperVOBill().insertSuperVOs(pvos);
   } catch (CpbBusinessException e) {
     LfwLogger.error(e.getMessage(), e);
   }
 }
 @Override
 protected PtSessionBean restoreByInfoMap(Map<String, String> info) {
   try {
     String userid = info.get(USERID);
     String groupno = info.get(GROUPNO);
     CpUserVO userVO = CpbServiceFacility.getCpUserQry().getGlobalUserByCode(userid);
     if (userVO == null) return null;
     CpUser user = new CpUser(userVO);
     PtSessionBean ses = new PtSessionBean();
     ses.setUser(user);
     ses.setGroupNo(groupno);
     return ses;
   } catch (CpbBusinessException e) {
     throw new PortalServerRuntimeException("恢复用户信息时出现错误");
   }
 }
Example #4
0
 /**
  * 删除ds中已经存在的数据行
  *
  * @param ds
  */
 protected void deleteExistRows(Dataset ds) {
   if (ds.getCurrentRowData() == null) {
     return;
   }
   Row[] rows = ds.getCurrentRowData().getRows();
   if (rows == null || rows.length == 0) {
     return;
   }
   Dataset2SuperVOSerializer serializer = new Dataset2SuperVOSerializer();
   SuperVO[] pvos = serializer.serialize(ds, rows);
   try {
     CpbServiceFacility.getCpSuperVOBill().deleteSuperVOs(pvos);
   } catch (CpbBusinessException e) {
     LfwLogger.error(e.getMessage(), e);
     throw new LfwRuntimeException(e.getMessage());
   }
   for (int i = 0; i < rows.length; i++) {
     ds.getCurrentRowData().removeRow(rows[i]);
   }
 }