Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String localize(){
- log.debug("Localize called : "+searchField);
- AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
- ViewObjectImpl vo = am.getBuildixxMapsSearchView1();
- /*//log.debug("Query : "+vo.getQuery());
- // 1. Create a view criteria rowset for this view object
- ViewCriteria vc = vo.createViewCriteria();
- // 2. Use the view criteria to create one or more view criteria rows
- ViewCriteriaRow vcr1 = vc.createViewCriteriaRow();
- vcr1.setUpperColumns(true);
- vcr1.setAttribute("IdString","%"+searchField.toUpperCase()+"%");
- // 4. Add the view criteria rows to the view critera rowset
- vc.add(vcr1);
- // 5. Apply the view criteria to the view object
- vo.applyViewCriteria(vc);*/
- vo.setWhereClause("ID_STRING like '%"+searchField.toUpperCase().replace("'", "''")+"%'");
- vo.executeQuery();
- //log.debug("Query : "+vo.getQuery());
- //log.debug("Found results : "+vo.getRowCount());
- locationSearchResults = null;
- googleRes = null;
- RowSetIterator rowIter = vo.createRowSetIterator(null);
- while (rowIter.hasNext()) {
- Row row = rowIter.next();
- //log.debug("Found row : "+row);
- LocationSearchResult lsr = LocationSearchResult.getLocationResult(row);
- addLocationSearchResult(lsr);
- }
- rowIter.closeRowSetIterator();
- //if(null == locationSearchResults || locationSearchResults.size()==0)
- googleRes = GoogleSearch.search(searchField);
- ArrayList<LocationSearchResult> res = new ArrayList<LocationSearchResult>();
- if(null != locationSearchResults)
- res.addAll(locationSearchResults);
- if(null != googleRes)
- res.addAll(googleRes);
- selectedResult = null;
- ADFContext.getCurrent().getSessionScope().put(mapSubtype, LocationTools.genJSON(res, selectedResult, null, "callBackResult"));
- log.debug("localizeSearch end");
- return "locationResult";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement