private void searchVMP() { try { VMPVoCollection result = domain.searchVMPByName(form.txtName().getValue()); form.ccDMD().setValues(result == null ? null : result.toIDMDValueArray(), DMDType.VMP); } catch (DomainInterfaceException e) { engine.showMessage(e.getMessage(), "Error", MessageButtons.OK, MessageIcon.ERROR); } }
/** * Search for VMP */ public VMPVoCollection searchVMPByName(String name) throws ims.domain.exceptions.DomainInterfaceException { if(name == null || name.trim().length() == 0) return null; return VMPVoAssembler.createVMPVoCollectionFromVMP(getDomainFactory().find("from VMP vm WHERE vm.name like '" + name + "%'")); }
public IDMDValue[] searchVMP(IDMDValue vtm) throws DomainInterfaceException { if(vtm == null || vtm.getIDMDValueId() == null || vtm.getIDMDValueType() != DMDType.VTM) throw new DomainInterfaceException("Invalid VMP reference"); VMPVoCollection result = VMPVoAssembler.createVMPVoCollectionFromVMP(getDomainFactory().find("from VMP vm WHERE vm.vTM.id = " + vtm.getIDMDValueId())); if(result != null) return result.toIDMDValueArray(); return new IDMDValue[] {}; }
public VMPVo getVMP(String vmpId) throws DomainInterfaceException { if(vmpId == null) throw new DomainInterfaceException("Invalid VMP reference"); VMPVoCollection vmpCol = VMPVoAssembler.createVMPVoCollectionFromVMP(getDomainFactory().find("from VMP vm WHERE vm.productIdentifier = '" + vmpId + "'")); if (vmpCol != null && vmpCol.size()>0) return vmpCol.get(0); else return null; }