@Override public List<GenericValue> getEntitiesByIssueObject(final String relationName, final Issue issue) throws GenericEntityException {return delegate.getEntitiesByIssueObject(relationName, issue);}
public boolean hasWorkStarted(Issue issue) { if (issue.getGenericValue() == null) { return false; } try { return !issueManager.getEntitiesByIssueObject(IssueRelationConstants.TYPE_WORKLOG, issue).isEmpty(); } catch (Exception e) { return true; } }
public List<Comment> apply(final Issue issue) { final List<Comment> comments = new ArrayList<Comment>(); try { // get a List<GenericValue> of comments final List<GenericValue> allComments = issueManager.getEntitiesByIssueObject(IssueRelationConstants.COMMENTS, issue); for (final GenericValue element : allComments) { comments.add(new SimpleComment(element, issue)); } } catch (final GenericEntityException e) { throw new DataAccessException(e); } Collections.sort(comments, CommentComparator.COMPARATOR); return comments; } }
public List<Comment> getComments(Issue issue) { List<Comment> comments = new ArrayList<Comment>(); try { // get a List<GenericValue> of comments List allComments = issueManager.getEntitiesByIssueObject(IssueRelationConstants.COMMENTS, issue); for (final Object allComment : allComments) { Comment comment = convertToComment((GenericValue) allComment, issue); comments.add(comment); } } catch (GenericEntityException e) { throw new DataAccessException(e); } Collections.sort(comments, CommentComparator.COMPARATOR); return comments; }
public List<Comment> getCommentsForUser(Issue issue, ApplicationUser user) { List<Comment> visibleComments; try { // get a List<GenericValue> of comments List<GenericValue> allComments = issueManager.getEntitiesByIssueObject(IssueRelationConstants.COMMENTS, issue); visibleComments = getVisibleComments(issue, user, allComments); } catch (GenericEntityException e) { throw new DataAccessException(e); } Collections.sort(visibleComments, CommentComparator.COMPARATOR); return visibleComments; }
public List<ChangeHistoryGroup> apply(final Issue issue) { final List<ChangeHistoryGroup> changeGroups = new ArrayList<ChangeHistoryGroup>(); try { // get a List<GenericValue> of changes final List<GenericValue> allChanges = issueManager.getEntitiesByIssueObject(IssueRelationConstants.CHANGE_GROUPS, issue); for (final GenericValue element : allChanges) { final List<ChangeHistoryItem> changes = new ArrayList<ChangeHistoryItem>(); final List<GenericValue> changeitems = element.getRelated("ChildChangeItem"); for (final GenericValue changeItem : changeitems) { changes.add(new ChangeHistoryItem(changeItem.getLong("id"), changeItem.getLong("group"), issue.getProjectObject().getId(),issue.getId(), issue.getKey(), "status", new Timestamp(System.currentTimeMillis()), changeItem.getString("oldstring"), changeItem.getString("newstring"), changeItem.getString("oldvalue"), changeItem.getString("newvalue"), element.getString("author"))); } changeGroups.add(new ChangeHistoryGroup(element.getLong("id"), issue.getProjectObject().getId(), issue.getId(), issue.getKey(), element.getString("author"), changes, element.getTimestamp("created"))); } } catch (final Exception e) { throw new DataAccessException(e); } return changeGroups; } }