Package com.esri.gpt.catalog.search

Examples of com.esri.gpt.catalog.search.SearchCriteria


  
    if (this.isTimeUp()) {
      throw new Exception("This thread has been stopped");
    }
    SearchResult result = new SearchResult();
    SearchCriteria criteria = this.getSearchContext().getSearchCriteria();
    ASearchEngine engine = this.getSearchEngine();
    engine.setRequestDefinition(new SearchRequestDefinition(criteria, result));
    engine.setHitsOnly(true);
    engine.setConnectionTimeoutMs(this.getMaxSearchTime());
    engine.setResponseTimeout(this.getMaxSearchTime());
View Full Code Here


return query;
}
//Populate the searchCriteria with the rest queryable hierarchy
protected SearchCriteria toSearchCriteria(HttpServletRequest request,
RequestContext context, RestQuery query) {
SearchCriteria criteria = super.toSearchCriteria(request, context, query);
RestQueryParser parser = new RestQueryParser(request,context, query);
String sHierarchy = Val.chkStr(parser.getRequestParameter(REST_PARAM_KEY1));
if (sHierarchy.length() > 0) {
SearchFilterHierarchy filterHierarchy = new SearchFilterHierarchy();
filterHierarchy.setHierarchy(sHierarchy);
criteria.getMiscelleniousFilters().add(filterHierarchy);
}

return criteria;
}
View Full Code Here

* Gets the search criteria.
* @return the search criteria (never null)
*/
public SearchCriteria getSearchCriteria() {
  if (this.searchCriteria == null) {
    this.setSearchCriteria(new SearchCriteria());
  }
  return this.searchCriteria;
}
View Full Code Here

      Map requestMap = facesBroker.getExternalContext().getRequestParameterMap();
      String searchId = (String)
      requestMap.get(SearchEvents.Event.PARAM_UUID);
      doLoad(searchId)
      success = true;
      SearchCriteria searchCriteria = this.getSearchCriteria();
      searchCriteria.getSearchFilterPageCursor().setCurrentPage(1);
      this.getSearchResult().reset();
      for(ISearchFilter iSearchFilter
          : searchCriteria.getMiscelleniousFilters()) {
        if(iSearchFilter instanceof SearchFilterHarvestSites) {
          SearchFilterHarvestSites sfHvSites =
            (SearchFilterHarvestSites) iSearchFilter;
          try {
            String url = sfHvSites.getSearchUrl();
View Full Code Here

*
* @throws SearchException the search exception
*/
private void doSave() throws SearchException {
  LOG.info("Event: Performing Save");
  SearchCriteria criteria = this.getSearchCriteria();
  //if(criteria.getSavedSearchList().size()
  //    >= SearchConfig.getConfiguredInstance().getMaxSavedSearches()) {
  //  throw new SearchException("catalog.search.error.maxSavedSearchesReached");
  //}
  if (LOG.isLoggable(Level.FINE)) {
    LOG.log(Level.FINE, "Search Criteria Object being saved = \n{0}", criteria.toString());
  }
  criteria = new SearchCriteria(criteria.toDom());
  criteria.getSearchFilterPageCursor().setCurrentPage(1);
  SavedSearchCriteria savedSearchCriteria =
    new SavedSearchCriteria(this.getSearchCriteria().getSavedSearchName(),
        criteria, this.extractRequestContext().getUser());

  ISearchSaveRepository saveRpstry =
    SearchSaveRpstryFactory.getSearchSaveRepository();
  saveRpstry.save(savedSearchCriteria);
  criteria.setSavedSearchName(null);

}
View Full Code Here

  if(LOG.isLoggable(Level.FINE)) {
    LOG.log(Level.FINE, "Current Search Criteria Object = \n{0}", this.getSearchCriteria().toString());
  }
  ISearchSaveRepository saveRepository = SearchSaveRpstryFactory
  .getSearchSaveRepository();
  SearchCriteria criteria =
    saveRepository.getSearchCriteria(id,
        this.extractRequestContext().getUser());
 
  this.getSearchCriteria().loadSearchCriteria(criteria.toDom());
  if(LOG.isLoggable(Level.FINE)) {
    LOG.log(Level.FINE, "Loaded Criteria Object = \n{0}", criteria.toString());
  }
}
View Full Code Here

protected void doSearch(int page, boolean doPrefetch)
throws SearchException {
  setWasSearched(true);
  LOG.fine("Event: Performing Search");
  this.getSearchResult().reset();
  SearchCriteria criteria = this.getSearchCriteria();

  if(LOG.isLoggable(Level.FINER)) {
    LOG.log(Level.FINER, "Search Criteria Object = \n{0}", criteria.toString());
  }
  PageCursor pageCursor = this.getSearchResult().getPageCursor();

  //record this for resetting the page cursor
  int recordsPerPage = pageCursor.getRecordsPerPage();
View Full Code Here

* Gets the rest search request url.
* @param format the format
* @return the rest search request url
*/
protected String getRestSearchRequestUrl(String format) {
  SearchCriteria criteria = this.getSearchCriteria();
  RequestContext context =  this.getContextBroker().extractRequestContext();
  HttpServletRequest request = this.getContextBroker().extractHttpServletRequest();
 
  MessageBroker messageBroker = this.getContextBroker().extractMessageBroker();
  RestUrlBuilder builder = RestUrlBuilder.newBuilder(context,request,messageBroker);
View Full Code Here

  @SuppressWarnings("unused")
  FacesContext fc = broker.getFacesContext();
  fc.getApplication().getViewHandler().createView(fc, SEARCH_PAGE);
 
  // intentionally not used
  SearchCriteria criteria =
    (SearchCriteria) broker.resolveManagedBean(JSFBEAN_SEARCH_CRITERIA);

  return criteria;
 
}
View Full Code Here

*/
private void setExtraCriteriaProperties(HttpServletRequest httpReq) {
  String rids = httpReq.getParameter("rids");
  String ridName = httpReq.getParameter("ridName");
  SearchCriteria criteria = this.getCriteria();
  SearchFiltersList filters = criteria.getMiscelleniousFilters();
  for(ISearchFilter filter:filters) {
    if(filter instanceof SearchFilterHarvestSites) {
      SearchFilterHarvestSites sfHs = (SearchFilterHarvestSites) filter;
      sfHs.setSelectedDistributedIds(rids);
      sfHs.setSelectedHarvestSiteName(ridName);
    }
  }
 
  boolean expandResults =
    Val.chkBool(httpReq.getParameter("expandResults"), false);
  criteria.setExpandResultContent(expandResults);
}
View Full Code Here

TOP

Related Classes of com.esri.gpt.catalog.search.SearchCriteria

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.