public synchronized IAddress[] getAddress( IAddress searchCriteria, String searchTypeText, String listItem, String searchStatus) throws PresentationLogicException { // WDEV-17296 String lSearchText = searchCriteria.getAddressSearchText(); // WDEV-17296 if (searchCriteria == null) { throw new PresentationLogicException("No address search criteria provided."); } ims.core.vo.PersonAddress[] l_address_results; ims.core.vo.PersonAddress l_address = new ims.core.vo.PersonAddress(); select = new Vector<String>(); where = new Vector(); data = new Vector(); l_address = (PersonAddress) searchForAddress(searchCriteria, searchTypeText, listItem, searchStatus); if (l_address == null) return null; int ambiguitySize = getAmbiguitySize(); l_address_results = new ims.core.vo.PersonAddress[ambiguitySize + 1]; l_address_results[0] = l_address; l_address_results = getAmbiguityList(l_address_results); // WDEV-16590 String ccgCode = null; if (ConfigFlag.UI.DISPLAY_PCT_CODE.getValue() && l_address != null && l_address.getPostCodeIsNotNull()) { String pCode = l_address.getPostCode().replaceAll(" ", ""); // WDEV-17296 if (pCode == null || pCode.equals("")) { pCode = lSearchText.replaceAll(" ", ""); } // WDEV-17296 CCGPCTPCCodes domCCG = CCGPCTPCCodes.getCCGPCTPCCodesFromPostcode(getDomainFactory(), pCode); if (domCCG != null && domCCG.getCCGCode() != null) { l_address.setPCT(domCCG.getCCGCode()); l_address_results[0].setPCT(domCCG.getCCGCode()); l_address_results[0].setPCTcode(domCCG.getCCGCode()); } else { l_address_results[0].setPCT(null); l_address_results[0].setPCTcode(null); } } return l_address_results; }
public GeoCoOrdVo getGPSCoordinatesForPostCode(String postCode) { GeoCoOrdVo geoCoOrdvo = new GeoCoOrdVo(); AddressManagmentProvider amf = new AddressManagmentProvider(); ims.core.vo.PersonAddress lpa = new ims.core.vo.PersonAddress(); lpa.setPostCode(postCode); double[] coOrds; try { coOrds = amf.getLatitudeLogitude(lpa); } catch (DomainRuntimeException e) { return null; } if (coOrds != null && coOrds.length == 2) { geoCoOrdvo.setLatitude((float) coOrds[0]); geoCoOrdvo.setLogitude((float) coOrds[1]); return geoCoOrdvo; } return null; }