diff options
author | relves | 2009-05-29 23:58:54 +0000 |
---|---|---|
committer | relves | 2009-05-29 23:58:54 +0000 |
commit | 3f652233314e32e98fd8e2441b93dc194f9507a1 (patch) | |
tree | e128522b6348427a3f0900cd68b723dc6efd12f7 /org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java | |
parent | b177d197242a2d019a1ed2e35abcda647ef7c058 (diff) | |
download | org.eclipse.mylyn.tasks-3f652233314e32e98fd8e2441b93dc194f9507a1.tar.gz org.eclipse.mylyn.tasks-3f652233314e32e98fd8e2441b93dc194f9507a1.tar.xz org.eclipse.mylyn.tasks-3f652233314e32e98fd8e2441b93dc194f9507a1.zip |
NEW - bug 271018: [patch] add support for passing security token upon editing attachments
https://bugs.eclipse.org/bugs/show_bug.cgi?id=271018
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 | 21 |
1 files changed, 19 insertions, 2 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 1146ee89b..7025d79c3 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 @@ -50,7 +50,7 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { private int commentNum = 0; - private TaskAttachmentMapper attachment; + private BugzillaAttachmentMapper attachment; private final Map<String, TaskData> taskDataMap; @@ -68,6 +68,8 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { private boolean isPatch = false; + private String token; + private TaskAttribute attachmentAttribute; public SaxMultiBugReportContentHandler(TaskAttributeMapper mapper, TaskDataCollector collector, @@ -119,6 +121,7 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { commentNum = 0; taskComment = null; longDescs = new ArrayList<TaskComment>(); + token = null; break; case LONG_DESC: taskComment = new TaskComment(commentNum++); @@ -325,11 +328,12 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { case ATTACHID: attachmentAttribute = repositoryTaskData.getRoot().createAttribute( TaskAttribute.PREFIX_ATTACHMENT + parsedText); - attachment = TaskAttachmentMapper.createFrom(attachmentAttribute); + attachment = BugzillaAttachmentMapper.createFrom(attachmentAttribute); attachment.setLength(new Long(-1)); attachment.setAttachmentId(parsedText); attachment.setPatch(isPatch); attachment.setDeprecated(isDeprecated); + attachment.setToken(null); break; case DATE: // ignore @@ -397,6 +401,12 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { updateCustomFields(repositoryTaskData); + if (token != null) { + TaskAttribute tokenAttribute = BugzillaTaskDataHandler.createAttribute(repositoryTaskData, + BugzillaAttribute.TOKEN); + tokenAttribute.setValue(token); + } + // Guard against empty data sets if (attrCreation != null && !attrCreation.equals("")) { //$NON-NLS-1$ collector.accept(repositoryTaskData); @@ -422,6 +432,13 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { case FLAG: //ignore break; + case TOKEN: + if (attachment != null) { + attachment.setToken(parsedText); + } else { + token = parsedText; + } + break; default: TaskAttribute defaultAttribute = repositoryTaskData.getRoot().getMappedAttribute(tag.getKey()); if (defaultAttribute == null) { |