Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 85823 Details for
Bug 168204
support bugzilla's usermatchmode for matching names to email addresses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch with without ui
patch168204back.txt (text/plain), 25.48 KB, created by
Frank Becker
on 2007-12-25 16:07:54 EST
(
hide
)
Description:
Patch with without ui
Filename:
MIME Type:
Creator:
Frank Becker
Created:
2007-12-25 16:07:54 EST
Size:
25.48 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.bugzilla.core >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaLanguageSettings.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaLanguageSettings.java,v >retrieving revision 1.4 >diff -u -r1.4 BugzillaLanguageSettings.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaLanguageSettings.java 5 Dec 2007 02:57:16 -0000 1.4 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaLanguageSettings.java 25 Dec 2007 21:00:47 -0000 >@@ -38,6 +38,8 @@ > > public static final String COMMAND_CHANGES_SUBMITTED = "changes_submitted"; > >+ public static final String COMMAND_ERROR_CONFIRM_MATCH = "error_confirm_match"; >+ > private Map<String, List<String>> languageAttributes = new LinkedHashMap<String, List<String>>(); > > public BugzillaLanguageSettings(String languageName) { >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java,v >retrieving revision 1.35 >diff -u -r1.35 BugzillaTaskDataHandler.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java 29 Nov 2007 19:29:40 -0000 1.35 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java 25 Dec 2007 21:00:47 -0000 >@@ -22,6 +22,7 @@ > import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_RESOLUTION_3_0; > import org.eclipse.mylyn.monitor.core.StatusHandler; > import org.eclipse.mylyn.tasks.core.AbstractAttributeFactory; >+import org.eclipse.mylyn.tasks.core.AbstractPostTaskDataResult; > import org.eclipse.mylyn.tasks.core.AbstractTask; > import org.eclipse.mylyn.tasks.core.AbstractTaskDataHandler; > import org.eclipse.mylyn.tasks.core.RepositoryOperation; >@@ -359,4 +360,31 @@ > return true; > } > >+ @Override >+ public boolean usePostTaskDataNewAPI() { >+ return true; >+ } >+ >+ public void postTaskData(TaskRepository repository, RepositoryTaskData taskData, IProgressMonitor monitor, AbstractPostTaskDataResult abstractPostTaskDataResult) >+ throws CoreException { >+try { >+ BugzillaClient client = connector.getClientManager().getClient(repository); >+ try { >+ client.postTaskData(taskData, abstractPostTaskDataResult); >+ } catch (CoreException e) { >+ // TODO: Move retry handling into client >+ if (e.getStatus().getCode() == RepositoryStatus.ERROR_REPOSITORY_LOGIN) { >+ client.postTaskData(taskData, abstractPostTaskDataResult); >+ } else { >+ throw e; >+ } >+ >+ } >+ >+} catch (IOException e) { >+ throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ RepositoryStatus.ERROR_IO, repository.getUrl(), e)); >+} >+} >+ > } >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java,v >retrieving revision 1.93 >diff -u -r1.93 BugzillaRepositoryConnector.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java 11 Dec 2007 02:43:58 -0000 1.93 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java 25 Dec 2007 21:00:47 -0000 >@@ -90,6 +90,7 @@ > enSetting.addLanguageAttribute("bad_login", "error"); > enSetting.addLanguageAttribute("processed", "processed"); > enSetting.addLanguageAttribute("changes_submitted", "Changes submitted"); >+ enSetting.addLanguageAttribute("error_confirm_match", "confirm match"); > languages.add(enSetting); > } > >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java,v >retrieving revision 1.107 >diff -u -r1.107 BugzillaClient.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java 19 Dec 2007 18:45:59 -0000 1.107 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java 25 Dec 2007 21:00:47 -0000 >@@ -42,11 +42,13 @@ > import org.apache.commons.httpclient.methods.multipart.PartBase; > import org.apache.commons.httpclient.methods.multipart.StringPart; > import org.apache.commons.httpclient.params.HttpMethodParams; >+import org.eclipse.core.runtime.Assert; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Status; > import org.eclipse.mylyn.internal.bugzilla.core.history.BugzillaTaskHistoryParser; > import org.eclipse.mylyn.internal.bugzilla.core.history.TaskHistory; >+import org.eclipse.mylyn.tasks.core.AbstractPostTaskDataResult; > import org.eclipse.mylyn.tasks.core.AbstractRepositoryQuery; > import org.eclipse.mylyn.tasks.core.ITaskAttachment; > import org.eclipse.mylyn.tasks.core.ITaskCollector; >@@ -1341,4 +1343,335 @@ > + " failed. Please verify connection and authentication information.")); > } > >+ public void postTaskData(RepositoryTaskData taskData, AbstractPostTaskDataResult abstractPostTaskDataResult) throws IOException, CoreException { >+ Assert.isNotNull(abstractPostTaskDataResult); >+ NameValuePair[] formData = null; >+ String prefix = null; >+ String prefix2 = null; >+ String postfix = null; >+ String postfix2 = null; >+ >+ if (taskData == null) { >+ return; >+ } else if (taskData.isNew()) { >+ formData = getPairsForNew(taskData); >+ prefix = IBugzillaConstants.FORM_PREFIX_BUG_218; >+ prefix2 = IBugzillaConstants.FORM_PREFIX_BUG_220; >+ postfix = IBugzillaConstants.FORM_POSTFIX_216; >+ postfix2 = IBugzillaConstants.FORM_POSTFIX_218; >+ } else { >+ formData = getPairsForExisting(taskData); >+ } >+ >+ GzipPostMethod method = null; >+ try { >+ if (taskData.isNew()) { >+ method = postFormData(POST_BUG_CGI, formData); >+ } else { >+ method = postFormData(PROCESS_BUG_CGI, formData); >+ } >+ >+ if (method == null) { >+ throw new IOException("Could not post form, client returned null method."); >+ } >+ BufferedReader in = new BufferedReader(new InputStreamReader(method.getResponseBodyAsUnzippedStream(), >+ method.getRequestCharSet())); >+ in.mark(40960); >+ HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(in, null); >+ >+ boolean existingBugPosted = false; >+ boolean isTitle = false; >+ String title = ""; >+ boolean isBodyDT = false; >+ boolean isBodyCode = false; >+ String divIDName = ""; >+ String dtName = ""; >+ String codeName = ""; >+ String bugzillaBody = ""; >+ >+ for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) { >+ >+ if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == HtmlTag.Type.TITLE >+ && !((HtmlTag) (token.getValue())).isEndTag()) { >+ isTitle = true; >+ continue; >+ } >+ >+ if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == HtmlTag.Type.DIV) { >+ divIDName = ((HtmlTag) (token.getValue())).getAttribute("id"); >+ } >+ >+ if (divIDName != null && divIDName.equals("bugzilla-body")) { >+ bugzillaBody += token.toString(); >+ if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == HtmlTag.Type.DT >+ && ((HtmlTag) (token.getValue())).isEndTag()) { >+ isBodyDT = false; >+ continue; >+ } >+ if (token.getType() == Token.TAG >+ && ((HtmlTag) (token.getValue())).getTagType() == HtmlTag.Type.CODE >+ && ((HtmlTag) (token.getValue())).isEndTag()) { >+ isBodyCode = false; >+ abstractPostTaskDataResult.addResponseData(dtName, codeName); >+ continue; >+ } >+ if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == HtmlTag.Type.DT) { >+ isBodyDT = true; >+ dtName = ""; >+ codeName = ""; >+ } >+ if (token.getType() == Token.TAG >+ && ((HtmlTag) (token.getValue())).getTagType() == HtmlTag.Type.CODE) { >+ isBodyCode = true; >+ codeName = ""; >+ } >+ >+ if (token.getType() != Token.TAG) { >+ if (isBodyDT) >+ dtName += ((StringBuffer) token.getValue()).toString().toLowerCase(Locale.ENGLISH) + " "; >+ if (isBodyCode) >+ codeName += ((StringBuffer) token.getValue()).toString().toLowerCase(Locale.ENGLISH) + " "; >+ continue; >+ } >+ } >+ >+ if (isTitle) { >+ // get all of the data in the title tag >+ if (token.getType() != Token.TAG) { >+ title += ((StringBuffer) token.getValue()).toString().toLowerCase(Locale.ENGLISH) + " "; >+ continue; >+ } else if (token.getType() == Token.TAG >+ && ((HtmlTag) token.getValue()).getTagType() == HtmlTag.Type.TITLE >+ && ((HtmlTag) token.getValue()).isEndTag()) { >+ >+ boolean found = false; >+ for (Iterator<String> iterator = bugzillaLanguageSettings.getResponseForCommand( >+ BugzillaLanguageSettings.COMMAND_PROCESSED).iterator(); iterator.hasNext() && !found;) { >+ String value = iterator.next().toLowerCase(Locale.ENGLISH); >+ found = found || title.indexOf(value) != -1; >+ } >+ if (!taskData.isNew() && found) { >+ existingBugPosted = true; >+ } else if (taskData.isNew() && prefix != null && prefix2 != null && postfix != null >+ && postfix2 != null) { >+ int startIndex = -1; >+ int startIndexPrefix = title.toLowerCase(Locale.ENGLISH).indexOf( >+ prefix.toLowerCase(Locale.ENGLISH)); >+ int startIndexPrefix2 = title.toLowerCase(Locale.ENGLISH).indexOf( >+ prefix2.toLowerCase(Locale.ENGLISH)); >+ >+ if (startIndexPrefix != -1 || startIndexPrefix2 != -1) { >+ if (startIndexPrefix != -1) { >+ startIndex = startIndexPrefix + prefix.length(); >+ } else { >+ startIndex = startIndexPrefix2 + prefix2.length(); >+ } >+ int stopIndex = title.toLowerCase(Locale.ENGLISH).indexOf( >+ postfix.toLowerCase(Locale.ENGLISH), startIndex); >+ if (stopIndex == -1) >+ stopIndex = title.toLowerCase(Locale.ENGLISH).indexOf( >+ postfix2.toLowerCase(Locale.ENGLISH), startIndex); >+ if (stopIndex > -1) { >+ abstractPostTaskDataResult.setNewTaskID((title.substring(startIndex, stopIndex)).trim()); >+ } >+ } >+ } >+ isTitle = false; >+ } >+ } >+ } >+ >+ if ((!taskData.isNew() && existingBugPosted != true) || (taskData.isNew() && abstractPostTaskDataResult.getNewTaskID() == null)) { >+ try { >+ in.reset(); >+ } catch (IOException e) { >+ // ignore >+ } >+ parseHtmlError(in, abstractPostTaskDataResult); >+ } >+ >+ return; >+ } catch (ParseException e) { >+ authenticated = false; >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString() + ".")); >+ } finally { >+ if (method != null) { >+ method.releaseConnection(); >+ } >+ } >+ >+ } >+ >+ /** >+ * Utility method for determining what potential error has occurred from a bugzilla html reponse page >+ */ >+ public void parseHtmlError(BufferedReader in, AbstractPostTaskDataResult abstractPostTaskDataResult) throws IOException, CoreException { >+ Assert.isNotNull(abstractPostTaskDataResult); >+ HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(in, null); >+ boolean isTitle = false; >+ String title = ""; >+ String body = ""; >+ >+ try { >+ for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) { >+ body += token.toString(); >+ if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == HtmlTag.Type.TITLE >+ && !((HtmlTag) (token.getValue())).isEndTag()) { >+ isTitle = true; >+ continue; >+ } >+ >+ if (isTitle) { >+ // get all of the data in the title tag >+ if (token.getType() != Token.TAG) { >+ title += ((StringBuffer) token.getValue()).toString().toLowerCase(Locale.ENGLISH) + " "; >+ continue; >+ } else if (token.getType() == Token.TAG >+ && ((HtmlTag) token.getValue()).getTagType() == HtmlTag.Type.TITLE >+ && ((HtmlTag) token.getValue()).isEndTag()) { >+ >+ boolean found = false; >+ for (Iterator<String> iterator = bugzillaLanguageSettings.getResponseForCommand( >+ BugzillaLanguageSettings.COMMAND_ERROR_LOGIN).iterator(); iterator.hasNext() && !found;) { >+ String value = iterator.next().toLowerCase(Locale.ENGLISH); >+ found = found || title.indexOf(value) != -1; >+ } >+ if (found) { >+ authenticated = false; >+ abstractPostTaskDataResult.setErrorStatus("ERROR_REPOSITORY_LOGIN"); >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ RepositoryStatus.ERROR_REPOSITORY_LOGIN, repositoryUrl.toString(), title)); >+ } >+ found = false; >+ for (Iterator<String> iterator = bugzillaLanguageSettings.getResponseForCommand( >+ BugzillaLanguageSettings.COMMAND_ERROR_COLLISION).iterator(); iterator.hasNext() >+ && !found;) { >+ String value = iterator.next().toLowerCase(Locale.ENGLISH); >+ found = found || title.indexOf(value) != -1; >+ } >+ if (found) { >+ abstractPostTaskDataResult.setErrorStatus("REPOSITORY_COLLISION"); >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ RepositoryStatus.REPOSITORY_COLLISION, repositoryUrl.toString())); >+ } >+ found = false; >+ for (Iterator<String> iterator = bugzillaLanguageSettings.getResponseForCommand( >+ BugzillaLanguageSettings.COMMAND_ERROR_COMMENT_REQUIRED).iterator(); iterator.hasNext() >+ && !found;) { >+ String value = iterator.next().toLowerCase(Locale.ENGLISH); >+ found = found || title.indexOf(value) != -1; >+ } >+ if (found) { >+ abstractPostTaskDataResult.setErrorStatus("REPOSITORY_COMMENT_REQUIRED"); >+ throw new CoreException(new BugzillaStatus(Status.INFO, BugzillaCorePlugin.PLUGIN_ID, >+ RepositoryStatus.REPOSITORY_COMMENT_REQUIRED)); >+ } >+ found = false; >+ for (Iterator<String> iterator = bugzillaLanguageSettings.getResponseForCommand( >+ BugzillaLanguageSettings.COMMAND_ERROR_LOGGED_OUT).iterator(); iterator.hasNext() >+ && !found;) { >+ String value = iterator.next().toLowerCase(Locale.ENGLISH); >+ found = found || title.indexOf(value) != -1; >+ } >+ if (found) { >+ authenticated = false; >+ // throw new >+ // BugzillaException(IBugzillaConstants.LOGGED_OUT); >+ abstractPostTaskDataResult.setErrorStatus("REPOSITORY_LOGGED_OUT"); >+ throw new CoreException(new BugzillaStatus(Status.INFO, BugzillaCorePlugin.PLUGIN_ID, >+ RepositoryStatus.REPOSITORY_LOGGED_OUT, >+ "You have been logged out. Please retry operation.")); >+ } >+ found = false; >+ for (Iterator<String> iterator = bugzillaLanguageSettings.getResponseForCommand( >+ BugzillaLanguageSettings.COMMAND_ERROR_CONFIRM_MATCH).iterator(); iterator.hasNext() >+ && !found;) { >+ String value = iterator.next().toLowerCase(Locale.ENGLISH); >+ found = found || title.indexOf(value) != -1; >+ } >+ if (found) { >+ abstractPostTaskDataResult.setErrorStatus("COMMAND_ERROR_CONFIRM_MATCH"); >+ try { >+ in.reset(); >+ } catch (IOException e) { >+ // ignore >+ } >+ parseResultConfirmMatch(in, abstractPostTaskDataResult); >+ } >+ found = false; >+ for (Iterator<String> iterator = bugzillaLanguageSettings.getResponseForCommand( >+ BugzillaLanguageSettings.COMMAND_CHANGES_SUBMITTED).iterator(); iterator.hasNext() >+ && !found;) { >+ String value = iterator.next().toLowerCase(Locale.ENGLISH); >+ found = found || title.indexOf(value) != -1; >+ } >+ if (found) { >+ return; >+ } >+ isTitle = false; >+ } >+ } >+ } >+ >+ abstractPostTaskDataResult.setErrorStatus("A repository error has occurred."); >+ throw new CoreException(RepositoryStatus.createHtmlStatus(repositoryUrl.toString(), IStatus.INFO, >+ BugzillaCorePlugin.PLUGIN_ID, RepositoryStatus.ERROR_REPOSITORY, >+ "A repository error has occurred.", body)); >+ >+ } catch (ParseException e) { >+ authenticated = false; >+ abstractPostTaskDataResult.setErrorStatus("ERROR_INTERNAL: Unable to parse response from " + repositoryUrl.toString() + "."); >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString() + ".")); >+ } finally { >+ in.close(); >+ } >+ } >+ >+ public void parseResultConfirmMatch(BufferedReader in, AbstractPostTaskDataResult postResult) throws IOException, >+ CoreException { >+ HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(in, null); >+ >+ boolean isSelect = false; >+ String select = ""; >+ String body = ""; >+ String name = ""; >+ String value = ""; >+ try { >+ for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) { >+ body += token.toString(); >+ if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == HtmlTag.Type.SELECT >+ && !((HtmlTag) (token.getValue())).isEndTag()) { >+ isSelect = true; >+ select += token.toString().toLowerCase(Locale.ENGLISH); >+ name = ((HtmlTag) (token.getValue())).getAttribute("id"); >+ continue; >+ } >+ >+ if (isSelect) { >+ if (token.getType() == Token.TAG >+ && ((HtmlTag) (token.getValue())).getTagType() == HtmlTag.Type.OPTION >+ && !((HtmlTag) (token.getValue())).isEndTag()) { >+ value = ((HtmlTag) (token.getValue())).getAttribute("value"); >+ postResult.addResponseData(name, value); >+ } >+ if (token.getType() == Token.TAG >+ && ((HtmlTag) token.getValue()).getTagType() == HtmlTag.Type.SELECT >+ && ((HtmlTag) token.getValue()).isEndTag()) { >+ isSelect = false; >+ } >+ } >+ } >+ postResult.setErrorStatus("ERROR_CONFIRM_MATCH"); >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ RepositoryStatus.ERROR_CONFIRM_MATCH, repositoryUrl.toString(), "confirm match")); >+ } catch (ParseException e) { >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString() + ".")); >+ } finally { >+ in.close(); >+ } >+ } >+ > } >#P org.eclipse.mylyn.tasks.core >Index: src/org/eclipse/mylyn/tasks/core/AbstractTaskDataHandler.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskDataHandler.java,v >retrieving revision 1.10 >diff -u -r1.10 AbstractTaskDataHandler.java >--- src/org/eclipse/mylyn/tasks/core/AbstractTaskDataHandler.java 21 Nov 2007 22:39:09 -0000 1.10 >+++ src/org/eclipse/mylyn/tasks/core/AbstractTaskDataHandler.java 25 Dec 2007 21:00:49 -0000 >@@ -52,6 +52,26 @@ > throws CoreException; > > /** >+ * API-3.0 remove when API change is done >+ * >+ * @since 2.3 >+ */ >+ public boolean usePostTaskDataNewAPI() { >+ return false; >+ } >+ >+ /** >+ * API-3.0 make abstract if we can switch from postTaskData >+ * >+ * AbstractRepositoryTaskEditor submitToRepository use old or new style >+ * >+ * @since 2.3 >+ */ >+ public void postTaskData(TaskRepository repository, RepositoryTaskData taskData, IProgressMonitor monitor, >+ AbstractPostTaskDataResult abstractPostTaskDataResult) throws CoreException { >+ } >+ >+ /** > * @param repositoryUrl > * @param repositoryKind > * @param taskKind >Index: src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java,v >retrieving revision 1.7 >diff -u -r1.7 RepositoryStatus.java >--- src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java 26 Jun 2007 01:16:32 -0000 1.7 >+++ src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java 25 Dec 2007 21:00:49 -0000 >@@ -46,6 +46,8 @@ > > public final static int ERROR_INTERNAL = 7; > >+ public final static int ERROR_CONFIRM_MATCH = 13; >+ > private String htmlMessage; > > protected String repositoryUrl; >Index: src/org/eclipse/mylyn/tasks/core/AbstractPostTaskDataResult.java >=================================================================== >RCS file: src/org/eclipse/mylyn/tasks/core/AbstractPostTaskDataResult.java >diff -N src/org/eclipse/mylyn/tasks/core/AbstractPostTaskDataResult.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/tasks/core/AbstractPostTaskDataResult.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,63 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project committers 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 >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.tasks.core; >+ >+import java.util.LinkedHashMap; >+import java.util.LinkedList; >+import java.util.List; >+import java.util.Map; >+ >+public class AbstractPostTaskDataResult { >+ >+ private String newTaskID; >+ >+ private String errorStatus; >+ >+ private Map<String, List<String>> responseData = new LinkedHashMap<String, List<String>>(); >+ >+ public String getNewTaskID() { >+ return newTaskID; >+ } >+ >+ public void setNewTaskID(String newTaskID) { >+ this.newTaskID = newTaskID; >+ } >+ >+ public String getErrorStatus() { >+ return errorStatus; >+ } >+ >+ public void setErrorStatus(String errorStatus) { >+ this.errorStatus = errorStatus; >+ } >+ >+ public Map<String, List<String>> getResponseData() { >+ return responseData; >+ } >+ >+ public void setResponseData(Map<String, List<String>> responseData) { >+ this.responseData = responseData; >+ } >+ >+ public void addResponseData(String name, String response) { >+ List<String> responseList = responseData.get(name); >+ if (responseList == null) { >+ responseList = new LinkedList<String>(); >+ responseData.put(name.toLowerCase(), responseList); >+ } >+ responseList.add(response); >+ } >+ >+ public void reset() { >+ newTaskID = null; >+ errorStatus = null; >+ responseData.clear(); >+ } >+ >+} >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java,v >retrieving revision 1.253 >diff -u -r1.253 AbstractRepositoryTaskEditor.java >--- src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java 15 Dec 2007 04:03:25 -0000 1.253 >+++ src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java 25 Dec 2007 21:00:52 -0000 >@@ -94,6 +94,7 @@ > import org.eclipse.mylyn.internal.tasks.ui.views.ResetRepositoryConfigurationAction; > import org.eclipse.mylyn.monitor.core.DateUtil; > import org.eclipse.mylyn.monitor.core.StatusHandler; >+import org.eclipse.mylyn.tasks.core.AbstractPostTaskDataResult; > import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; > import org.eclipse.mylyn.tasks.core.AbstractTask; > import org.eclipse.mylyn.tasks.core.AbstractTaskCategory; >@@ -318,6 +319,8 @@ > > private TaskComment selectedComment = null; > >+ private AbstractPostTaskDataResult taskDataResult = new AbstractPostTaskDataResult(); >+ > /** > * @author Raphael Ackermann (bug 195514) > */ >@@ -3315,10 +3318,18 @@ > @Override > protected IStatus run(IProgressMonitor monitor) { > AbstractTask modifiedTask = null; >+ String taskId; > try { > monitor.beginTask("Submitting task", 3); >- String taskId = connector.getTaskDataHandler().postTaskData(repository, taskData, >+ if (connector.getTaskDataHandler().usePostTaskDataNewAPI()) { >+ taskDataResult.reset(); >+ connector.getTaskDataHandler().postTaskData(repository, taskData, >+ new SubProgressMonitor(monitor, 1), taskDataResult); >+ taskId = taskDataResult.getNewTaskID(); >+ } else { >+ taskId = connector.getTaskDataHandler().postTaskData(repository, taskData, > new SubProgressMonitor(monitor, 1)); >+ } > final boolean isNew = taskData.isNew(); > if (isNew) { > if (taskId != null) { >@@ -3536,6 +3547,8 @@ > submitToRepository(); > return; > } >+ } else if (exception.getStatus().getCode() == RepositoryStatus.ERROR_CONFIRM_MATCH) { >+ StatusHandler.displayStatus("Confirm Match", exception.getStatus()); > } else { > StatusHandler.displayStatus("Submit failed", exception.getStatus()); > } >#P org.eclipse.mylyn.bugzilla.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/plugin.xml,v >retrieving revision 1.94 >diff -u -r1.94 plugin.xml >--- plugin.xml 5 Dec 2007 02:57:17 -0000 1.94 >+++ plugin.xml 25 Dec 2007 21:00:53 -0000 >@@ -57,6 +57,7 @@ > <languageAttribute command="bad_login" response="error"/> > <languageAttribute command="processed" response="processed"/> > <languageAttribute command="changes_submitted" response="Changes submitted"/> >+ <languageAttribute command="error_confirm_match" response="Ãbereinstimmungen bestätigen"/> > </language> > </extension> >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 168204
:
55762
|
55763
|
84912
|
85823
|
85824
|
86228
|
86229
|
89687
|
89688
|
120122
|
120123
|
135057
|
135058
|
136649
|
136650
|
162614
|
162615
|
191048
|
191049
|
196758
|
196759
|
198194
|
198195
|
200621
|
203550
|
209855
|
210155
|
210244
|
210607
|
210682
|
210942
|
212020