private void open() { form.grdSecurity().getRows().clear(); SecurityLevelConfigVoCollection voCollSecurityLevelConfig = domain.listSecurityLevel(); if (voCollSecurityLevelConfig == null) return; for (SecurityLevelConfigVo voSecurityLevelConfig : voCollSecurityLevelConfig) { grdSecurityRow row = form.grdSecurity().getRows().newRow(); row.setColSecurityLevelDesc(voSecurityLevelConfig.getSecurityLevelDescription()); row.setValue(voSecurityLevelConfig); } updateControlState(); }
/** * deleteSecurityLevel - delete record and then reorder the collection that remains */ public void deleteSecurityLevel(ims.ocrr.configuration.vo.SecurityLevelRefVo voSecurityLevel, SecurityLevelConfigVoCollection voCollSecurityLevel) throws ims.domain.exceptions.ForeignKeyViolationException, StaleObjectException { if (voSecurityLevel == null) throw new CodingRuntimeException("voSecurityLevel is null in method deleteSecurityLevel"); getDomainFactory().delete(getDomainFactory().getDomainObject(voSecurityLevel)); //only reorder collection if records exist if(voCollSecurityLevel == null || voCollSecurityLevel.size() == 0) return; List lstSecurityLevel = SecurityLevelConfigVoAssembler.extractSecurityLevelList(getDomainFactory(), voCollSecurityLevel); if(lstSecurityLevel != null) { Iterator it = lstSecurityLevel.iterator(); while(it.hasNext()) { SecurityLevel doSecurityLevel = (SecurityLevel)it.next(); getDomainFactory().save(doSecurityLevel); } } }
private void loadSecurityLevel() { form.cmbSecurityLevel().clear(); SecurityLevelConfigVoCollection voColSecurity = domain.listSecurityLevel(); for(SecurityLevelConfigVo voSecurity : voColSecurity) form.cmbSecurityLevel().newRow(voSecurity, voSecurity.getSecurityLevelDescription()); }
private Integer getNextIndexValue() { SecurityLevelConfigVoCollection voCollSecurityLevelConfig = form.grdSecurity().getValues(); if(voCollSecurityLevelConfig.size() == 0) return new Integer(0); voCollSecurityLevelConfig.sort(); return voCollSecurityLevelConfig.get(voCollSecurityLevelConfig.size() - 1).getSecurityLevel() + 1; }
/** * listSecurityLevel - ordered by SecurityLevel */ public ims.ocrr.vo.SecurityLevelConfigVoCollection listSecurityLevel() { String hql = "from SecurityLevel sec order by sec.securityLevel asc"; List lstSecs = getDomainFactory().find(hql); return SecurityLevelConfigVoAssembler.createSecurityLevelConfigVoCollectionFromSecurityLevel(lstSecs); }
public SecurityLevelConfigVoCollection listSecurityLevel() { String hql = "from SecurityLevel sec order by sec.securityLevel asc"; List lstSecs = getDomainFactory().find(hql); return SecurityLevelConfigVoAssembler.createSecurityLevelConfigVoCollectionFromSecurityLevel(lstSecs); }