public MemberOfStaffLiteVoCollection listContactPersons(String name) { // Use StringBuilder to build the HQL query (more memory efficient) StringBuilder hqlQuery = new StringBuilder(); hqlQuery.append("from MemberOfStaff as mos"); // Declare the ArrayList for parameters names and parameters values ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); // Create parameters string if (name != null && name.length() > 0) { hqlQuery.append(" where UPPER(mos.name.surname) like :NAME or UPPER(mos.name.forename) like :NAME"); paramNames.add("NAME"); paramValues.add("%" + name.toUpperCase() + "%"); } // Set order mode hqlQuery.append(" order by UPPER(mos.name.surname) asc"); return MemberOfStaffLiteVoAssembler.createMemberOfStaffLiteVoCollectionFromMemberOfStaff(getDomainFactory().find(hqlQuery.toString(), paramNames, paramValues)); }
protected void onQmbOrderedByTextSubmited(String value) throws PresentationLogicException { form.lyrDetails().tabGenDetails().qmbOrderedBy().clear(); if (value == null || value.equals("")) { engine.showMessage("Please enter at least one character to search on"); return; } MemberOfStaffLiteVoCollection voCollMos = domain.listActiveMosByName(value); if (voCollMos != null && voCollMos.size() > 0) { for (int i = 0; i < voCollMos.size(); i++) { form.lyrDetails().tabGenDetails().qmbOrderedBy().newRow(voCollMos.get(i), voCollMos.get(i).getName().toString()); } if (voCollMos.size() == 1) { form.lyrDetails().tabGenDetails().qmbOrderedBy().setValue(voCollMos.get(0)); } else if (voCollMos.size() > 1) form.lyrDetails().tabGenDetails().qmbOrderedBy().showOpened(); } else engine.showMessage("No matching records found"); }
public MemberOfStaffLiteVoCollection listActiveMosByName(String name) { if(name == null) throw new CodingRuntimeException("name parameter is null in method listActiveMosByName"); HcpAdmin impl = (HcpAdmin) getDomainImpl(HcpAdminImpl.class); //WDEV-8204 HcpLiteVoCollection hcps = impl.listHcpLiteByName(name, 400); //WDEV-11656 if (hcps == null || hcps.size()==0) return null; MemberOfStaffLiteVoCollection result = new MemberOfStaffLiteVoCollection(); for (int i=0 ; i<hcps.size() ; i++) { result.add(hcps.get(i).getMos()); } return result; //return MemberOfStaffLiteVoAssembler.createMemberOfStaffLiteVoCollectionFromMemberOfStaff(members).sort(); }
protected void onQmbReferredToTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException { form.qmbReferredTo().clear(); MemberOfStaffLiteVoCollection voCollMOSs = listMOSs(value); if(voCollMOSs == null || voCollMOSs.size() == 0) { engine.showMessage("No MOS found matching the search criteria"); return; } for(int i=0;i<voCollMOSs.size();i++) { form.qmbReferredTo().newRow(voCollMOSs.get(i), voCollMOSs.get(i).toString()); } if(voCollMOSs.size() == 1) { form.qmbReferredTo().setValue(voCollMOSs.get(0)); } else { form.qmbReferredTo().showOpened(); } }
private void populateMosUsers(MemberOfStaffLiteVoCollection mosUsers) { form.qmbRecordingUser().clear(); if (mosUsers == null) return; for (MemberOfStaffLiteVo mos : mosUsers) { form.qmbRecordingUser().newRow(mos, mos.getIMosName()); } if (mosUsers.size() == 1) form.qmbRecordingUser().setValue(mosUsers.get(0)); else form.qmbRecordingUser().showOpened(); }
private void populateAcceptingConsultants(MemberOfStaffLiteVoCollection consultants) { form.qmbAcceptingConsultant().clear(); if (consultants == null) return; for (MemberOfStaffLiteVo consultant : consultants) { form.qmbAcceptingConsultant().newRow(consultant, consultant.getIMosName()); } if (consultants.size() == 1) form.qmbAcceptingConsultant().setValue(consultants.get(0)); else form.qmbAcceptingConsultant().showOpened(); }
@Override protected void onQmbAcceptingConsultantTextSubmited(String value) throws PresentationLogicException { MemberOfStaffLiteVoCollection consultants = domain.listAcceptingConsultants(value); populateAcceptingConsultants(consultants); }
/** * Function used to populate ICP Contact Persons * * @param contactPersons */ private void populateICPContactPersons(MemberOfStaffLiteVoCollection contactPersons) { // Clear contact persons form.ctnConfiguration().lyrICPTabs().ICP().qmbICPContactPerson().clear(); // Terminate function if the list is null if (contactPersons == null) return; for (MemberOfStaffLiteVo contactPerson : contactPersons) { // Skip null contacts if (contactPerson == null) continue; form.ctnConfiguration().lyrICPTabs().ICP().qmbICPContactPerson().newRow(contactPerson, contactPerson.getIMosName()); } if (contactPersons.size() == 1) { form.ctnConfiguration().lyrICPTabs().ICP().qmbICPContactPerson().setValue(contactPersons.get(0)); } else { form.ctnConfiguration().lyrICPTabs().ICP().qmbICPContactPerson().showOpened(); } }
public MemberOfStaffLiteVoCollection listContactPersons(String name) { // Use StringBuilder to build the HQL query (more memory efficient) StringBuilder hqlQuery = new StringBuilder(); hqlQuery.append("from MemberOfStaff as mos"); // Declare the ArrayList for parameters names and parameters values ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); // Create parameters string if (name != null && name.length() > 0) { hqlQuery.append(" where mos.name.upperSurname like :NAME or mos.name.upperForename like :NAME"); //WDEV-20219 paramNames.add("NAME"); paramValues.add("%" + name.toUpperCase() + "%"); } // Set order mode hqlQuery.append(" order by mos.name.upperSurname asc"); //WDEV-20219 return MemberOfStaffLiteVoAssembler.createMemberOfStaffLiteVoCollectionFromMemberOfStaff(getDomainFactory().find(hqlQuery.toString(), paramNames, paramValues)); }
@Override protected void onqmbTechnicianTextSubmitted(String value) throws PresentationLogicException { //wdev-11680 form.qmbTechnician().clear(); //----------- MemberOfStaffLiteVoCollection activeMos = domain.getMembersOfStaff(value); for (int i = 0; i < activeMos.size(); i++) { form.qmbTechnician().newRow(activeMos.get(i), activeMos.get(i).getName().toShortForm()); form.qmbTechnician().showOpened(); } }
protected void onQmbEnquireToTextSubmited(String value) throws PresentationLogicException { form.lyrCorrespondenceDetail().tabRecipients().qmbEnquiriesTo().clear(); MemberOfStaffLiteVoCollection enquiriesTo = domain.getMos(value); for (int index = 0; index < enquiriesTo.size(); index++) { form.lyrCorrespondenceDetail().tabRecipients().qmbEnquiriesTo().newRow(enquiriesTo.get(index), enquiriesTo.get(index).getName().toString()); } form.lyrCorrespondenceDetail().tabRecipients().qmbEnquiriesTo().showOpened(); }
protected void onQmbTypedByTextSubmited(String value) throws PresentationLogicException { form.lyrCorrespondenceDetail().tabRecipients().qmbTypedBy().clear(); MemberOfStaffLiteVoCollection Typers = domain.getMos(value); for (int index = 0; index < Typers.size(); index++) { form.lyrCorrespondenceDetail().tabRecipients().qmbTypedBy().newRow(Typers.get(index), Typers.get(index).getName().toString()); } form.lyrCorrespondenceDetail().tabRecipients().qmbTypedBy().showOpened(); }
/** * Function used to populate the Contact Person query combobox search filter * * @param contactList */ private void populateContactPerson(MemberOfStaffLiteVoCollection contactList) { // Clear the query combobox form.qmbContactPerson().clear(); // Check the list of contacts if (contactList == null) return; for (MemberOfStaffLiteVo contact : contactList) { // Skip null contacts if (contact == null) continue; form.qmbContactPerson().newRow(contact, contact.getIMosName()); } // Set the default value if only one record was returned, else expand // the query combobox if (contactList.size() == 1) { form.qmbContactPerson().setValue(contactList.get(0)); } else { form.qmbContactPerson().showOpened(); } }
public MemberOfStaffLiteVoCollection listActiveMosByName(String name) { if(name == null) throw new CodingRuntimeException("name parameter null in method listActiveMosByName"); MemberOfStaffShortVo voFilter = new MemberOfStaffShortVo(); voFilter.setName(new PersonName()); voFilter.getName().setSurname(name); voFilter.setIsActive(Boolean.TRUE); return MemberOfStaffLiteVoAssembler.createMemberOfStaffLiteVoCollectionFromMemberOfStaff(listDomMos(voFilter)); }
protected void onQmbAuthorTextSubmitted(String value) throws PresentationLogicException { MemberOfStaffLiteVoCollection activeMos = domain.listActiveMosByName(value); for (int i = 0; i < activeMos.size(); i++) { form.qmbAuthor().newRow(activeMos.get(i), activeMos.get(i).getIMosName()); } form.qmbAuthor().showOpened(); }
@Override protected void onQmbRecordingUserTextSubmited(String value) throws PresentationLogicException { MemberOfStaffLiteVoCollection mosUsers = domain.listMosUsers(value); populateMosUsers(mosUsers); }
@Override protected void onQmbAcceptingConsultantTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException { MemberOfStaffLiteVoCollection consultants = domain.listAcceptingConsultants(value); populateAcceptingConsultants(consultants); }
public MemberOfStaffLiteVoCollection listMosUsers(String name) { if (name == null) return null; StringBuilder query = new StringBuilder("SELECT mos FROM MemberOfStaff AS mos WHERE mos.isActive = 1 AND mos.name.upperSurname LIKE :NAME"); query.append(" ORDER BY mos.name.upperSurname "); return MemberOfStaffLiteVoAssembler.createMemberOfStaffLiteVoCollectionFromMemberOfStaff(getDomainFactory().find(query.toString(), "NAME", name.toUpperCase() + "%")); }
@Override protected void onqmbTechTextSubmitted(String value) throws PresentationLogicException { MemberOfStaffLiteVoCollection searchResult = domain.getMembersOfStaff(value); populateTechQmb(searchResult); }
private void populateTechQmb(MemberOfStaffLiteVoCollection searchResult) { //wdev-11680 form.qmbTech().clear(); //------- for (int i = 0; i < searchResult.size(); i++) { form.qmbTech().newRow(searchResult.get(i), searchResult.get(i).getIMosName()); } form.qmbTech().showOpened(); }
private void populateResponsibleTechnicianCombo(String value) { form.qmbResponsibleTechnician().clear(); MemberOfStaffLiteVoCollection techs = domain.getResponsibleTechnican(value); for (int i = 0; i < techs.size(); i++) { form.qmbResponsibleTechnician().newRow(techs.get(i), techs.get(i).getIItemText()); } }
private void populateQmbRecUser(String value) { MemberOfStaffLiteVoCollection users = domain.getMos(value); if (users != null) { for (int i = 0; i < users.size(); i++) { form.qmbRecUser().newRow(users.get(i), users.get(i).getIMosName()); } form.qmbRecUser().showOpened(); } }