Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2016-03-27 20:54:24 +0000
committerGerrit Code Review @ Eclipse.org2016-04-12 20:34:26 +0000
commitdcf2e0aae45414e3c7134613f81df424c97497c9 (patch)
tree10042edf0a72370d51efeb69fd9572ba6c63361e
parent7931176ce6ad47073b33d36cce2e314cd0623924 (diff)
downloadorg.eclipse.mylyn.tasks-dcf2e0aae45414e3c7134613f81df424c97497c9.tar.gz
org.eclipse.mylyn.tasks-dcf2e0aae45414e3c7134613f81df424c97497c9.tar.xz
org.eclipse.mylyn.tasks-dcf2e0aae45414e3c7134613f81df424c97497c9.zip
483745: some improvements for the first complete Bugzilla REST Editor
Change-Id: I7354910f0ea222799ed7b92adc48306d2476a20d Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=483745
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/internal/bugzilla/rest/core/tests/BugzillaRestClientTest.java32
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConfiguration.java3
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConnector.java90
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestGetTaskData.java26
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestTaskSchema.java4
-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/BugzillaRestRepositoryConnectorUi.java4
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositorySettingsPage.java4
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPageFactory.java2
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/Messages.java36
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/messages.properties5
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/BugzillaRestQueryTypeWizardPage.java16
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/BugzillaRestSearchQueryPage.java59
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/BugzillaRestUiUtil.java28
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/Messages.java55
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/messages.properties15
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/RepositoryQuerySchemaPage.java13
17 files changed, 325 insertions, 69 deletions
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/internal/bugzilla/rest/core/tests/BugzillaRestClientTest.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/internal/bugzilla/rest/core/tests/BugzillaRestClientTest.java
index 314c2159e..597685f31 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/internal/bugzilla/rest/core/tests/BugzillaRestClientTest.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/internal/bugzilla/rest/core/tests/BugzillaRestClientTest.java
@@ -452,9 +452,13 @@ public class BugzillaRestClientTest {
String taskId = harness.submitNewTask(taskData);
TaskData taskDataGet = harness.getTaskFromServer(taskId);
- // actual we read no comments and so we also can not get the description
- taskData.getRoot().removeAttribute("task.common.description");
- taskDataGet.getRoot().removeAttribute("task.common.description");
+ // description is only for old tasks readonly and has the two sub attributes
+ // COMMENT_NUMBER and COMMENT_ISPRIVATE
+ TaskAttribute getDesc = taskDataGet.getRoot()
+ .getAttribute(BugzillaRestTaskSchema.getDefault().DESCRIPTION.getKey());
+ getDesc.getMetaData().setReadOnly(false);
+ getDesc.removeAttribute(TaskAttribute.COMMENT_ISPRIVATE);
+ getDesc.removeAttribute(TaskAttribute.COMMENT_NUMBER);
// resolution is only for new tasks readonly
taskData.getRoot()
@@ -463,22 +467,24 @@ public class BugzillaRestClientTest {
.setReadOnly(false);
// attributes we know that they can not be equal
- taskData.getRoot().removeAttribute("task.common.status");
- taskDataGet.getRoot().removeAttribute("task.common.status");
- taskData.getRoot().removeAttribute("task.common.user.assigned");
- taskDataGet.getRoot().removeAttribute("task.common.user.assigned");
- taskData.getRoot().removeAttribute("task.common.operation");
- taskDataGet.getRoot().removeAttribute("task.common.operation");
+ taskData.getRoot().removeAttribute(BugzillaRestTaskSchema.getDefault().STATUS.getKey());
+ taskDataGet.getRoot().removeAttribute(BugzillaRestTaskSchema.getDefault().STATUS.getKey());
+ taskData.getRoot().removeAttribute(BugzillaRestTaskSchema.getDefault().ASSIGNED_TO.getKey());
+ taskDataGet.getRoot().removeAttribute(BugzillaRestTaskSchema.getDefault().ASSIGNED_TO.getKey());
+ taskData.getRoot().removeAttribute(TaskAttribute.OPERATION);
+ taskDataGet.getRoot().removeAttribute(TaskAttribute.OPERATION);
+ taskDataGet.getRoot().removeAttribute(BugzillaRestTaskSchema.getDefault().DATE_MODIFICATION.getKey());
+ taskData.getRoot().removeAttribute(BugzillaRestTaskSchema.getDefault().DATE_MODIFICATION.getKey());
// CC attribute has diverences in the meta data between create and update
- taskData.getRoot().removeAttribute("task.common.user.cc");
- taskDataGet.getRoot().removeAttribute("task.common.user.cc");
+ taskData.getRoot().removeAttribute(TaskAttribute.USER_CC);
+ taskDataGet.getRoot().removeAttribute(TaskAttribute.USER_CC);
// attributes only in old tasks
taskData.getRoot().removeAttribute("description_is_private");
// attributes only in new tasks
taskDataGet.getRoot().removeAttribute("bug_id");
- taskDataGet.getRoot().removeAttribute("task.common.comment.new");
+ taskDataGet.getRoot().removeAttribute(TaskAttribute.COMMENT_NEW);
taskDataGet.getRoot().removeAttribute("addCC");
taskDataGet.getRoot().removeAttribute("removeCC");
@@ -488,7 +494,7 @@ public class BugzillaRestClientTest {
taskDataGet.getRoot().removeAttribute("task.common.operation-RESOLVED");
taskDataGet.getRoot().removeAttribute("resolutionInput");
taskDataGet.getRoot().removeAttribute("task.common.operation-duplicate");
- taskDataGet.getRoot().removeAttribute("dupe_of");
+ taskDataGet.getRoot().removeAttribute(BugzillaRestTaskSchema.getDefault().DUPE_OF.getKey());
assertEquals(taskData.getRoot().toString(), taskDataGet.getRoot().toString());
}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConfiguration.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConfiguration.java
index 581429404..828347e7a 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConfiguration.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConfiguration.java
@@ -121,7 +121,8 @@ public class BugzillaRestConfiguration implements Serializable {
if (key.equals(BugzillaRestTaskSchema.getDefault().ADD_SELF_CC.getKey())
|| key.equals(BugzillaRestTaskSchema.getDefault().NEW_COMMENT.getKey())
|| key.equals(BugzillaRestTaskSchema.getDefault().DUPE_OF.getKey())
- || key.equals(TaskAttribute.OPERATION)) {
+ || key.equals(TaskAttribute.OPERATION)
+ || key.equals(BugzillaRestTaskSchema.getDefault().DATE_MODIFICATION.getKey())) {
continue;
}
TaskAttribute attribute = data.getRoot().getAttribute(key);
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConnector.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConnector.java
index becd6cea4..bc6092738 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConnector.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestConnector.java
@@ -13,6 +13,8 @@ package org.eclipse.mylyn.internal.bugzilla.rest.core;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.util.Date;
+import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
@@ -21,6 +23,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.core.operations.IOperationMonitor;
import org.eclipse.mylyn.commons.core.operations.OperationUtil;
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
@@ -28,12 +31,13 @@ import org.eclipse.mylyn.commons.net.Policy;
import org.eclipse.mylyn.commons.repositories.core.RepositoryLocation;
import org.eclipse.mylyn.commons.repositories.core.auth.AuthenticationType;
import org.eclipse.mylyn.commons.repositories.core.auth.UserCredentials;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.Field;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.response.data.FieldValues;
import org.eclipse.mylyn.internal.commons.core.operations.NullOperationMonitor;
import org.eclipse.mylyn.internal.tasks.core.IRepositoryConstants;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITaskMapping;
import org.eclipse.mylyn.tasks.core.RepositoryInfo;
import org.eclipse.mylyn.tasks.core.RepositoryVersion;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -254,7 +258,89 @@ public class BugzillaRestConnector extends AbstractRepositoryConnector {
@Override
public void updateTaskFromTaskData(TaskRepository taskRepository, ITask task, TaskData taskData) {
+ TaskMapper scheme = getTaskMapping(taskData);
+ scheme.applyTo(task);
task.setUrl(taskData.getRepositoryUrl() + "/rest.cgi/bug/" + taskData.getTaskId()); //$NON-NLS-1$
+
+ boolean isComplete = false;
+ TaskAttribute attributeStatus = taskData.getRoot().getMappedAttribute(TaskAttribute.STATUS);
+ if (attributeStatus != null) {
+ try {
+ BugzillaRestConfiguration configuration;
+ configuration = getRepositoryConfiguration(taskRepository);
+ if (configuration != null) {
+ Field stat = configuration.getFieldWithName(IBugzillaRestConstants.BUG_STATUS);
+ for (FieldValues fieldValue : stat.getValues()) {
+ if (attributeStatus.getValue().equals(fieldValue.getName())) {
+ isComplete = !fieldValue.isOpen();
+ }
+ }
+ }
+ } catch (CoreException e) {
+ StatusHandler.log(new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN,
+ "Error during get BugzillaRestConfiguration", e));
+ }
+ }
+ if (taskData.isPartial()) {
+ if (isComplete) {
+ if (task.getCompletionDate() == null) {
+ task.setCompletionDate(new Date(0));
+ }
+ } else {
+ task.setCompletionDate(null);
+ }
+ } else {
+ inferCompletionDate(task, taskData, scheme, isComplete);
+ }
+
+ }
+
+ private void inferCompletionDate(ITask task, TaskData taskData, TaskMapper scheme, boolean isComplete) {
+ if (isComplete) {
+ Date completionDate = null;
+ List<TaskAttribute> taskComments = taskData.getAttributeMapper().getAttributesByType(taskData,
+ TaskAttribute.TYPE_COMMENT);
+ if (taskComments != null && taskComments.size() > 0) {
+ TaskAttribute lastComment = taskComments.get(taskComments.size() - 1);
+ if (lastComment != null) {
+ TaskAttribute attributeCommentDate = lastComment.getMappedAttribute(TaskAttribute.COMMENT_DATE);
+ if (attributeCommentDate != null) {
+ completionDate = new Date(Long.parseLong(attributeCommentDate.getValue()));
+ }
+ }
+ }
+ if (completionDate == null) {
+ // Use last modified date
+ TaskAttribute attributeLastModified = taskData.getRoot()
+ .getMappedAttribute(TaskAttribute.DATE_MODIFICATION);
+ if (attributeLastModified != null && attributeLastModified.getValue().length() > 0) {
+ completionDate = taskData.getAttributeMapper().getDateValue(attributeLastModified);
+ }
+ }
+ task.setCompletionDate(completionDate);
+ } else {
+ task.setCompletionDate(null);
+ }
+ // Bugzilla Specific Attributes
+
+ // Product
+ if (scheme.getProduct() != null) {
+ task.setAttribute(BugzillaRestTaskSchema.getDefault().PRODUCT.getKey(), scheme.getProduct());
+ }
+
+ // Severity
+ TaskAttribute attrSeverity = taskData.getRoot()
+ .getMappedAttribute(BugzillaRestTaskSchema.getDefault().SEVERITY.getKey());
+ if (attrSeverity != null && !attrSeverity.getValue().equals("")) { //$NON-NLS-1$
+ task.setAttribute(BugzillaRestTaskSchema.getDefault().SEVERITY.getKey(), attrSeverity.getValue());
+ }
+
+ // Severity
+ TaskAttribute attrDelta = taskData.getRoot()
+ .getAttribute(BugzillaRestTaskSchema.getDefault().DATE_MODIFICATION.getKey());
+ if (attrDelta != null && !attrDelta.getValue().equals("")) { //$NON-NLS-1$
+ task.setAttribute(BugzillaRestTaskSchema.getDefault().DATE_MODIFICATION.getKey(), attrDelta.getValue());
+ }
}
@Override
@@ -341,7 +427,7 @@ public class BugzillaRestConnector extends AbstractRepositoryConnector {
}
@Override
- public ITaskMapping getTaskMapping(final TaskData taskData) {
+ public TaskMapper getTaskMapping(final TaskData taskData) {
return new TaskMapper(taskData) {
@Override
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestGetTaskData.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestGetTaskData.java
index 97b87b255..d6d2ecc04 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestGetTaskData.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestGetTaskData.java
@@ -15,12 +15,19 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Type;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
+import java.util.Locale;
import java.util.Map.Entry;
+import java.util.TimeZone;
import org.apache.http.HttpStatus;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.operations.IOperationMonitor;
import org.eclipse.mylyn.commons.repositories.http.core.CommonHttpResponse;
import org.eclipse.mylyn.commons.repositories.http.core.HttpUtil;
@@ -124,7 +131,26 @@ public class BugzillaRestGetTaskData extends BugzillaRestAuthenticatedGetRequest
attribute.setValue(value.getAsString());
}
continue;
+ } else if (entry.getKey().equals("last_change_time")) {
+ TaskAttribute attribute = taskData.getRoot()
+ .getAttribute(taskSchema.DATE_MODIFICATION.getKey());
+ JsonElement value = entry.getValue(); //.get("real_name");
+ if (attribute != null) {
+ try {
+ SimpleDateFormat iso8601Format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", //$NON-NLS-1$
+ Locale.US);
+ iso8601Format.setTimeZone(TimeZone.getTimeZone("UTC")); //$NON-NLS-1$
+ Date tempDate = iso8601Format.parse(value.getAsString());
+ attribute.setValue(Long.toString(tempDate.getTime()));
+ continue;
+ } catch (ParseException e) {
+ com.google.common.base.Throwables.propagate(
+ new CoreException(new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN,
+ "Can not parse Date (" + value.getAsString() + ")"))); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
}
+
TaskAttribute attribute = taskData.getRoot().getAttribute(attributeId);
if (attribute != null) {
JsonElement value = entry.getValue();
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 3d6530b89..1cf478396 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
@@ -36,6 +36,7 @@ public class BugzillaRestTaskSchema extends AbstractTaskSchema {
.put("resolution", getDefault().RESOLUTION.getKey()) //$NON-NLS-1$
.put("version", getDefault().VERSION.getKey()) //$NON-NLS-1$
.put("dup_id", getDefault().DUPE_OF.getKey()) //$NON-NLS-1$
+ .put("last_change_time", getDefault().DATE_MODIFICATION.getKey()) //$NON-NLS-1$
.build();
private static ImmutableMap<String, String> attribute2FieldMapper = new ImmutableMap.Builder<String, String>()
@@ -53,6 +54,7 @@ public class BugzillaRestTaskSchema extends AbstractTaskSchema {
.put(getDefault().RESOLUTION.getKey(), "resolution") //$NON-NLS-1$
.put(getDefault().DUPE_OF.getKey(), "dup_id") //$NON-NLS-1$
.put("resolutionInput", "resolution") //$NON-NLS-1$ //$NON-NLS-2$
+ .put(getDefault().DATE_MODIFICATION.getKey(), "last_change_time") //$NON-NLS-1$
.build();
public static String getAttributeNameFromFieldName(String fieldName) {
@@ -144,6 +146,8 @@ public class BugzillaRestTaskSchema extends AbstractTaskSchema {
public final Field KEYWORDS = createField("keywords", "Keywords", IBugzillaRestConstants.EDITOR_TYPE_KEYWORD,
Flag.ATTRIBUTE);
+ public final Field DATE_MODIFICATION = inheritFrom(parent.DATE_MODIFICATION).create();
+
@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 dfc2260e4..6ea53aba4 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
@@ -15,4 +15,6 @@ 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$
+
+ public static final String BUG_STATUS = "bug_status";
}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositoryConnectorUi.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositoryConnectorUi.java
index f3cd48ce7..a9d096c82 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositoryConnectorUi.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositoryConnectorUi.java
@@ -53,7 +53,7 @@ public class BugzillaRestRepositoryConnectorUi extends AbstractRepositoryConnect
BugzillaRestConnector connectorREST = (BugzillaRestConnector) connector;
TaskData taskData = new TaskData(new BugzillaRestTaskAttributeMapper(repository, connectorREST),
- repository.getConnectorKind(), "Query", "Query");
+ repository.getConnectorKind(), "Query", "Query"); //$NON-NLS-1$ //$NON-NLS-2$
if (query == null) {
wizard.addPage(new BugzillaRestQueryTypeWizardPage(repository, connector));
@@ -70,7 +70,7 @@ public class BugzillaRestRepositoryConnectorUi extends AbstractRepositoryConnect
}
private boolean isCustomQuery(IRepositoryQuery query2) {
- String custom = query2.getAttribute("SimpleURLQueryPage");
+ String custom = query2.getAttribute("SimpleURLQueryPage"); //$NON-NLS-1$
return custom != null && custom.equals(Boolean.TRUE.toString());
}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositorySettingsPage.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositorySettingsPage.java
index 46f4d3421..ed81d1249 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositorySettingsPage.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestRepositorySettingsPage.java
@@ -24,12 +24,12 @@ public class BugzillaRestRepositorySettingsPage extends AbstractRepositorySettin
private static final String LABEL_VERSION_NUMBER = "5.0"; //$NON-NLS-1$
private static final String DESCRIPTION = MessageFormat.format(
- "Supports Bugzilla {0} Example: https://bugs.eclipse.org/bugs/ (do not include rest.cgi)",
+ Messages.BugzillaRestRepositorySettingsPage_SupportsVersionMessage,
LABEL_VERSION_NUMBER);
public BugzillaRestRepositorySettingsPage(TaskRepository taskRepository, AbstractRepositoryConnector connector,
AbstractRepositoryConnectorUi connectorUi) {
- super("Bugzilla REST Repository Settings", DESCRIPTION, taskRepository, connector, connectorUi);
+ super(Messages.BugzillaRestRepositorySettingsPage_RestRepositorySetting, DESCRIPTION, taskRepository, connector, connectorUi);
setNeedsAnonymousLogin(true);
setNeedsEncoding(false);
setNeedsAdvanced(false);
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPageFactory.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPageFactory.java
index bc9ed06bf..84dae2ed1 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPageFactory.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/BugzillaRestTaskEditorPageFactory.java
@@ -49,7 +49,7 @@ public class BugzillaRestTaskEditorPageFactory extends AbstractTaskEditorPageFac
@Override
public String getPageText() {
- return "Bugzilla";
+ return Messages.BugzillaRestTaskEditorPageFactory_Bugzilla;
}
@Override
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/Messages.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/Messages.java
new file mode 100644
index 000000000..28009e885
--- /dev/null
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/Messages.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Frank Becker 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:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.bugzilla.rest.ui;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.bugzilla.rest.ui.messages"; //$NON-NLS-1$
+
+ public static String BugzillaRestRepositorySettingsPage_RestRepositorySetting;
+
+ public static String BugzillaRestRepositorySettingsPage_SupportsVersionMessage;
+
+ public static String BugzillaRestSearchQueryPage_PropertiesForNewQuery;
+
+ public static String BugzillaRestSearchQueryPage_PropertiesForQuery;
+
+ public static String BugzillaRestTaskEditorPageFactory_Bugzilla;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/messages.properties b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/messages.properties
new file mode 100644
index 000000000..6300ec225
--- /dev/null
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/bugzilla/rest/ui/messages.properties
@@ -0,0 +1,5 @@
+BugzillaRestRepositorySettingsPage_RestRepositorySetting=Bugzilla REST Repository Settings
+BugzillaRestRepositorySettingsPage_SupportsVersionMessage=Supports Bugzilla {0} Example: https://bugs.eclipse.org/bugs/ (do not include rest.cgi)
+BugzillaRestSearchQueryPage_PropertiesForNewQuery=Properties for new Query
+BugzillaRestSearchQueryPage_PropertiesForQuery=Properties for Query ''{0}''
+BugzillaRestTaskEditorPageFactory_Bugzilla=Bugzilla
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/BugzillaRestQueryTypeWizardPage.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/BugzillaRestQueryTypeWizardPage.java
index 559bc6c68..a551114a7 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/BugzillaRestQueryTypeWizardPage.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/BugzillaRestQueryTypeWizardPage.java
@@ -40,15 +40,17 @@ public class BugzillaRestQueryTypeWizardPage extends WizardPage {
private Composite composite;
public BugzillaRestQueryTypeWizardPage(TaskRepository repository, AbstractRepositoryConnector connector) {
- super("Choose query type");
- setTitle("Choose query type");
- setDescription("Select from the available query types.");
+ super(Messages.BugzillaRestQueryTypeWizardPage_ChooseQueryType);
+ setTitle(Messages.BugzillaRestQueryTypeWizardPage_ChooseQueryType);
+ setDescription(Messages.BugzillaRestQueryTypeWizardPage_SelectAvailableQueryTypes);
setImageDescriptor(TasksUiImages.BANNER_REPOSITORY);
BugzillaRestConnector connectorREST = (BugzillaRestConnector) connector;
TaskData taskDataSimpleURL = new TaskData(new BugzillaRestTaskAttributeMapper(repository, connectorREST),
- repository.getConnectorKind(), "Query", "Query");
+ repository.getConnectorKind(), Messages.BugzillaRestQueryTypeWizardPage_Query,
+ Messages.BugzillaRestQueryTypeWizardPage_Query);
TaskData taskDataSearch = new TaskData(new BugzillaRestTaskAttributeMapper(repository, connectorREST),
- repository.getConnectorKind(), "Query", "Query");
+ repository.getConnectorKind(), Messages.BugzillaRestQueryTypeWizardPage_Query,
+ Messages.BugzillaRestQueryTypeWizardPage_Query);
customPage = BugzillaRestUiUtil.createBugzillaRestSearchPage(true, false, taskDataSimpleURL, connectorREST,
repository, null);
searchPage = BugzillaRestUiUtil.createBugzillaRestSearchPage(false, false, taskDataSearch, connectorREST,
@@ -64,11 +66,11 @@ public class BugzillaRestQueryTypeWizardPage extends WizardPage {
composite.setLayout(new GridLayout(1, false));
buttonForm = new Button(composite, SWT.RADIO);
- buttonForm.setText("Cre&ate query using a form");
+ buttonForm.setText(Messages.BugzillaRestQueryTypeWizardPage_CreateQueryUsingForm);
buttonForm.setSelection(true);
buttonCustom = new Button(composite, SWT.RADIO);
- buttonCustom.setText("&Create query from existing URL");
+ buttonCustom.setText(Messages.BugzillaRestQueryTypeWizardPage_CreateQueryFromExistingURL);
setPageComplete(true);
setControl(composite);
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/BugzillaRestSearchQueryPage.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/BugzillaRestSearchQueryPage.java
index b23367d46..a25b270e7 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/BugzillaRestSearchQueryPage.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/BugzillaRestSearchQueryPage.java
@@ -11,7 +11,9 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.bugzilla.rest.core.BugzillaRestConfiguration;
import org.eclipse.mylyn.internal.bugzilla.rest.core.BugzillaRestConnector;
+import org.eclipse.mylyn.internal.bugzilla.rest.core.BugzillaRestTaskSchema;
import org.eclipse.mylyn.internal.bugzilla.rest.ui.BugzillaRestUiPlugin;
+import org.eclipse.mylyn.internal.bugzilla.rest.ui.Messages;
import org.eclipse.mylyn.internal.provisional.tasks.ui.wizards.AbstractQueryPageSchema;
import org.eclipse.mylyn.internal.provisional.tasks.ui.wizards.QueryPageDetails;
import org.eclipse.mylyn.internal.provisional.tasks.ui.wizards.RepositoryQuerySchemaPage;
@@ -20,19 +22,25 @@ import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
+import org.eclipse.osgi.util.NLS;
public class BugzillaRestSearchQueryPage extends RepositoryQuerySchemaPage {
public BugzillaRestSearchQueryPage(String pageName, TaskRepository repository, IRepositoryQuery query,
AbstractQueryPageSchema schema, TaskData data, QueryPageDetails pageDetails) {
super(pageName, repository, query, schema, data, pageDetails);
+ if (query != null) {
+ setTitle(NLS.bind(Messages.BugzillaRestSearchQueryPage_PropertiesForQuery, query.getSummary()));
+ } else {
+ setTitle(Messages.BugzillaRestSearchQueryPage_PropertiesForNewQuery);
+ }
}
@Override
protected void doRefreshControls() {
try {
BugzillaRestConnector connectorREST = (BugzillaRestConnector) getConnector();
- connectorREST.getRepositoryConfiguration(getTaskRepository()).updateProductOptions(targetTaskData);
+ connectorREST.getRepositoryConfiguration(getTaskRepository()).updateProductOptions(getTargetTaskData());
for (Entry<String, AbstractAttributeEditor> entry : editorMap.entrySet()) {
entry.getValue().refresh();
@@ -72,6 +80,7 @@ public class BugzillaRestSearchQueryPage extends RepositoryQuerySchemaPage {
return false;
}
+ @SuppressWarnings("restriction")
private void restoreStateFromUrl(String queryUrl) throws UnsupportedEncodingException {
queryUrl = queryUrl.substring(queryUrl.indexOf("?") + 1); //$NON-NLS-1$
String[] options = queryUrl.split("&"); //$NON-NLS-1$
@@ -83,18 +92,18 @@ public class BugzillaRestSearchQueryPage extends RepositoryQuerySchemaPage {
} else {
key = option.substring(0, option.indexOf("=")); //$NON-NLS-1$
}
- if (key == null || key.equals("order")) {
+ if (key == null || key.equals("order")) { //$NON-NLS-1$
continue;
}
String value = URLDecoder.decode(option.substring(option.indexOf("=") + 1), //$NON-NLS-1$
getTaskRepository().getCharacterEncoding());
key = mapAttributeKey(key);
- TaskAttribute attr = targetTaskData.getRoot().getAttribute(key);
+ TaskAttribute attr = getTargetTaskData().getRoot().getAttribute(key);
if (attr != null) {
- if (targetTaskData.getRoot().getAttribute(key).getValue().equals("")) {
- targetTaskData.getRoot().getAttribute(key).setValue(value);
+ if (getTargetTaskData().getRoot().getAttribute(key).getValue().equals("")) { //$NON-NLS-1$
+ getTargetTaskData().getRoot().getAttribute(key).setValue(value);
} else {
- targetTaskData.getRoot().getAttribute(key).addValue(value);
+ getTargetTaskData().getRoot().getAttribute(key).addValue(value);
}
}
}
@@ -108,13 +117,13 @@ public class BugzillaRestSearchQueryPage extends RepositoryQuerySchemaPage {
private StringBuilder getQueryParameters() {
StringBuilder sb = new StringBuilder();
for (Entry<String, AbstractAttributeEditor> entry : editorMap.entrySet()) {
- TaskAttribute attrib = targetTaskData.getRoot().getAttribute(entry.getKey());
+ TaskAttribute attrib = getTargetTaskData().getRoot().getAttribute(entry.getKey());
for (String string : attrib.getValues()) {
- if (string != null && !string.equals("")) {
+ if (string != null && !string.equals("")) { //$NON-NLS-1$
try {
- appendToBuffer(sb, mapUrlKey(entry.getKey()) + "=", URLEncoder
- .encode(string.replaceAll(" ", "%20"), getTaskRepository().getCharacterEncoding())
- .replaceAll("%2520", "%20"));
+ appendToBuffer(sb, mapUrlKey(entry.getKey()) + "=", //$NON-NLS-1$
+ URLEncoder.encode(string.replaceAll(" ", "%20"), //$NON-NLS-1$//$NON-NLS-2$
+ getTaskRepository().getCharacterEncoding()).replaceAll("%2520", "%20")); //$NON-NLS-1$ //$NON-NLS-2$
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -139,7 +148,7 @@ public class BugzillaRestSearchQueryPage extends RepositoryQuerySchemaPage {
* Creates the bugzilla query URL start. Example: https://bugs.eclipse.org/bugs/buglist.cgi?
*/
private String getQueryURLStart(String repsitoryUrl) {
- return repsitoryUrl + (repsitoryUrl.endsWith("/") ? "" : "/") + "rest.cgi/bug?";
+ return repsitoryUrl + (repsitoryUrl.endsWith("/") ? "" : "/") + "rest.cgi/bug?"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
}
private void appendToBuffer(StringBuilder sb, String key, String value) {
@@ -152,14 +161,9 @@ public class BugzillaRestSearchQueryPage extends RepositoryQuerySchemaPage {
protected String mapUrlKey(String attributeKey) {
String key;
- if (TaskAttribute.SUMMARY.equals(attributeKey)) {
- key = "summary";
- } else if (TaskAttribute.PRODUCT.equals(attributeKey)) {
- key = "product";
- } else if (TaskAttribute.COMPONENT.equals(attributeKey)) {
- key = "component";
- } else if (TaskAttribute.VERSION.equals(attributeKey)) {
- key = "version";
+ if (TaskAttribute.SUMMARY.equals(attributeKey) || TaskAttribute.PRODUCT.equals(attributeKey)
+ || TaskAttribute.COMPONENT.equals(attributeKey) || TaskAttribute.VERSION.equals(attributeKey)) {
+ key = BugzillaRestTaskSchema.getFieldNameFromAttributeName(attributeKey);
} else {
key = attributeKey;
}
@@ -168,13 +172,20 @@ public class BugzillaRestSearchQueryPage extends RepositoryQuerySchemaPage {
protected String mapAttributeKey(String attributeKey) {
String key;
- if ("summary".equals(attributeKey)) {
+ if (BugzillaRestTaskSchema.getFieldNameFromAttributeName(BugzillaRestTaskSchema.getDefault().SUMMARY.getKey())
+ .equals(attributeKey)) {
key = TaskAttribute.SUMMARY;
- } else if ("product".equals(attributeKey)) {
+ } else if (BugzillaRestTaskSchema
+ .getFieldNameFromAttributeName(BugzillaRestTaskSchema.getDefault().PRODUCT.getKey())
+ .equals(attributeKey)) {
key = TaskAttribute.PRODUCT;
- } else if ("component".equals(attributeKey)) {
+ } else if (BugzillaRestTaskSchema
+ .getFieldNameFromAttributeName(BugzillaRestTaskSchema.getDefault().COMPONENT.getKey())
+ .equals(attributeKey)) {
key = TaskAttribute.COMPONENT;
- } else if ("version".equals(attributeKey)) {
+ } else if (BugzillaRestTaskSchema
+ .getFieldNameFromAttributeName(BugzillaRestTaskSchema.getDefault().VERSION.getKey())
+ .equals(attributeKey)) {
key = TaskAttribute.VERSION;
} else {
key = attributeKey;
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/BugzillaRestUiUtil.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/BugzillaRestUiUtil.java
index 80d600911..35618529c 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/BugzillaRestUiUtil.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/BugzillaRestUiUtil.java
@@ -31,10 +31,11 @@ public class BugzillaRestUiUtil {
// TODO Auto-generated catch block
e.printStackTrace();
}
- return new BugzillaRestSearchQueryPage("Create query from URL", repository, null,
+ return new BugzillaRestSearchQueryPage(Messages.BugzillaRestUiUtil_CreateQueryFromURL, repository, null,
SimpleURLQueryPageSchema.getInstance(), taskData,
- new QueryPageDetails(true, "buglist.cgi?", "Enter query parameters", "Please anter a title and an URL",
- "([a-zA-Z][a-zA-Z+.-]{0,10}://[a-zA-Z0-9%._~!$&?#'()*+,;:@/=-]+)", "SimpleURLQueryPage"));
+ new QueryPageDetails(true, "buglist.cgi?", Messages.BugzillaRestUiUtil_EnterQueryParameter, //$NON-NLS-1$
+ Messages.BugzillaRestUiUtil_EnterTitleAndURL,
+ "([a-zA-Z][a-zA-Z+.-]{0,10}://[a-zA-Z0-9%._~!$&?#'()*+,;:@/=-]+)", "SimpleURLQueryPage")); //$NON-NLS-1$ //$NON-NLS-2$
}
protected static BugzillaRestSearchQueryPage createBugzillaRestSearchQueryPage(TaskData taskData,
@@ -46,10 +47,11 @@ public class BugzillaRestUiUtil {
// TODO Auto-generated catch block
e.printStackTrace();
}
- return new BugzillaRestSearchQueryPage("Create query from a form", repository, null,
+ return new BugzillaRestSearchQueryPage(Messages.BugzillaRestUiUtil_CreateQueryFromForm, repository, null,
BugzillaRestSearchQueryPageSchema.getInstance(), taskData,
- new QueryPageDetails(true, "buglist.cgi?", "fill the form", "Please enter a title and fill the form",
- "([a-zA-Z][a-zA-Z+.-]{0,10}://[a-zA-Z0-9%._~!$&?#'()*+,;:@/=-]+)", null));
+ new QueryPageDetails(true, "buglist.cgi?", Messages.BugzillaRestUiUtil_FillForm, //$NON-NLS-1$
+ Messages.BugzillaRestUiUtil_enterTitleAndFillForm,
+ "([a-zA-Z][a-zA-Z+.-]{0,10}://[a-zA-Z0-9%._~!$&?#'()*+,;:@/=-]+)", null)); //$NON-NLS-1$
}
public static BugzillaRestSearchQueryPage createBugzillaRestSearchPage(boolean simplePage, boolean updateMode,
@@ -80,10 +82,11 @@ public class BugzillaRestUiUtil {
// TODO Auto-generated catch block
e.printStackTrace();
}
- return new BugzillaRestSearchQueryPage("Create query from URL", repository, query,
+ return new BugzillaRestSearchQueryPage(Messages.BugzillaRestUiUtil_CreateQueryFromURL, repository, query,
SimpleURLQueryPageSchema.getInstance(), taskData,
- new QueryPageDetails(true, "buglist.cgi?", "Enter query parameters", "Please anter a title and an URL",
- "([a-zA-Z][a-zA-Z+.-]{0,10}://[a-zA-Z0-9%._~!$&?#'()*+,;:@/=-]+)", "SimpleURLQueryPage"));
+ new QueryPageDetails(true, "buglist.cgi?", Messages.BugzillaRestUiUtil_EnterQueryParameters, //$NON-NLS-1$
+ Messages.BugzillaRestUiUtil_EnterTitleAndURL1,
+ "([a-zA-Z][a-zA-Z+.-]{0,10}://[a-zA-Z0-9%._~!$&?#'()*+,;:@/=-]+)", "SimpleURLQueryPage")); //$NON-NLS-1$ //$NON-NLS-2$
}
protected static BugzillaRestSearchQueryPage updateBugzillaRestSearchQueryPage(TaskData taskData,
@@ -97,10 +100,11 @@ public class BugzillaRestUiUtil {
// TODO Auto-generated catch block
e.printStackTrace();
}
- return new BugzillaRestSearchQueryPage("Create query from a form", repository, query,
+ return new BugzillaRestSearchQueryPage(Messages.BugzillaRestUiUtil_CreateQueryFromForm, repository, query,
BugzillaRestSearchQueryPageSchema.getInstance(), taskData,
- new QueryPageDetails(true, "buglist.cgi?", "fill the form", "Please enter a title and fill the form",
- "([a-zA-Z][a-zA-Z+.-]{0,10}://[a-zA-Z0-9%._~!$&?#'()*+,;:@/=-]+)", null));
+ new QueryPageDetails(true, "buglist.cgi?", Messages.BugzillaRestUiUtil_fillForm, //$NON-NLS-1$
+ Messages.BugzillaRestUiUtil_EnterTitleAndFillForm,
+ "([a-zA-Z][a-zA-Z+.-]{0,10}://[a-zA-Z0-9%._~!$&?#'()*+,;:@/=-]+)", null)); //$NON-NLS-1$
}
}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/Messages.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/Messages.java
new file mode 100644
index 000000000..933bb75e9
--- /dev/null
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/Messages.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Frank Becker 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:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.provisional.bugzilla.rest.ui;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.provisional.bugzilla.rest.ui.messages"; //$NON-NLS-1$
+
+ public static String BugzillaRestQueryTypeWizardPage_ChooseQueryType;
+
+ public static String BugzillaRestQueryTypeWizardPage_CreateQueryFromExistingURL;
+
+ public static String BugzillaRestQueryTypeWizardPage_CreateQueryUsingForm;
+
+ public static String BugzillaRestQueryTypeWizardPage_Query;
+
+ public static String BugzillaRestQueryTypeWizardPage_SelectAvailableQueryTypes;
+
+ public static String BugzillaRestUiUtil_CreateQueryFromForm;
+
+ public static String BugzillaRestUiUtil_CreateQueryFromURL;
+
+ public static String BugzillaRestUiUtil_EnterQueryParameter;
+
+ public static String BugzillaRestUiUtil_EnterQueryParameters;
+
+ public static String BugzillaRestUiUtil_enterTitleAndFillForm;
+
+ public static String BugzillaRestUiUtil_EnterTitleAndFillForm;
+
+ public static String BugzillaRestUiUtil_EnterTitleAndURL;
+
+ public static String BugzillaRestUiUtil_EnterTitleAndURL1;
+
+ public static String BugzillaRestUiUtil_fillForm;
+
+ public static String BugzillaRestUiUtil_FillForm;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/messages.properties b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/messages.properties
new file mode 100644
index 000000000..e0d2c3da3
--- /dev/null
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.ui/src/org/eclipse/mylyn/internal/provisional/bugzilla/rest/ui/messages.properties
@@ -0,0 +1,15 @@
+BugzillaRestQueryTypeWizardPage_ChooseQueryType=Choose query type
+BugzillaRestQueryTypeWizardPage_CreateQueryFromExistingURL=&Create query from existing URL
+BugzillaRestQueryTypeWizardPage_CreateQueryUsingForm=Cre&ate query using a form
+BugzillaRestQueryTypeWizardPage_Query=Query
+BugzillaRestQueryTypeWizardPage_SelectAvailableQueryTypes=Select from the available query types.
+BugzillaRestUiUtil_CreateQueryFromForm=Create query from a form
+BugzillaRestUiUtil_CreateQueryFromURL=Create query from URL
+BugzillaRestUiUtil_EnterQueryParameter=Enter query parameters
+BugzillaRestUiUtil_EnterQueryParameters=Enter query parameters
+BugzillaRestUiUtil_enterTitleAndFillForm=Please enter a title and fill the form
+BugzillaRestUiUtil_EnterTitleAndFillForm=Please enter a title and fill the form
+BugzillaRestUiUtil_EnterTitleAndURL=Please enter a title and an URL
+BugzillaRestUiUtil_EnterTitleAndURL1=Please anter a title and an URL
+BugzillaRestUiUtil_fillForm=fill the form
+BugzillaRestUiUtil_FillForm=fill the form
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/RepositoryQuerySchemaPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/RepositoryQuerySchemaPage.java
index 32425cc9b..90f8f0317 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/RepositoryQuerySchemaPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/RepositoryQuerySchemaPage.java
@@ -74,7 +74,7 @@ public class RepositoryQuerySchemaPage extends AbstractRepositoryQueryPage2 {
private SectionComposite scrolledComposite;
- protected TaskData targetTaskData;
+ private TaskData targetTaskData;
protected final Map<String, AbstractAttributeEditor> editorMap = new HashMap<String, AbstractAttributeEditor>();
@@ -245,10 +245,8 @@ public class RepositoryQuerySchemaPage extends AbstractRepositoryQueryPage2 {
setMessage("");
boolean oneFieldHasValue = false;
for (Field field : schema.getFields()) {
- oneFieldHasValue |= (targetTaskData.getRoot().getAttribute(field.getKey()).hasValue() && !targetTaskData.getRoot()
- .getAttribute(field.getKey())
- .getValue()
- .equals(""));
+ oneFieldHasValue |= (targetTaskData.getRoot().getAttribute(field.getKey()).hasValue()
+ && !targetTaskData.getRoot().getAttribute(field.getKey()).getValue().equals(""));
if (field.isQueryRequired()) {
String text = targetTaskData.getRoot().getAttribute(field.getKey()).getValue();
if (text == null || text.length() == 0) {
@@ -315,4 +313,9 @@ public class RepositoryQuerySchemaPage extends AbstractRepositoryQueryPage2 {
// ignore
return false;
}
+
+ protected TaskData getTargetTaskData() {
+ return targetTaskData;
+ }
+
}

Back to the top