protected void doSetCurrentCalcPeriod(Integer calcPeriodId) {
   CalcPeriod calcPeriod = ServerUtils.getPersistentManager().find(CalcPeriod.class, calcPeriodId);
   if (calcPeriod.getStaffList() == null)
     throw new BusinessException(
         Messages.getInstance().getMessage(Messages.NOT_CHOOSE_STAFFLIST_BY_SEARCHED_CALCPERIOD));
   UIProfile profile = UIProfileManagerLocator.locate().load(CalcPeriodServiceLocal.PROFILE_NAME);
   profile.setProperty(CalcPeriodServiceLocal.PROFILE_PROPERTY, calcPeriodId);
   UIProfileManagerLocator.locate().store(profile);
 }
Example #2
0
 /**
  * сохранение параметров отчета
  *
  * @param report
  */
 private void saveParamsValue(RptMain report) {
   try {
     UIProfile profile = getReportUIProfile(report);
     for (Map.Entry<String, ReportParameter> entry : reportParams.entrySet()) {
       // не сохраняем системные параметры
       if (!entry.getKey().startsWith("__"))
         profile.setProperty(entry.getKey(), DataUtils.valueToString(entry.getValue().getValue()));
     }
     UIProfileManagerLocator.locate().store(profile);
   } catch (Exception e) {
     log.error("Cann't save report parameters, report code: " + report.getCode(), e);
   }
 }
Example #3
0
 /**
  * восстановление парамтеров отчета
  *
  * @param report
  */
 private void restoreParamsValue(RptMain report) {
   try {
     UIProfile profile = getReportUIProfile(report);
     for (Map.Entry<String, ReportParameter> entry : reportParams.entrySet()) {
       // не восстанавливаем системные и установленные через API параметры
       if (!entry.getKey().startsWith("__") && !externalParams.contains(entry.getKey())) {
         String propValue = profile.getProperty(entry.getKey());
         if (propValue != null)
           entry
               .getValue()
               .setValue(DataUtils.stringToValue(propValue, entry.getValue().getJavaType()));
       }
     }
   } catch (Exception e) {
     log.error("Cann't restore report parameters, report code: " + report.getCode(), e);
   }
 }