View | Details | Raw Unified | Return to bug 302654 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java (-1 / +4 lines)
Lines 185-191 Link Here
185
185
186
	BUGS(Messages.BugzillaAttribute_used_by_search_engine_bugs, "bugs", null, false, false), //$NON-NLS-1$
186
	BUGS(Messages.BugzillaAttribute_used_by_search_engine_bugs, "bugs", null, false, false), //$NON-NLS-1$
187
187
188
	QUERY_TIMESTAMP(Messages.BugzillaAttribute_Query_Timestamp, "query_timestamp", null, false, false); //$NON-NLS-1$
188
	QUERY_TIMESTAMP(Messages.BugzillaAttribute_Query_Timestamp, "query_timestamp", null, false, false), //$NON-NLS-1$
189
190
	// new in Bugzilla 3.6
191
	ATTACHER(Messages.BugzillaAttribute_Attacher, "attacher", null, false, false); //$NON-NLS-1$
189
192
190
	private final boolean isHidden;
193
	private final boolean isHidden;
191
194
(-)src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java (+2 lines)
Lines 177-182 Link Here
177
177
178
	public static String BugzillaAttribute_Worked;
178
	public static String BugzillaAttribute_Worked;
179
179
180
	public static String BugzillaAttribute_Attacher;
181
180
	public static String BugzillaAttachmentMapper_Author;
182
	public static String BugzillaAttachmentMapper_Author;
181
183
182
	public static String BugzillaAttachmentMapper_Content_Type;
184
	public static String BugzillaAttachmentMapper_Content_Type;
(-)src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java (-5 / +26 lines)
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());
(-)src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties (+1 lines)
Lines 84-89 Link Here
84
BugzillaAttribute_who=who
84
BugzillaAttribute_who=who
85
BugzillaAttribute_who_name=who_name
85
BugzillaAttribute_who_name=who_name
86
BugzillaAttribute_Worked=Worked:
86
BugzillaAttribute_Worked=Worked:
87
BugzillaAttribute_BugzillaAttribute_Attacher=Attacher
87
88
88
BugzillaAttachmentMapper_Author=Attachment Author:
89
BugzillaAttachmentMapper_Author=Attachment Author:
89
BugzillaAttachmentMapper_Content_Type=Content Type:
90
BugzillaAttachmentMapper_Content_Type=Content Type:

Return to bug 302654