Package com.esri.gpt.catalog.search

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


* @throws SearchException if an exception occurs
*/
private List<SelectItem> loadSavedSearches(RequestContext requestContext)
  throws SearchException {
  List<SelectItem> list = new ArrayList<SelectItem>();
  ISearchSaveRepository saveRpstry = SearchSaveRpstryFactory.getSearchSaveRepository();
  SavedSearchCriterias savedCriterias = saveRpstry.getSavedList(requestContext.getUser());
  for(SavedSearchCriteria savedCriteria: savedCriterias){
    SelectItem selectItem = new SelectItem();
    selectItem.setValue(savedCriteria.getId());
    selectItem.setLabel(savedCriteria.getName());
    list.add(selectItem);
View Full Code Here


    FacesContextBroker facesBroker = new FacesContextBroker();
    Map requestMap = facesBroker.getExternalContext().getRequestParameterMap();
    try {
      String searchId = (String)
      requestMap.get(SearchEvents.Event.PARAM_UUID);
      ISearchSaveRepository searchSaveRepository =
        SearchSaveRpstryFactory.getSearchSaveRepository();
      searchSaveRepository.delete(searchId,
          this.extractRequestContext().getUser());
    } finally {
      this.setSavedSearchesPanelStyle("");
      savedSearches = loadSavedSearches(context);
     
View Full Code Here

  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

  LOG.info("Event: Performing Load");
 
  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

*/
private void putSavedSearches(HttpServletRequest request,
    HttpServletResponse response, RequestContext context)
  throws SearchException, IOException, JSONException {
 
  ISearchSaveRepository saveRpstry =
    SearchSaveRpstryFactory.getSearchSaveRepository();
  if(saveRpstry instanceof GptRepository) {
    ((GptRepository) saveRpstry).setRequestContext(context);
  }
   
  SavedSearchCriterias savedSearchCriterias =
    saveRpstry.getSavedList(context.getUser());
  if(savedSearchCriterias.size() >=
    SearchConfig.getConfiguredInstance().getMaxSavedSearches()) {
    MessageBroker messageBroker =
      new FacesContextBroker(request,response).extractMessageBroker();
    String message =
      messageBroker.getMessage("catalog.search.error.maxSavedSearchesReached")
        .getSummary();
    writeSavedSearches(request, response, context, message);
    return;
  }
 
  String body = IOUtils.toString(request.getInputStream(), "UTF-8");
  Map<String, String> paramMap = urlToParamMap(body);
 
  String name = "";
  String criteria = "";
  name = paramMap.get("name");
  if("".equals(Val.chkStr(name))) {
    MessageBroker messageBroker =
      new FacesContextBroker(request,response).extractMessageBroker();
    String message =
      messageBroker.getMessage("catalog.search.savedSearches.noSaveName")
        .getSummary();
    writeSavedSearches(request, response, context, message);
    return;
  }
  criteria = Val.chkStr(paramMap.get("criteria"));
  if(criteria.contains("?")) {
    criteria = criteria.substring(criteria.indexOf("?"));
    criteria = criteria.replace("?", "");
  }
 
  saveRpstry.save(name, criteria, context.getUser());
  writeSavedSearches(request, response, context);
 
}
View Full Code Here

  Map<String, String> urlParams = urlToParamMap(url);
  String id = Val.chkStr(urlParams.get("id"));
  if(id.equals("")) {
    id = Val.chkStr(request.getParameter("id"));
  }
  ISearchSaveRepository saveRpstry =
    SearchSaveRpstryFactory.getSearchSaveRepository();
  if(saveRpstry instanceof GptRepository) {
    ((GptRepository) saveRpstry).setRequestContext(context);
  }
  saveRpstry.delete(id, context.getUser());
  writeSavedSearches(request, response, context);
 
}
View Full Code Here

*/
private void writeSavedSearches(HttpServletRequest request,
    HttpServletResponse response, RequestContext context, String errorMessage)
  throws SearchException, JSONException, IOException {

  ISearchSaveRepository saveRpstry =
    SearchSaveRpstryFactory.getSearchSaveRepository();
  if(saveRpstry instanceof GptRepository) {
    ((GptRepository) saveRpstry).setRequestContext(context);
  }
  SavedSearchCriterias savedCriterias =
    saveRpstry.getSavedList(context.getUser());
  JSONArray resultsArray = new JSONArray();
  for(SavedSearchCriteria savedCriteria: savedCriterias){
    JSONObject jObj = new JSONObject();
    jObj.put("id", savedCriteria.getId());
    jObj.put("name", savedCriteria.getName());
View Full Code Here

TOP

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

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.