protected void onFormOpen() throws ims.framework.exceptions.PresentationLogicException { initialize(); //wdev-13392 form.setMode(FormMode.VIEW); form.dyngrdSecs().setSelectable(true); populateParameterCombo(null); SECSVoCollection tempVoCol = domain.getSecsColection(); SECSVo tempVo = null; if(tempVoCol != null && tempVoCol.size() > 0) { tempVo = tempVoCol.get(0); if(tempVoCol.size() > 1) engine.showMessage("There are more than one SECS Configuration records in database"); } populateScreenFromData(tempVo); //------------------- //open(); }
/** * There will only be one secs record */ public SECSVo getSecs() //wdev-13392 { List secs = getDomainFactory().find("from SECS as s1_1 order by s1_1.systemInformation.creationDateTime desc "); SECSVoCollection secsVoColl = SECSVoAssembler.createSECSVoCollectionFromSECS(secs); //wdev-13392 if(secsVoColl != null && secsVoColl.size() > 0) return secsVoColl.get(0); return null; }
public SECSVo saveSECS(SECSVo voSecs) throws StaleObjectException,UniqueKeyViolationException { if(voSecs == null) throw new CodingRuntimeException("voSecs parameter is null in method saveSECS"); if(!voSecs.isValidated()) throw new CodingRuntimeException("voSecs has not been validated"); DomainFactory factory = getDomainFactory(); //wdev-13392 if(voSecs.getID_SECS() == null) { SECSVoCollection list = getSecsConfiguration(); if(list != null && list.size() > 0) { throw new UniqueKeyViolationException("A SECS Configuration already exists."); } } //--------------- SECS doSecs = SECSVoAssembler.extractSECS(factory, voSecs); factory.save(doSecs); return SECSVoAssembler.create(doSecs); }
public SECSVo getSecs() //wdev-13392 { List secs = getDomainFactory().find("from SECS as s1_1 order by s1_1.systemInformation.creationDateTime desc "); SECSVoCollection secsVoColl = SECSVoAssembler.createSECSVoCollectionFromSECS(secs); //wdev-13392 if(secsVoColl != null && secsVoColl.size() > 0) return secsVoColl.get(0); return null; }
public SECSVoCollection getSecsColection() { List secs = getDomainFactory().find("from SECS as s1_1 order by s1_1.systemInformation.creationDateTime desc "); SECSVoCollection secsVoColl = SECSVoAssembler.createSECSVoCollectionFromSECS(secs); return secsVoColl; }
private SECSVoCollection getSecsConfiguration() { DomainFactory factory = getDomainFactory(); String hql; hql = " from SECS "; SECSVoCollection collSystemReview = SECSVoAssembler.createSECSVoCollectionFromSECS(factory.find(hql)); return collSystemReview; }