diff options
author | relves | 2008-06-17 02:59:15 +0000 |
---|---|---|
committer | relves | 2008-06-17 02:59:15 +0000 |
commit | a2ae0d93ff22e058c6c889ae934630ca89877e27 (patch) | |
tree | 70826beb97e657ce0e86d01fc28988d4325c911d /org.eclipse.mylyn.bugzilla.core | |
parent | 61d55857f90f8c9af4ae42d8b121ab0b4488f8ca (diff) | |
download | org.eclipse.mylyn.tasks-a2ae0d93ff22e058c6c889ae934630ca89877e27.tar.gz org.eclipse.mylyn.tasks-a2ae0d93ff22e058c6c889ae934630ca89877e27.tar.xz org.eclipse.mylyn.tasks-a2ae0d93ff22e058c6c889ae934630ca89877e27.zip |
NEW - bug 237389: update old attributes that should now be visible in new editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=237389
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
-rw-r--r-- | org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java index 0d411074c..657316b6d 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java @@ -76,47 +76,46 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler { VERSION_2_0(2.0f) { @Override void migrate(TaskRepository repository, TaskData data) { - TaskAttribute attrDescription = data.getRoot().getMappedAttribute(BugzillaAttribute.LONG_DESC.getKey()); - if (attrDescription != null) { - attrDescription.getMetaData().setType(TaskAttribute.TYPE_LONG_RICH_TEXT); - } + updateAttribute(data, BugzillaAttribute.LONG_DESC); } }, VERSION_3_0(3.0f) { @Override void migrate(TaskRepository repository, TaskData data) { - TaskAttribute attrNewComment = data.getRoot() - .getMappedAttribute(BugzillaAttribute.NEW_COMMENT.getKey()); - if (attrNewComment != null) { - attrNewComment.getMetaData().setType(TaskAttribute.TYPE_LONG_RICH_TEXT); - } + updateAttribute(data, BugzillaAttribute.NEW_COMMENT); } }, VERSION_4_0(4.0f) { @Override void migrate(TaskRepository repository, TaskData data) { - TaskAttribute attrDeadline = data.getRoot().getMappedAttribute(BugzillaAttribute.DEADLINE.getKey()); - if (attrDeadline != null) { - attrDeadline.getMetaData().setReadOnly(false); - attrDeadline.getMetaData().setType(TaskAttribute.TYPE_DATE); - } - TaskAttribute attrActualTime = data.getRoot() - .getMappedAttribute(BugzillaAttribute.ACTUAL_TIME.getKey()); - if (attrActualTime != null) { - attrActualTime.getMetaData().setReadOnly(true); - } + updateAttribute(data, BugzillaAttribute.DEADLINE); + updateAttribute(data, BugzillaAttribute.ACTUAL_TIME); } }, VERSION_4_1(4.1f) { @Override void migrate(TaskRepository repository, TaskData data) { + updateAttribute(data, BugzillaAttribute.VOTES); TaskAttribute attrDeadline = data.getRoot().getMappedAttribute(BugzillaAttribute.VOTES.getKey()); if (attrDeadline != null) { attrDeadline.getMetaData().setType(BugzillaAttribute.VOTES.getType()); } } }, - VERSION_CURRENT(4.2f) { + VERSION_4_2(4.2f) { + @Override + void migrate(TaskRepository repository, TaskData data) { + updateAttribute(data, BugzillaAttribute.CC); + updateAttribute(data, BugzillaAttribute.DEPENDSON); + updateAttribute(data, BugzillaAttribute.BLOCKED); + updateAttribute(data, BugzillaAttribute.BUG_FILE_LOC); + updateAttribute(data, BugzillaAttribute.KEYWORDS); + updateAttribute(data, BugzillaAttribute.STATUS_WHITEBOARD); + updateAttribute(data, BugzillaAttribute.QA_CONTACT); + updateAttribute(data, BugzillaAttribute.NEWCC); + } + }, + VERSION_CURRENT(4.3f) { @Override void migrate(TaskRepository repository, TaskData data) { data.setVersion(TaskDataVersion.VERSION_CURRENT.toString()); @@ -139,6 +138,15 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler { public String toString() { return "" + getVersionNum(); } + + private static void updateAttribute(TaskData data, BugzillaAttribute bugAttribute) { + TaskAttribute attribute = data.getRoot().getMappedAttribute(bugAttribute.getKey()); + if (attribute != null) { + attribute.getMetaData().setType(bugAttribute.getType()); + attribute.getMetaData().setReadOnly(bugAttribute.isReadOnly()); + attribute.getMetaData().setKind(bugAttribute.getKind()); + } + } } private final BugzillaRepositoryConnector connector; |