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 136642 Details for
Bug 165072
when submitting changes from a rich editor into the repository, it would be nice to see who were notified
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
updated patch
patch165072.txt (text/plain), 29.82 KB, created by
Frank Becker
on 2009-05-21 07:11:26 EDT
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Frank Becker
Created:
2009-05-21 07:11:26 EDT
Size:
29.82 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.bugzilla.ui >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties,v >retrieving revision 1.3 >diff -u -r1.3 messages.properties >--- src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties 10 Jan 2009 04:15:15 -0000 1.3 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties 21 May 2009 11:05:15 -0000 >@@ -7,6 +7,10 @@ > BugzillaPlanningEditorPart_Current_Estimate=Current Estimate: > BugzillaPlanningEditorPart_Team_Planning=Team Planning > >+BugzillaTaskEditorPage_Changes_Submitted_Action_Line={0}\n >+BugzillaTaskEditorPage_Changes_Submitted_Email_Line=\ \ \ \ \ \ \ \ {0}\n >+BugzillaTaskEditorPage_Changes_Submitted_Message=Changes submitted >+BugzillaTaskEditorPage_Changes_Submitted_Titel=Changes submitted > BugzillaTaskEditorPage_Please_enter_a_description_before_submitting=Please enter a description before submitting > BugzillaTaskEditorPage_Please_enter_a_short_summary_before_submitting=Please enter a short summary before submitting > BugzillaTaskEditorPage_Please_select_a_component_before_submitting=Please select a component before submitting >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/editor/Messages.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/Messages.java,v >retrieving revision 1.3 >diff -u -r1.3 Messages.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/editor/Messages.java 10 Jan 2009 04:15:15 -0000 1.3 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/editor/Messages.java 21 May 2009 11:05:15 -0000 >@@ -37,6 +37,14 @@ > > public static String BugzillaPlanningEditorPart_Team_Planning; > >+ public static String BugzillaTaskEditorPage_Changes_Submitted_Action_Line; >+ >+ public static String BugzillaTaskEditorPage_Changes_Submitted_Email_Line; >+ >+ public static String BugzillaTaskEditorPage_Changes_Submitted_Message; >+ >+ public static String BugzillaTaskEditorPage_Changes_Submitted_Titel; >+ > public static String BugzillaTaskEditorPage_Please_enter_a_description_before_submitting; > > public static String BugzillaTaskEditorPage_Please_enter_a_short_summary_before_submitting; >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java,v >retrieving revision 1.29 >diff -u -r1.29 BugzillaTaskEditorPage.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java 20 May 2009 20:14:45 -0000 1.29 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java 21 May 2009 11:05:15 -0000 >@@ -11,6 +11,7 @@ > > package org.eclipse.mylyn.internal.bugzilla.ui.editor; > >+import java.text.MessageFormat; > import java.util.Collections; > import java.util.HashMap; > import java.util.List; >@@ -20,15 +21,20 @@ > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.NullProgressMonitor; >+import org.eclipse.jface.dialogs.IDialogConstants; > import org.eclipse.jface.dialogs.IMessageProvider; >+import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.mylyn.commons.core.StatusHandler; > import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute; > import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; > import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCustomField; >+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryResponse; > import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataHandler; > import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; > import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration; > import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin; >+import org.eclipse.mylyn.internal.provisional.commons.ui.WorkbenchUtil; >+import org.eclipse.mylyn.tasks.core.RepositoryResponse; > import org.eclipse.mylyn.tasks.core.RepositoryStatus; > import org.eclipse.mylyn.tasks.core.data.TaskAttribute; > import org.eclipse.mylyn.tasks.core.data.TaskAttributeMetaData; >@@ -36,6 +42,7 @@ > import org.eclipse.mylyn.tasks.core.data.TaskDataModel; > import org.eclipse.mylyn.tasks.core.data.TaskDataModelEvent; > import org.eclipse.mylyn.tasks.core.data.TaskDataModelListener; >+import org.eclipse.mylyn.tasks.core.sync.SubmitJobEvent; > import org.eclipse.mylyn.tasks.ui.TasksUi; > import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor; > import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage; >@@ -45,6 +52,8 @@ > import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; > import org.eclipse.mylyn.tasks.ui.editors.TaskEditorInput; > import org.eclipse.mylyn.tasks.ui.editors.TaskEditorPartDescriptor; >+import org.eclipse.ui.forms.events.HyperlinkAdapter; >+import org.eclipse.ui.forms.events.HyperlinkEvent; > > /** > * @author Rob Elves >@@ -227,6 +236,7 @@ > attrToken.setValue(getModel().getTask().getAttribute(BugzillaAttribute.TOKEN.getKey())); > } > >+ getTaskEditor().setMessage("", IMessageProvider.NONE); //$NON-NLS-1$ > super.doSubmit(); > } > >@@ -365,4 +375,36 @@ > } > } > >+ @Override >+ protected void handleTaskSubmitted(SubmitJobEvent event) { >+ if (event.getJob().getResponse() != null) { >+ final RepositoryResponse response = event.getJob().getResponse(); >+ getTaskEditor().setMessage(Messages.BugzillaTaskEditorPage_Changes_Submitted_Message, >+ IMessageProvider.INFORMATION, new HyperlinkAdapter() { >+ @Override >+ public void linkActivated(HyperlinkEvent event) { >+ String mes = ""; //$NON-NLS-1$ >+ if (response instanceof BugzillaRepositoryResponse) { >+ BugzillaRepositoryResponse bugzillaResponse = (BugzillaRepositoryResponse) response; >+ for (String iterable_element : bugzillaResponse.getResponseData().keySet()) { >+ mes += MessageFormat.format( >+ Messages.BugzillaTaskEditorPage_Changes_Submitted_Action_Line, >+ iterable_element); >+ List<String> o = bugzillaResponse.getResponseData().get(iterable_element); >+ for (String string : o) { >+ mes += MessageFormat.format( >+ Messages.BugzillaTaskEditorPage_Changes_Submitted_Email_Line, string); >+ } >+ } >+ new MessageDialog(WorkbenchUtil.getShell(), >+ Messages.BugzillaTaskEditorPage_Changes_Submitted_Titel, null, mes, >+ MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0).open(); >+ } >+ } >+ }); >+ } else { >+ super.handleTaskSubmitted(event); >+ } >+ } >+ > } >#P org.eclipse.mylyn.bugzilla.core >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.182 >diff -u -r1.182 BugzillaClient.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java 11 May 2009 19:50:49 -0000 1.182 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java 21 May 2009 11:05:17 -0000 >@@ -550,13 +550,13 @@ > // provide a solution for bug 196056 by allowing a (cached) gzipped configuration to be sent > // modified to also accept "application/x-gzip" as results from a 302 redirect to a previously gzipped file. > if (method == null) { >- throw new IOException("Could not retrieve configuratoin. HttpClient return null method."); >+ throw new IOException("Could not retrieve configuratoin. HttpClient return null method."); //$NON-NLS-1$ > } > > InputStream stream = getResponseStream(method, monitor); > try { > if (method.getResponseHeader("Content-Type") != null) { //$NON-NLS-1$ >- Header responseTypeHeader = method.getResponseHeader("Content-Type"); >+ Header responseTypeHeader = method.getResponseHeader("Content-Type"); //$NON-NLS-1$ > for (String type : VALID_CONFIG_CONTENT_TYPES) { > if (responseTypeHeader.getValue().toLowerCase(Locale.ENGLISH).contains(type)) { > RepositoryConfigurationFactory configFactory = new RepositoryConfigurationFactory( >@@ -576,7 +576,7 @@ > } else { > throw new CoreException( > new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN, >- "Unable to retrieve repository configuration. Ensure credentials are valid.")); >+ "Unable to retrieve repository configuration. Ensure credentials are valid.")); //$NON-NLS-1$ > } > } > } >@@ -704,13 +704,13 @@ > Iterator<TaskAttribute> itr = attributes.iterator(); > while (itr.hasNext()) { > TaskAttribute a = itr.next(); >- if (a.getId().startsWith("task.common.kind.flag_type")) { >+ if (a.getId().startsWith("task.common.kind.flag_type")) { //$NON-NLS-1$ > List<BugzillaFlag> flags = repositoryConfiguration.getFlags(); > TaskAttribute requestee = a.getAttribute("requestee"); //$NON-NLS-1$ >- a = a.getAttribute("state"); >+ a = a.getAttribute("state"); //$NON-NLS-1$ > String value = a.getValue(); > String id = ""; //$NON-NLS-1$ >- if (value.equals(" ")) { >+ if (value.equals(" ")) { //$NON-NLS-1$ > continue; > } > String flagname = a.getMetaData().getLabel(); >@@ -723,28 +723,28 @@ > } > if (theFlag != null) { > int flagTypeNumber = theFlag.getFlagId(); >- id = "flag_type-" + flagTypeNumber; >+ id = "flag_type-" + flagTypeNumber; //$NON-NLS-1$ > value = a.getValue(); > if (value.equals("?") && requestee != null) { //$NON-NLS-1$ >- parts.add(new StringPart("requestee_type-" + flagTypeNumber, >- requestee.getValue() != null ? requestee.getValue() : "")); >+ parts.add(new StringPart("requestee_type-" + flagTypeNumber, //$NON-NLS-1$ >+ requestee.getValue() != null ? requestee.getValue() : "")); //$NON-NLS-1$ > } > } > parts.add(new StringPart(id, value != null ? value : "")); //$NON-NLS-1$ >- } else if (a.getId().startsWith("task.common.kind.flag")) { >- TaskAttribute flagnumber = a.getAttribute("number"); >+ } else if (a.getId().startsWith("task.common.kind.flag")) { //$NON-NLS-1$ >+ TaskAttribute flagnumber = a.getAttribute("number"); //$NON-NLS-1$ > TaskAttribute requestee = a.getAttribute("requestee"); //$NON-NLS-1$ > a = a.getAttribute("state"); //$NON-NLS-1$ >- String id = "flag-" + flagnumber.getValue(); >+ String id = "flag-" + flagnumber.getValue(); //$NON-NLS-1$ > String value = a.getValue(); > if (value.equals(" ")) { //$NON-NLS-1$ >- value = "X"; >+ value = "X"; //$NON-NLS-1$ > } > if (value.equals("?") && requestee != null) { //$NON-NLS-1$ >- parts.add(new StringPart("requestee-" + flagnumber.getValue(), >- requestee.getValue() != null ? requestee.getValue() : "")); >+ parts.add(new StringPart("requestee-" + flagnumber.getValue(), //$NON-NLS-1$ >+ requestee.getValue() != null ? requestee.getValue() : "")); //$NON-NLS-1$ > } >- parts.add(new StringPart(id, value != null ? value : "")); >+ parts.add(new StringPart(id, value != null ? value : "")); //$NON-NLS-1$ > } > } > } >@@ -823,32 +823,32 @@ > boolean existingBugPosted = false; > > formData.add(new NameValuePair("action", action)); //$NON-NLS-1$ >- formData.add(new NameValuePair("contenttypemethod", "manual")); >+ formData.add(new NameValuePair("contenttypemethod", "manual")); //$NON-NLS-1$ //$NON-NLS-2$ > >- formData.add(new NameValuePair("id", taskAttribute.getValue())); >+ formData.add(new NameValuePair("id", taskAttribute.getValue())); //$NON-NLS-1$ > Collection<TaskAttribute> attributes = taskAttribute.getAttributes().values(); > Iterator<TaskAttribute> itr = attributes.iterator(); > while (itr.hasNext()) { > TaskAttribute a = itr.next(); > String id = a.getId(); > String value = a.getValue(); >- if (id.equals(TaskAttribute.ATTACHMENT_AUTHOR) || id.equals("date") || id.equals("size") >+ if (id.equals(TaskAttribute.ATTACHMENT_AUTHOR) || id.equals("date") || id.equals("size") //$NON-NLS-1$ //$NON-NLS-2$ > || id.equals(TaskAttribute.ATTACHMENT_URL)) { > continue; > } > > if (id.equals("desc")) { //$NON-NLS-1$ >- id = "description"; >+ id = "description"; //$NON-NLS-1$ > } > if (id.equals("ctype")) { //$NON-NLS-1$ >- id = "contenttypeentry"; >+ id = "contenttypeentry"; //$NON-NLS-1$ > } > > if (id.equals(TaskAttribute.ATTACHMENT_IS_DEPRECATED)) { >- id = "isobsolete"; >+ id = "isobsolete"; //$NON-NLS-1$ > } > if (id.equals(TaskAttribute.ATTACHMENT_IS_PATCH)) { >- id = "ispatch"; >+ id = "ispatch"; //$NON-NLS-1$ > } > formData.add(new NameValuePair(id, value)); > } >@@ -883,7 +883,7 @@ > if (isTitle) { > // get all of the data in the title tag > if (token.getType() != Token.TAG) { >- title += ((StringBuffer) token.getValue()).toString().toLowerCase(Locale.ENGLISH) + " "; >+ title += ((StringBuffer) token.getValue()).toString().toLowerCase(Locale.ENGLISH) + " "; //$NON-NLS-1$ > continue; > } else if (token.getType() == Token.TAG && ((HtmlTag) token.getValue()).getTagType() == Tag.TITLE > && ((HtmlTag) token.getValue()).isEndTag()) { >@@ -913,7 +913,7 @@ > } catch (ParseException e) { > loggedIn = false; > throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, >- RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString() + ".")); >+ RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString() + ".")); //$NON-NLS-1$ //$NON-NLS-2$ > } finally { > if (input != null) { > input.close(); >@@ -928,7 +928,7 @@ > CoreException { > NameValuePair[] formData = null; > monitor = Policy.monitorFor(monitor); >- >+ BugzillaRepositoryResponse response; > authenticate(new SubProgressMonitor(monitor, 1)); > > if (taskData == null) { >@@ -950,7 +950,7 @@ > } > > if (method == null) { >- throw new IOException("Could not post form, client returned null method."); >+ throw new IOException("Could not post form, client returned null method."); //$NON-NLS-1$ > } > > input = getResponseStream(method, monitor); >@@ -975,7 +975,7 @@ > if (isTitle) { > // get all of the data in the title tag > if (token.getType() != Token.TAG) { >- title += ((StringBuffer) token.getValue()).toString().toLowerCase(Locale.ENGLISH) + " "; >+ title += ((StringBuffer) token.getValue()).toString().toLowerCase(Locale.ENGLISH) + " "; //$NON-NLS-1$ > continue; > } else if (token.getType() == Token.TAG && ((HtmlTag) token.getValue()).getTagType() == Tag.TITLE > && ((HtmlTag) token.getValue()).isEndTag()) { >@@ -1017,7 +1017,11 @@ > } > } > } >- >+ if (taskData.isNew()) { >+ response = new BugzillaRepositoryResponse(ResponseKind.TASK_CREATED, result); >+ } else { >+ response = new BugzillaRepositoryResponse(ResponseKind.TASK_UPDATED, taskData.getTaskId()); >+ } > if ((!taskData.isNew() && existingBugPosted != true) || (taskData.isNew() && result == null)) { > try { > if (in.markSupported()) { >@@ -1027,17 +1031,21 @@ > // ignore > } > parseHtmlError(in); >- } >- >- if (taskData.isNew()) { >- return new RepositoryResponse(ResponseKind.TASK_CREATED, result); > } else { >- return new RepositoryResponse(ResponseKind.TASK_UPDATED, taskData.getTaskId()); >+ try { >+ if (in.markSupported()) { >+ in.reset(); >+ } >+ } catch (IOException e) { >+ // ignore >+ } >+ parseResultOK(in, response); > } >+ return response; > } catch (ParseException e) { > loggedIn = false; > throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, >- RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString() + ".")); >+ RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString() + ".")); //$NON-NLS-1$//$NON-NLS-2$ > } finally { > if (input != null) { > input.close(); >@@ -1058,7 +1066,7 @@ > Iterator<TaskAttribute> itr = attributes.iterator(); > while (itr.hasNext()) { > TaskAttribute a = itr.next(); >- if (a != null && a.getId() != null && a.getId().compareTo("") != 0) { >+ if (a != null && a.getId() != null && a.getId().compareTo("") != 0) { //$NON-NLS-1$ > String value = null; > value = a.getValue(); > if (value == null) { >@@ -1084,7 +1092,7 @@ > } > > TaskAttribute descAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.DESCRIPTION); >- if (descAttribute != null && !descAttribute.getValue().equals("")) { >+ if (descAttribute != null && !descAttribute.getValue().equals("")) { //$NON-NLS-1$ > BugzillaVersion bugzillaVersion = null; > if (repositoryConfiguration != null) { > bugzillaVersion = repositoryConfiguration.getInstallVersion(); >@@ -1111,7 +1119,7 @@ > } > > private void cleanIfShortLogin(TaskAttribute a) { >- if ("true".equals(configParameters.get(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN))) { >+ if ("true".equals(configParameters.get(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN))) { //$NON-NLS-1$ > if (a.getValue() != null && a.getValue().length() > 0) { > int atIndex = a.getValue().indexOf("@"); //$NON-NLS-1$ > if (atIndex != -1) { >@@ -1168,19 +1176,19 @@ > List<String> values = a.getValues(); > int i = 0; > for (String string : values) { >- fields.put(id + i++, new NameValuePair(id, string != null ? string : "")); >+ fields.put(id + i++, new NameValuePair(id, string != null ? string : "")); //$NON-NLS-1$ > } >- } else if (id != null && id.compareTo("") != 0) { >+ } else if (id != null && id.compareTo("") != 0) { //$NON-NLS-1$ > String value = a.getValue(); > if (id.equals(BugzillaAttribute.DELTA_TS.getKey())) { > value = stripTimeZone(value); > } >- if (id.startsWith("task.common.kind.flag_type")) { >+ if (id.startsWith("task.common.kind.flag_type")) { //$NON-NLS-1$ > List<BugzillaFlag> flags = repositoryConfiguration.getFlags(); > TaskAttribute requestee = a.getAttribute("requestee"); //$NON-NLS-1$ >- a = a.getAttribute("state"); >+ a = a.getAttribute("state"); //$NON-NLS-1$ > value = a.getValue(); >- if (value.equals(" ")) { >+ if (value.equals(" ")) { //$NON-NLS-1$ > continue; > } > String flagname = a.getMetaData().getLabel(); >@@ -1193,31 +1201,31 @@ > } > if (theFlag != null) { > int flagTypeNumber = theFlag.getFlagId(); >- id = "flag_type-" + flagTypeNumber; >+ id = "flag_type-" + flagTypeNumber; //$NON-NLS-1$ > value = a.getValue(); > if (value.equals("?") && requestee != null) { //$NON-NLS-1$ >- fields.put("requestee_type-" + flagTypeNumber, new NameValuePair("requestee_type-" //$NON-NLS-2$ >- + flagTypeNumber, requestee.getValue() != null ? requestee.getValue() : "")); >+ fields.put("requestee_type-" + flagTypeNumber, new NameValuePair("requestee_type-" //$NON-NLS-1$ //$NON-NLS-2$ >+ + flagTypeNumber, requestee.getValue() != null ? requestee.getValue() : "")); //$NON-NLS-1$ > } > } > } else if (id.startsWith("task.common.kind.flag")) { //$NON-NLS-1$ >- TaskAttribute flagnumber = a.getAttribute("number"); >+ TaskAttribute flagnumber = a.getAttribute("number"); //$NON-NLS-1$ > TaskAttribute requestee = a.getAttribute("requestee"); //$NON-NLS-1$ > a = a.getAttribute("state"); //$NON-NLS-1$ >- id = "flag-" + flagnumber.getValue(); >+ id = "flag-" + flagnumber.getValue(); //$NON-NLS-1$ > value = a.getValue(); > if (value.equals(" ")) { //$NON-NLS-1$ >- value = "X"; >+ value = "X"; //$NON-NLS-1$ > } > if (value.equals("?") && requestee != null) { //$NON-NLS-1$ >- fields.put("requestee-" + flagnumber.getValue(), new NameValuePair("requestee-" //$NON-NLS-2$ >- + flagnumber.getValue(), requestee.getValue() != null ? requestee.getValue() : "")); >+ fields.put("requestee-" + flagnumber.getValue(), new NameValuePair("requestee-" //$NON-NLS-1$//$NON-NLS-2$ >+ + flagnumber.getValue(), requestee.getValue() != null ? requestee.getValue() : "")); //$NON-NLS-1$ > } >- } else if (id.startsWith("task.common.")) { >+ } else if (id.startsWith("task.common.")) { //$NON-NLS-1$ > // Don't post any remaining non-bugzilla specific attributes > continue; > } >- fields.put(id, new NameValuePair(id, value != null ? value : "")); >+ fields.put(id, new NameValuePair(id, value != null ? value : "")); //$NON-NLS-1$ > } > } > } >@@ -1249,7 +1257,7 @@ > } else { > String inputAttributeId = originalOperation.getMetaData().getValue( > TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID); >- if (inputAttributeId == null || inputAttributeId.equals("")) { >+ if (inputAttributeId == null || inputAttributeId.equals("")) { //$NON-NLS-1$ > String sel = attributeOperation.getValue(); > fields.put(KEY_KNOB, new NameValuePair(KEY_KNOB, sel)); > } else { >@@ -1282,7 +1290,7 @@ > } else if (attributeOperation != null > && attributeOperation.getValue().equals(BugzillaOperation.duplicate.toString())) { > // fix for bug#198677 >- fields.put(KEY_COMMENT, new NameValuePair(KEY_COMMENT, "")); >+ fields.put(KEY_COMMENT, new NameValuePair(KEY_COMMENT, "")); //$NON-NLS-1$ > } > } > } else { >@@ -1306,32 +1314,32 @@ > fields.put(fieldName, new NameValuePair(fieldName, attributeStatus.getValue())); > } else { > String selOp = attributeOperation.getValue().toUpperCase(); >- if (selOp.equals("NONE")) { >+ if (selOp.equals("NONE")) { //$NON-NLS-1$ > selOp = attributeStatus.getValue(); > } > if (selOp.equals("ACCEPT")) { //$NON-NLS-1$ >- selOp = "ASSIGNED"; >+ selOp = "ASSIGNED"; //$NON-NLS-1$ > } > if (selOp.equals("RESOLVE")) { //$NON-NLS-1$ >- selOp = "RESOLVED"; >+ selOp = "RESOLVED"; //$NON-NLS-1$ > } > if (selOp.equals("VERIFY")) { //$NON-NLS-1$ >- selOp = "VERIFIED"; >+ selOp = "VERIFIED"; //$NON-NLS-1$ > } > if (selOp.equals("CLOSE")) { //$NON-NLS-1$ >- selOp = "CLOSED"; >+ selOp = "CLOSED"; //$NON-NLS-1$ > } > if (selOp.equals("REOPEN")) { //$NON-NLS-1$ >- selOp = "REOPENED"; >+ selOp = "REOPENED"; //$NON-NLS-1$ > } > if (selOp.equals("DUPLICATE")) { //$NON-NLS-1$ >- selOp = "RESOLVED"; >+ selOp = "RESOLVED"; //$NON-NLS-1$ > String knob = BugzillaAttribute.RESOLUTION.getKey(); >- fields.put(knob, new NameValuePair(knob, "DUPLICATE")); >+ fields.put(knob, new NameValuePair(knob, "DUPLICATE")); //$NON-NLS-1$ > } > > fields.put(fieldName, new NameValuePair(fieldName, selOp)); >- if (inputAttributeId != null && !inputAttributeId.equals("")) { >+ if (inputAttributeId != null && !inputAttributeId.equals("")) { //$NON-NLS-1$ > TaskAttribute inputAttribute = attributeOperation.getTaskData().getRoot().getAttribute( > inputAttributeId); > if (inputAttribute != null) { >@@ -1345,7 +1353,7 @@ > } else { > String sel = inputAttribute.getValue(); > String knob = attributeOperation.getValue(); >- if (knob.equals("duplicate")) { >+ if (knob.equals("duplicate")) { //$NON-NLS-1$ > knob = inputAttributeId; > } > if (knob.equals(BugzillaOperation.reassign.toString())) { >@@ -1414,8 +1422,8 @@ > > String bugUrl = taskData.getRepositoryUrl() + IBugzillaConstants.URL_GET_SHOW_BUG + taskData.getTaskId(); > GzipGetMethod getMethod = new GzipGetMethod(WebUtil.getRequestPath(bugUrl), false); >- getMethod.setRequestHeader("Content-Type", "text/xml; charset=" + characterEncoding); //$NON-NLS-1$ >- httpClient.getParams().setParameter("http.protocol.single-cookie-header", true); >+ getMethod.setRequestHeader("Content-Type", "text/xml; charset=" + characterEncoding); //$NON-NLS-1$ //$NON-NLS-2$ >+ httpClient.getParams().setParameter("http.protocol.single-cookie-header", true); //$NON-NLS-1$ > getMethod.setDoAuthentication(true); > > int code; >@@ -1901,4 +1909,66 @@ > > } > >+ private void parseResultOK(BufferedReader in, BugzillaRepositoryResponse response) throws IOException, >+ CoreException { >+ HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(in, null); >+ >+ boolean isDT = false; >+ String dtString = ""; //$NON-NLS-1$ >+ String body = ""; //$NON-NLS-1$ >+ String lastDTValue = ""; //$NON-NLS-1$ >+ boolean isCode = false; >+ String codeString = ""; //$NON-NLS-1$ >+ 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() == Tag.DT >+ && ((HtmlTag) (token.getValue())).isEndTag()) { >+ isDT = false; >+ if (!dtString.equals("")) { //$NON-NLS-1$ >+ lastDTValue = dtString; >+ } >+ dtString = ""; //$NON-NLS-1$ >+ continue; >+ } >+ if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == Tag.CODE >+ && ((HtmlTag) (token.getValue())).isEndTag()) { >+ isCode = false; >+ if (codeString.length() > 0) { >+ codeString = codeString.replace("@", "@"); //$NON-NLS-1$ //$NON-NLS-2$ >+ response.addResponseData(lastDTValue, codeString); >+ } >+ dtString = ""; //$NON-NLS-1$ >+ codeString = ""; //$NON-NLS-1$ >+ continue; >+ } >+ if (isCode) { >+ codeString += (" " + token.getValue()); //$NON-NLS-1$ >+ } >+ if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == Tag.CODE >+ && !((HtmlTag) (token.getValue())).isEndTag()) { >+ isCode = true; >+ codeString = ""; //$NON-NLS-1$ >+ } >+ if (isDT) { >+ if (dtString.length() > 0) { >+ dtString += (" " + token.getValue()); //$NON-NLS-1$ >+ } else { >+ dtString += token.getValue(); >+ } >+ } >+ if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == Tag.DT >+ && !((HtmlTag) (token.getValue())).isEndTag()) { >+ isDT = true; >+ continue; >+ } >+ } >+ } catch (ParseException e) { >+ throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, >+ RepositoryStatus.ERROR_INTERNAL, "Unable to parse response from " + repositoryUrl.toString() + ".")); //$NON-NLS-1$ //$NON-NLS-2$ >+ } finally { >+ in.close(); >+ } >+ } >+ > } >Index: .refactorings/2009/5/21/refactorings.history >=================================================================== >RCS file: .refactorings/2009/5/21/refactorings.history >diff -N .refactorings/2009/5/21/refactorings.history >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2009/5/21/refactorings.history 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,4 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<session version="1.0"> >+<refactoring accessors="true" comment="Delete 1 element(s) from project 'org.eclipse.mylyn.bugzilla.core'
- Original project: 'org.eclipse.mylyn.bugzilla.core'
- Original element: 'org.eclipse.mylyn.internal.bugzilla.core.BgzillaRepositoryResponse.java'" description="Delete element" element1="/src<org.eclipse.mylyn.internal.bugzilla.core{BgzillaRepositoryResponse.java" elements="1" flags="589830" id="org.eclipse.jdt.ui.delete" resources="0" stamp="1242858637609" subPackages="false" version="1.0"/> >+</session> >\ No newline at end of file >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryResponse.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryResponse.java >diff -N src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryResponse.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryResponse.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,54 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2008 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; >+ >+import java.util.LinkedHashMap; >+import java.util.LinkedList; >+import java.util.List; >+import java.util.Map; >+ >+import org.eclipse.mylyn.tasks.core.RepositoryResponse; >+ >+/** >+ * @author Frank Becker >+ * @since 3.2 >+ */ >+ >+public class BugzillaRepositoryResponse extends RepositoryResponse { >+ private Map<String, List<String>> responseData = new LinkedHashMap<String, List<String>>(); >+ >+ public BugzillaRepositoryResponse(ResponseKind reposonseKind, String taskId) { >+ super(reposonseKind, taskId); >+ } >+ >+ public BugzillaRepositoryResponse() { >+ // ignore >+ } >+ >+ 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, responseList); >+ } >+ responseList.add(response); >+ } >+ >+} >Index: .refactorings/2009/5/21/refactorings.index >=================================================================== >RCS file: .refactorings/2009/5/21/refactorings.index >diff -N .refactorings/2009/5/21/refactorings.index >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2009/5/21/refactorings.index 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,1 @@ >+1242858637609 Delete element
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 165072
:
135069
|
135070
| 136642 |
136643
|
137235
|
137236