}
/* Attachments */
if(issue.getAttachments()!=null) {
for (Attachment attachment : issue.getAttachments().getAll()) {
TaskAttachmentMapper mapper = new TaskAttachmentMapper();
mapper.setAttachmentId("" + attachment.getId()); //$NON-NLS-1$
mapper.setAuthor(repository.createPerson(""+attachment.getAuthorId())); //$NON-NLS-1$
mapper.setDescription(attachment.getDescription());
mapper.setCreationDate(attachment.getCreatedOn());
mapper.setContentType(attachment.getContentType());
mapper.setFileName(attachment.getFilename());
mapper.setLength((long)attachment.getFilesize());
mapper.setUrl(String.format(IRedmineConstants.REDMINE_URL_ATTACHMENT_DOWNLOAD, repository.getUrl(), attachment.getId()));
taskAttribute = taskData.getRoot().createAttribute(TaskAttribute.PREFIX_ATTACHMENT + mapper.getAttachmentId());
mapper.applyTo(taskAttribute);
}
}
if(issue.getTimeEntries()!=null && issue.getTimeEntries().isViewAllowed()) {
//TODO kind/label
taskAttribute = taskData.getRoot().createAttribute(IRedmineConstants.TASK_ATTRIBUTE_TIMEENTRY_TOTAL);
if(issue.getTimeEntries()!=null) {
taskAttribute.setValue(""+issue.getTimeEntries().getSum()); //$NON-NLS-1$
for (TimeEntry timeEntry : issue.getTimeEntries().getAll()) {
RedmineTaskTimeEntryMapper mapper = new RedmineTaskTimeEntryMapper();
mapper.setTimeEntryId(timeEntry.getId());
mapper.setUser(repository.createPerson(""+timeEntry.getUserId())); //$NON-NLS-1$
mapper.setActivityId(timeEntry.getActivityId());
mapper.setHours(timeEntry.getHours());
mapper.setSpentOn(timeEntry.getSpentOn());
mapper.setComments(timeEntry.getComments());
mapper.setCustomValues(timeEntry.getCustomValues().getAll());
taskAttribute = taskData.getRoot().createAttribute(IRedmineConstants.TASK_ATTRIBUTE_TIMEENTRY_PREFIX + mapper.getTimeEntryId());
mapper.applyTo(taskAttribute, cfg);
}
}
}