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);
 }
示例#2
0
 protected void onVoSave(SuperVO[] pvos) {
   try {
     CpbServiceFacility.getCpSuperVOBill().insertSuperVOs(pvos);
   } catch (CpbBusinessException e) {
     LfwLogger.error(e.getMessage(), e);
   }
 }
示例#3
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]);
   }
 }