Package com.esri.gpt.catalog.search

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


    distributedSearch.setSearchContext(searchContext);
    distributedSearch.addActionListener(sp);
    distributedSearch.search();
      
  } catch (Exception e) {
    throw new SearchException(e.getMessage(), e);
  }
  return searchResultRecords;

}
View Full Code Here


      String cswRequest = "";
      try {
        GetRecordsGenerator grg = new GetRecordsGenerator(context);
        cswRequest = grg.generateCswRequest(query);
      } catch (Exception e) {
        throw new SearchException(e);
      }

      // execute the query
      engine = SearchEngineFactory.createSearchEngine(criteria, result, context, messageBroker);
      SearchEngineCSW csw = (SearchEngineCSW) engine;
View Full Code Here

      record.setMetadataResourceURL(requestUrl);
      hasResourceUrl = true;
    }

    if (!hasFullMetadata && !hasResourceUrl) {
      throw new SearchException("Neither full metadata nor metadata"
          + " resource URL was found for the CSW record.");
    } else if (hasResourceUrl) {
      // need to load metadata from resource URL
      URL url = null;
      Exception ex = null;
      try {
        url = new URL(record.getMetadataResourceURL());

        HttpClientRequest clientRequest = HttpClientRequest.newRequest(
            HttpClientRequest.MethodName.GET, url.toExternalForm());
        // clientRequest.setConnectionTimeOut(getConnectionTimeout());
        //clientRequest.setResponseTimeOut(getResponseTimeout());
        clientRequest.execute();
        String response = clientRequest.readResponseAsCharacters();
        LOG.finer("Response from get Metadata url = " + url.toExternalForm()
            +"\n response = \n"+ response);
        record.setFullMetadata(response);
      } catch (MalformedURLException e) {
        ex = e;
      } catch (IOException e) {
        ex = e;
      }
      if(ex != null) {
        throw new SearchException("Could not get metadata id url = " + url, ex);
      }

     
    }
View Full Code Here

}
// Before search, validate will be called. An exception can be thrown
// that will stop the search and the error is displayed on the search page
public void validate() throws SearchException {
if (this.getHierarchy().equals("this should throw an exception")) {
throw new SearchException("this should throw an exception");
}
}
View Full Code Here

TOP

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

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.