Package edu.uga.galileo.voci.bo

Examples of edu.uga.galileo.voci.bo.SearchResult


          User user = (User) request.getSession()
              .getAttribute("user");
          // if user is null, stick with the default that none of
          // the results is editable
          if (user != null) {
            SearchResult result;
            boolean includeExtras = request
                .getParameter("includeExtras") == null ? false
                : true;
            for (int m = results.size() - 1; m >= 0; m--) {
              result = results.get(m);
              try {
                if (wm.canEdit(user, pm.getProjectHandle(result
                    .getProjectId()), ContentType.valueOf(
                    result.getVBO().getType()).getPlural(),
                    result.getVBO().getId())) {
                  result.setUserEditable(true);
                } else if (!includeExtras) {
                  results.remove(m);
                }
              } catch (NoSuchProjectException e) {
                Logger
                    .error("Couldn't get project handle for ID "
                        + result.getProjectId());
              }
            }
          }
        }
View Full Code Here


            if (Pattern.matches(regexQuery, value)) {
              if (partialResults == null) {
                partialResults = new ArrayList<SearchResult>();
              }

              partialResults.add(new SearchResult(id, multiplier,
                  contentType, projectID));
            }
          }
        }
      } else {
        Logger.debug("advanced subquery: " + splitQuery[m]);
        partialResults = performQueryNewer(splitQuery[m]
            .substring(splitQuery[m].indexOf(':') + 1), searchType,
            projectID, activeOnly, allowsZero, metadataId, null,
            includeSupportProjects, includeOnly, username,
            updateDateStart, updateDateEnd);
      }

      if (partialResults != null) {
        if (results.size() == 0) {
          Logger.debug("===>>> adding results: "
              + partialResults.size());
          results.addAll(partialResults);
        } else {
          if ((searchType == SearchType.AND)
              || ((searchType == SearchType.REGEX))) {
            for (int n = results.size() - 1; n >= 0; n--) {
              if (!partialResults.contains(results.get(n))) {
                Logger.debug("===>>> remove result: "
                    + results.get(n));
                results.remove(n);
              } else {
                SearchResult firstResult = results.get(n);
                SearchResult secondResult = partialResults
                    .get(partialResults.indexOf(results
                        .get(n)));
                firstResult.setWeight(firstResult.getWeight()
                    + secondResult.getWeight());
              }
            }
          } else if (searchType == SearchType.OR) {
            for (int n = partialResults.size() - 1; n >= 0; n--) {
              if (!results.contains(partialResults.get(n))) {
                Logger.debug("===>>> adding result: "
                    + partialResults.get(n));
                results.add(partialResults.get(n));
              } else {
                SearchResult firstResult = partialResults
                    .get(n);
                SearchResult secondResult = results.get(results
                    .indexOf(partialResults.get(n)));
                secondResult.setWeight(secondResult.getWeight()
                    + firstResult.getWeight());
              }
            }
          }
        }
View Full Code Here

      } else {
        weight = weights.get(id);
      }
      ctype = contentTypes.get(m);
      pid = projectIDs.get(m);
      results.add(new SearchResult(id, weight, ctype, pid));
    }

    return results;
  }
View Full Code Here

TOP

Related Classes of edu.uga.galileo.voci.bo.SearchResult

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.