Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.bugzilla.core/.classpath3
-rw-r--r--org.eclipse.mylyn.bugzilla.core/META-INF/MANIFEST.MF5
-rw-r--r--org.eclipse.mylyn.bugzilla.core/build.properties8
-rw-r--r--org.eclipse.mylyn.bugzilla.core/plugin.xml33
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugReport.java12
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaRemoteContextDelegate.java45
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/Comment.java31
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryUtil.java306
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java5
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/Bugzilla220ParserTest.java47
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/testdata/contexts/downloadedContext.xml1
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-222attachment.html859
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/plugin.xml118
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/AbstractBugEditor.java60
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/ExistingBugEditor.java7
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositoryConnector.java70
-rw-r--r--org.eclipse.mylyn.help.ui/doc/faq.html38
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/planner/ui/TaskPlannerEditorPart.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskActivityView.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskListView.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextAttachWizard.java75
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextAttachWizardPage.java81
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextRetrieveWizard.java70
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextRetrieveWizardPage.java123
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/AbstractRepositoryConnector.java11
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/IRemoteContextDelegate.java25
26 files changed, 1871 insertions, 170 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/.classpath b/org.eclipse.mylyn.bugzilla.core/.classpath
index a68b3ff0f..63f02a415 100644
--- a/org.eclipse.mylyn.bugzilla.core/.classpath
+++ b/org.eclipse.mylyn.bugzilla.core/.classpath
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
<accessrules>
<accessrule kind="accessible" pattern="**/internal/**"/>
@@ -7,6 +8,6 @@
</accessrules>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="src" path="src"/>
+ <classpathentry kind="lib" path="lib/commons-httpclient-3.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.mylyn.bugzilla.core/META-INF/MANIFEST.MF b/org.eclipse.mylyn.bugzilla.core/META-INF/MANIFEST.MF
index 84d4f5c51..000c3fbf9 100644
--- a/org.eclipse.mylyn.bugzilla.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.bugzilla.core/META-INF/MANIFEST.MF
@@ -17,7 +17,10 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.mylar.tasklist
Eclipse-AutoStart: true
Bundle-Vendor: Eclipse.org
-Bundle-ClassPath: bugzilla-core.jar
+Bundle-ClassPath: bugzilla-core.jar,
+ lib/commons-logging.jar,
+ lib/commons-codec-1.3.jar,
+ lib/commons-httpclient-3.0.jar
Export-Package: org.eclipse.mylar.bugzilla.core,
org.eclipse.mylar.internal.bugzilla.core,
org.eclipse.mylar.internal.bugzilla.core.compare,
diff --git a/org.eclipse.mylyn.bugzilla.core/build.properties b/org.eclipse.mylyn.bugzilla.core/build.properties
index ce488ac66..362fd8174 100644
--- a/org.eclipse.mylyn.bugzilla.core/build.properties
+++ b/org.eclipse.mylyn.bugzilla.core/build.properties
@@ -8,12 +8,12 @@
# Contributors:
# University Of British Columbia - initial API and implementation
###############################################################################
-bin.includes = plugin.xml,\
- META-INF/,\
+bin.includes = META-INF/,\
about.html,\
- bugzilla-core.jar
+ bugzilla-core.jar,\
+ lib/commons-codec-1.3.jar,\
+ lib/commons-httpclient-3.0.jar
src.includes = META-INF/,\
- plugin.xml,\
src/,\
about.html
jars.compile.order = bugzilla-core.jar
diff --git a/org.eclipse.mylyn.bugzilla.core/plugin.xml b/org.eclipse.mylyn.bugzilla.core/plugin.xml
deleted file mode 100644
index d200d562c..000000000
--- a/org.eclipse.mylyn.bugzilla.core/plugin.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension
- id="searchHit"
- name="Bugzilla Search Match"
- point="org.eclipse.core.resources.markers">
- <super type="org.eclipse.search.searchmarker"/>
- <attribute name="id"/>
- <attribute name="href"/>
- <attribute name="description"/>
- <attribute name="label"/>
- <attribute name="severity"/>
- <attribute name="priority"/>
- <attribute name="platform"/>
- <attribute name="status"/>
- <attribute name="result"/>
- <attribute name="owner"/>
- <attribute name="query"/>
- </extension>
-
-<!-- <extension point="org.eclipse.ui.preferencePages">
- <page
- name="Bugzilla Client"
- class="org.eclipse.mylar.internal.bugzilla.core.BugzillaPreferencePage"
- id="org.eclipse.mylar.bugzilla.bugzillaPreferences"
- category="org.eclipse.mylar.ui.preferences"/>
- </extension>
- -->
-</plugin>
-
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugReport.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugReport.java
index fbf2f92d8..ac890c8bf 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugReport.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugReport.java
@@ -88,6 +88,9 @@ public class BugReport implements Serializable, IBugzillaBug {
/** Bug attributes (status, resolution, etc.) */
protected HashMap<String, Attribute> attributes = new HashMap<String, Attribute>();
+// /** Attachments (Id, Description) **/
+// protected HashMap<Integer, String> attachements = new HashMap<Integer, String>();
+
/** The keys for the bug attributes */
protected ArrayList<String> attributeKeys = new ArrayList<String>();
@@ -523,4 +526,13 @@ public class BugReport implements Serializable, IBugzillaBug {
public void setCharset(String charset) {
this.charset = charset;
}
+
+
+// public void addAttachment(int id, String description) {
+// attachements.put(id, description);
+// }
+//
+// public HashMap<Integer, String> getAttachements() {
+// return attachements;
+// }
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaRemoteContextDelegate.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaRemoteContextDelegate.java
new file mode 100644
index 000000000..7f7b0a8d1
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaRemoteContextDelegate.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2004 - 2006 University Of British Columbia 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:
+ * University Of British Columbia - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylar.bugzilla.core;
+
+import java.util.Date;
+
+import org.eclipse.mylar.provisional.tasklist.IRemoteContextDelegate;
+
+/**
+ * @author Rob Elves
+ * TODO: Find a better spot for this
+ */
+public class BugzillaRemoteContextDelegate implements IRemoteContextDelegate {
+
+ private Comment comment;
+
+ public BugzillaRemoteContextDelegate(Comment comment) {
+ this.comment = comment;
+ }
+ public Date getDate() {
+ return comment.getCreated();
+ }
+
+ public String getAuthor() {
+ return comment.getAuthor();
+ }
+
+ public String getComment() {
+ return comment.getText().trim();
+ }
+
+ public int getId() {
+ return comment.getAttachmentId();
+ }
+
+}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/Comment.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/Comment.java
index 4ffbf303d..590981daf 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/Comment.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/Comment.java
@@ -48,6 +48,12 @@ public class Comment implements Serializable {
/** Following comment */
private Comment next;
+ private boolean hasAttachment = false;
+
+ private int attachmentId = -1;
+
+ private String attachmentDescription = "";
+
/**
* Constructor
*
@@ -171,4 +177,29 @@ public class Comment implements Serializable {
protected void setPrevious(Comment previous) {
this.previous = previous;
}
+
+ public void setHasAttachment(boolean b) {
+ this.hasAttachment = b;
+ }
+
+ public boolean hasAttachment() {
+ return hasAttachment;
+ }
+
+ public void setAttachmentId(int attachmentID) {
+ this.attachmentId = attachmentID;
+ }
+
+ public int getAttachmentId() {
+ return attachmentId;
+ }
+
+ public void setAttachmentDescription(String attachmentDescription) {
+ this.attachmentDescription = attachmentDescription;
+ }
+
+ public String getAttachmentDescription() {
+ return attachmentDescription;
+ }
+
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryUtil.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryUtil.java
index 5f75189f9..d6a457f0b 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryUtil.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryUtil.java
@@ -11,9 +11,13 @@
package org.eclipse.mylar.internal.bugzilla.core;
import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
@@ -28,6 +32,16 @@ import java.util.List;
import javax.security.auth.login.LoginException;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.multipart.FilePart;
+import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;
+import org.apache.commons.httpclient.methods.multipart.Part;
+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.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -42,23 +56,56 @@ import org.eclipse.mylar.internal.bugzilla.core.internal.BugParser;
import org.eclipse.mylar.internal.bugzilla.core.internal.NewBugParser;
import org.eclipse.mylar.internal.bugzilla.core.internal.OfflineReportsFile;
import org.eclipse.mylar.internal.bugzilla.core.search.BugzillaQueryPageParser;
+import org.eclipse.mylar.internal.core.util.MylarStatusHandler;
import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
import org.eclipse.mylar.provisional.tasklist.TaskRepository;
import org.eclipse.mylar.provisional.tasklist.TaskRepositoryManager;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
+
/**
* @author Mik Kersten (some rewriting)
+ * @author Rob Elves (attachments)
*/
public class BugzillaRepositoryUtil {
+ private static final String VALUE_CONTENTTYPEMETHOD_MANUAL = "manual";
+
+ private static final String VALUE_ISPATCH = "1";
+
+ private static final String VALUE_ACTION_INSERT = "insert";
+
+ private static final String ATTRIBUTE_CONTENTTYPEENTRY = "contenttypeentry";
+
+ private static final String ATTRIBUTE_CONTENTTYPEMETHOD = "contenttypemethod";
+
+ private static final String ATTRIBUTE_ISPATCH = "ispatch";
+
+ private static final String ATTRIBUTE_DATA = "data";
+
+ private static final String ATTRIBUTE_COMMENT = "comment";
+
+ private static final String ATTRIBUTE_DESCRIPTION = "description";
+
+ private static final String ATTRIBUTE_BUGID = "bugid";
+
+ private static final String ATTRIBUTE_BUGZILLA_PASSWORD = "Bugzilla_password";
+
+ private static final String ATTRIBUTE_BUGZILLA_LOGIN = "Bugzilla_login";
+
+ private static final String ATTRIBUTE_ACTION = "action";
+
private static final String POST_ARGS_PASSWORD = "&Bugzilla_password=";
public static final char PREF_DELIM_REPOSITORY = ':';
public static final String POST_ARGS_SHOW_BUG = "/show_bug.cgi?id=";
+ public static final String POST_ARGS_ATTACHMENT_DOWNLOAD = "/attachment.cgi?id=";
+
+ public static final String POST_ARGS_ATTACHMENT_UPLOAD = "/attachment.cgi";// ?action=insert";//&bugid=";
+
private static final String POST_ARGS_LOGIN = "GoAheadAndLogIn=1&Bugzilla_login=";
public static BugReport getBug(String repositoryUrl, int id) throws IOException, MalformedURLException,
@@ -83,7 +130,8 @@ public class BugzillaRepositoryUtil {
String url = repositoryUrl + POST_ARGS_SHOW_BUG + id;
if (repository.hasCredentials()) {
- url += "&"+ POST_ARGS_LOGIN + URLEncoder.encode(repository.getUserName(), BugzillaPlugin.ENCODING_UTF_8)
+ url += "&" + POST_ARGS_LOGIN
+ + URLEncoder.encode(repository.getUserName(), BugzillaPlugin.ENCODING_UTF_8)
+ POST_ARGS_PASSWORD
+ URLEncoder.encode(repository.getPassword(), BugzillaPlugin.ENCODING_UTF_8);
}
@@ -96,9 +144,9 @@ public class BugzillaRepositoryUtil {
in = new BufferedReader(new InputStreamReader(input));
// get the actual bug fron the server and return it
- BugReport bug = BugParser.parseBug(in, id, repository.getUrl(), !repository
- .getVersion().equals(BugzillaServerVersion.SERVER_216.toString()),
- repository.getUserName(), repository.getPassword(), connection.getContentType());
+ BugReport bug = BugParser.parseBug(in, id, repository.getUrl(), !repository.getVersion().equals(
+ BugzillaServerVersion.SERVER_216.toString()), repository.getUserName(), repository
+ .getPassword(), connection.getContentType());
return bug;
}
}
@@ -159,52 +207,58 @@ public class BugzillaRepositoryUtil {
* Get the list of products
*
* @return The list of valid products a bug can be logged against
- * @throws IOException LoginException Exception
+ * @throws IOException
+ * LoginException Exception
*/
public static List<String> getProductList(TaskRepository repository) throws IOException, LoginException, Exception {
-// BufferedReader in = null;
-// try {
-// repository = MylarTaskListPlugin.getRepositoryManager().getRepository(
-// BugzillaPlugin.REPOSITORY_KIND, repositoryUrl);
-// String urlText = "";
-// if (repository.hasCredentials()) {
-// urlText += POST_ARGS_LOGIN_FIRST
-// + URLEncoder.encode(repository.getUserName(), BugzillaPlugin.ENCODING_UTF_8)
-// + POST_ARGS_PASSWORD
-// + URLEncoder.encode(repository.getPassword(), BugzillaPlugin.ENCODING_UTF_8);
-// }
-//
-// URL url = new URL(repository.getUrl() + "/enter_bug.cgi" + urlText);
-//
-// URLConnection cntx = BugzillaPlugin.getDefault().getUrlConnection(url);
-// if (cntx != null) {
-// InputStream input = cntx.getInputStream();
-// if (input != null) {
-// in = new BufferedReader(new InputStreamReader(input));
-//
-//
-//
-// return new ProductParser(in).getProducts(repository);
-// }
-// }
-
- BugzillaQueryPageParser parser = new BugzillaQueryPageParser(repository, new NullProgressMonitor());
- if (!parser.wasSuccessful()) {
- throw new RuntimeException("Couldn't get products");
- } else {
- return Arrays.asList(parser.getProductValues());
- }
-
-// return null;
-// } finally {
-// try {
-// if (in != null)
-// in.close();
-// } catch (IOException e) {
-// BugzillaPlugin.log(new Status(IStatus.ERROR, IBugzillaConstants.PLUGIN_ID, IStatus.ERROR,
-// "Problem closing the stream", e));
-// }
-// }
+ // BufferedReader in = null;
+ // try {
+ // repository =
+ // MylarTaskListPlugin.getRepositoryManager().getRepository(
+ // BugzillaPlugin.REPOSITORY_KIND, repositoryUrl);
+ // String urlText = "";
+ // if (repository.hasCredentials()) {
+ // urlText += POST_ARGS_LOGIN_FIRST
+ // + URLEncoder.encode(repository.getUserName(),
+ // BugzillaPlugin.ENCODING_UTF_8)
+ // + POST_ARGS_PASSWORD
+ // + URLEncoder.encode(repository.getPassword(),
+ // BugzillaPlugin.ENCODING_UTF_8);
+ // }
+ //
+ // URL url = new URL(repository.getUrl() + "/enter_bug.cgi" + urlText);
+ //
+ // URLConnection cntx =
+ // BugzillaPlugin.getDefault().getUrlConnection(url);
+ // if (cntx != null) {
+ // InputStream input = cntx.getInputStream();
+ // if (input != null) {
+ // in = new BufferedReader(new InputStreamReader(input));
+ //
+ //
+ //
+ // return new ProductParser(in).getProducts(repository);
+ // }
+ // }
+
+ BugzillaQueryPageParser parser = new BugzillaQueryPageParser(repository, new NullProgressMonitor());
+ if (!parser.wasSuccessful()) {
+ throw new RuntimeException("Couldn't get products");
+ } else {
+ return Arrays.asList(parser.getProductValues());
+ }
+
+ // return null;
+ // } finally {
+ // try {
+ // if (in != null)
+ // in.close();
+ // } catch (IOException e) {
+ // BugzillaPlugin.log(new Status(IStatus.ERROR,
+ // IBugzillaConstants.PLUGIN_ID, IStatus.ERROR,
+ // "Problem closing the stream", e));
+ // }
+ // }
}
/**
@@ -222,14 +276,15 @@ public class BugzillaRepositoryUtil {
TaskRepository repository = MylarTaskListPlugin.getRepositoryManager().getRepository(
BugzillaPlugin.REPOSITORY_KIND, serverUrl);
-
- if(repository == null) {
- throw new LoginException("Repository configuration error.");
+
+ if (repository == null) {
+ throw new LoginException("Repository configuration error.");
}
- if(repository.getUserName() == null || repository.getUserName().trim().equals("") || repository.getPassword() == null) {
- throw new LoginException("Login credentials missing.");
- }
-
+ if (repository.getUserName() == null || repository.getUserName().trim().equals("")
+ || repository.getPassword() == null) {
+ throw new LoginException("Login credentials missing.");
+ }
+
String url = repository.getUrl() + "/enter_bug.cgi";
// use the proper url if we dont know the product yet
@@ -354,7 +409,8 @@ public class BugzillaRepositoryUtil {
String url = repository.getUrl() + POST_ARGS_SHOW_BUG + id;
try {
if (repository.hasCredentials()) {
- url += "&"+POST_ARGS_LOGIN + URLEncoder.encode(repository.getUserName(), BugzillaPlugin.ENCODING_UTF_8)
+ url += "&" + POST_ARGS_LOGIN
+ + URLEncoder.encode(repository.getUserName(), BugzillaPlugin.ENCODING_UTF_8)
+ POST_ARGS_PASSWORD
+ URLEncoder.encode(repository.getPassword(), BugzillaPlugin.ENCODING_UTF_8);
}
@@ -416,9 +472,10 @@ public class BugzillaRepositoryUtil {
*
* @param monitor
* A reference to a progress monitor
- * @throws IOException
+ * @throws IOException
*/
- public static void updateQueryOptions(TaskRepository repository, IProgressMonitor monitor) throws LoginException, IOException {
+ public static void updateQueryOptions(TaskRepository repository, IProgressMonitor monitor) throws LoginException,
+ IOException {
String repositoryUrl = repository.getUrl();
BugzillaQueryPageParser parser = new BugzillaQueryPageParser(repository, monitor);
@@ -472,6 +529,139 @@ public class BugzillaRepositoryUtil {
queryOptionsToString(parser.getTargetValues()));
monitor.worked(1);
}
+
+ public static boolean downloadAttachment(TaskRepository repository, int id, File destinationFile, boolean overwrite)
+ throws IOException {
+ BufferedReader in = null;
+ try {
+ String url = repository.getUrl() + POST_ARGS_ATTACHMENT_DOWNLOAD + id;
+ if (repository.hasCredentials()) {
+ url += "&" + POST_ARGS_LOGIN
+ + URLEncoder.encode(repository.getUserName(), BugzillaPlugin.ENCODING_UTF_8)
+ + POST_ARGS_PASSWORD
+ + URLEncoder.encode(repository.getPassword(), BugzillaPlugin.ENCODING_UTF_8);
+ }
+ URL downloadUrl = new URL(url);
+ URLConnection connection = BugzillaPlugin.getDefault().getUrlConnection(downloadUrl);
+ if (connection != null) {
+ InputStream input = connection.getInputStream();
+ if (input != null) {
+ in = new BufferedReader(new InputStreamReader(input));
+ if (destinationFile.exists() && !overwrite) {
+ return false;
+ }
+ destinationFile.createNewFile();
+ OutputStreamWriter outputStream = new OutputStreamWriter(new FileOutputStream(destinationFile));
+ BufferedWriter out = new BufferedWriter(outputStream);
+ char[] buf = new char[1024];
+ int len;
+ while ((len = in.read(buf)) > 0) {
+ out.write(buf, 0, len);
+ }
+ in.close();
+ out.close();
+ return true;
+ }
+ }
+ } catch (MalformedURLException e) {
+ throw e;
+ } catch (IOException e) {
+ throw e;
+ } catch (Exception e) {
+ BugzillaPlugin.log(new Status(IStatus.ERROR, IBugzillaConstants.PLUGIN_ID, IStatus.ERROR,
+ "Problem retrieving attachment", e));
+ return false;
+ } finally {
+ try {
+ if (in != null)
+ in.close();
+ } catch (IOException e) {
+ BugzillaPlugin.log(new Status(IStatus.ERROR, IBugzillaConstants.PLUGIN_ID, IStatus.ERROR,
+ "Problem closing the stream", e));
+ }
+ }
+ return false;
+ }
+
+ public static boolean uploadAttachment(TaskRepository repository, int bugReportID, String comment,
+ String description, File sourceFile, String contentType, boolean isPatch) throws IOException {
+
+ // Note: The following debug code requires http commons-logging and
+ // commons-logging-api jars
+ // System.setProperty("org.apache.commons.logging.Log",
+ // "org.apache.commons.logging.impl.SimpleLog");
+ // System.setProperty("org.apache.commons.logging.simplelog.showdatetime",
+ // "true");
+ // System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire",
+ // "debug");
+ // System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient",
+ // "debug");
+
+ boolean uploadResult = true;
+
+ HttpClient client = new HttpClient();
+ PostMethod postMethod = new PostMethod(repository.getUrl() + POST_ARGS_ATTACHMENT_UPLOAD);
+
+ // My understanding is that this option causes the client to first check
+ // with the server to see if it will in fact recieve the post before
+ // actually sending the contents.
+ postMethod.getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, true);
+
+ try {
+
+ List<PartBase> parts = new ArrayList<PartBase>();
+
+ parts.add(new StringPart(ATTRIBUTE_ACTION, VALUE_ACTION_INSERT));
+
+ parts.add(new StringPart(ATTRIBUTE_BUGZILLA_LOGIN, repository.getUserName()));
+
+ parts.add(new StringPart(ATTRIBUTE_BUGZILLA_PASSWORD, repository.getPassword()));
+
+ parts.add(new StringPart(ATTRIBUTE_BUGID, String.valueOf(bugReportID)));
+
+ parts.add(new StringPart(ATTRIBUTE_DESCRIPTION, description));
+
+ parts.add(new StringPart(ATTRIBUTE_COMMENT, comment));
+
+ parts.add(new FilePart(ATTRIBUTE_DATA, sourceFile));
+
+ if (isPatch) {
+ parts.add(new StringPart(ATTRIBUTE_ISPATCH, VALUE_ISPATCH));
+ } else {
+ parts.add(new StringPart(ATTRIBUTE_CONTENTTYPEMETHOD, VALUE_CONTENTTYPEMETHOD_MANUAL));
+ parts.add(new StringPart(ATTRIBUTE_CONTENTTYPEENTRY, contentType));
+ }
+
+ postMethod.setRequestEntity(new MultipartRequestEntity(parts.toArray(new Part[1]), postMethod.getParams()));
+
+ client.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
+ int status = client.executeMethod(postMethod);
+ if (status == HttpStatus.SC_OK) {
+ InputStreamReader reader = new InputStreamReader(postMethod.getResponseBodyAsStream(), postMethod
+ .getResponseCharSet());
+ BufferedReader bufferedReader = new BufferedReader(reader);
+ String newLine;
+ while ((newLine = bufferedReader.readLine()) != null) {
+ if (newLine.indexOf("Invalid Username Or Password") >= 0) {
+ throw new IOException(
+ "Invalid Username Or Password - Check credentials in Task Repositories view.");
+ }
+ // TODO: test for no comment and no description etc.
+ }
+ } else {
+ MylarStatusHandler.log(HttpStatus.getStatusText(status), BugzillaRepositoryUtil.class);
+ uploadResult = false;
+ }
+ } catch (HttpException e) {
+ MylarStatusHandler.log("Attachment upload failed\n" + e.getMessage(), BugzillaRepositoryUtil.class);
+ uploadResult = false;
+ } finally {
+ postMethod.releaseConnection();
+ }
+
+ return uploadResult;
+ }
+
}
/**
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 0d093e34d..5ddc47042 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
@@ -29,6 +29,9 @@ public interface IBugzillaConstants {
static final String EDITOR_PAGE_CONTEXT = PLUGIN_ID + ".bugzillaEditorContext";
+ /**
+ * XXX: remove?
+ */
static final String HIT_MARKER_ID = PLUGIN_ID + ".searchHit";
// The is's for hit markers used in the label provider and sorters
@@ -176,6 +179,6 @@ public interface IBugzillaConstants {
public static final String MESSAGE_LOGIN_FAILURE = "Bugzilla login information or repository version incorrect";
- public static final String INVALID_2201_ATTRIBUTE_IGNORED = "EclipsebugsBugzilla2.20.1 ";
+ public static final String INVALID_2201_ATTRIBUTE_IGNORED = "EclipsebugsBugzilla2.20.1";
}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/Bugzilla220ParserTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/Bugzilla220ParserTest.java
index be8d3946e..a06dd19c5 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/Bugzilla220ParserTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/Bugzilla220ParserTest.java
@@ -14,16 +14,21 @@ package org.eclipse.mylar.bugzilla.tests;
import java.io.File;
import java.io.FileReader;
import java.io.Reader;
+import java.net.URL;
import junit.framework.TestCase;
+import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.mylar.bugzilla.core.BugReport;
import org.eclipse.mylar.core.tests.support.FileTool;
+import org.eclipse.mylar.internal.bugzilla.core.BugzillaPlugin;
+import org.eclipse.mylar.internal.bugzilla.core.BugzillaRepositoryUtil;
import org.eclipse.mylar.internal.bugzilla.core.IBugzillaConstants;
import org.eclipse.mylar.internal.bugzilla.core.NewBugModel;
import org.eclipse.mylar.internal.bugzilla.core.internal.BugParser;
import org.eclipse.mylar.internal.bugzilla.core.internal.NewBugParser;
+import org.eclipse.mylar.provisional.tasklist.TaskRepository;
/**
* @author Mik Kersten
@@ -88,4 +93,46 @@ public class Bugzilla220ParserTest extends TestCase {
assertEquals(PRODUCT_MYLAR, nbm.getAttribute("product").getValue());
}
+ public void testExistingBugWithAttachment() throws Exception {
+ File f = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path(
+ "testdata/pages/test-report-222attachment.html"));
+ Reader in = new FileReader(f);
+
+ BugReport bug = BugParser.parseBug(in, 4, TEST_SERVER, false, null, null, null);
+
+ assertEquals(4, bug.getId());
+ assertEquals("4", bug.getAttribute("Bug#").getValue());
+ assertEquals("4", bug.getAttribute("id").getValue());
+
+ assertNotNull(bug.getComments());
+ assertEquals(1, bug.getComments().size());
+ assertTrue(bug.getComments().get(0).hasAttachment());
+ assertEquals("Testing upload", bug.getComments().get(0).getAttachmentDescription());
+// System.err.println(bug.getComments().get(0).getText());
+// assertEquals(1, bug.getAttachements().size());
+// assertEquals("Testing upload", bug.getAttachements().get(1));
+ }
+
+ public void testAttachementDownload() throws Exception {
+ URL localURL = null;
+
+ URL installURL = BugzillaTestPlugin.getDefault().getBundle().getEntry("testdata/contexts/");
+ localURL = FileLocator.toFileURL(installURL);
+
+ File destinationFile = new File(localURL.getPath()+"downloadedContext.xml");
+
+ TaskRepository repository = new TaskRepository(BugzillaPlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL);
+ boolean result = BugzillaRepositoryUtil.downloadAttachment(repository, 2, destinationFile, true);
+ assertTrue(result);
+ }
+
+// public void testAttachementUpload() throws Exception {
+// File sourceFile = FileTool.getFileInPlugin(BugzillaTestPlugin.getDefault(), new Path(
+// "testdata/contexts/downloadedContext.xml"));
+// TaskRepository repository = new TaskRepository(BugzillaPlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL);
+// repository.setAuthenticationCredentials("relves@cs.ubc.ca", "***");
+// boolean result = BugzillaRepositoryUtil.uploadAttachment(repository, 4, "Upload Comment 2", "Upload Description 2", sourceFile, "application/xml", false);
+// assertTrue(result);
+// }
+
}
diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/contexts/downloadedContext.xml b/org.eclipse.mylyn.bugzilla.tests/testdata/contexts/downloadedContext.xml
new file mode 100644
index 000000000..b85da0a78
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/testdata/contexts/downloadedContext.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><InteractionHistory Id="local-25" Version="1"><InteractionEvent Delta="null" EndDate="2006-02-01 12:43:55.253 PST" Interest="-0.25500003" Kind="manipulation" Navigation="null" OriginId="org.eclipse.mylar.core.model.interest.decay" StartDate="2006-02-01 12:43:55.253 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui/src&amp;lt;org.eclipse.mylar.internal.bugzilla.ui.editor" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:05:08.898 PST" Interest="-0.0" Kind="manipulation" Navigation="null" OriginId="org.eclipse.mylar.core.model.interest.decay" StartDate="2006-02-01 12:05:08.898 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui/src&amp;lt;org.eclipse.mylar.internal.bugzilla.ui.editor" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:12:59.174 PST" Interest="8.749001" Kind="propagation" Navigation="org.eclipse.mylar.core.model.edges.containment" OriginId="org.eclipse.mylar.core.model.interest.propagation" StartDate="2006-02-01 12:05:01.166 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui/src&amp;lt;org.eclipse.mylar.internal.bugzilla.ui.editor" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:43:55.253 PST" Interest="-0.08500001" Kind="manipulation" Navigation="null" OriginId="org.eclipse.mylar.core.model.interest.decay" StartDate="2006-02-01 12:43:55.253 PST" StructureHandle="=org.eclipse.mylar.doc" StructureKind="*"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:42:19.555 PST" Interest="3.9490001" Kind="propagation" Navigation="org.eclipse.mylar.core.model.edges.containment" OriginId="org.eclipse.mylar.core.model.interest.propagation" StartDate="2006-02-01 12:13:59.791 PST" StructureHandle="=org.eclipse.mylar.doc" StructureKind="*"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:42:06.516 PST" Interest="2.0" Kind="selection" Navigation="null" OriginId="org.eclipse.jdt.ui.PackageExplorer" StartDate="2006-02-01 12:13:52.761 PST" StructureHandle="=org.eclipse.mylar.doc" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:43:55.253 PST" Interest="-0.25500003" Kind="manipulation" Navigation="null" OriginId="org.eclipse.mylar.core.model.interest.decay" StartDate="2006-02-01 12:43:55.253 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui/src&amp;lt;org.eclipse.mylar.internal.bugzilla.ui.editor{AbstractBugEditor.java" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:05:06.454 PST" Interest="-2.0" Kind="manipulation" Navigation="null" OriginId="org.eclipse.mylar.ide.editor.tracker.interest" StartDate="2006-02-01 12:05:08.898 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui/src&amp;lt;org.eclipse.mylar.internal.bugzilla.ui.editor{AbstractBugEditor.java" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:12:47.968 PST" Interest="6.7490005" Kind="propagation" Navigation="org.eclipse.mylar.core.model.edges.containment" OriginId="org.eclipse.mylar.core.model.interest.propagation" StartDate="2006-02-01 12:05:01.166 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui/src&amp;lt;org.eclipse.mylar.internal.bugzilla.ui.editor{AbstractBugEditor.java" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:12:59.174 PST" Interest="1.0" Kind="selection" Navigation="null" OriginId="org.eclipse.jdt.ui.PackageExplorer" StartDate="2006-02-01 12:12:59.174 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui/src&amp;lt;org.eclipse.mylar.internal.bugzilla.ui.editor{AbstractBugEditor.java" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:43:55.253 PST" Interest="-0.068" Kind="manipulation" Navigation="null" OriginId="org.eclipse.mylar.core.model.interest.decay" StartDate="2006-02-01 12:43:55.253 PST" StructureHandle="/org.eclipse.mylar.doc/doc" StructureKind="*"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:42:19.555 PST" Interest="3.9490001" Kind="propagation" Navigation="org.eclipse.mylar.core.model.edges.containment" OriginId="org.eclipse.mylar.core.model.interest.propagation" StartDate="2006-02-01 12:13:59.791 PST" StructureHandle="/org.eclipse.mylar.doc/doc" StructureKind="*"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:43:55.253 PST" Interest="-0.238" Kind="manipulation" Navigation="null" OriginId="org.eclipse.mylar.core.model.interest.decay" StartDate="2006-02-01 12:43:55.253 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui/src&amp;lt;org.eclipse.mylar.internal.bugzilla.ui.editor{AbstractBugEditor.java[AbstractBugEditor" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:12:47.968 PST" Interest="4.0" Kind="edit" Navigation="null" OriginId="org.eclipse.mylar.java.ui.editor.MylarCompilationUnitEditor" StartDate="2006-02-01 12:08:22.256 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui/src&amp;lt;org.eclipse.mylar.internal.bugzilla.ui.editor{AbstractBugEditor.java[AbstractBugEditor" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:05:11.932 PST" Interest="-0.98300004" Kind="manipulation" Navigation="null" OriginId="org.eclipse.mylar.core.model.interest.decay.correction" StartDate="2006-02-01 12:05:08.898 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui/src&amp;lt;org.eclipse.mylar.internal.bugzilla.ui.editor{AbstractBugEditor.java[AbstractBugEditor" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:05:11.932 PST" Interest="2.0" Kind="selection" Navigation="null" OriginId="org.eclipse.mylar.java.ui.editor.MylarCompilationUnitEditor" StartDate="2006-02-01 12:05:01.166 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui/src&amp;lt;org.eclipse.mylar.internal.bugzilla.ui.editor{AbstractBugEditor.java[AbstractBugEditor" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:43:55.253 PST" Interest="-0.25500003" Kind="manipulation" Navigation="null" OriginId="org.eclipse.mylar.core.model.interest.decay" StartDate="2006-02-01 12:43:55.253 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui/src" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:05:08.898 PST" Interest="-0.0" Kind="manipulation" Navigation="null" OriginId="org.eclipse.mylar.core.model.interest.decay" StartDate="2006-02-01 12:05:08.898 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui/src" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:12:59.174 PST" Interest="9.766001" Kind="propagation" Navigation="org.eclipse.mylar.core.model.edges.containment" OriginId="org.eclipse.mylar.core.model.interest.propagation" StartDate="2006-02-01 12:05:01.166 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui/src" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:43:55.253 PST" Interest="-0.25500003" Kind="manipulation" Navigation="null" OriginId="org.eclipse.mylar.core.model.interest.decay" StartDate="2006-02-01 12:43:55.253 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:05:08.898 PST" Interest="-0.017" Kind="manipulation" Navigation="null" OriginId="org.eclipse.mylar.core.model.interest.decay" StartDate="2006-02-01 12:05:08.898 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:12:59.174 PST" Interest="10.783001" Kind="propagation" Navigation="org.eclipse.mylar.core.model.edges.containment" OriginId="org.eclipse.mylar.core.model.interest.propagation" StartDate="2006-02-01 12:05:01.166 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:13:50.578 PST" Interest="2.0" Kind="selection" Navigation="null" OriginId="org.eclipse.jdt.ui.PackageExplorer" StartDate="2006-02-01 12:05:00.956 PST" StructureHandle="=org.eclipse.mylar.bugzilla.ui" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:43:55.253 PST" Interest="-0.25500003" Kind="manipulation" Navigation="null" OriginId="org.eclipse.mylar.core.model.interest.decay" StartDate="2006-02-01 12:43:55.253 PST" StructureHandle="" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:05:08.898 PST" Interest="-0.017" Kind="manipulation" Navigation="null" OriginId="org.eclipse.mylar.core.model.interest.decay" StartDate="2006-02-01 12:05:08.898 PST" StructureHandle="" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:42:19.555 PST" Interest="19.715" Kind="propagation" Navigation="org.eclipse.mylar.core.model.edges.containment" OriginId="org.eclipse.mylar.core.model.interest.propagation" StartDate="2006-02-01 12:05:00.956 PST" StructureHandle="" StructureKind="java"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:43:55.253 PST" Interest="-0.068" Kind="manipulation" Navigation="null" OriginId="org.eclipse.mylar.core.model.interest.decay" StartDate="2006-02-01 12:43:55.253 PST" StructureHandle="/org.eclipse.mylar.doc/doc/faq.html" StructureKind="*"/><InteractionEvent Delta="null" EndDate="2006-02-01 12:42:19.555 PST" Interest="4.0" Kind="selection" Navigation="null" OriginId="org.eclipse.jdt.ui.PackageExplorer" StartDate="2006-02-01 12:13:59.791 PST" StructureHandle="/org.eclipse.mylar.doc/doc/faq.html" StructureKind="*"/></InteractionHistory> \ No newline at end of file
diff --git a/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-222attachment.html b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-222attachment.html
new file mode 100644
index 000000000..6248ce40d
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.tests/testdata/pages/test-report-222attachment.html
@@ -0,0 +1,859 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <title>Bug 4 - Another Test</title>
+
+
+<link rel="Top" href="http://mylar.eclipse.org/bugs222/">
+
+
+ <link rel="Up" href="buglist.cgi?regetlastlist=1">
+
+ <link rel="First" href="show_bug.cgi?id=1">
+ <link rel="Last" href="show_bug.cgi?id=4">
+
+
+
+ <link rel="Prev" href="show_bug.cgi?id=3">
+
+
+
+
+
+ <link rel="Show" title="Dependency Tree"
+ href="showdependencytree.cgi?id=4">
+ <link rel="Show" title="Dependency Graph"
+ href="showdependencygraph.cgi?id=4">
+
+
+ <link rel="Show" title="Bug Activity"
+ href="show_activity.cgi?id=4">
+
+ <link rel="Show" title="Printer-Friendly Version"
+ href="show_bug.cgi?format=multiple&amp;id=4">
+
+
+
+ <link rel="Saved&nbsp;Searches" title="My Bugs"
+ href="buglist.cgi?bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;emailassigned_to1=1&amp;emailreporter1=1&amp;emailtype1=exact&amp;email1=relves%40cs.ubc.ca&amp;field0-0-0=bug_status&amp;type0-0-0=notequals&amp;value0-0-0=UNCONFIRMED&amp;field0-0-1=reporter&amp;type0-0-1=equals&amp;value0-0-1=relves%40cs.ubc.ca">
+
+
+ <link rel="Administration" title="Parameters"
+ href="editparams.cgi"><link rel="Administration" title="Users"
+ href="editusers.cgi"><link rel="Administration" title="Products"
+ href="editproducts.cgi"><link rel="Administration" title="Flag Types"
+ href="editflagtypes.cgi"><link rel="Administration" title="Groups"
+ href="editgroups.cgi"><link rel="Administration" title="Keywords"
+ href="editkeywords.cgi"><link rel="Administration" title="Whining"
+ href="editwhines.cgi"><link rel="Administration" title="Sanity Check"
+ href="sanitycheck.cgi">
+
+
+
+ <script type="text/javascript">
+ <!--
+
+ function initHelp() {}
+ // -->
+ </script>
+
+ <link href="skins/standard/global.css" rel="stylesheet" type="text/css">
+
+ <link href="skins/custom/global.css" rel="stylesheet" type="text/css">
+
+
+
+
+
+ </head>
+
+
+
+ <body onload=""
+ class="mylar-eclipse-org-bugs222 bz_bug bz_status_NEW bz_component_TestComponent bz_bug_4">
+
+
+<div id="banner">
+ <div class="intro"></div>
+
+ <p id="banner-name">
+ <span>This is Bugzilla</span>
+ </p>
+ <p id="banner-version">
+ <a href="http://www.bugzilla.org/"><span>Bugzilla</span></a>
+ <span>Version 2.22rc1</span>
+ </p>
+
+ <div class="outro"></div>
+ </div>
+
+<div id="header">
+ <h1>Bugzilla Bug 4</h1>
+
+ <h2>Another Test</h2>
+
+ <h3>Last modified: 2006-03-10 14:11:48</h3>
+
+</div>
+
+<b>Bug List:</b>
+ (4 of 4)
+
+ <a href="show_bug.cgi?id=1">First</a>
+ <a href="show_bug.cgi?id=4">Last</a>
+
+ <a href="show_bug.cgi?id=3">Prev</a>
+
+ <i><font color="#777777">Next</font></i>
+
+ &nbsp;&nbsp;<a href="buglist.cgi?regetlastlist=1">Show last search results</a>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="query.cgi">Search page</a>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="enter_bug.cgi">Enter new bug</a>
+
+<hr>
+<script type="text/javascript">
+ <!--
+
+ /* Outputs a link to call replyToComment(); used to reduce HTML output */
+ function addReplyLink(id) {
+ /* XXX this should really be updated to use the DOM Core's
+ * createElement, but finding a container isn't trivial.
+ */
+ document.write('[<a href="#add_comment" onclick="replyToComment(' +
+ id + ');">reply<' + '/a>]');
+ }
+
+ /* Adds the reply text to the `comment' textarea */
+ function replyToComment(id) {
+ /* pre id="comment_name_N" */
+ var text_elem = document.getElementById('comment_text_'+id);
+ var text = getText(text_elem);
+
+ /* make sure we split on all newlines -- IE or Moz use \r and \n
+ * respectively.
+ */
+ text = text.split(/\r|\n/);
+
+ var replytext = "";
+ for (var i=0; i < text.length; i++) {
+ replytext += "> " + text[i] + "\n";
+ }
+
+ replytext = "(In reply to comment #" + id + ")\n" + replytext + "\n";
+
+
+ /* <textarea id="comment"> */
+ var textarea = document.getElementById('comment');
+ textarea.value += replytext;
+
+ textarea.focus();
+ }
+
+ if (typeof Node == 'undefined') {
+ /* MSIE doesn't define Node, so provide a compatibility object */
+ window.Node = {
+ TEXT_NODE: 3,
+ ENTITY_REFERENCE_NODE: 5
+ };
+ }
+
+ /* Concatenates all text from element's childNodes. This is used
+ * instead of innerHTML because we want the actual text (and
+ * innerText is non-standard).
+ */
+ function getText(element) {
+ var child, text = "";
+ for (var i=0; i < element.childNodes.length; i++) {
+ child = element.childNodes[i];
+ var type = child.nodeType;
+ if (type == Node.TEXT_NODE || type == Node.ENTITY_REFERENCE_NODE) {
+ text += child.nodeValue;
+ } else {
+ /* recurse into nodes of other types */
+ text += getText(child);
+ }
+ }
+ return text;
+ }
+
+
+ function updateCommentTagControl(checkbox, form) {
+ if (checkbox.checked) {
+ form.comment.className='bz_private';
+ } else {
+ form.comment.className='';
+ }
+ }
+
+ //-->
+ </script>
+
+<form name="changeform" method="post" action="process_bug.cgi">
+
+ <input type="hidden" name="delta_ts" value="2006-03-10 14:11:48">
+
+ <input type="hidden" name="longdesclength" value="2">
+ <input type="hidden" name="id" value="4">
+
+
+
+ <table>
+
+ <tr>
+ <td valign="top">
+ <table cellspacing="1" cellpadding="1">
+ <tr>
+
+ <td align="right">
+ <b>Bug#:</b>
+ </td>
+ <td>
+ <a href="http://mylar.eclipse.org/bugs222/show_bug.cgi?id=4">4</a>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b><u>P</u>roduct:</b>
+ </td><td>
+ <label for="product" accesskey="p">
+ <select name="product" id="product">
+ <option value="TestProduct" selected>TestProduct
+ </option>
+
+ </select>
+ </label>
+ </td>
+ </tr>
+
+
+
+ <tr>
+ <td align="right">
+ <b>
+ <a href="describecomponents.cgi?product=TestProduct">
+
+ Co<u>m</u>ponent</a>:
+ </b>
+ </td><td>
+ <label for="component" accesskey="m">
+ <select name="component" id="component">
+ <option value="TestComponent" selected>TestComponent
+ </option>
+ </select>
+
+ </label>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>
+ <a href="page.cgi?id=fields.html#status">Status</a>:
+ </b>
+
+ </td>
+ <td>NEW</td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>
+ <a href="page.cgi?id=fields.html#resolution">Resolution</a>:
+ </b>
+
+ </td>
+ <td>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>
+ <a href="page.cgi?id=fields.html#assigned_to">Assigned&nbsp;To</a>:
+ </b>
+
+ </td>
+ <td>Robert Elves &lt;relves&#64;cs.ubc.ca&gt;</td>
+ </tr>
+
+ </table>
+
+ </td>
+ <td valign="top">
+
+ <table cellspacing="1" cellpadding="1">
+
+ <tr>
+ <td align="right">
+ <b><u>H</u>ardware:</b>
+ </td><td>
+ <label for="rep_platform" accesskey="h">
+ <select name="rep_platform" id="rep_platform">
+
+ <option value="All">All
+ </option>
+ <option value="PC" selected>PC
+ </option>
+ <option value="Macintosh">Macintosh
+ </option>
+ <option value="Other">Other
+ </option>
+ </select>
+ </label>
+ </td>
+
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b><u>O</u>S:</b>
+ </td><td>
+ <label for="op_sys" accesskey="o">
+ <select name="op_sys" id="op_sys">
+
+ <option value="All">All
+ </option>
+ <option value="Windows">Windows
+ </option>
+ <option value="Mac OS">Mac OS
+ </option>
+ <option value="Linux">Linux
+ </option>
+ <option value="Other" selected>Other
+ </option>
+ </select>
+
+ </label>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>Version:</b>
+ </td><td>
+ <label for="version" accesskey="o">
+
+ <select name="version" id="version">
+ <option value="other" selected>other
+ </option>
+ </select>
+ </label>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+
+ <b><a href="page.cgi?id=fields.html#priority">Pr<u>i</u>ority</a>:</b>
+ </td><td>
+ <label for="priority" accesskey="i">
+ <select name="priority" id="priority">
+ <option value="P1">P1
+ </option>
+ <option value="P2">P2
+ </option>
+
+ <option value="P3" selected>P3
+ </option>
+ <option value="P4">P4
+ </option>
+ <option value="P5">P5
+ </option>
+ </select>
+ </label>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b><a href="page.cgi?id=fields.html#bug_severity">Severity</a>:</b>
+ </td><td>
+ <label for="bug_severity" accesskey="i">
+ <select name="bug_severity" id="bug_severity">
+ <option value="blocker">blocker
+ </option>
+
+ <option value="critical">critical
+ </option>
+ <option value="major">major
+ </option>
+ <option value="normal" selected>normal
+ </option>
+ <option value="minor">minor
+ </option>
+ <option value="trivial">trivial
+ </option>
+ <option value="enhancement">enhancement
+ </option>
+
+ </select>
+ </label>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right">
+ <b>
+ Target Milestone:
+ </b>
+
+ </td><td>
+ <label for="target_milestone" accesskey="i">
+ <select name="target_milestone" id="target_milestone">
+ <option value="---" selected>---
+ </option>
+ </select>
+ </label>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+
+ <td valign="top">
+
+ <table cellpadding="1" cellspacing="1">
+
+ <tr>
+ <td align="right">
+ <b>Reporter:</b>
+
+ </td>
+ <td>
+ <a href="mailto:relves&#64;cs.ubc.ca">Robert Elves &lt;relves&#64;cs.ubc.ca&gt;</a>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" valign="top">
+
+ <b><u>A</u>dd&nbsp;CC:</b>
+ </td>
+ <td><input
+ name="newcc"
+ value="" accesskey="a" size="30"
+>
+ </td>
+ </tr>
+
+ <tr>
+ <td align="right" valign="top">
+
+ <b>CC:</b>
+ </td>
+ <td valign="top">
+ <input type="hidden" name="cc" value="">
+ </td>
+ </tr>
+
+ </table>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <table cellspacing="1" cellpadding="1">
+
+
+
+
+ <tr>
+ <td align="right">
+ <b>
+
+ <u>U</u>RL:
+ </b>
+ </td>
+ <td colspan="5">
+ <input name="bug_file_loc" accesskey="u"
+ value="" size="60">
+ </td>
+ </tr>
+
+ <tr>
+
+ <td align="right">
+ <b><u>S</u>ummary:</b>
+ </td>
+ <td colspan="5">
+ <input name="short_desc" accesskey="s"
+ value="Another Test" size="60">
+ </td>
+ </tr>
+
+
+ </table>
+ </td>
+
+ <td valign="top">
+ <table cellspacing="1" cellpadding="1">
+ <tr>
+ <td colspan="2" valign="top">
+ </td>
+
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+
+
+
+<br>
+<table cellspacing="0" cellpadding="4" border="1">
+ <tr>
+
+ <th bgcolor="#cccccc" align="left">Attachment</th>
+ <th bgcolor="#cccccc" align="left">Type</th>
+ <th bgcolor="#cccccc" align="left">Creator</th>
+ <th bgcolor="#cccccc" align="left">Created</th>
+ <th bgcolor="#cccccc" align="left">Size</th>
+ <th bgcolor="#cccccc" align="left">Actions</th>
+
+ </tr>
+ <tr >
+ <td valign="top">
+ <a href="attachment.cgi?id=1">Testing upload</a>
+ </td>
+
+ <td valign="top">text/plain
+ </td>
+
+ <td valign="top">
+
+ <a href="mailto:relves&#64;cs.ubc.ca">Robert Elves
+ </a>
+ </td>
+ <td valign="top">2006-03-10 14:11</td>
+ <td valign="top">6.87 KB</td>
+
+
+ <td valign="top">
+ <a href="attachment.cgi?id=1&amp;action=edit">Edit</a>
+
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="5">
+ <a href="attachment.cgi?bugid=4&amp;action=enter">Create a New Attachment</a> (proposed patch, testcase, etc.)
+ </td>
+ <td>
+ <a href="attachment.cgi?bugid=4&amp;action=viewall">View All</a>
+
+ </td>
+ </tr>
+</table>
+<br>
+
+
+
+ <table>
+ <tr><th align="right">Bug 4 depends on:</th>
+ <td>
+ </td>
+
+ <td>
+ <input name="dependson" accesskey="i"
+ value="">
+ </td>
+ <td rowspan="2">
+ <a href="showdependencytree.cgi?id=4">Show
+ dependency tree</a>
+
+ <br>
+ <a href="showdependencygraph.cgi?id=4">Show
+ dependency graph</a>
+
+ </td>
+ </tr>
+
+ <tr><th align="right">Bug 4 <u>b</u>locks:</th>
+ <td>
+ </td>
+ <td>
+ <input name="blocked" accesskey="b"
+ value="">
+
+ </td>
+ </tr>
+ </table>
+
+
+
+
+ <br>
+ <b>Additional <u>C</u>omments:</b>
+
+ <br>
+ <a name="add_comment"></a>
+ <textarea name="comment" id="comment" rows="10" cols="80"
+ accesskey="c"></textarea>
+
+ <br>
+ <label for="addselfcc">
+ <input type="checkbox" id="addselfcc" name="addselfcc">
+ Add relves&#64;cs.ubc.ca to CC list
+ </label>
+
+ <br>
+
+<br>
+ <input type="radio" id="knob-leave" name="knob" value="none" checked="checked">
+ <label for="knob-leave">
+ Leave as <b>NEW&nbsp;</b>
+ </label>
+ <br>
+
+
+ <input type="radio" id="knob-accept" name="knob" value="accept">
+ <label for="knob-accept">
+ Accept bug (change
+ status to <b>ASSIGNED</b>)
+ </label>
+ <br>
+
+
+ <input type="radio" id="knob-resolve" name="knob" value="resolve">
+
+ <label for="knob-resolve">
+ Resolve bug, changing
+ <a href="page.cgi?id=fields.html#resolution">resolution</a> to
+ </label>
+ <select name="resolution"
+ onchange="document.changeform.knob[2].checked=true">
+ <option value="FIXED">FIXED</option>
+ <option value="INVALID">INVALID</option>
+ <option value="WONTFIX">WONTFIX</option>
+
+ <option value="LATER">LATER</option>
+ <option value="REMIND">REMIND</option>
+ <option value="WORKSFORME">WORKSFORME</option>
+ </select>
+ <br>
+
+ <input type="radio" id="knob-duplicate" name="knob" value="duplicate">
+ <label for="knob-duplicate">
+
+ Resolve bug, mark it as duplicate of bug #
+ </label>
+ <input name="dup_id" size="6"
+ onchange="if (this.value != '')
+ {document.changeform.knob[3].checked=true}">
+ <br>
+
+ <input type="radio" id="knob-reassign" name="knob" value="reassign">
+ <label for="knob-reassign">
+ <a href="page.cgi?id=fields.html#assigned_to">Reassign</a> bug to
+ </label><input
+ name="assigned_to"
+ value="relves&#64;cs.ubc.ca" onchange="if ((this.value != 'relves\x40cs.ubc.ca') &amp;&amp; (this.value != '')) {
+ document.changeform.knob[4].checked=true;
+ }" accesskey="b" size="32"
+>
+
+ <br>
+
+ <input type="radio" id="knob-reassign-cmp" name="knob" value="reassignbycomponent">
+ <label for="knob-reassign-cmp">
+ Reassign bug to default assignee
+ of selected component
+ </label>
+ <br>
+
+ <input type="submit" value="Commit">
+ <input type="hidden" name="form_name" value="process_bug">
+
+ <p>
+ <font size="+1">
+ <b>
+ <a href="show_activity.cgi?id=4">View Bug Activity</a>
+ &nbsp; | &nbsp;
+ <a href="show_bug.cgi?format=multiple&amp;id=4">Format For Printing</a>
+ &nbsp; | &nbsp;
+
+ <a href="show_bug.cgi?ctype=xml&amp;id=4">XML</a>
+ &nbsp; | &nbsp;
+ <a href="enter_bug.cgi?cloned_bug_id=4">Clone This Bug</a>
+
+
+ </b>
+ </font>
+
+ </p>
+
+
+
+<hr>
+<script type="text/javascript">
+ <!--
+ function updateCommentPrivacy(checkbox, id) {
+ var text_elem = document.getElementById('comment_text_'+id);
+ if (checkbox.checked) {
+ text_elem.parentNode.className='bz_private';
+ } else {
+ text_elem.parentNode.className='';
+ }
+ }
+ //-->
+ </script>
+
+
+
+
+
+
+
+
+<div >
+ <table>
+
+ <tr>
+ <td align="left">
+ <b><a name="c0" href="show_bug.cgi?id=4#c0">
+ Description</a>:</b>&nbsp;&nbsp;<script type="text/javascript"><!--
+ addReplyLink(0);
+ //--></script>
+ </td>
+ <td align="left" width="30%">
+ <b>Opened:</b> 2006-03-09 13:09
+ </td>
+
+ </tr>
+ </table>
+
+
+
+<pre id="comment_text_0">Testing new 2.22 version capability
+</pre>
+ </div>
+ <div >
+ <br>
+ <span class="bz_comment">
+ ------- <i>Comment
+ <a name="c1" href="show_bug.cgi?id=4#c1">
+
+ #1</a> From
+ <a href="mailto:relves&#64;cs.ubc.ca">Robert Elves</a>
+ 2006-03-10 14:11:48
+ </i>
+ <script type="text/javascript"><!--
+ addReplyLink(1); //--></script>
+ -------
+ </span>
+
+
+
+<pre id="comment_text_1"><span class=""><a href="attachment.cgi?id=1&amp;action=view" title="Testing upload">Created an attachment (id=1)</a> <a href="attachment.cgi?id=1&amp;action=edit" title="Testing upload">[edit]</a></span>
+
+Testing upload
+
+The comment
+</pre>
+ </div>
+
+</form>
+
+<hr>
+<b>Bug List:</b>
+ (4 of 4)
+
+ <a href="show_bug.cgi?id=1">First</a>
+ <a href="show_bug.cgi?id=4">Last</a>
+
+ <a href="show_bug.cgi?id=3">Prev</a>
+
+ <i><font color="#777777">Next</font></i>
+
+ &nbsp;&nbsp;<a href="buglist.cgi?regetlastlist=1">Show last search results</a>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="query.cgi">Search page</a>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="enter_bug.cgi">Enter new bug</a>
+
+<br>
+<div id="footer">
+ <div class="intro"></div>
+
+
+
+
+<div id="useful-links">
+ <div id="links-actions">
+ <div class="label">Actions:</div>
+ <div class="links">
+
+ <a href="./">Home</a> |
+ <a href="enter_bug.cgi">New</a> |
+ <a href="query.cgi">Search</a> |
+
+ <form action="buglist.cgi" method="get"
+ onsubmit="if (this.quicksearch.value == '')
+ { alert('Please enter one or more search terms first.');
+ return false; } return true;">
+ <input class="txt" type="text" name="quicksearch">
+ <input class="btn" type="submit" value="Find">
+ </form> |
+
+ <a href="report.cgi">Reports</a>
+
+ | <a href="request.cgi?requester=relves%40cs.ubc.ca&amp;requestee=relves%40cs.ubc.ca&amp;do_union=1&amp;group=type">My Requests</a>
+
+
+ | <a href="votes.cgi?action=show_user">My&nbsp;Votes</a>
+ | <a href="sanitycheck.cgi">Sanity&nbsp;check</a>
+ | <a href="relogin.cgi">Log&nbsp;out</a>&nbsp;relves&#64;cs.ubc.ca
+ </div>
+ </div>
+
+
+ <div id="links-edit">
+ <div class="label">Edit:</div>
+ <div class="links">
+
+ <a href="userprefs.cgi">Prefs</a> | <a href="editparams.cgi">Parameters</a> | <a href="editsettings.cgi">User Preferences</a> | <a href="editusers.cgi">Users</a> | <a href="editproducts.cgi">Products</a> | <a href="editflagtypes.cgi">Flags</a> | <a href="editvalues.cgi">Field Values</a> | <a href="editgroups.cgi">Groups</a> | <a href="editkeywords.cgi">Keywords</a> | <a href="editwhines.cgi">Whining</a>
+
+ </div>
+ </div>
+
+
+
+
+ <div id="links-saved">
+ <div class="label">
+ Saved&nbsp;Searches:
+ </div>
+ <div class="links">
+ <a href="buglist.cgi?bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;emailassigned_to1=1&amp;emailreporter1=1&amp;emailtype1=exact&amp;email1=relves%40cs.ubc.ca&amp;field0-0-0=bug_status&amp;type0-0-0=notequals&amp;value0-0-0=UNCONFIRMED&amp;field0-0-1=reporter&amp;type0-0-1=equals&amp;value0-0-1=relves%40cs.ubc.ca">My&nbsp;Bugs</a>
+
+ </div>
+ </div>
+
+
+<div id="links-special">
+ <div class="label">&nbsp;</div>
+ <div class="links">
+ <form action="buglist.cgi" method="get">
+ <input type="hidden" name="cmdtype" value="doit">
+ <input type="hidden" name="remtype" value="asnamed">
+
+ <input type="hidden" name="add_bugids" value="1">
+ <input type="submit" value="Add"> bugs
+ <input type="text" name="bug_ids" size="8" maxlength="80"> to
+ the new saved search:
+ <input type="text" name="newqueryname" size="20" maxlength="64">
+ </form>
+ </div>
+ </div>
+
+
+</div>
+
+ <div class="outro"></div>
+</div>
+
+</body>
+</html>
diff --git a/org.eclipse.mylyn.bugzilla.ui/plugin.xml b/org.eclipse.mylyn.bugzilla.ui/plugin.xml
index 36f8d52b2..5ee114c8f 100644
--- a/org.eclipse.mylyn.bugzilla.ui/plugin.xml
+++ b/org.eclipse.mylyn.bugzilla.ui/plugin.xml
@@ -3,6 +3,25 @@
<?eclipse version="3.0"?>
<plugin>
+ <!-- TODO: remove? -->
+ <extension
+ id="searchHit"
+ name="Bugzilla Search Match"
+ point="org.eclipse.core.resources.markers">
+ <super type="org.eclipse.search.searchmarker"/>
+ <attribute name="id"/>
+ <attribute name="href"/>
+ <attribute name="description"/>
+ <attribute name="label"/>
+ <attribute name="severity"/>
+ <attribute name="priority"/>
+ <attribute name="platform"/>
+ <attribute name="status"/>
+ <attribute name="result"/>
+ <attribute name="owner"/>
+ <attribute name="query"/>
+ </extension>
+
<extension
id="org.eclipse.mylar.bugzilla.repository"
name="Bugzilla Repository"
@@ -24,7 +43,6 @@
point="org.eclipse.mylar.tasklist.editors">
<editorFactory class="org.eclipse.mylar.internal.bugzilla.ui.tasklist.BugzillaReportEditorFactory"/>
</extension>
-
<extension
point="org.eclipse.ui.perspectiveExtensions">
@@ -48,28 +66,6 @@
</decorator>
</extension>
-<!--
-<extension
- id="org.eclipse.mylar.bugzilla.wizards"
- name="Bug Wizard"
- point="org.eclipse.ui.newWizards">
- <category
- name="Bugzilla Client"
- id="org.eclipse.mylar.bugzilla.wizard.category">
- </category>
- <wizard
- category="org.eclipse.mylar.bugzilla.wizard.category"
- class="org.eclipse.mylar.bugzilla.ui.wizard.NewBugzillaReportWizard"
- icon="icons/elcl16/bug-new.gif"
- id="org.eclipse.mylar.bugzilla.bugWizard"
- name="New Bug Report">
- <description>
- Create a new bug report
- </description>
- </wizard>
-</extension>
--->
-
<extension
id="org.eclipse.mylar.bugzilla.help.browser"
name="Bugzilla Help"
@@ -79,28 +75,7 @@
primary="false">
</toc>
</extension>
- <!--
- <extension
- id="org.eclipse.mylar.bugzilla.ui"
- name="Bugzilla Client Views"
- point="org.eclipse.ui.views">
- <category
- name="Bugzilla"
- id="org.eclipse.mylar.bugzilla.category"/>
- <view
- name="Bugzilla Offline Reports"
- icon="icons/elcl16/bug-dirty.gif"
- category="org.eclipse.mylar.bugzilla.category"
- class="org.eclipse.mylar.bugzilla.ui.OfflineView"
- id="org.eclipse.mylar.bugzilla.ui.offlineReportsView"/>
- <view
- name="Bugzilla Favorites"
- icon="icons/elcl16/bug-favorite.gif"
- category="org.eclipse.mylar.bugzilla.category"
- class="org.eclipse.mylar.bugzilla.ui.FavoritesView"
- id="org.eclipse.mylar.bugzilla.ui.favoritesView"/>
- </extension>
- -->
+
<extension
point="org.eclipse.ui.editors">
<editor
@@ -151,6 +126,59 @@
</extension>
</plugin>
+<!--
+<extension
+ id="org.eclipse.mylar.bugzilla.wizards"
+ name="Bug Wizard"
+ point="org.eclipse.ui.newWizards">
+ <category
+ name="Bugzilla Client"
+ id="org.eclipse.mylar.bugzilla.wizard.category">
+ </category>
+ <wizard
+ category="org.eclipse.mylar.bugzilla.wizard.category"
+ class="org.eclipse.mylar.bugzilla.ui.wizard.NewBugzillaReportWizard"
+ icon="icons/elcl16/bug-new.gif"
+ id="org.eclipse.mylar.bugzilla.bugWizard"
+ name="New Bug Report">
+ <description>
+ Create a new bug report
+ </description>
+ </wizard>
+</extension>
+-->
+
+ <!--
+ <extension
+ id="org.eclipse.mylar.bugzilla.ui"
+ name="Bugzilla Client Views"
+ point="org.eclipse.ui.views">
+ <category
+ name="Bugzilla"
+ id="org.eclipse.mylar.bugzilla.category"/>
+ <view
+ name="Bugzilla Offline Reports"
+ icon="icons/elcl16/bug-dirty.gif"
+ category="org.eclipse.mylar.bugzilla.category"
+ class="org.eclipse.mylar.bugzilla.ui.OfflineView"
+ id="org.eclipse.mylar.bugzilla.ui.offlineReportsView"/>
+ <view
+ name="Bugzilla Favorites"
+ icon="icons/elcl16/bug-favorite.gif"
+ category="org.eclipse.mylar.bugzilla.category"
+ class="org.eclipse.mylar.bugzilla.ui.FavoritesView"
+ id="org.eclipse.mylar.bugzilla.ui.favoritesView"/>
+ </extension>
+ -->
+
+<!-- <extension point="org.eclipse.ui.preferencePages">
+ <page
+ name="Bugzilla Client"
+ class="org.eclipse.mylar.internal.bugzilla.core.BugzillaPreferencePage"
+ id="org.eclipse.mylar.bugzilla.bugzillaPreferences"
+ category="org.eclipse.mylar.ui.preferences"/>
+ </extension>
+ -->
<!--
<action
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/AbstractBugEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/AbstractBugEditor.java
index 1cd3da182..d5d8a15bb 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/AbstractBugEditor.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/AbstractBugEditor.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.mylar.internal.bugzilla.ui.editor;
-import java.net.MalformedURLException;
-import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -44,6 +42,7 @@ import org.eclipse.mylar.internal.bugzilla.core.IBugzillaConstants;
import org.eclipse.mylar.internal.bugzilla.core.IBugzillaReportSelection;
import org.eclipse.mylar.internal.bugzilla.ui.tasklist.BugzillaRepositoryConnector;
import org.eclipse.mylar.internal.core.util.MylarStatusHandler;
+import org.eclipse.mylar.internal.tasklist.ui.TaskListUiUtil;
import org.eclipse.mylar.internal.tasklist.ui.editors.MylarTaskEditor;
import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
import org.eclipse.mylar.provisional.tasklist.TaskRepository;
@@ -67,11 +66,8 @@ import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.actions.RetargetAction;
-import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
@@ -378,7 +374,6 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
// foreground = JFaceColors.getBannerForeground(display);
// createInfoArea(editorComposite);
-
createContextMenu();
createAttributeLayout();
createDescriptionLayout(toolkit, form);
@@ -1048,17 +1043,20 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
formText.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent event) {
- try {
- // Perhaps should use TaskListUiUtil.openUrl instead?
- URL url = new URL((String) event.getHref());
- IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
-
- support.getExternalBrowser().openURL(url);
- } catch (PartInitException e1) {
- MessageDialog.openError(null, "Link error", "Could not open browser");
- } catch (MalformedURLException e) {
- MessageDialog.openError(null, "Link error", "Hyperlink address is malformed");
- }
+ String address = (String) event.getHref();
+ // TODO: how to get proper page title and
+ TaskListUiUtil.openUrl(address, address, address);
+// try {
+// // Perhaps should use TaskListUiUtil.openUrl instead?
+// URL url = new URL((String) event.getHref());
+// IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
+//
+// support.getExternalBrowser().openURL(url);
+// } catch (PartInitException e1) {
+// MessageDialog.openError(null, "Link error", "Could not open browser");
+// } catch (MalformedURLException e) {
+// MessageDialog.openError(null, "Link error", "Hyperlink address is malformed");
+// }
}
});
@@ -1102,6 +1100,34 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
formText.setFont("code", JFaceResources.getTextFont());
formText.setText(buf.toString(), true, false);
+ formText.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent event) {
+// try {
+ // Perhaps should use TaskListUiUtil.openUrl instead?
+// URL url = new URL((String) event.getHref());
+ TaskListUiUtil.openUrl("Attachment", "", (String) event.getHref());
+// IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
+//
+// support.getExternalBrowser().openURL(url);
+// } catch (PartInitException e1) {
+// MessageDialog.openError(null, "Link error", "Could not open browser");
+// } catch (MalformedURLException e) {
+// MessageDialog.openError(null, "Link error", "Hyperlink address is malformed");
+// }
+ }
+ });
+
+ formText.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FormText c = (FormText) e.widget;
+ if (c != null && c.canCopy()) {
+ currentSelectedText = c;
+ }
+
+ }
+ });
resultText = formText;
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/ExistingBugEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/ExistingBugEditor.java
index da8834b52..a9842b10a 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/ExistingBugEditor.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/ExistingBugEditor.java
@@ -456,8 +456,13 @@ public class ExistingBugEditor extends AbstractBugEditor {
for (Iterator<Comment> it = bug.getComments().iterator(); it.hasNext();) {
Comment comment = it.next();
String commentHeader = "<b>" + comment.getNumber() + ": " + comment.getAuthorName() + ", "
- + df.format(comment.getCreated()) + "</b>";
+ + df.format(comment.getCreated()) + "</b>";
formText = newLayout(addCommentsComposite, 1, commentHeader, HEADER);
+ if(comment.hasAttachment()) {
+ String attachmentHeader = " Attached: "+comment.getAttachmentDescription()+" <a href='"+repository.getUrl()+"/attachment.cgi?id="+comment.getAttachmentId()+"&amp;action=view'>[view]</a>";
+ formText = newLayout(addCommentsComposite, 1, attachmentHeader, HEADER);//
+ formText.addListener(SWT.FocusIn, new CommentListener(comment));
+ }
formText.addListener(SWT.FocusIn, new CommentListener(comment));
formText = newLayout(addCommentsComposite, 1, comment.getText(), VALUE);
formText.setFont(COMMENT_FONT);
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositoryConnector.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositoryConnector.java
index a372ffa1e..918da5a9d 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositoryConnector.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositoryConnector.java
@@ -11,8 +11,10 @@
package org.eclipse.mylar.internal.bugzilla.ui.tasklist;
+import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -30,6 +32,8 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.mylar.bugzilla.core.BugReport;
+import org.eclipse.mylar.bugzilla.core.BugzillaRemoteContextDelegate;
+import org.eclipse.mylar.bugzilla.core.Comment;
import org.eclipse.mylar.bugzilla.core.IBugzillaBug;
import org.eclipse.mylar.internal.bugzilla.core.BugzillaException;
import org.eclipse.mylar.internal.bugzilla.core.BugzillaPlugin;
@@ -51,11 +55,13 @@ import org.eclipse.mylar.internal.tasklist.ui.views.TaskRepositoriesView;
import org.eclipse.mylar.internal.tasklist.ui.wizards.AbstractAddExistingTaskWizard;
import org.eclipse.mylar.internal.tasklist.ui.wizards.AbstractRepositorySettingsPage;
import org.eclipse.mylar.internal.tasklist.ui.wizards.ExistingTaskWizardPage;
+import org.eclipse.mylar.provisional.core.MylarPlugin;
import org.eclipse.mylar.provisional.tasklist.AbstractQueryHit;
import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryQuery;
import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryTask;
import org.eclipse.mylar.provisional.tasklist.DateRangeContainer;
+import org.eclipse.mylar.provisional.tasklist.IRemoteContextDelegate;
import org.eclipse.mylar.provisional.tasklist.ITask;
import org.eclipse.mylar.provisional.tasklist.ITaskActivityListener;
import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
@@ -71,6 +77,8 @@ import org.eclipse.ui.actions.WorkspaceModifyOperation;
*/
public class BugzillaRepositoryConnector extends AbstractRepositoryConnector {
+ private static final String CONTENTTYPE_APPLICATION_XML = "application/xml";
+
private static final String LABEL_JOB_SUBMIT = "Submitting to Bugzilla repository";
private static final String DESCRIPTION_DEFAULT = "<needs synchronize>";
@@ -528,4 +536,66 @@ public class BugzillaRepositoryConnector extends AbstractRepositoryConnector {
}
}
+ @Override
+ public boolean attachContext(TaskRepository repository, AbstractRepositoryTask task, String longComment)
+ throws IOException {
+ boolean result = false;
+ MylarPlugin.getContextManager().saveContext(task.getHandleIdentifier());
+ File sourceContextFile = MylarPlugin.getContextManager().getFileForContext(task.getHandleIdentifier());
+ if (sourceContextFile != null && sourceContextFile.exists()) {
+ result = BugzillaRepositoryUtil.uploadAttachment(repository, BugzillaTask.getTaskIdAsInt(task
+ .getHandleIdentifier()), longComment, MYLAR_CONTEXT_DESCRIPTION, sourceContextFile,
+ CONTENTTYPE_APPLICATION_XML, false);
+ if (result) {
+ synchronize(task, false, null);
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public Set<IRemoteContextDelegate> getAvailableContexts(TaskRepository repository, AbstractRepositoryTask task) {
+ Set<IRemoteContextDelegate> contextDelegates = new HashSet<IRemoteContextDelegate>();
+ if(task instanceof BugzillaTask) {
+ BugzillaTask bugzillaTask = (BugzillaTask)task;
+ for (Comment comment : bugzillaTask.getBugReport().getComments()) {
+ if(comment.hasAttachment() && comment.getAttachmentDescription().equals(MYLAR_CONTEXT_DESCRIPTION)) {
+ contextDelegates.add(new BugzillaRemoteContextDelegate(comment));
+ }
+ }
+ }
+ return contextDelegates;
+ }
+
+ @Override
+ public boolean retrieveContext(TaskRepository repository, AbstractRepositoryTask task,
+ IRemoteContextDelegate remoteContextDelegate) throws IOException {
+ boolean result = false;
+ boolean wasActive = false;
+ if (remoteContextDelegate instanceof BugzillaRemoteContextDelegate) {
+ BugzillaRemoteContextDelegate contextDelegate = (BugzillaRemoteContextDelegate) remoteContextDelegate;
+
+ if (task.isActive()) {
+ wasActive = true;
+ MylarTaskListPlugin.getTaskListManager().deactivateTask(task);
+ }
+
+ File destinationContextFile = MylarPlugin.getContextManager().getFileForContext(task.getHandleIdentifier());
+ // if(destinationContextFile.exists()) {
+ // destinationContextFile.delete();
+ // }
+
+ result = BugzillaRepositoryUtil.downloadAttachment(repository, contextDelegate.getId(),
+ destinationContextFile, true);
+
+ if (result) {
+ MylarTaskListPlugin.getTaskListManager().getTaskList().notifyLocalInfoChanged(task);
+ if (wasActive) {
+ MylarTaskListPlugin.getTaskListManager().activateTask(task);
+ }
+ }
+ }
+ return result;
+ }
+
}
diff --git a/org.eclipse.mylyn.help.ui/doc/faq.html b/org.eclipse.mylyn.help.ui/doc/faq.html
index 8805cd85e..5f4fdcd0c 100644
--- a/org.eclipse.mylyn.help.ui/doc/faq.html
+++ b/org.eclipse.mylyn.help.ui/doc/faq.html
@@ -35,7 +35,12 @@
<li><a href="#active-search-empty">Why does nothing show up in the Active Search or Active Hierarchy?</a></li>
</ul>
- <p><b>Key Limitations </b></p>
+ <p><b>Technologies and Adoption</b></p>
+ <ul>
+ <li>What dependencies does Mylar have?</li>
+ <li>How is Mylar related to the IBM Jazz project?</li>
+ </ul>
+ <p><b>Key Limitations </b></p>
<ul>
<li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=106678">Bug 106678</a>&nbsp;
The Package Explorer hierarchical layout is not supported properly yet and
@@ -315,5 +320,36 @@ recommended, but can be useful for 1024x768 screen resolutions.</p>
views.&nbsp; To force an element to populate the views manually make
it a landmark by right-clicking or hitting Ctrl+Alt+Shift+Up Arrow.&nbsp;
</p>
+ <hr>
+<p>
+ &nbsp;</p>
+ <h3>How is Mylar related to the IBM Jazz project?</h3>
+ <p>
+ At EclipseCon 2006 IBM showed a demonstration of Jazz, and due to
+ the similarities there have been numerous inquiries on how that
+ effort relates to Mylar.&nbsp; Both tools provide a task-centric
+ perspective on development, support task-based change sets...&nbsp;
+ This approach and related tooling originated with Mylar, is
+ re-implemented in Jazz, with the following notable differences
+ between Mylar and what was demonstrated at EclipseCon 2006:</p>
+ <ul>
+ <li><b>Mylar is open source and Jazz is closed source</b>.&nbsp; The
+ goal of Mylar is to make tasks and contexts a first class part of the
+ Eclipse platform in order to make it possible for the Eclipse ecosystem
+ to build on this technology.</li>
+ <li><b>Mylar integrates with existing repositories, Jazz is built around
+ a new repository</b>.&nbsp; While Jazz requires a next generation
+ repository, Mylar integrates deeply with Bugzilla and JIRA, and can be
+ extended to any other task/bug/issue repository, and integrates with CVS
+ and Subclipse for source repositories.</li>
+ <li><b>Jazz provides many additional features</b>.&nbsp; While the Mylar
+ project is focused on Eclipse SDK integration and personal productivity,
+ Jazz provides additional features for instant messaging style
+ communication similar to <a href="http://eclipse.org/ecf">ECF</a>, as
+ well as planning and project health support similar to the web-based
+ <a href="http://www.sdmagazine.com/jolts/">project management tools</a>.</li>
+ </ul>
+ <p>
+ &nbsp;</p>
<p>&nbsp;</p>
</body></html> \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/planner/ui/TaskPlannerEditorPart.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/planner/ui/TaskPlannerEditorPart.java
index c93b5ccdf..868c592df 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/planner/ui/TaskPlannerEditorPart.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/planner/ui/TaskPlannerEditorPart.java
@@ -43,15 +43,14 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.ViewerDropAdapter;
-import org.eclipse.mylar.internal.core.dt.MylarWebRef;
import org.eclipse.mylar.internal.core.util.DateUtil;
import org.eclipse.mylar.internal.core.util.MylarStatusHandler;
import org.eclipse.mylar.internal.tasklist.ui.ComboSelectionDialog;
import org.eclipse.mylar.internal.tasklist.ui.views.TaskListView;
import org.eclipse.mylar.provisional.tasklist.AbstractQueryHit;
import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryQuery;
-import org.eclipse.mylar.provisional.tasklist.ITask;
import org.eclipse.mylar.provisional.tasklist.AbstractTaskContainer;
+import org.eclipse.mylar.provisional.tasklist.ITask;
import org.eclipse.mylar.provisional.tasklist.ITaskListElement;
import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
import org.eclipse.mylar.provisional.tasklist.TaskCategory;
@@ -528,7 +527,6 @@ public class TaskPlannerEditorPart extends EditorPart {
});
}
- @MylarWebRef(name = "Drag and drop article", url = "http://www.eclipse.org/articles/Article-Workbench-DND/drag_drop.html")
private void initDrop(final TableViewer tableViewer, final PlannedTasksContentProvider contentProvider) {
Transfer[] types = new Transfer[] { TextTransfer.getInstance() };
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskActivityView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskActivityView.java
index 426afabde..011042a52 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskActivityView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskActivityView.java
@@ -32,7 +32,6 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.ViewerDropAdapter;
-import org.eclipse.mylar.internal.core.dt.MylarWebRef;
import org.eclipse.mylar.internal.tasklist.planner.ui.ReminderCellEditor;
import org.eclipse.mylar.internal.tasklist.ui.TaskListColorsAndFonts;
import org.eclipse.mylar.internal.tasklist.ui.actions.OpenTaskListElementAction;
@@ -273,7 +272,6 @@ public class TaskActivityView extends ViewPart {
}
- @MylarWebRef(name = "Drag and drop article", url = "http://www.eclipse.org/articles/Article-Workbench-DND/drag_drop.html")
private void initDrop() {
Transfer[] types = new Transfer[] { TextTransfer.getInstance() };
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskListView.java
index 3e6366b64..01cf1922e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/views/TaskListView.java
@@ -42,7 +42,6 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TextCellEditor;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.window.Window;
-import org.eclipse.mylar.internal.core.dt.MylarWebRef;
import org.eclipse.mylar.internal.core.util.MylarStatusHandler;
import org.eclipse.mylar.internal.tasklist.TaskListPreferenceConstants;
import org.eclipse.mylar.internal.tasklist.ui.AbstractTaskListFilter;
@@ -909,7 +908,6 @@ public class TaskListView extends ViewPart {
}
}
- @MylarWebRef(name = "Drag and drop article", url = "http://www.eclipse.org/articles/Article-Workbench-DND/drag_drop.html")
private void initDragAndDrop(Composite parent) {
Transfer[] types = new Transfer[] { TextTransfer.getInstance(), PluginTransfer.getInstance() };
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextAttachWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextAttachWizard.java
new file mode 100644
index 000000000..98c27151d
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextAttachWizard.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2004 - 2006 University Of British Columbia 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:
+ * University Of British Columbia - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylar.internal.tasklist.ui.wizards;
+
+import java.io.IOException;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryTask;
+import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
+import org.eclipse.mylar.provisional.tasklist.TaskRepository;
+
+/**
+ * @author Rob Elves
+ */
+public class ContextAttachWizard extends Wizard {
+
+ public static final String WIZARD_TITLE = "Attach Context";
+ private final TaskRepository repository;
+ private final AbstractRepositoryTask task;
+ private ContextAttachWizardPage wizardPage;
+
+ public ContextAttachWizard(AbstractRepositoryTask task) {
+ repository = MylarTaskListPlugin.getRepositoryManager().getRepository(
+ task.getRepositoryKind(), task.getRepositoryUrl());
+ this.task = task;
+// init();
+ }
+
+ @Override
+ public void addPages() {
+ wizardPage = new ContextAttachWizardPage(repository, task);
+ addPage(wizardPage);
+ super.addPages();
+ }
+
+ @Override
+ public final boolean performFinish() {
+
+ AbstractRepositoryConnector connector = MylarTaskListPlugin.getRepositoryManager().getRepositoryConnector(
+ this.repository.getKind());
+
+ try {
+ if (connector.attachContext(repository, task, wizardPage.getComment())) {
+
+ MessageDialog.openInformation(null, "Context Attachment",
+ "Attachment of task context was successful.\n Attached to: " + task.getDescription());
+ } else {
+ MessageDialog.openError(null, "Context Attachment", "Attachment of task context FAILED. See error log for details.");
+ }
+ } catch (IOException e) {
+ MessageDialog.openError(null, "Context Attachment", "Attachment of task context FAILED.\n"+e.getMessage());
+ }
+
+ return true;
+ }
+
+// public void init(IWorkbench workbench, IStructuredSelection selection) {
+// }
+
+// private void init() {
+//// super.setForcePreviousAndNextButtons(true);
+// }
+
+}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextAttachWizardPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextAttachWizardPage.java
new file mode 100644
index 000000000..67a7ae67d
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextAttachWizardPage.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2004 - 2006 University Of British Columbia 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:
+ * University Of British Columbia - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylar.internal.tasklist.ui.wizards;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryTask;
+import org.eclipse.mylar.provisional.tasklist.TaskRepository;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Rob Elves
+ */
+public class ContextAttachWizardPage extends WizardPage {
+
+ private TaskRepository repository;
+ private AbstractRepositoryTask task;
+ private Text commentText;
+ private Form form;
+
+ protected ContextAttachWizardPage(TaskRepository repository, AbstractRepositoryTask task) {
+ super(ContextAttachWizard.WIZARD_TITLE);
+ this.repository = repository;
+ this.task = task;
+ }
+
+ public void createControl(Composite parent) {
+ FormToolkit toolkit = new FormToolkit(parent.getDisplay());
+ form = toolkit.createForm(parent);
+ form.getBody().setLayout(new GridLayout(1, false));
+ toolkit.createLabel(form.getBody(), "Task: "+task.getDescription());
+ toolkit.createLabel(form.getBody(), "Repository: "+repository.getUrl());
+ toolkit.createLabel(form.getBody(), "Enter comment below:");
+
+ commentText = toolkit.createText(form.getBody(),"", SWT.MULTI | SWT.V_SCROLL
+ | SWT.WRAP);
+
+ commentText.addKeyListener(new KeyListener(){
+ public void keyPressed(KeyEvent e) {
+ getWizard().getContainer().updateButtons();
+ }
+
+ public void keyReleased(KeyEvent e) {
+ getWizard().getContainer().updateButtons();
+ }
+ });
+
+ commentText.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ toolkit.paintBordersFor(form.getBody());
+
+ setControl(form.getBody());
+ }
+
+ public String getComment() {
+ return commentText.getText();
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ if(commentText.getText().equals("")) return false;
+ return super.isPageComplete();
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextRetrieveWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextRetrieveWizard.java
new file mode 100644
index 000000000..318863f96
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextRetrieveWizard.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2004 - 2006 University Of British Columbia 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:
+ * University Of British Columbia - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylar.internal.tasklist.ui.wizards;
+
+import java.io.IOException;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryTask;
+import org.eclipse.mylar.provisional.tasklist.IRemoteContextDelegate;
+import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
+import org.eclipse.mylar.provisional.tasklist.TaskRepository;
+
+/**
+ * @author Rob Elves
+ */
+public class ContextRetrieveWizard extends Wizard {
+
+ public static final String WIZARD_TITLE = "Retrieve Context";
+
+ private final TaskRepository repository;
+
+ private final AbstractRepositoryTask task;
+
+ private ContextRetrieveWizardPage wizardPage;
+
+ public ContextRetrieveWizard(AbstractRepositoryTask task) {
+ repository = MylarTaskListPlugin.getRepositoryManager().getRepository(task.getRepositoryKind(),
+ task.getRepositoryUrl());
+ this.task = task;
+ }
+
+ @Override
+ public void addPages() {
+ wizardPage = new ContextRetrieveWizardPage(repository, task);
+ addPage(wizardPage);
+ super.addPages();
+ }
+
+ @Override
+ public final boolean performFinish() {
+
+ IRemoteContextDelegate delegate = wizardPage.getSelectedContext();
+ AbstractRepositoryConnector connector = MylarTaskListPlugin.getRepositoryManager().getRepositoryConnector(
+ this.repository.getKind());
+ try {
+ if (connector.retrieveContext(repository, task, delegate)) {
+
+ MessageDialog.openInformation(null, "Context Retrieval", "Task context was successfully retrieved.");
+ } else {
+ MessageDialog.openError(null, "Context Retrieval",
+ "Retrieval of task context FAILED. See error log for details.");
+ }
+ } catch (IOException e) {
+ MessageDialog.openError(null, "Context Retrieval", "Retrieval of task context FAILED.\n" + e.getMessage());
+ }
+ return true;
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextRetrieveWizardPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextRetrieveWizardPage.java
new file mode 100644
index 000000000..e04650585
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasklist/ui/wizards/ContextRetrieveWizardPage.java
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2004 - 2006 University Of British Columbia 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:
+ * University Of British Columbia - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylar.internal.tasklist.ui.wizards;
+
+import java.text.DateFormat;
+import java.util.Set;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector;
+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryTask;
+import org.eclipse.mylar.provisional.tasklist.IRemoteContextDelegate;
+import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin;
+import org.eclipse.mylar.provisional.tasklist.TaskRepository;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Rob Elves
+ */
+public class ContextRetrieveWizardPage extends WizardPage {
+
+ private static final String COLUMN_COMMENT = "Comment";
+
+ private static final String COLUMN_AUTHOR = "Author";
+
+ private static final String COLUMN_DATE = "Date";
+
+ private TaskRepository repository;
+
+ private AbstractRepositoryTask task;
+
+ private Form form;
+
+ private IRemoteContextDelegate selectedContext = null;
+
+ protected ContextRetrieveWizardPage(TaskRepository repository, AbstractRepositoryTask task) {
+ super(ContextAttachWizard.WIZARD_TITLE);
+ this.repository = repository;
+ this.task = task;
+ }
+
+ public void createControl(Composite parent) {
+ FormToolkit toolkit = new FormToolkit(parent.getDisplay());
+ form = toolkit.createForm(parent);
+ form.getBody().setLayout(new GridLayout(1, false));
+ toolkit.createLabel(form.getBody(), "Task: " + task.getDescription());
+ toolkit.createLabel(form.getBody(), "Repository: " + repository.getUrl());
+ toolkit.createLabel(form.getBody(), "Select context below:");
+ final Table contextTable = toolkit.createTable(form.getBody(), SWT.FULL_SELECTION | SWT.SINGLE | SWT.V_SCROLL);
+ contextTable.setHeaderVisible(true);
+ contextTable.setLinesVisible(true);
+ contextTable.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ if (contextTable.getSelectionIndex() > -1) {
+ selectedContext = (IRemoteContextDelegate) contextTable.getItem(contextTable.getSelectionIndex())
+ .getData();
+ getWizard().getContainer().updateButtons();
+ }
+ }
+ });
+
+ AbstractRepositoryConnector connector = MylarTaskListPlugin.getRepositoryManager().getRepositoryConnector(
+ repository.getKind());
+
+ Set<IRemoteContextDelegate> contextDelegates = connector.getAvailableContexts(repository, task);
+ TableColumn[] columns = new TableColumn[3];
+
+ columns[0] = new TableColumn(contextTable, SWT.LEFT);
+ columns[0].setText(COLUMN_DATE);
+
+ columns[1] = new TableColumn(contextTable, SWT.LEFT);
+ columns[1].setText(COLUMN_AUTHOR);
+
+ columns[2] = new TableColumn(contextTable, SWT.CENTER);
+ columns[2].setText(COLUMN_COMMENT);
+
+ for (IRemoteContextDelegate delegate : contextDelegates) {
+ TableItem item = new TableItem(contextTable, SWT.NONE);
+ item.setText(0, DateFormat.getDateInstance(DateFormat.MEDIUM).format(delegate.getDate()));
+ item.setText(1, delegate.getAuthor());
+ item.setText(2, delegate.getComment());
+ item.setData(delegate);
+ }
+
+ for (int i = 0, n = columns.length; i < n; i++) {
+ columns[i].pack();
+ }
+
+ GridData tableLayoutData = new GridData(GridData.FILL_BOTH);
+ contextTable.setLayoutData(tableLayoutData);
+ toolkit.paintBordersFor(form.getBody());
+ setControl(form.getBody());
+ }
+
+ public IRemoteContextDelegate getSelectedContext() {
+ return selectedContext;
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ if(selectedContext == null) return false;
+ return super.isPageComplete();
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/AbstractRepositoryConnector.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/AbstractRepositoryConnector.java
index b79ed40fa..7d9d63ad0 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/AbstractRepositoryConnector.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/AbstractRepositoryConnector.java
@@ -11,6 +11,7 @@
package org.eclipse.mylar.provisional.tasklist;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
@@ -48,6 +49,8 @@ import org.eclipse.ui.progress.IProgressConstants;
* @author Mik Kersten
*/
public abstract class AbstractRepositoryConnector {
+
+ public static final String MYLAR_CONTEXT_DESCRIPTION = "mylar/context/xml";
private static final int MAX_REFRESH_JOBS = 5;
@@ -64,7 +67,13 @@ public abstract class AbstractRepositoryConnector {
public abstract boolean canCreateTaskFromId();
public abstract boolean canCreateNewTask();
-
+
+ public abstract boolean attachContext(TaskRepository repository, AbstractRepositoryTask task, String longComment) throws IOException;
+
+ public abstract Set<IRemoteContextDelegate> getAvailableContexts(TaskRepository repository, AbstractRepositoryTask task);
+
+ public abstract boolean retrieveContext(TaskRepository repository, AbstractRepositoryTask task, IRemoteContextDelegate remoteContextDelegate) throws IOException;
+
private class SynchronizeTaskJob extends Job {
private AbstractRepositoryTask repositoryTask;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/IRemoteContextDelegate.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/IRemoteContextDelegate.java
new file mode 100644
index 000000000..0ca1ea5ba
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/provisional/tasklist/IRemoteContextDelegate.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2004 - 2006 University Of British Columbia 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:
+ * University Of British Columbia - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylar.provisional.tasklist;
+
+import java.util.Date;
+
+/**
+ * @author Rob Elves
+ */
+public interface IRemoteContextDelegate {
+
+ public Date getDate();
+ public String getAuthor();
+ public String getComment();
+
+}

Back to the top