|
Lines 11-16
Link Here
|
| 11 |
|
11 |
|
| 12 |
package org.eclipse.mylyn.internal.bugzilla.core; |
12 |
package org.eclipse.mylyn.internal.bugzilla.core; |
| 13 |
|
13 |
|
|
|
14 |
import java.text.ParseException; |
| 15 |
import java.text.SimpleDateFormat; |
| 14 |
import java.util.ArrayList; |
16 |
import java.util.ArrayList; |
| 15 |
import java.util.HashMap; |
17 |
import java.util.HashMap; |
| 16 |
import java.util.List; |
18 |
import java.util.List; |
|
Lines 75-80
Link Here
|
| 75 |
|
77 |
|
| 76 |
private final BugzillaRepositoryConnector connector; |
78 |
private final BugzillaRepositoryConnector connector; |
| 77 |
|
79 |
|
|
|
80 |
private final SimpleDateFormat simpleFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm"); //$NON-NLS-1$ |
| 81 |
|
| 78 |
public SaxMultiBugReportContentHandler(TaskAttributeMapper mapper, TaskDataCollector collector, |
82 |
public SaxMultiBugReportContentHandler(TaskAttributeMapper mapper, TaskDataCollector collector, |
| 79 |
Map<String, TaskData> taskDataMap, List<BugzillaCustomField> customFields, |
83 |
Map<String, TaskData> taskDataMap, List<BugzillaCustomField> customFields, |
| 80 |
BugzillaRepositoryConnector connector) { |
84 |
BugzillaRepositoryConnector connector) { |
|
Lines 341-347
Link Here
|
| 341 |
attachment.setToken(null); |
345 |
attachment.setToken(null); |
| 342 |
break; |
346 |
break; |
| 343 |
case DATE: |
347 |
case DATE: |
| 344 |
// ignore |
348 |
if (attachment != null) { |
|
|
349 |
try { |
| 350 |
attachment.setCreationDate(simpleFormatter.parse(parsedText)); |
| 351 |
break; |
| 352 |
} catch (ParseException e) { |
| 353 |
} catch (NumberFormatException e) { |
| 354 |
} |
| 355 |
} |
| 345 |
break; |
356 |
break; |
| 346 |
case DESC: |
357 |
case DESC: |
| 347 |
if (attachment != null) { |
358 |
if (attachment != null) { |
|
Lines 457-462
Link Here
|
| 457 |
token = parsedText; |
468 |
token = parsedText; |
| 458 |
} |
469 |
} |
| 459 |
break; |
470 |
break; |
|
|
471 |
case ATTACHER: |
| 472 |
if (attachment != null) { |
| 473 |
IRepositoryPerson author = repositoryTaskData.getAttributeMapper().getTaskRepository().createPerson( |
| 474 |
parsedText); |
| 475 |
author.setName(parsedText); |
| 476 |
attachment.setAuthor(author); |
| 477 |
} |
| 478 |
break; |
| 460 |
default: |
479 |
default: |
| 461 |
TaskAttribute defaultAttribute = repositoryTaskData.getRoot().getMappedAttribute(tag.getKey()); |
480 |
TaskAttribute defaultAttribute = repositoryTaskData.getRoot().getMappedAttribute(tag.getKey()); |
| 462 |
if (defaultAttribute == null) { |
481 |
if (defaultAttribute == null) { |
|
Lines 521-530
Link Here
|
| 521 |
repositoryTaskData, TaskAttribute.TYPE_ATTACHMENT); |
540 |
repositoryTaskData, TaskAttribute.TYPE_ATTACHMENT); |
| 522 |
for (TaskAttribute attachment : taskAttachments) { |
541 |
for (TaskAttribute attachment : taskAttachments) { |
| 523 |
BugzillaAttachmentMapper attachmentMapper = BugzillaAttachmentMapper.createFrom(attachment); |
542 |
BugzillaAttachmentMapper attachmentMapper = BugzillaAttachmentMapper.createFrom(attachment); |
| 524 |
TaskCommentMapper taskComment = attachIdToComment.get(attachmentMapper.getAttachmentId()); |
543 |
if (attachmentMapper.getAuthor() == null || attachmentMapper.getCreationDate() == null) { |
| 525 |
if (taskComment != null) { |
544 |
TaskCommentMapper taskComment = attachIdToComment.get(attachmentMapper.getAttachmentId()); |
| 526 |
attachmentMapper.setAuthor(taskComment.getAuthor()); |
545 |
if (taskComment != null) { |
| 527 |
attachmentMapper.setCreationDate(taskComment.getCreationDate()); |
546 |
attachmentMapper.setAuthor(taskComment.getAuthor()); |
|
|
547 |
attachmentMapper.setCreationDate(taskComment.getCreationDate()); |
| 548 |
} |
| 528 |
} |
549 |
} |
| 529 |
attachmentMapper.setUrl(repositoryTaskData.getRepositoryUrl() |
550 |
attachmentMapper.setUrl(repositoryTaskData.getRepositoryUrl() |
| 530 |
+ IBugzillaConstants.URL_GET_ATTACHMENT_SUFFIX + attachmentMapper.getAttachmentId()); |
551 |
+ IBugzillaConstants.URL_GET_ATTACHMENT_SUFFIX + attachmentMapper.getAttachmentId()); |