public SearchResults search(String username, String searchString) { final List<SearchMatch> matches = new ArrayList<SearchMatch>(); matches.add(new BasicSearchMatch("http://foo.com", "My Foo", "This is the excerpt", new BasicResourceType(applicationProperties, "someType"))); matches.add(new BasicSearchMatch("http://bar.com", "My Bar", "This is the bar excerpt", new BasicResourceType(applicationProperties, "someType2"))); return new SearchResults(matches, 2, 666); } }
public SearchResults search(String username, String searchString) { final List<SearchMatch> matches = new ArrayList<SearchMatch>(); matches.add(new BasicSearchMatch("http://foo.com", "My Foo", "This is the excerpt", new BasicResourceType(applicationProperties, "someType"))); matches.add(new BasicSearchMatch("http://bar.com", "My Bar", "This is the bar excerpt", new BasicResourceType(applicationProperties, "someType2"))); return new SearchResults(matches, 2, 666); }
public SearchResults search(String username, String searchString) { final List<SearchMatch> matches = new ArrayList<SearchMatch>(); matches.add(new BasicSearchMatch("http://foo.com", "My Foo", "This is the excerpt", new BasicResourceType(applicationProperties, "someType"))); matches.add(new BasicSearchMatch("http://bar.com", "My Bar", "This is the bar excerpt", new BasicResourceType(applicationProperties, "someType2"))); return new SearchResults(matches, 2, 666); } }
public SearchResults search(String username, String searchString) { final List<SearchMatch> matches = new ArrayList<SearchMatch>(); matches.add(new BasicSearchMatch("http://foo.com", "My Foo", "This is the excerpt", new BasicResourceType(applicationProperties, "someType"))); matches.add(new BasicSearchMatch("http://bar.com", "My Bar", "This is the bar excerpt", new BasicResourceType(applicationProperties, "someType2"))); return new SearchResults(matches, 2, 666); } }
private BasicSearchMatch createNewSearchMatch(Review review) { return new BasicSearchMatch(review.getLink(), review.getName(), StringUtils.defaultString(review.getDescription()), new BasicResourceType(applicationProperties, "review")); }
private List<SearchMatch> transformCrucibleResults(List<Integer> resultIds, int maxHits, String username) { final List<SearchMatch> matches = new ArrayList<SearchMatch>(); for (Integer resultId : resultIds) { if (matches.size() >= maxHits) { break; } final Review review = ReviewManager.getReviewById(resultId); final BasicSearchMatch searchMatch = new BasicSearchMatch(review.getLink(), review.getName(), review.getDescription(), new BasicResourceType(applicationProperties, "review")); matches.add(searchMatch); } return matches; }
private List<SearchMatch> transformResults(final Collection<Issue> issues) { final List<SearchMatch> matches = new ArrayList<SearchMatch>(); for (Issue issue : issues) { matches.add(new BasicSearchMatch(applicationProperties.getBaseUrl() + "/browse/" + issue.getKey(), "[" + issue.getKey() + "] " + issue.getSummary(), issue.getDescription(), new BasicResourceType(applicationProperties, issue.getIssueTypeObject().getId()))); } return matches; }
private List<SearchMatch> transformResults(final Collection<Issue> issues) { final List<SearchMatch> matches = new ArrayList<SearchMatch>(); for (Issue issue : issues) { matches.add(new BasicSearchMatch(applicationProperties.getBaseUrl() + "/browse/" + issue.getKey(), "[" + issue.getKey() + "] " + issue.getSummary(), issue.getDescription(), new BasicResourceType(applicationProperties, issue.getIssueTypeObject().getId()))); } return matches; }
private List<SearchMatch> transformFisheyeResults(final int maxHits, final String repositoryName, final SearchResultsExplorer results) throws Exception { final String baseUrl = applicationProperties.getBaseUrl(); final List<SearchResultsExplorer.GroupItem> groups = results.getGroups(); final List<SearchMatch> matches = new ArrayList<SearchMatch>(); int count = 0; for (final Iterator<GroupItem> iterator = groups.iterator(); iterator.hasNext() && count < maxHits; count++) { final SearchResultsExplorer.GroupItem groupItem = iterator.next(); final FileRevision firstRevision = groupItem.getFirst(); final List<FileRevision> revisionList = groupItem.getItems(); final String excerpt = buildExcerpt(firstRevision, revisionList); matches.add(new BasicSearchMatch(baseUrl + "/changelog/" + repositoryName + "/" + firstRevision.getPath() + "/?cs=" + firstRevision.getChangeSetId(), firstRevision.getChangeSetId() + " by " + firstRevision.getAuthor(), excerpt, new BasicResourceType(applicationProperties, "changeset"))); } return matches; }
private List<SearchMatch> transformFisheyeResults(final int maxHits, final String repositoryName, final SearchResultsExplorer results) throws Exception { final String baseUrl = applicationProperties.getBaseUrl(); final List<SearchResultsExplorer.GroupItem> groups = results.getGroups(); final List<SearchMatch> matches = new ArrayList<SearchMatch>(); int count = 0; for (final Iterator<GroupItem> iterator = groups.iterator(); iterator.hasNext() && count < maxHits; count++) { final SearchResultsExplorer.GroupItem groupItem = iterator.next(); final FileRevision firstRevision = groupItem.getFirst(); final List<FileRevision> revisionList = groupItem.getItems(); final String excerpt = buildExcerpt(firstRevision, revisionList); matches.add(new BasicSearchMatch(baseUrl + "/changelog/" + repositoryName + "/" + firstRevision.getPath() + "/?cs=" + firstRevision.getChangeSetId(), firstRevision.getChangeSetId() + " by " + firstRevision.getAuthor(), excerpt, new BasicResourceType(applicationProperties, "changeset"))); } return matches; }