diff options
author | fbecker | 2010-08-09 19:46:40 +0000 |
---|---|---|
committer | fbecker | 2010-08-09 19:46:40 +0000 |
commit | 40bd3136fd16f79de80ed79337f73341e19b10ce (patch) | |
tree | 1687e9837961caba33fdbd967d45df778b445dc3 /org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java | |
parent | 519e0789401dca14290a20f53cfd758c27d4d315 (diff) | |
download | org.eclipse.mylyn.tasks-40bd3136fd16f79de80ed79337f73341e19b10ce.tar.gz org.eclipse.mylyn.tasks-40bd3136fd16f79de80ed79337f73341e19b10ce.tar.xz org.eclipse.mylyn.tasks-40bd3136fd16f79de80ed79337f73341e19b10ce.zip |
ASSIGNED - bug 320202: [patch] add support for use... administation parameters
https://bugs.eclipse.org/bugs/show_bug.cgi?id=320202
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 | 68 |
1 files changed, 58 insertions, 10 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 2572f5788..051b93fc8 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 @@ -480,25 +480,72 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { break; case ATTACHER: if (attachment != null) { - IRepositoryPerson author = repositoryTaskData.getAttributeMapper().getTaskRepository().createPerson( - parsedText); + 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) { - defaultAttribute = BugzillaTaskDataHandler.createAttribute(repositoryTaskData, tag); - defaultAttribute.setValue(parsedText); + case CLASSIFICATION: + case TARGET_MILESTONE: + case QA_CONTACT: + case STATUS_WHITEBOARD: + case ALIAS: + case SEE_ALSO: + TaskAttribute suppressAttribute = createAttrribute(parsedText, tag); + String propertyName = null; + switch (tag) { + case CLASSIFICATION: + propertyName = IBugzillaConstants.BUGZILLA_PARAM_USECLASSIFICATION; + break; + case TARGET_MILESTONE: + propertyName = IBugzillaConstants.BUGZILLA_PARAM_USETARGETMILESTONE; + break; + case QA_CONTACT: + propertyName = IBugzillaConstants.BUGZILLA_PARAM_USEQACONTACT; + break; + case STATUS_WHITEBOARD: + propertyName = IBugzillaConstants.BUGZILLA_PARAM_USESTATUSWHITEBOARD; + break; + case ALIAS: + propertyName = IBugzillaConstants.BUGZILLA_PARAM_USEBUGALIASES; + break; + case SEE_ALSO: + propertyName = IBugzillaConstants.BUGZILLA_PARAM_USE_SEE_ALSO; + break; + default: + propertyName = null; + break; + } + String useParam = repositoryTaskData.getAttributeMapper().getTaskRepository().getProperty(propertyName); + if (useParam != null && useParam.equals("true")) { //$NON-NLS-1$ + suppressAttribute.getMetaData().setKind(TaskAttribute.KIND_DEFAULT); + if (BugzillaAttribute.CLASSIFICATION.equals(tag)) { + suppressAttribute.getMetaData().setReadOnly(true); + } } else { - defaultAttribute.addValue(parsedText); + suppressAttribute.getMetaData().setKind(null); } break; + default: + createAttrribute(parsedText, tag); + break; } } + private TaskAttribute createAttrribute(String parsedText, BugzillaAttribute tag) { + TaskAttribute attribute = repositoryTaskData.getRoot().getMappedAttribute(tag.getKey()); + if (attribute == null) { + attribute = BugzillaTaskDataHandler.createAttribute(repositoryTaskData, tag); + attribute.setValue(parsedText); + } else { + attribute.addValue(parsedText); + } + return attribute; + } + private void updateCustomFields(TaskData taskData) { RepositoryConfiguration config = connector.getRepositoryConfiguration(repositoryTaskData.getRepositoryUrl()); if (config != null) { @@ -621,8 +668,9 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler { TaskCommentMapper taskComment = TaskCommentMapper.createFrom(attribute); taskComment.setCommentId(commentNum + ""); //$NON-NLS-1$ taskComment.setNumber(commentNum); - IRepositoryPerson author = repositoryTaskData.getAttributeMapper().getTaskRepository().createPerson( - comment.author); + IRepositoryPerson author = repositoryTaskData.getAttributeMapper() + .getTaskRepository() + .createPerson(comment.author); author.setName(comment.authorName); taskComment.setAuthor(author); TaskAttribute attrTimestamp = attribute.createAttribute(BugzillaAttribute.BUG_WHEN.getKey()); |