private Collection<Long> findMostRecentlyUpdatedIssueIds(int maxResults, Collection<String> userkeys, Collection<Long> projects, ApplicationUser remoteUser) { // JRADEV-11735: special case used when we just want all updated issues regardless of who did the updating (such // as when we're displaying the activity stream for the whole JIRA). return findMostRecentlyUpdatedIssueIdsByUsers(projects, userkeys, maxResults); }
@Override public List<ChangeHistory> getChangeHistoriesForUser(Iterable<Issue> issues, ApplicationUser remoteUser) { return getAllChangeHistories(issues); }
@Override @Deprecated public Map<String, String> findAllPossibleValues(final String field) { notNull("field", field); final OfBizListIterator iterator = getAllChangeItemsContainingValueAndString(field); if (iterator != null) { try { return collectFieldValues(iterator); } finally { iterator.close(); } } else { return Collections.emptyMap(); } }
public Collection<Issue> findUserHistory(final ApplicationUser remoteUser, final Collection<String> userkeys, final int maxResults) { // Only search in projects that we have permission to see final Collection<Project> projectObjects = permissionManager.getProjects(BROWSE_PROJECTS, remoteUser); final Collection<Long> projectIds = new ArrayList<Long>(projectObjects.size()); for (Project project : projectObjects) { projectIds.add(project.getId()); } return doFindUserHistory(remoteUser, userkeys, projectIds, maxResults); }
public Collection<String> getPreviousIssueKeys(final String issueKey) { notNull("issueKey", issueKey); Issue theIssue = issueManager.getIssueObject(issueKey); if (theIssue == null) { return Collections.emptySet(); } return getPreviousIssueKeys(theIssue.getId()); }
private Collection<Long> findMostRecentlyUpdatedIssueIdsByUsers(Collection<Long> projects, @Nonnull Collection<String> userkeys, int maxResults) { final Set<Long> issueIds = new LinkedHashSet<Long>(); OfBizListIterator changeGroupIssueViewIt = null; OfBizListIterator actionIssueViewIt = null; try { // filter by project and username EntityCondition entityCondition = new EntityConditionList(ImmutableList.<EntityCondition>of( new EntityExpr("project", IN, projects), new EntityExpr("author", IN, userkeys) ), AND); EntityFindOptions entityFindOptions = findOptions().maxResults(maxResults); //Get changegroup history. changeGroupIssueViewIt = ofBizDelegator.findListIteratorByCondition("ChangeGroupIssueView", entityCondition, null, FIELDS_TO_SELECT, ImmutableList.of("created DESC"), entityFindOptions); issueIds.addAll(extractIssueIds(maxResults, changeGroupIssueViewIt)); //Get comment history. actionIssueViewIt = ofBizDelegator.findListIteratorByCondition("ActionIssueView", entityCondition, null, FIELDS_TO_SELECT, ImmutableList.of("created DESC"), entityFindOptions); issueIds.addAll(extractIssueIds(maxResults, actionIssueViewIt)); return issueIds; } finally { // close the iterators to avoid connection leaks if (actionIssueViewIt != null) { actionIssueViewIt.close(); } if (changeGroupIssueViewIt != null) { changeGroupIssueViewIt.close(); } } }
try final IssueIdCollector issueIdCollector = getIssueIdCollector(); searchProvider.searchAndSortOverrideSecurity(query, remoteUser, issueIdCollector, new PagerFilter(0, maxResults)); return Lists.transform(Lists.newArrayList(issueIdCollector.getIssueIds()), new Function<String, Long>()
final Collection<Long> issueIds = findMostRecentlyUpdatedIssueIds(maxResults, userkeys, projects, remoteUser); if (issueIds.isEmpty())
public Collection<Issue> findUserHistory(final ApplicationUser remoteUser, final Collection<String> userkeys, final Collection<Project> projects, final int maxResults) { // Filter out the projects that we can't see final ApplicationUser user = remoteUser; final Collection<Long> filteredProjectIds = new ArrayList<Long>(projects.size()); for (Project project : projects) { if (permissionManager.hasPermission(BROWSE_PROJECTS, project, user)) { filteredProjectIds.add(project.getId()); } } return doFindUserHistory(remoteUser, userkeys, filteredProjectIds, maxResults); }
@Override public List<ChangeHistory> getChangeHistories(final Issue issue) { return getAllChangeHistories(ImmutableList.of(issue)); }
public List<ChangeHistory> getChangeHistoriesForUser(final Issue issue, final ApplicationUser remoteUser) { return getAllChangeHistories(ImmutableList.of(issue)); }