Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2012-02-21 07:59:03 +0000
committerFrank Becker2012-02-21 07:59:03 +0000
commit5b126670ee3f8f3b8e69517a96b7d9f94f99acbc (patch)
treed984ade9eec43b1ed058ed7c54051838781a7272
parente87b60aee18c81693c4b05cd784848a08bae2be7 (diff)
downloadorg.eclipse.mylyn.tasks-5b126670ee3f8f3b8e69517a96b7d9f94f99acbc.tar.gz
org.eclipse.mylyn.tasks-5b126670ee3f8f3b8e69517a96b7d9f94f99acbc.tar.xz
org.eclipse.mylyn.tasks-5b126670ee3f8f3b8e69517a96b7d9f94f99acbc.zip
ASSIGNED - bug 372068: DELTA_TS is used for task and attachments
https://bugs.eclipse.org/bugs/show_bug.cgi?id=372068 Change-Id: I2a76249bdd841f80578e4ce7fe6d69417a952742
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentMapper.java25
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java3
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java17
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties1
5 files changed, 47 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentMapper.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentMapper.java
index b3f57f3cf..d659aa47c 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentMapper.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentMapper.java
@@ -11,6 +11,8 @@
package org.eclipse.mylyn.internal.bugzilla.core;
+import java.util.Date;
+
import org.eclipse.core.runtime.Assert;
import org.eclipse.mylyn.tasks.core.data.TaskAttachmentMapper;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
@@ -24,6 +26,8 @@ import org.eclipse.mylyn.tasks.core.data.TaskData;
public class BugzillaAttachmentMapper extends TaskAttachmentMapper {
private String token;
+ private Date deltaDate;
+
public String getToken() {
return token;
}
@@ -41,7 +45,7 @@ public class BugzillaAttachmentMapper extends TaskAttachmentMapper {
if (getAttachmentId() != null) {
mapper.setValue(taskAttribute, getAttachmentId());
}
- if (getAuthor() != null) {
+ if (getAuthor() != null && getAuthor().getPersonId() != null) {
TaskAttribute child = taskAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_AUTHOR);
TaskAttributeMetaData defaults = child.getMetaData().defaults();
defaults.setType(TaskAttribute.TYPE_PERSON);
@@ -111,6 +115,13 @@ public class BugzillaAttachmentMapper extends TaskAttachmentMapper {
defaults.setLabel(Messages.BugzillaAttachmentMapper_Token);
mapper.setValue(child, getToken());
}
+ if (getDeltaDate() != null) {
+ TaskAttribute child = taskAttribute.createMappedAttribute(BugzillaAttribute.DELTA_TS.getKey());
+ TaskAttributeMetaData defaults = child.getMetaData().defaults();
+ defaults.setType(TaskAttribute.TYPE_DATE);
+ defaults.setLabel(Messages.BugzillaAttachmentMapper_DELTA_TS);
+ mapper.setDateValue(child, getDeltaDate());
+ }
}
public static BugzillaAttachmentMapper createFrom(TaskAttribute taskAttribute) {
@@ -161,6 +172,18 @@ public class BugzillaAttachmentMapper extends TaskAttachmentMapper {
if (child != null) {
attachment.setToken(mapper.getValue(child));
}
+ child = taskAttribute.getMappedAttribute(BugzillaAttribute.DELTA_TS.getKey());
+ if (child != null) {
+ attachment.setDeltaDate(mapper.getDateValue(child));
+ }
return attachment;
}
+
+ public Date getDeltaDate() {
+ return deltaDate;
+ }
+
+ public void setDeltaDate(Date deltaDate) {
+ this.deltaDate = deltaDate;
+ }
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
index 026168442..961117824 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
@@ -1072,6 +1072,9 @@ public class BugzillaClient {
while (itr.hasNext()) {
TaskAttribute attrib = itr.next();
String id = attrib.getId();
+ if (id.equals(BugzillaAttribute.DELTA_TS.getKey())) {
+ continue;
+ }
String value = attrib.getValue();
if (id.equals(TaskAttribute.ATTACHMENT_AUTHOR) || id.equals("date") || id.equals("size") //$NON-NLS-1$ //$NON-NLS-2$
|| id.equals(TaskAttribute.ATTACHMENT_URL)) {
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java
index 88d53bcfd..766f9dd51 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java
@@ -197,6 +197,8 @@ public class Messages extends NLS {
public static String BugzillaAttachmentMapper_Creation_Date;
+ public static String BugzillaAttachmentMapper_DELTA_TS;
+
public static String BugzillaAttachmentMapper_Description;
public static String BugzillaAttachmentMapper_Filename;
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
index 070d4a299..aedf7d494 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
@@ -393,6 +393,23 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler {
attachment.setContentType(parsedText);
}
break;
+ case DELTA_TS:
+ if (attachment != null) {
+ try {
+ if (parsedText != null) {
+ try {
+ attachment.setDeltaDate(simpleFormatter.parse(parsedText));
+ } catch (ParseException e) {
+ }
+ }
+ } catch (NumberFormatException e) {
+ // ignore
+ }
+ } else {
+ createAttrribute(parsedText, tag);
+ }
+ break;
+
case SIZE:
if (attachment != null) {
try {
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties
index 119c132b2..c6871571f 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties
@@ -95,6 +95,7 @@ BugzillaAttribute_Attacher=Attacher
BugzillaAttachmentMapper_Author=Attachment Author:
BugzillaAttachmentMapper_Content_Type=Content Type:
BugzillaAttachmentMapper_Creation_Date=Creation Date:
+BugzillaAttachmentMapper_DELTA_TS=Modification Date
BugzillaAttachmentMapper_Description=Description:
BugzillaAttachmentMapper_Filename=Filename:
BugzillaAttachmentMapper_obsolete=obsolete

Back to the top