Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2013-06-03 15:25:48 -0400
committerFrank Becker2013-06-03 15:25:48 -0400
commit31fba80064e2deaaa304a17b5ce53e27ed0be55d (patch)
treef3ffd0f9b6833f41f18eeb574ae59cd2be9ec9f2 /org.eclipse.mylyn.bugzilla.core/src
parent4df8e40de32fb67695bd3413913feebc06eec2df (diff)
downloadorg.eclipse.mylyn.tasks-31fba80064e2deaaa304a17b5ce53e27ed0be55d.tar.gz
org.eclipse.mylyn.tasks-31fba80064e2deaaa304a17b5ce53e27ed0be55d.tar.xz
org.eclipse.mylyn.tasks-31fba80064e2deaaa304a17b5ce53e27ed0be55d.zip
Revert "403024: Ability to reopen a task when 'REOPENED' state is not available."
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core/src')
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java9
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java6
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties2
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java80
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/Messages.java31
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/messages.properties3
7 files changed, 31 insertions, 104 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
index 4f2921f7e..06647e699 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
@@ -729,8 +729,6 @@ public class BugzillaClient {
throws IOException, CoreException {
GzipGetMethod method = null;
int attempt = 0;
- StatusHandler.log(new Status(IStatus.INFO, BugzillaCorePlugin.ID_PLUGIN,
- Messages.BugzillaClient_Start_GetConfiguration + repositoryUrl));
while (attempt < 2) {
try {
method = getConnectGzip(repositoryUrl + IBugzillaConstants.URL_GET_CONFIG_RDF, monitor, eTagValue);
@@ -750,7 +748,6 @@ public class BugzillaClient {
stream, getCharacterEncoding());
repositoryConfiguration = configFactory.getConfiguration();
- repositoryConfiguration.setRepositoryUrl(repositoryUrl.toExternalForm());
Header eTag = method.getResponseHeader("ETag"); //$NON-NLS-1$
if (eTag != null) {
repositoryConfiguration.setETagValue(eTag.getValue());
@@ -772,7 +769,7 @@ public class BugzillaClient {
getXmlRpcClient();
if (xmlRpcClient != null) {
xmlRpcClient.updateConfiguration(monitor, repositoryConfiguration,
- configParameters);
+ configParameters.get(IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE));
} else {
repositoryConfiguration.setValidTransitions(monitor,
configParameters.get(IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE), null);
@@ -782,8 +779,6 @@ public class BugzillaClient {
}
if (!repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT).isEmpty()) {
- StatusHandler.log(new Status(IStatus.INFO, BugzillaCorePlugin.ID_PLUGIN,
- Messages.BugzillaClient_Stop_GetConfiguration + repositoryUrl));
return repositoryConfiguration;
} else {
if (attempt == 0) {
@@ -814,8 +809,6 @@ public class BugzillaClient {
}
}
}
- StatusHandler.log(new Status(IStatus.INFO, BugzillaCorePlugin.ID_PLUGIN,
- Messages.BugzillaClient_Start_GetConfiguration + repositoryUrl));
return null;
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java
index 4d8eb8d81..7a2513e65 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java
@@ -252,11 +252,7 @@ public interface IBugzillaConstants {
public static final String BUGZILLA_DESCRIPTOR_FILE = "bugzilla.desciptorFile"; //$NON-NLS-1$
- public static final String BUGZILLA_USE_XMLRPC = "bugzilla.xmlrpc"; //$NON-NLS-1$
-
- public static final String BUGZILLA_USE_XMLRPC_WORKFLOW = "bugzilla.xmlrpc.status.transition"; //$NON-NLS-1$
-
- public static final String BUGZILLA_USE_XMLRPC_DEFAULT_MILESTONE = "bugzilla.xmlrpc.default.milestone"; //$NON-NLS-1$
+ public static final String BUGZILLA_USE_XMLRPC = "bugzilla.xmlrpc.status.transition"; //$NON-NLS-1$
public static final String DEFAULT_LANG = "en (default)"; //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java
index 2900bd402..0d4a71cfe 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java
@@ -219,10 +219,6 @@ public class Messages extends NLS {
public static String BugzillaClient_description_required_when_submitting_attachments;
- public static String BugzillaClient_Start_GetConfiguration;
-
- public static String BugzillaClient_Stop_GetConfiguration;
-
public static String BugzillaClient_Unable_to_retrieve_new_task;
public static String BugzillaClientManager_Refreshing_repository_configuration;
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties
index 636eabcbd..31c9fafb7 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties
@@ -107,8 +107,6 @@ BugzillaAttachmentMapper_URL=URL:
BugzillaClient_anonymous_user_not_allowed=Anonymous user not allowed for this operation.
BugzillaClient_could_not_post_form_null_returned=Could not post form, client returned null method.
BugzillaClient_description_required_when_submitting_attachments=A description is required when submitting attachments.
-BugzillaClient_Start_GetConfiguration=Start getRepositoryConfiguration for
-BugzillaClient_Stop_GetConfiguration=Stop getRepositoryConfiguration for
BugzillaClient_Unable_to_retrieve_new_task=Unable to retrieve new task.
BugzillaClientManager_Refreshing_repository_configuration=Refreshing repository configuration
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
index 51da85d7a..af2d235a7 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
@@ -32,7 +32,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.commons.net.AbstractWebLocation;
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
import org.eclipse.mylyn.commons.net.AuthenticationType;
@@ -55,7 +54,6 @@ import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskCommentMapper;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataCollector;
-import org.eclipse.osgi.util.NLS;
@SuppressWarnings("restriction")
public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
@@ -415,71 +413,51 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
}
public void updateConfiguration(IProgressMonitor monitor, RepositoryConfiguration repositoryConfiguration,
- Map<String, String> configParameters) throws CoreException {
- if (Boolean.parseBoolean(configParameters.get(IBugzillaConstants.BUGZILLA_USE_XMLRPC_WORKFLOW))) {
- repositoryConfiguration.setValidTransitions(monitor,
- configParameters.get(IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE), this);
- }
- if (!repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT).isEmpty()
- && Boolean.parseBoolean(configParameters.get(IBugzillaConstants.BUGZILLA_USE_XMLRPC_DEFAULT_MILESTONE))) {
+ String fileName) throws CoreException {
+ repositoryConfiguration.setValidTransitions(monitor, fileName, this);
+ if (!repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT).isEmpty()) {
updateProductInfo(monitor, repositoryConfiguration);
}
}
public void updateProductInfo(IProgressMonitor monitor, RepositoryConfiguration repositoryConfiguration)
throws CoreException {
- ArrayList<Object> productIDNew = new ArrayList<Object>();
- StatusHandler.log(new Status(IStatus.INFO, BugzillaCorePlugin.ID_PLUGIN, Messages.BugzillaXmlRpcClient_Start_UpdateProductInfo
- + repositoryConfiguration.getRepositoryUrl()));
try {
Object[] productIDs = getAccessibleProducts(monitor);
- for (Object productID : productIDs) {
- productIDNew.clear();
- productIDNew.add(productID);
- try {
- Object[] products = getProducts(monitor, productIDNew.toArray());
- for (Object object : products) {
- if (object instanceof HashMap<?, ?>) {
- String defaultMilestone = null;
- String product = (String) ((HashMap<?, ?>) object).get("name"); //$NON-NLS-1$
- HashMap<?, ?> values = (HashMap<?, ?>) ((HashMap<?, ?>) object).get("internals"); //$NON-NLS-1$
- Object defaultMilestoneObj = null;
- if (values != null) {
- if (values instanceof HashMap<?, ?>) {
- defaultMilestoneObj = ((HashMap<?, ?>) values).get("defaultmilestone"); //$NON-NLS-1$
- }
- } else {
- defaultMilestoneObj = ((HashMap<?, ?>) object).get("default_milestone"); //$NON-NLS-1$
- }
- if (defaultMilestoneObj != null) {
- if (defaultMilestoneObj instanceof String) {
- defaultMilestone = (String) defaultMilestoneObj;
- } else if (defaultMilestoneObj instanceof Double) {
- defaultMilestone = ((Double) defaultMilestoneObj).toString();
- } else if (defaultMilestoneObj instanceof Integer) {
- defaultMilestone = ((Integer) defaultMilestoneObj).toString();
- }
- }
- if (product != null && !product.equals("") //$NON-NLS-1$
- && defaultMilestone != null && !defaultMilestone.equals("")) { //$NON-NLS-1$
- repositoryConfiguration.setDefaultMilestone(product, defaultMilestone);
- }
+ Object[] products = getProducts(monitor, productIDs);
+ for (Object object : products) {
+ if (object instanceof HashMap<?, ?>) {
+ String defaultMilestone = null;
+ String product = (String) ((HashMap<?, ?>) object).get("name"); //$NON-NLS-1$
+ HashMap<?, ?> values = (HashMap<?, ?>) ((HashMap<?, ?>) object).get("internals"); //$NON-NLS-1$
+ Object defaultMilestoneObj = null;
+ if (values != null) {
+ if (values instanceof HashMap<?, ?>) {
+ defaultMilestoneObj = ((HashMap<?, ?>) values).get("defaultmilestone"); //$NON-NLS-1$
+ }
+ } else {
+ defaultMilestoneObj = ((HashMap<?, ?>) object).get("default_milestone"); //$NON-NLS-1$
+ }
+ if (defaultMilestoneObj != null) {
+ if (defaultMilestoneObj instanceof String) {
+ defaultMilestone = (String) defaultMilestoneObj;
+ } else if (defaultMilestoneObj instanceof Double) {
+ defaultMilestone = ((Double) defaultMilestoneObj).toString();
+ } else if (defaultMilestoneObj instanceof Integer) {
+ defaultMilestone = ((Integer) defaultMilestoneObj).toString();
}
}
- } catch (Exception e) {
- Status status = new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, NLS.bind(
- Messages.BugzillaXmlRpcClient_CanNotGetTheDefaultMilestoneForProductWithID,
- productIDNew.get(0)));
- StatusHandler.log(status);
+ if (product != null && !product.equals("") //$NON-NLS-1$
+ && defaultMilestone != null && !defaultMilestone.equals("")) { //$NON-NLS-1$
+ repositoryConfiguration.setDefaultMilestone(product, defaultMilestone);
+ }
}
}
} catch (XmlRpcException e) {
throw new CoreException(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN,
"Can not get the Default Milestones using XMLRPC")); //$NON-NLS-1$
- } finally {
- StatusHandler.log(new Status(IStatus.INFO, BugzillaCorePlugin.ID_PLUGIN, Messages.BugzillaXmlRpcClient_Stop_UpdateProductInfo
- + repositoryConfiguration.getRepositoryUrl()));
}
+
}
public int getUserID() {
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/Messages.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/Messages.java
deleted file mode 100644
index 9b672cac0..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/Messages.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 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.core.service;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.bugzilla.core.service.messages"; //$NON-NLS-1$
-
- public static String BugzillaXmlRpcClient_CanNotGetTheDefaultMilestoneForProductWithID;
-
- public static String BugzillaXmlRpcClient_Start_UpdateProductInfo;
-
- public static String BugzillaXmlRpcClient_Stop_UpdateProductInfo;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/messages.properties b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/messages.properties
deleted file mode 100644
index 734191b51..000000000
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/messages.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-BugzillaXmlRpcClient_CanNotGetTheDefaultMilestoneForProductWithID=Can not get the Default Milestone for Product with ID {0} using XMLRPC
-BugzillaXmlRpcClient_Start_UpdateProductInfo=Start updateProductInfo for
-BugzillaXmlRpcClient_Stop_UpdateProductInfo=Stop updateProductInfo for

Back to the top