diff options
author | fbecker | 2011-05-30 03:56:00 +0000 |
---|---|---|
committer | fbecker | 2011-05-30 03:56:00 +0000 |
commit | 1ff7e0bd7ef8653133985473b4eef38a7ae3bbee (patch) | |
tree | 8959aff692496869c7c64f6e4d7fe8b256913e54 /org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java | |
parent | 81be28de6992a80d43b12832d3f7d0fc6baad7d9 (diff) | |
download | org.eclipse.mylyn.tasks-1ff7e0bd7ef8653133985473b4eef38a7ae3bbee.tar.gz org.eclipse.mylyn.tasks-1ff7e0bd7ef8653133985473b4eef38a7ae3bbee.tar.xz org.eclipse.mylyn.tasks-1ff7e0bd7ef8653133985473b4eef38a7ae3bbee.zip |
ASSIGNED - bug 345847: [patch][api] create UI for private comments and attachments
https://bugs.eclipse.org/bugs/show_bug.cgi?id=345847
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java')
-rw-r--r-- | org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java | 34 |
1 files changed, 23 insertions, 11 deletions
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 b98341a33..c912bc3b0 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 @@ -124,9 +124,9 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { case BUGZILLA: // Note: here we can get the bugzilla version if necessary // String version = attributes.getValue("version"); -// String urlbase = attributes.getValue("urlbase"); +// urlbase = attributes.getValue("urlbase"); //$NON-NLS-1$ // String maintainer = attributes.getValue("maintainer"); - exporter = attributes.getValue("exporter"); + exporter = attributes.getValue("exporter"); //$NON-NLS-1$ break; case BUG: if (attributes != null && (attributes.getValue("error") != null)) { //$NON-NLS-1$ @@ -141,7 +141,8 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { token = null; break; case LONG_DESC: - taskComment = new TaskComment(commentNum++); + String is_private = attributes.getValue("isprivate"); + taskComment = new TaskComment(is_private); break; case WHO: if (taskComment != null) { @@ -317,7 +318,7 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { break; } - // Comment attributes + // Comment attributes case WHO: if (taskComment != null) { taskComment.author = parsedText; @@ -522,6 +523,11 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { BugzillaUtil.createAttributeWithKindDefaultIfUsed(parsedText, tag, repositoryTaskData, IBugzillaConstants.BUGZILLA_PARAM_USE_SEE_ALSO, false); break; + case COMMENTID: + if (taskComment != null) { + taskComment.id = Integer.parseInt(parsedText); + } + break; default: createAttrribute(parsedText, tag); break; @@ -667,6 +673,7 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { .createPerson(comment.author); author.setName(comment.authorName); taskComment.setAuthor(author); + taskComment.setIsPrivate(comment.isPrivate.equals("1")); //$NON-NLS-1$ TaskAttribute attrTimestamp = attribute.createAttribute(BugzillaAttribute.BUG_WHEN.getKey()); attrTimestamp.setValue(comment.createdTimeStamp); taskComment.setCreationDate(repositoryTaskData.getAttributeMapper().getDateValue(attrTimestamp)); @@ -683,6 +690,13 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { workTime.setValue(comment.timeWorked); } + if (comment.id != 0) { + TaskAttribute commentID = BugzillaTaskDataHandler.createAttribute(attribute, BugzillaAttribute.COMMENTID); + commentID.setValue(Integer.toString(comment.id)); + int i = 9; + i++; + } + parseAttachment(taskComment); } @@ -723,6 +737,8 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { @SuppressWarnings("unused") public int number; + public int id; + public String author; public String authorName; @@ -733,14 +749,10 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { public String timeWorked; - @SuppressWarnings("unused") - public boolean hasAttachment; - - @SuppressWarnings("unused") - public String attachmentId; + public String isPrivate; - public TaskComment(int num) { - this.number = num; + public TaskComment(String isprivate) { + this.isPrivate = isprivate; } } |