Advertisement
psi_mmobile

Untitled

Mar 23rd, 2021
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. public String localize(){
  2. log.debug("Localize called : "+searchField);
  3. AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
  4. ViewObjectImpl vo = am.getBuildixxMapsSearchView1();
  5. /*//log.debug("Query : "+vo.getQuery());
  6. // 1. Create a view criteria rowset for this view object
  7. ViewCriteria vc = vo.createViewCriteria();
  8. // 2. Use the view criteria to create one or more view criteria rows
  9. ViewCriteriaRow vcr1 = vc.createViewCriteriaRow();
  10. vcr1.setUpperColumns(true);
  11. vcr1.setAttribute("IdString","%"+searchField.toUpperCase()+"%");
  12. // 4. Add the view criteria rows to the view critera rowset
  13. vc.add(vcr1);
  14. // 5. Apply the view criteria to the view object
  15. vo.applyViewCriteria(vc);*/
  16. vo.setWhereClause("ID_STRING like '%"+searchField.toUpperCase().replace("'", "''")+"%'");
  17. vo.executeQuery();
  18. //log.debug("Query : "+vo.getQuery());
  19. //log.debug("Found results : "+vo.getRowCount());
  20. locationSearchResults = null;
  21. googleRes = null;
  22.  
  23. RowSetIterator rowIter = vo.createRowSetIterator(null);
  24. while (rowIter.hasNext()) {
  25. Row row = rowIter.next();
  26. //log.debug("Found row : "+row);
  27. LocationSearchResult lsr = LocationSearchResult.getLocationResult(row);
  28. addLocationSearchResult(lsr);
  29. }
  30.  
  31. rowIter.closeRowSetIterator();
  32. //if(null == locationSearchResults || locationSearchResults.size()==0)
  33. googleRes = GoogleSearch.search(searchField);
  34.  
  35. ArrayList<LocationSearchResult> res = new ArrayList<LocationSearchResult>();
  36. if(null != locationSearchResults)
  37. res.addAll(locationSearchResults);
  38. if(null != googleRes)
  39. res.addAll(googleRes);
  40. selectedResult = null;
  41. ADFContext.getCurrent().getSessionScope().put(mapSubtype, LocationTools.genJSON(res, selectedResult, null, "callBackResult"));
  42. log.debug("localizeSearch end");
  43. return "locationResult";
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement