### Eclipse Workspace Patch 1.0 #P org.eclipse.mylyn.bugzilla.core Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java,v retrieving revision 1.20 diff -u -r1.20 BugzillaAttribute.java --- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java 20 Aug 2009 20:35:44 -0000 1.20 +++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java 13 Feb 2010 22:31:13 -0000 @@ -185,7 +185,10 @@ BUGS(Messages.BugzillaAttribute_used_by_search_engine_bugs, "bugs", null, false, false), //$NON-NLS-1$ - QUERY_TIMESTAMP(Messages.BugzillaAttribute_Query_Timestamp, "query_timestamp", null, false, false); //$NON-NLS-1$ + QUERY_TIMESTAMP(Messages.BugzillaAttribute_Query_Timestamp, "query_timestamp", null, false, false), //$NON-NLS-1$ + + // new in Bugzilla 3.6 + ATTACHER(Messages.BugzillaAttribute_Attacher, "attacher", null, false, false); //$NON-NLS-1$ private final boolean isHidden; Index: src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java,v retrieving revision 1.11 diff -u -r1.11 Messages.java --- src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java 24 Jan 2010 14:30:04 -0000 1.11 +++ src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java 13 Feb 2010 22:31:13 -0000 @@ -177,6 +177,8 @@ public static String BugzillaAttribute_Worked; + public static String BugzillaAttribute_Attacher; + public static String BugzillaAttachmentMapper_Author; public static String BugzillaAttachmentMapper_Content_Type; Index: src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java,v retrieving revision 1.53 diff -u -r1.53 SaxMultiBugReportContentHandler.java --- src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java 24 Jan 2010 14:30:04 -0000 1.53 +++ src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java 13 Feb 2010 22:31:13 -0000 @@ -11,6 +11,8 @@ package org.eclipse.mylyn.internal.bugzilla.core; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -75,6 +77,8 @@ private final BugzillaRepositoryConnector connector; + private final SimpleDateFormat simpleFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm"); //$NON-NLS-1$ + public SaxMultiBugReportContentHandler(TaskAttributeMapper mapper, TaskDataCollector collector, Map taskDataMap, List customFields, BugzillaRepositoryConnector connector) { @@ -341,7 +345,14 @@ attachment.setToken(null); break; case DATE: - // ignore + if (attachment != null) { + try { + attachment.setCreationDate(simpleFormatter.parse(parsedText)); + break; + } catch (ParseException e) { + } catch (NumberFormatException e) { + } + } break; case DESC: if (attachment != null) { @@ -457,6 +468,14 @@ token = parsedText; } break; + case ATTACHER: + if (attachment != null) { + IRepositoryPerson author = repositoryTaskData.getAttributeMapper().getTaskRepository().createPerson( + parsedText); + author.setName(parsedText); + attachment.setAuthor(author); + } + break; default: TaskAttribute defaultAttribute = repositoryTaskData.getRoot().getMappedAttribute(tag.getKey()); if (defaultAttribute == null) { @@ -521,10 +540,12 @@ repositoryTaskData, TaskAttribute.TYPE_ATTACHMENT); for (TaskAttribute attachment : taskAttachments) { BugzillaAttachmentMapper attachmentMapper = BugzillaAttachmentMapper.createFrom(attachment); - TaskCommentMapper taskComment = attachIdToComment.get(attachmentMapper.getAttachmentId()); - if (taskComment != null) { - attachmentMapper.setAuthor(taskComment.getAuthor()); - attachmentMapper.setCreationDate(taskComment.getCreationDate()); + if (attachmentMapper.getAuthor() == null || attachmentMapper.getCreationDate() == null) { + TaskCommentMapper taskComment = attachIdToComment.get(attachmentMapper.getAttachmentId()); + if (taskComment != null) { + attachmentMapper.setAuthor(taskComment.getAuthor()); + attachmentMapper.setCreationDate(taskComment.getCreationDate()); + } } attachmentMapper.setUrl(repositoryTaskData.getRepositoryUrl() + IBugzillaConstants.URL_GET_ATTACHMENT_SUFFIX + attachmentMapper.getAttachmentId()); Index: src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties =================================================================== RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties,v retrieving revision 1.15 diff -u -r1.15 messages.properties --- src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties 24 Jan 2010 14:30:04 -0000 1.15 +++ src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties 13 Feb 2010 22:31:13 -0000 @@ -84,6 +84,7 @@ BugzillaAttribute_who=who BugzillaAttribute_who_name=who_name BugzillaAttribute_Worked=Worked: +BugzillaAttribute_BugzillaAttribute_Attacher=Attacher BugzillaAttachmentMapper_Author=Attachment Author: BugzillaAttachmentMapper_Content_Type=Content Type: