Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2007-02-16 15:17:29 -0500
committerrelves2007-02-16 15:17:29 -0500
commit3e1ddadf84b13bec556d964987715abf1fce3947 (patch)
tree442e1ebb446d47ccf2f5a80c2acac3907e388d18
parent5b4c3852968efb01759bcd79726d742d6176c589 (diff)
downloadorg.eclipse.mylyn.tasks-3e1ddadf84b13bec556d964987715abf1fce3947.tar.gz
org.eclipse.mylyn.tasks-3e1ddadf84b13bec556d964987715abf1fce3947.tar.xz
org.eclipse.mylyn.tasks-3e1ddadf84b13bec556d964987715abf1fce3947.zip
NEW - bug 166555: Bugs with QA contacts cannot be updated when using "local users"
https://bugs.eclipse.org/bugs/show_bug.cgi?id=166555
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java30
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientFactory.java11
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientManager.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java19
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/RepositorySynchronizationManager.java5
6 files changed, 64 insertions, 5 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 5d5282ab6..ab053b267 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
@@ -190,14 +190,22 @@ public class BugzillaClient {
private String htAuthPass;
+ private Map<String, String> configParameters;
+
public BugzillaClient(URL url, String username, String password, String htAuthUser, String htAuthPass,
String characterEncoding) {
+ this(url, username, password, htAuthUser, htAuthPass, characterEncoding, new HashMap<String, String>());
+ }
+
+ public BugzillaClient(URL url, String username, String password, String htAuthUser, String htAuthPass,
+ String characterEncoding, Map<String, String> configParameters) {
this.username = username;
this.password = password;
this.repositoryUrl = url;
this.htAuthUser = htAuthUser;
this.htAuthPass = htAuthPass;
this.characterEncoding = characterEncoding;
+ this.configParameters = configParameters;
}
public void validate() throws IOException, CoreException {
@@ -812,6 +820,9 @@ public class BugzillaClient {
value = a.getValue();
if (value == null)
continue;
+
+ cleanQAContact(a);
+
fields.put(a.getID(), new NameValuePair(a.getID(), value));
}
}
@@ -829,6 +840,20 @@ public class BugzillaClient {
}
+ private void cleanQAContact(RepositoryTaskAttribute a) {
+ if (a.getID().equals(BugzillaReportElement.QA_CONTACT.getKeyString())) {
+ if ("true".equals(configParameters.get(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN))) {
+ if (a.getValue() != null && a.getValue().length() > 0) {
+ int atIndex = a.getValue().indexOf("@");
+ if (atIndex != -1) {
+ String newValue = a.getValue().substring(0, atIndex);
+ a.setValue(newValue);
+ }
+ }
+ }
+ }
+ }
+
private NameValuePair[] getPairsForExisting(RepositoryTaskData model) {
Map<String, NameValuePair> fields = new HashMap<String, NameValuePair>();
@@ -846,9 +871,8 @@ public class BugzillaClient {
|| a.getID().equals(BugzillaReportElement.CREATION_TS.getKeyString())) {
continue;
} else if (a.getID() != null && a.getID().compareTo("") != 0) {
- String value = a.getValue();
- // DEBUG: System.err.println(">>> "+a.getName()+" =
- // "+a.getValue());
+ cleanQAContact(a);
+ String value = a.getValue();
if (a.getID().equals(BugzillaReportElement.DELTA_TS.getKeyString())) {
value = stripTimeZone(value);
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientFactory.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientFactory.java
index 6a2a486ab..02905929f 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientFactory.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientFactory.java
@@ -13,6 +13,8 @@ package org.eclipse.mylar.internal.bugzilla.core;
import java.net.MalformedURLException;
import java.net.Proxy;
import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
/**
* @author Steffen Pingel
@@ -22,9 +24,16 @@ public class BugzillaClientFactory {
public static BugzillaClient createClient(String hostUrl, String username, String password, String htAuthUser,
String htAuthPass, Proxy proxy, String encoding) throws MalformedURLException {
+ return createClient(hostUrl, username, password, htAuthUser, htAuthPass, proxy, encoding,
+ new HashMap<String, String>());
+ }
+
+ public static BugzillaClient createClient(String hostUrl, String username, String password, String htAuthUser,
+ String htAuthPass, Proxy proxy, String encoding, Map<String, String> configParameters)
+ throws MalformedURLException {
URL url = new URL(hostUrl);
- BugzillaClient client = new BugzillaClient(url, username, password, htAuthUser, htAuthPass, encoding);
+ BugzillaClient client = new BugzillaClient(url, username, password, htAuthUser, htAuthPass, encoding, configParameters);
client.setProxy(proxy);
return client;
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientManager.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientManager.java
index 3dfe36ca5..3be5d7196 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientManager.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientManager.java
@@ -38,7 +38,7 @@ public class BugzillaClientManager implements ITaskRepositoryListener {
client = BugzillaClientFactory.createClient(taskRepository.getUrl(), taskRepository.getUserName(),
taskRepository.getPassword(), htUser, htPass, taskRepository.getProxy(), taskRepository
- .getCharacterEncoding());
+ .getCharacterEncoding(), taskRepository.getProperties());
clientByUrl.put(taskRepository.getUrl(), client);
}
return client;
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 aa51d9d56..fd90b4f14 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
@@ -239,5 +239,7 @@ public interface IBugzillaConstants {
public static final String CHANGES_SUBMITTED = "changes submitted";
public static final String SHOW_ACTIVITY = "/show_activity.cgi?id=";
+
+ public static final String REPOSITORY_SETTING_SHORT_LOGIN = "bugzilla.shortLoginEnabled";
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java
index fb4b9bd12..a9797e397 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java
@@ -40,6 +40,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
@@ -58,6 +59,8 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
protected Combo repositoryVersionCombo;
+ private Button cleanQAContact;
+
public BugzillaRepositorySettingsPage(AbstractRepositoryConnectorUi repositoryUi) {
super(TITLE, DESCRIPTION, repositoryUi);
setNeedsAnonymousLogin(true);
@@ -120,6 +123,17 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
// ignore
}
});
+
+
+ boolean shortLogin = Boolean.parseBoolean(repository.getProperty(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN));
+
+ Label shortLoginLabel = new Label(parent, SWT.NONE);
+ shortLoginLabel.setText("Short logins enabled on repository:");
+ cleanQAContact = new Button(parent, SWT.CHECK | SWT.LEFT);
+ cleanQAContact.setSelection(shortLogin);
+
+
+
}
public void setBugzillaVersion(String version) {
@@ -151,6 +165,11 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
}
@Override
+ public void updateProperties(TaskRepository repository) {
+ repository.setProperty(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN, String.valueOf(cleanQAContact.getSelection()));
+ }
+
+ @Override
public boolean isPageComplete() {
return super.isPageComplete();
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/RepositorySynchronizationManager.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/RepositorySynchronizationManager.java
index 053db4a8b..5eb348918 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/RepositorySynchronizationManager.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/RepositorySynchronizationManager.java
@@ -387,6 +387,11 @@ public class RepositorySynchronizationManager {
}
repositoryTask.setSyncState(RepositoryTaskSyncState.OUTGOING);
TasksUiPlugin.getTaskListManager().getTaskList().notifyLocalInfoChanged(repositoryTask);
+ }else if (read && repositoryTask.getSyncState().equals(RepositoryTaskSyncState.SYNCHRONIZED)) {
+ if (repositoryTask.getTaskData() != null && repositoryTask.getTaskData().getLastModified() != null) {
+ repositoryTask.setLastSyncDateStamp(repositoryTask.getTaskData().getLastModified());
+ //TasksUiPlugin.getDefault().getTaskDataManager().clearIncoming(repositoryTask.getHandleIdentifier());
+ }
} else if (!read && repositoryTask.getSyncState().equals(RepositoryTaskSyncState.SYNCHRONIZED)) {
repositoryTask.setSyncState(RepositoryTaskSyncState.INCOMING);
TasksUiPlugin.getTaskListManager().getTaskList().notifyLocalInfoChanged(repositoryTask);

Back to the top