Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2016-03-12 14:57:58 +0000
committerFrank Becker2016-03-25 07:03:25 +0000
commitf76a87b4d57bc7f4cbc17fba249ac1040b7ba18c (patch)
tree99011957e7d73a76c3b16e90186a7d07aea52615 /connector-bugzilla-rest
parentfa141daf3c63f922b8997c67cccabe91b2978648 (diff)
downloadorg.eclipse.mylyn.tasks-f76a87b4d57bc7f4cbc17fba249ac1040b7ba18c.tar.gz
org.eclipse.mylyn.tasks-f76a87b4d57bc7f4cbc17fba249ac1040b7ba18c.tar.xz
org.eclipse.mylyn.tasks-f76a87b4d57bc7f4cbc17fba249ac1040b7ba18c.zip
414360: add support for keyword attribute to REST API
Change-Id: I47d37116800606c181bb6d9de75ac8fdb6b748a1 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=414360
Diffstat (limited to 'connector-bugzilla-rest')
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData.txt1
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData1.txt1
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData2.txt1
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData.txt1
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData1.txt1
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData2.txt1
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestCreateTaskSchema.java3
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPostNewTask.java59
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPutUpdateTask.java30
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java3
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/IBugzillaRestConstants.java2
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaKeywordAttributeEditor.java47
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPage.java2
13 files changed, 109 insertions, 43 deletions
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData.txt b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData.txt
index 0cb446e1c..99bc99ff2 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData.txt
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData.txt
@@ -20,6 +20,7 @@ TaskAttribute[id=root,values=[],options=null,metaData=null]
TaskAttribute[id=task.common.operation,values=[],options=null,metaData={task.meta.label=Operation, task.meta.type=operation, task.meta.readOnly=false, task.meta.required=false}]
TaskAttribute[id=depends_on,values=[],options=null,metaData={task.meta.label=Depends on:, task.meta.type=taskDepenedency, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=blocks,values=[],options=null,metaData={task.meta.label=Blocks:, task.meta.type=taskDepenedency, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
+ TaskAttribute[id=keywords,values=[],options={Keyword1=Keyword1, Keyword2=Keyword2},metaData={task.meta.label=Keywords, task.meta.type=bugzilla.editor.keyword, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=cf_bugid,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.type=integer, task.meta.required=false, task.meta.label=bug id custom field, task.meta.attributeKind=task.common.kind.default}]
TaskAttribute[id=cf_datetime,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.type=dateTime, task.meta.required=false, task.meta.label=date time custom field, task.meta.attributeKind=task.common.kind.default}]
TaskAttribute[id=cf_dropdown,values=[],options={---=---, one=one, three=three, two=two},metaData={task.meta.readOnly=false, task.meta.type=singleSelect, task.meta.required=true, task.meta.label=drop down custom field, task.meta.attributeKind=task.common.kind.default}]
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData1.txt b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData1.txt
index de1a57ec3..be848efaa 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData1.txt
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData1.txt
@@ -20,6 +20,7 @@ TaskAttribute[id=root,values=[],options=null,metaData=null]
TaskAttribute[id=task.common.operation,values=[],options=null,metaData={task.meta.label=Operation, task.meta.type=operation, task.meta.readOnly=false, task.meta.required=false}]
TaskAttribute[id=depends_on,values=[],options=null,metaData={task.meta.label=Depends on:, task.meta.type=taskDepenedency, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=blocks,values=[],options=null,metaData={task.meta.label=Blocks:, task.meta.type=taskDepenedency, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
+ TaskAttribute[id=keywords,values=[],options={Keyword1=Keyword1, Keyword2=Keyword2},metaData={task.meta.label=Keywords, task.meta.type=bugzilla.editor.keyword, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=cf_bugid,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.type=integer, task.meta.required=false, task.meta.label=bug id custom field, task.meta.attributeKind=task.common.kind.default}]
TaskAttribute[id=cf_datetime,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.type=dateTime, task.meta.required=false, task.meta.label=date time custom field, task.meta.attributeKind=task.common.kind.default}]
TaskAttribute[id=cf_dropdown,values=[],options={---=---, one=one, three=three, two=two},metaData={task.meta.readOnly=false, task.meta.type=singleSelect, task.meta.required=true, task.meta.label=drop down custom field, task.meta.attributeKind=task.common.kind.default}]
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData2.txt b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData2.txt
index b083d231f..68fe8fe09 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData2.txt
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version1/taskData2.txt
@@ -20,6 +20,7 @@ TaskAttribute[id=root,values=[],options=null,metaData=null]
TaskAttribute[id=task.common.operation,values=[],options=null,metaData={task.meta.label=Operation, task.meta.type=operation, task.meta.readOnly=false, task.meta.required=false}]
TaskAttribute[id=depends_on,values=[],options=null,metaData={task.meta.label=Depends on:, task.meta.type=taskDepenedency, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=blocks,values=[],options=null,metaData={task.meta.label=Blocks:, task.meta.type=taskDepenedency, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
+ TaskAttribute[id=keywords,values=[],options={Keyword1=Keyword1, Keyword2=Keyword2},metaData={task.meta.label=Keywords, task.meta.type=bugzilla.editor.keyword, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=cf_bugid,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.type=integer, task.meta.required=false, task.meta.label=bug id custom field, task.meta.attributeKind=task.common.kind.default}]
TaskAttribute[id=cf_datetime,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.type=dateTime, task.meta.required=false, task.meta.label=date time custom field, task.meta.attributeKind=task.common.kind.default}]
TaskAttribute[id=cf_dropdown,values=[],options={---=---, one=one, three=three, two=two},metaData={task.meta.readOnly=false, task.meta.type=singleSelect, task.meta.required=true, task.meta.label=drop down custom field, task.meta.attributeKind=task.common.kind.default}]
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData.txt b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData.txt
index 0cb446e1c..99bc99ff2 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData.txt
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData.txt
@@ -20,6 +20,7 @@ TaskAttribute[id=root,values=[],options=null,metaData=null]
TaskAttribute[id=task.common.operation,values=[],options=null,metaData={task.meta.label=Operation, task.meta.type=operation, task.meta.readOnly=false, task.meta.required=false}]
TaskAttribute[id=depends_on,values=[],options=null,metaData={task.meta.label=Depends on:, task.meta.type=taskDepenedency, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=blocks,values=[],options=null,metaData={task.meta.label=Blocks:, task.meta.type=taskDepenedency, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
+ TaskAttribute[id=keywords,values=[],options={Keyword1=Keyword1, Keyword2=Keyword2},metaData={task.meta.label=Keywords, task.meta.type=bugzilla.editor.keyword, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=cf_bugid,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.type=integer, task.meta.required=false, task.meta.label=bug id custom field, task.meta.attributeKind=task.common.kind.default}]
TaskAttribute[id=cf_datetime,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.type=dateTime, task.meta.required=false, task.meta.label=date time custom field, task.meta.attributeKind=task.common.kind.default}]
TaskAttribute[id=cf_dropdown,values=[],options={---=---, one=one, three=three, two=two},metaData={task.meta.readOnly=false, task.meta.type=singleSelect, task.meta.required=true, task.meta.label=drop down custom field, task.meta.attributeKind=task.common.kind.default}]
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData1.txt b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData1.txt
index de1a57ec3..be848efaa 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData1.txt
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData1.txt
@@ -20,6 +20,7 @@ TaskAttribute[id=root,values=[],options=null,metaData=null]
TaskAttribute[id=task.common.operation,values=[],options=null,metaData={task.meta.label=Operation, task.meta.type=operation, task.meta.readOnly=false, task.meta.required=false}]
TaskAttribute[id=depends_on,values=[],options=null,metaData={task.meta.label=Depends on:, task.meta.type=taskDepenedency, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=blocks,values=[],options=null,metaData={task.meta.label=Blocks:, task.meta.type=taskDepenedency, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
+ TaskAttribute[id=keywords,values=[],options={Keyword1=Keyword1, Keyword2=Keyword2},metaData={task.meta.label=Keywords, task.meta.type=bugzilla.editor.keyword, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=cf_bugid,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.type=integer, task.meta.required=false, task.meta.label=bug id custom field, task.meta.attributeKind=task.common.kind.default}]
TaskAttribute[id=cf_datetime,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.type=dateTime, task.meta.required=false, task.meta.label=date time custom field, task.meta.attributeKind=task.common.kind.default}]
TaskAttribute[id=cf_dropdown,values=[],options={---=---, one=one, three=three, two=two},metaData={task.meta.readOnly=false, task.meta.type=singleSelect, task.meta.required=true, task.meta.label=drop down custom field, task.meta.attributeKind=task.common.kind.default}]
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData2.txt b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData2.txt
index b083d231f..68fe8fe09 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData2.txt
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/testdata/Version2/taskData2.txt
@@ -20,6 +20,7 @@ TaskAttribute[id=root,values=[],options=null,metaData=null]
TaskAttribute[id=task.common.operation,values=[],options=null,metaData={task.meta.label=Operation, task.meta.type=operation, task.meta.readOnly=false, task.meta.required=false}]
TaskAttribute[id=depends_on,values=[],options=null,metaData={task.meta.label=Depends on:, task.meta.type=taskDepenedency, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=blocks,values=[],options=null,metaData={task.meta.label=Blocks:, task.meta.type=taskDepenedency, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
+ TaskAttribute[id=keywords,values=[],options={Keyword1=Keyword1, Keyword2=Keyword2},metaData={task.meta.label=Keywords, task.meta.type=bugzilla.editor.keyword, task.meta.readOnly=false, task.meta.attributeKind=task.common.kind.default, task.meta.required=false}]
TaskAttribute[id=cf_bugid,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.type=integer, task.meta.required=false, task.meta.label=bug id custom field, task.meta.attributeKind=task.common.kind.default}]
TaskAttribute[id=cf_datetime,values=[],options=null,metaData={task.meta.readOnly=false, task.meta.type=dateTime, task.meta.required=false, task.meta.label=date time custom field, task.meta.attributeKind=task.common.kind.default}]
TaskAttribute[id=cf_dropdown,values=[],options={---=---, one=one, three=three, two=two},metaData={task.meta.readOnly=false, task.meta.type=singleSelect, task.meta.required=true, task.meta.label=drop down custom field, task.meta.attributeKind=task.common.kind.default}]
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestCreateTaskSchema.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestCreateTaskSchema.java
index 17d84c4d8..ed8730dc0 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestCreateTaskSchema.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestCreateTaskSchema.java
@@ -99,4 +99,7 @@ public class BugzillaRestCreateTaskSchema extends AbstractTaskSchema {
Flag.ATTRIBUTE);
public final Field BLOCKS = createField("blocks", "Blocks:", TaskAttribute.TYPE_TASK_DEPENDENCY, Flag.ATTRIBUTE);
+
+ public final Field KEYWORDS = createField("keywords", "Keywords", IBugzillaRestConstants.EDITOR_TYPE_KEYWORD,
+ Flag.ATTRIBUTE);
}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPostNewTask.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPostNewTask.java
index 8706c8c45..1b46a3514 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPostNewTask.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPostNewTask.java
@@ -75,19 +75,14 @@ public class BugzillaRestPostNewTask extends BugzillaRestAuthenticatedPostReques
String value1 = BugzillaRestGsonUtil.convertString2GSonString(taskAttribute.getValue());
if (legalCreateAttributes.contains(id) || id.startsWith("cf_")) { //$NON-NLS-1$
id = BugzillaRestCreateTaskSchema.getFieldNameFromAttributeName(id);
- if (id.equals("status")) { //$NON-NLS-1$
- if (value != null && value.equals(TaskAttribute.PREFIX_OPERATION + "default")) { //$NON-NLS-1$
- continue;
- }
- }
-
- if (id.equals("cc")) { //$NON-NLS-1$
+ if (id.equals("status") //$NON-NLS-1$
+ && (value != null && value.equals(TaskAttribute.PREFIX_OPERATION + "default"))) {
+ continue;
+ } else if (id.equals("cc")) { //$NON-NLS-1$
HashSet<String> setNew = new HashSet<String>(
Arrays.asList(taskAttribute.getValue().split("\\s*,\\s*"))); //$NON-NLS-1$
BugzillaRestGsonUtil.buildArrayFromHash(out, id, setNew, false);
- continue;
- }
- if (id.equals(BugzillaRestCreateTaskSchema.getDefault().BLOCKS.getKey())
+ } else if (id.equals(BugzillaRestCreateTaskSchema.getDefault().BLOCKS.getKey())
|| id.equals(BugzillaRestCreateTaskSchema.getDefault().DEPENDS_ON.getKey())) {
if (taskAttribute.getValues().size() > 1) {
HashSet<String> setNew = new HashSet<String>(taskAttribute.getValues());
@@ -97,27 +92,32 @@ public class BugzillaRestPostNewTask extends BugzillaRestAuthenticatedPostReques
Arrays.asList(taskAttribute.getValue().split("\\s*,\\s*"))); //$NON-NLS-1$
BugzillaRestGsonUtil.buildArrayFromHash(out, id, setNew, true);
}
- continue;
- }
+ } else {
- if (taskAttribute.getMetaData().getType() != null
- && taskAttribute.getMetaData().getType().equals(TaskAttribute.TYPE_MULTI_SELECT)) {
- List<String> values = taskAttribute.getValues();
- int ii = 0;
- value1 = ""; //$NON-NLS-1$
- for (String string : values) {
- string = BugzillaRestGsonUtil.convertString2GSonString(string);
- value1 += ((ii++ == 0 ? "" : ",") + string); //$NON-NLS-1$ //$NON-NLS-2$
+ if (id.equals(BugzillaRestCreateTaskSchema.getDefault().KEYWORDS.getKey())) {
+ value1 = taskAttribute.getValues().toString();
+ value1 = value1.substring(1, value1.length() - 1);
+ }
+
+ if (taskAttribute.getMetaData().getType() != null
+ && taskAttribute.getMetaData().getType().equals(TaskAttribute.TYPE_MULTI_SELECT)) {
+ List<String> values = taskAttribute.getValues();
+ int ii = 0;
+ value1 = ""; //$NON-NLS-1$
+ for (String string : values) {
+ string = BugzillaRestGsonUtil.convertString2GSonString(string);
+ value1 += ((ii++ == 0 ? "" : ",") + string); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ out.name(id).value(value1);
+ if (id.equals("description")) { //$NON-NLS-1$
+ TaskAttribute descriptionpri = taskAttribute.getAttribute(
+ BugzillaRestCreateTaskSchema.getDefault().DESCRIPTION_IS_PRIVATE.getKey());
+ Boolean descriptionprivalue = (descriptionpri != null)
+ ? (descriptionpri.getValue().equals("1")) //$NON-NLS-1$
+ : false;
+ out.name("comment_is_private").value(Boolean.toString(descriptionprivalue)); //$NON-NLS-1$
}
- }
- out.name(id).value(value1);
- if (id.equals("description")) { //$NON-NLS-1$
- TaskAttribute descriptionpri = taskAttribute.getAttribute(
- BugzillaRestCreateTaskSchema.getDefault().DESCRIPTION_IS_PRIVATE.getKey());
- Boolean descriptionprivalue = (descriptionpri != null)
- ? (descriptionpri.getValue().equals("1")) //$NON-NLS-1$
- : false;
- out.name("comment_is_private").value(Boolean.toString(descriptionprivalue)); //$NON-NLS-1$
}
}
}
@@ -192,6 +192,7 @@ public class BugzillaRestPostNewTask extends BugzillaRestAuthenticatedPostReques
.add(BugzillaRestCreateTaskSchema.getDefault().CC.getKey())
.add(BugzillaRestCreateTaskSchema.getDefault().BLOCKS.getKey())
.add(BugzillaRestCreateTaskSchema.getDefault().DEPENDS_ON.getKey())
+ .add(BugzillaRestCreateTaskSchema.getDefault().KEYWORDS.getKey())
.build();
@Override
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPutUpdateTask.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPutUpdateTask.java
index 4dbd9a834..9f6895892 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPutUpdateTask.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPutUpdateTask.java
@@ -78,6 +78,7 @@ public class BugzillaRestPutUpdateTask extends BugzillaRestAuthenticatedPutReque
.add(BugzillaRestTaskSchema.getDefault().DUPE_OF.getKey())
.add(BugzillaRestTaskSchema.getDefault().BLOCKS.getKey())
.add(BugzillaRestTaskSchema.getDefault().DEPENDS_ON.getKey())
+ .add(BugzillaRestTaskSchema.getDefault().KEYWORDS.getKey())
.build();
class TaskAttributeTypeAdapter extends TypeAdapter<OldAttributes> {
@@ -133,9 +134,7 @@ public class BugzillaRestPutUpdateTask extends BugzillaRestAuthenticatedPutReque
out.name("comment").beginObject(); //$NON-NLS-1$
out.name("body").value(value); //$NON-NLS-1$
out.endObject();
- continue;
- }
- if (id.equals(BugzillaRestTaskSchema.getDefault().BLOCKS.getKey())
+ } else if (id.equals(BugzillaRestTaskSchema.getDefault().BLOCKS.getKey())
|| id.equals(BugzillaRestTaskSchema.getDefault().DEPENDS_ON.getKey())) {
Set<String> setOld;
if (element.getValues().size() > 1) {
@@ -150,17 +149,20 @@ public class BugzillaRestPutUpdateTask extends BugzillaRestAuthenticatedPutReque
setNew = new HashSet<String>(Arrays.asList(taskAttribute.getValue().split("\\s*,\\s*")));
}
BugzillaRestGsonUtil.getDefault().buildAddRemoveIntegerHash(out, id, setOld, setNew);
- continue;
- }
-
- out.name(id).value(value);
- if (id.equals("description")) { //$NON-NLS-1$
- TaskAttribute descriptionpri = taskAttribute
- .getAttribute(BugzillaRestTaskSchema.getDefault().COMMENT_ISPRIVATE.getKey());
- Boolean descriptionprivalue = (descriptionpri != null)
- ? (descriptionpri.getValue().equals("1")) //$NON-NLS-1$
- : false;
- out.name("comment_is_private").value(Boolean.toString(descriptionprivalue)); //$NON-NLS-1$
+ } else if (id.equals(BugzillaRestTaskSchema.getDefault().KEYWORDS.getKey())) {
+ Set<String> setOld = new HashSet<String>(element.getValues());
+ Set<String> setNew = new HashSet<String>(taskAttribute.getValues());
+ BugzillaRestGsonUtil.getDefault().buildAddRemoveHash(out, id, setOld, setNew);
+ } else {
+ out.name(id).value(value);
+ if (id.equals("description")) { //$NON-NLS-1$
+ TaskAttribute descriptionpri = taskAttribute
+ .getAttribute(BugzillaRestTaskSchema.getDefault().COMMENT_ISPRIVATE.getKey());
+ Boolean descriptionprivalue = (descriptionpri != null)
+ ? (descriptionpri.getValue().equals("1")) //$NON-NLS-1$
+ : false;
+ out.name("comment_is_private").value(Boolean.toString(descriptionprivalue)); //$NON-NLS-1$
+ }
}
}
}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java
index a4f644752..3d6530b89 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java
@@ -141,6 +141,9 @@ public class BugzillaRestTaskSchema extends AbstractTaskSchema {
public final Field BLOCKS = createField("blocks", "Blocks:", TaskAttribute.TYPE_TASK_DEPENDENCY, Flag.ATTRIBUTE);
+ public final Field KEYWORDS = createField("keywords", "Keywords", IBugzillaRestConstants.EDITOR_TYPE_KEYWORD,
+ Flag.ATTRIBUTE);
+
@Override
public void initialize(TaskData taskData) {
for (Field field : getFields()) {
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/IBugzillaRestConstants.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/IBugzillaRestConstants.java
index 2bb566a21..dfc2260e4 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/IBugzillaRestConstants.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/IBugzillaRestConstants.java
@@ -13,4 +13,6 @@ package org.eclipse.mylyn.internal.bugzilla.rest.core;
public interface IBugzillaRestConstants {
public static final String EDITOR_TYPE_CC = "bugzilla.editor.cc"; //$NON-NLS-1$
+
+ public static final String EDITOR_TYPE_KEYWORD = "bugzilla.editor.keyword"; //$NON-NLS-1$
}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaKeywordAttributeEditor.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaKeywordAttributeEditor.java
new file mode 100644
index 000000000..fb0d37dfa
--- /dev/null
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaKeywordAttributeEditor.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.bugzilla.rest.ui;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.mylyn.internal.tasks.ui.editors.CheckboxMultiSelectAttributeEditor;
+import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
+import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
+
+/**
+ * @author Rob Elves
+ */
+public class BugzillaKeywordAttributeEditor extends CheckboxMultiSelectAttributeEditor {
+
+ public BugzillaKeywordAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) {
+ super(manager, taskAttribute);
+
+ }
+
+ @Override
+ public List<String> getValues() {
+ List<String> values = new ArrayList<String>();
+ values = getTaskAttribute().getValues();
+ return values;
+ }
+
+ @Override
+ public void setValues(List<String> newValues) {
+ Collections.sort(newValues);
+ getTaskAttribute().clearValues();
+ getTaskAttribute().setValues(newValues);
+ attributeChanged();
+ }
+
+} \ No newline at end of file
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPage.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPage.java
index bd7a2bb80..dbc4c844f 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPage.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPage.java
@@ -40,6 +40,8 @@ public class BugzillaRestTaskEditorPage extends AbstractTaskEditorPage {
AbstractAttributeEditor editor;
if (IBugzillaRestConstants.EDITOR_TYPE_CC.equals(type)) {
editor = new BugzillaCcAttributeEditor(getModel(), taskAttribute);
+ } else if (IBugzillaRestConstants.EDITOR_TYPE_KEYWORD.equals(type)) {
+ editor = new BugzillaKeywordAttributeEditor(getModel(), taskAttribute);
} else {
editor = super.createEditor(type, taskAttribute);
}

Back to the top