Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 45141 Details for
Bug 145123
Support for generic web-based repositories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
query implementation for web-based provider
mylar.webquery.patch (text/plain), 23.40 KB, created by
Eugene Kuleshov
on 2006-06-22 22:15:32 EDT
(
hide
)
Description:
query implementation for web-based provider
Filename:
MIME Type:
Creator:
Eugene Kuleshov
Created:
2006-06-22 22:15:32 EDT
Size:
23.40 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylar.sandbox >Index: src/org/eclipse/mylar/internal/sandbox/web/WebRepositoryConnector.java >=================================================================== >RCS file: /home/technology/org.eclipse.mylar/sandbox/org.eclipse.mylar.sandbox/src/org/eclipse/mylar/internal/sandbox/web/WebRepositoryConnector.java,v >retrieving revision 1.3 >diff -u -r1.3 WebRepositoryConnector.java >--- src/org/eclipse/mylar/internal/sandbox/web/WebRepositoryConnector.java 16 Jun 2006 23:36:50 -0000 1.3 >+++ src/org/eclipse/mylar/internal/sandbox/web/WebRepositoryConnector.java 23 Jun 2006 02:05:15 -0000 >@@ -11,13 +11,26 @@ > > package org.eclipse.mylar.internal.sandbox.web; > >+import java.io.BufferedReader; >+import java.io.IOException; >+import java.io.InputStream; >+import java.io.InputStreamReader; >+import java.net.URL; >+import java.util.ArrayList; > import java.util.Collections; > import java.util.List; > import java.util.Set; >+import java.util.regex.Matcher; >+import java.util.regex.Pattern; > > import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.MultiStatus; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.jface.window.Window; > import org.eclipse.jface.wizard.IWizard; >+import org.eclipse.jface.wizard.WizardDialog; >+import org.eclipse.mylar.internal.core.util.MylarStatusHandler; > 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; >@@ -30,6 +43,8 @@ > import org.eclipse.mylar.provisional.tasklist.ITask; > import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin; > import org.eclipse.mylar.provisional.tasklist.TaskRepository; >+import org.eclipse.swt.widgets.Shell; >+import org.eclipse.ui.PlatformUI; > > /** > * Generic connector for web based issue tracking systems >@@ -98,12 +113,54 @@ > } > } > >+ for (AbstractRepositoryQuery query : MylarTaskListPlugin.getTaskListManager().getTaskList().getQueries()) { >+ if(query instanceof WebQuery) { >+ WebQuery webQuery = (WebQuery) query; >+ if(url.startsWith(webQuery.getTaskPrefix())) { >+ return webQuery.getRepositoryUrl(); >+ } >+ } >+ } >+ > return null; > } > > public List<AbstractQueryHit> performQuery(AbstractRepositoryQuery query, IProgressMonitor monitor, MultiStatus queryStatus) { >- // TODO >- return null; >+ List<AbstractQueryHit> hits = new ArrayList<AbstractQueryHit>(); >+ >+ if(query instanceof WebQuery) { >+ StringBuffer resource = null; >+ try { >+ resource = fetchResource(query.getQueryUrl()); >+ } catch (IOException ex) { >+ queryStatus.add(new Status(IStatus.OK, MylarTaskListPlugin.PLUGIN_ID, IStatus.OK, >+ "Could not fetch resource: " + query.getQueryUrl(), ex)); >+ } >+ >+ String regexp = ((WebQuery) query).getRegexp(); >+ >+ Pattern p = Pattern.compile(regexp, Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL | Pattern.UNICODE_CASE | Pattern.CANON_EQ); >+ Matcher matcher = p.matcher(resource); >+ >+ if(matcher.find()) { >+ if(matcher.groupCount()<2) { >+ queryStatus.add(new Status(IStatus.OK, MylarTaskListPlugin.PLUGIN_ID, IStatus.OK, >+ "Unable to parse fetched resource. Check query regexp", null)); >+ } else { >+ do { >+ String id = matcher.group(1); >+ String description = matcher.group(2); >+ hits.add(new WebQueryHit(id, description, query.getRepositoryUrl())); >+ } while(matcher.find()); >+ queryStatus.add(Status.OK_STATUS); >+ } >+ } else { >+ queryStatus.add(new Status(IStatus.OK, MylarTaskListPlugin.PLUGIN_ID, IStatus.OK, >+ "Unable to parse fetched resource. Check query regexp", null)); >+ } >+ >+ } >+ return hits; > } > > protected void updateTaskState(AbstractRepositoryTask repositoryTask) { >@@ -140,13 +197,36 @@ > } > > >- public IWizard getNewQueryWizard(TaskRepository repository) { >- // TODO >- return null; >+ public IWizard getNewQueryWizard(TaskRepository taskRepository) { >+ return new WebQueryWizard(taskRepository); > } > > public void openEditQueryDialog(AbstractRepositoryQuery query) { >- // TODO >+ try { >+ TaskRepository repository = MylarTaskListPlugin.getRepositoryManager().getRepository( >+ query.getRepositoryKind(), query.getRepositoryUrl()); >+ if (repository == null) >+ return; >+ >+ IWizard wizard = null; >+ if (query instanceof WebQuery) { >+ wizard = new WebQueryEditWizard(repository, query); >+ } >+ >+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); >+ if (wizard != null && shell != null && !shell.isDisposed()) { >+ WizardDialog dialog = new WizardDialog(shell, wizard); >+ dialog.create(); >+ dialog.setTitle("Edit Web Query"); >+ dialog.setBlockOnOpen(true); >+ if (dialog.open() == Window.CANCEL) { >+ dialog.close(); >+ return; >+ } >+ } >+ } catch (Exception e) { >+ MylarStatusHandler.fail(e, e.getMessage(), true); >+ } > } > > >@@ -165,5 +245,27 @@ > return null; > } > >+ >+ public static StringBuffer fetchResource(String url) throws IOException { >+ URL u = new URL(url); >+ InputStream is = null; >+ try { >+ is = u.openStream(); >+ BufferedReader r = new BufferedReader(new InputStreamReader(is)); >+ >+ StringBuffer resource = new StringBuffer(); >+ String line; >+ while((line = r.readLine())!=null) { >+ resource.append(line).append("\n"); >+ } >+ return resource; >+ >+ } finally { >+ if(is!=null) { >+ is.close(); >+ } >+ } >+ >+ } > } > >Index: src/org/eclipse/mylar/internal/sandbox/web/WebQueryHit.java >=================================================================== >RCS file: src/org/eclipse/mylar/internal/sandbox/web/WebQueryHit.java >diff -N src/org/eclipse/mylar/internal/sandbox/web/WebQueryHit.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylar/internal/sandbox/web/WebQueryHit.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,61 @@ >+/******************************************************************************* >+ * 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.sandbox.web; >+ >+import org.eclipse.mylar.provisional.tasklist.AbstractQueryHit; >+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryTask; >+ >+/** >+ * Represents issue returned by <code>WebQuery</code> >+ * >+ * @author Eugene Kuleshov >+ */ >+public class WebQueryHit extends AbstractQueryHit { >+ >+ private AbstractRepositoryTask task; >+ >+ >+ public WebQueryHit(String id, String description, String repositoryUrl) { >+ super(repositoryUrl, description, Integer.parseInt(id)); >+ } >+ >+ public String getDescription() { >+ return id + ": "+ description; >+ } >+ >+ public String getPriority() { >+ return "?"; >+ } >+ >+ public boolean isCompleted() { >+ return false; >+ } >+ >+ public AbstractRepositoryTask getCorrespondingTask() { >+ return task; >+ } >+ >+ public void setCorrespondingTask(AbstractRepositoryTask task) { >+ this.task = task; >+ } >+ >+ public AbstractRepositoryTask getOrCreateCorrespondingTask() { >+ // TODO >+ return null; >+ } >+ >+ public void setHandleIdentifier(String id) { >+ // TODO >+ } >+ >+} >+ >Index: src/org/eclipse/mylar/internal/sandbox/web/WebQueryEditWizard.java >=================================================================== >RCS file: src/org/eclipse/mylar/internal/sandbox/web/WebQueryEditWizard.java >diff -N src/org/eclipse/mylar/internal/sandbox/web/WebQueryEditWizard.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylar/internal/sandbox/web/WebQueryEditWizard.java 1 Jan 1970 00:00:00 -0000 >@@ -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.sandbox.web; >+ >+import org.eclipse.mylar.internal.tasklist.ui.wizards.AbstractEditQueryWizard; >+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector; >+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryQuery; >+import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin; >+import org.eclipse.mylar.provisional.tasklist.TaskRepository; >+ >+public class WebQueryEditWizard extends AbstractEditQueryWizard { >+ >+ private WebQueryWizardPage queryPage; >+ >+ public WebQueryEditWizard(TaskRepository repository, AbstractRepositoryQuery query) { >+ super(repository, query); >+ setForcePreviousAndNextButtons(true); >+ } >+ >+ @Override >+ public void addPages() { >+ queryPage = new WebQueryWizardPage(repository, (WebQuery) query); >+ queryPage.setWizard(this); >+ addPage(queryPage); >+ } >+ >+ @Override >+ public boolean performFinish() { >+ >+ AbstractRepositoryQuery q = queryPage.getQuery(); >+ if (q != null) { >+ >+// String name; >+// if (q instanceof JiraRepositoryQuery) { >+// name = ((JiraRepositoryQuery) q).getNamedFilter().getName(); >+// } else { >+// name = ((JiraCustomQuery) query).getFilterDefinition().getName(); >+// } >+ >+ MylarTaskListPlugin.getTaskListManager().getTaskList().deleteQuery(query); >+ MylarTaskListPlugin.getTaskListManager().getTaskList().addQuery(q); >+ >+ AbstractRepositoryConnector connector = MylarTaskListPlugin.getRepositoryManager().getRepositoryConnector(repository.getKind()); >+ if (connector != null) { >+ connector.synchronize(q, null); >+ } >+// filter.refreshHits(); >+ } >+ >+ return true; >+ } >+ >+ @Override >+ public boolean canFinish() { >+ if(queryPage.getNextPage() == null) { >+ return queryPage.isPageComplete(); >+ } >+ return queryPage.getNextPage().isPageComplete(); >+ } >+} >+ >Index: src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizardPage.java >=================================================================== >RCS file: src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizardPage.java >diff -N src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizardPage.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizardPage.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,213 @@ >+/******************************************************************************* >+ * 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.sandbox.web; >+ >+import java.util.regex.Matcher; >+import java.util.regex.Pattern; >+ >+import org.eclipse.jface.wizard.WizardPage; >+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryQuery; >+import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin; >+import org.eclipse.mylar.provisional.tasklist.TaskRepository; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.custom.SashForm; >+import org.eclipse.swt.events.ModifyEvent; >+import org.eclipse.swt.events.ModifyListener; >+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.Button; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Label; >+import org.eclipse.swt.widgets.Table; >+import org.eclipse.swt.widgets.TableColumn; >+import org.eclipse.swt.widgets.TableItem; >+import org.eclipse.swt.widgets.Text; >+ >+/** >+ * >+ * Subclipse (IssueZilla) >+ * url: http://subclipse.tigris.org/issues/buglist.cgi?issue_status=NEW;issue_status=STARTED;issue_status=REOPENED&order=issues.issue_id >+ * regexp: <a href="show_bug.cgi\?id\=(.+?)">.+?<span class="summary">(.+?)</span> >+ * task prefix: http://subclipse.tigris.org/issues/show_bug.cgi?id= >+ * >+ * ASM (GForge) >+ * url: http://forge.objectweb.org/tracker/?group_id=23&atid=350023 >+ * regexp: <a class="tracker" href="/tracker/index.php\?func=detail&aid=(.+?)&group_id=23&atid=350023">(.+?)</a></td> >+ * task prefix: http://forge.objectweb.org/tracker/index.php?func=detail&group_id=23&atid=350023&aid= >+ * >+ * @author Eugene Kuleshov >+ */ >+public class WebQueryWizardPage extends WizardPage { >+ private Text taskPrefixText; >+ private Text descriptionText; >+ private Text queryUrlText; >+ private Text regexpText; >+ private Table previewTable; >+ >+ private StringBuffer webPage; >+ >+ private TaskRepository repository; >+ private WebQuery query; >+ >+ public WebQueryWizardPage(TaskRepository repository) { >+ this(repository, null); >+ } >+ >+ public WebQueryWizardPage(TaskRepository repository, WebQuery query) { >+ super("New web query"); >+ this.repository = repository; >+ this.query = query; >+ >+ setTitle("Create web query"); >+ setDescription("http://subclipse.tigris.org/issues/buglist.cgi?issue_status=NEW;issue_status=STARTED;issue_status=REOPENED&order=issues.issue_id\n" + >+ "<a href=\"show_bug.cgi\\?id\\=(.+?)\">.+?<span class=\"summary\">(.+?)</span>"); >+ } >+ >+ public void createControl(Composite parent) { >+ SashForm sashForm = new SashForm(parent, SWT.VERTICAL); >+ >+ Composite composite = new Composite(sashForm, SWT.NONE); >+ GridLayout gridLayout = new GridLayout(); >+ gridLayout.numColumns = 3; >+ composite.setLayout(gridLayout); >+ >+ Label descriptionLabel = new Label(composite, SWT.NONE); >+ descriptionLabel.setLayoutData(new GridData()); >+ descriptionLabel.setText("Description:"); >+ >+ descriptionText = new Text(composite, SWT.BORDER); >+ descriptionText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); >+ new Label(composite, SWT.NONE); >+ >+ Label queryUrlLabel = new Label(composite, SWT.NONE); >+ queryUrlLabel.setText("URL:"); >+ >+ queryUrlText = new Text(composite, SWT.BORDER); >+ queryUrlText.addModifyListener(new ModifyListener() { >+ public void modifyText(final ModifyEvent e) { >+ webPage = null; >+ } >+ }); >+ queryUrlText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); >+ >+ Button preview = new Button(composite, SWT.NONE); >+ preview.setText("Preview"); >+ preview.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(final SelectionEvent e) { >+ updatePreview(); >+ } >+ }); >+ >+ Label taskPrefixLabel = new Label(composite, SWT.NONE); >+ taskPrefixLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false)); >+ taskPrefixLabel.setText("Task prefix:"); >+ >+ taskPrefixText = new Text(composite, SWT.BORDER); >+ taskPrefixText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); >+ new Label(composite, SWT.NONE); >+ >+ Label regexpLabel = new Label(composite, SWT.NONE); >+ regexpLabel.setText("Regexp:"); >+ regexpLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, true)); >+ >+ regexpText = new Text(composite, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER); >+ GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); >+ gridData.heightHint = 39; >+ regexpText.setLayoutData(gridData); >+ regexpText.addModifyListener(new ModifyListener() { >+ public void modifyText(final ModifyEvent e) { >+ if(webPage!=null) { >+ updatePreview(); >+ } >+ } >+ }); >+ >+ previewTable = new Table(sashForm, SWT.BORDER); >+ previewTable.setLinesVisible(true); >+ previewTable.setHeaderVisible(true); >+ >+ TableColumn colId = new TableColumn(previewTable, SWT.NONE); >+ colId.setWidth(100); >+ colId.setText("Id"); >+ >+ TableColumn colDescription = new TableColumn(previewTable, SWT.NONE); >+ colDescription.setWidth(328); >+ colDescription.setText("Description"); >+ >+ setControl(sashForm); >+ >+ if(query!=null) { >+ descriptionText.setText(query.getDescription()); >+ queryUrlText.setText(query.getQueryUrl()); >+ taskPrefixText.setText(query.getTaskPrefix()); >+ regexpText.setText(query.getRegexp()); >+ } >+ new Label(composite, SWT.NONE); >+ sashForm.setWeights(new int[] {123, 166 }); >+ } >+ >+ public AbstractRepositoryQuery getQuery() { >+ String description = descriptionText.getText(); >+ String queryUrl = queryUrlText.getText(); >+ String taskPrefix = taskPrefixText.getText(); >+ String regexp = regexpText.getText(); >+ return new WebQuery(description, queryUrl, taskPrefix, regexp, >+ MylarTaskListPlugin.getTaskListManager().getTaskList(), repository.getUrl()); >+ } >+ >+ // TODO run asynchronously >+ synchronized void updatePreview() { >+ String regexp = regexpText.getText(); >+ try { >+ Pattern p = Pattern.compile(regexp, Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL | Pattern.UNICODE_CASE | Pattern.CANON_EQ); >+ Matcher matcher = p.matcher(getWebPage()); >+ >+ previewTable.removeAll(); >+ >+ while(matcher.find()) { >+ if(matcher.groupCount()>0) { >+ TableItem item = new TableItem(previewTable, SWT.NONE); >+ for (int i = 0; i < matcher.groupCount(); i++) { >+ item.setText(i, matcher.group(i+1)); >+ } >+ } >+ >+ if(matcher.groupCount()<2) { >+ setErrorMessage("Require two matching groups (id and description)"); >+ setPageComplete(false); >+ } else { >+ setErrorMessage(null); >+ setPageComplete(true); >+ } >+ } >+ >+ } catch(Exception ex) { >+ setErrorMessage("Parsing error: "+ex.getMessage()); >+ setPageComplete(false); >+ } >+ } >+ >+ private StringBuffer getWebPage() { >+ if(webPage==null) { >+ try { >+ webPage = WebRepositoryConnector.fetchResource(queryUrlText.getText()); >+ } catch(Exception ex) { >+ setErrorMessage("Unable to fetch resource: "+ex.getMessage()); >+ setPageComplete(false); >+ } >+ } >+ return webPage; >+ } >+ >+} >Index: src/org/eclipse/mylar/internal/sandbox/web/WebQuery.java >=================================================================== >RCS file: src/org/eclipse/mylar/internal/sandbox/web/WebQuery.java >diff -N src/org/eclipse/mylar/internal/sandbox/web/WebQuery.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylar/internal/sandbox/web/WebQuery.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,50 @@ >+/******************************************************************************* >+ * 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.sandbox.web; >+ >+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryQuery; >+import org.eclipse.mylar.provisional.tasklist.TaskList; >+ >+/** >+ * Represents regexp-based query on repository web page >+ * >+ * @author Eugene Kuleshov >+ */ >+public class WebQuery extends AbstractRepositoryQuery { >+ >+ private final String regexp; >+ private final String taskPrefix; >+ >+ public WebQuery(String description, String queryUrl, String taskPrefix, String regexp, >+ TaskList taskList, String repositoryUrl) { >+ super(description, taskList); >+ this.taskPrefix = taskPrefix; >+ >+ this.regexp = regexp; >+ >+ setQueryUrl(queryUrl); >+ setRepositoryUrl(repositoryUrl); >+ } >+ >+ public String getRepositoryKind() { >+ return WebRepositoryConnector.REPOSITORY_TYPE; >+ } >+ >+ public String getRegexp() { >+ return this.regexp; >+ } >+ >+ public String getTaskPrefix() { >+ return this.taskPrefix; >+ } >+ >+} >Index: src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizard.java >=================================================================== >RCS file: src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizard.java >diff -N src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizard.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizard.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,72 @@ >+/******************************************************************************* >+ * 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.sandbox.web; >+ >+import org.eclipse.jface.wizard.Wizard; >+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryConnector; >+import org.eclipse.mylar.provisional.tasklist.AbstractRepositoryQuery; >+import org.eclipse.mylar.provisional.tasklist.MylarTaskListPlugin; >+import org.eclipse.mylar.provisional.tasklist.TaskRepository; >+ >+/** >+ * Wizard used to create query for web based connector >+ * >+ * @author Eugene Kuleshov >+ */ >+public class WebQueryWizard extends Wizard { >+ >+ private static final String TITLE = "New Web Query"; >+ >+ private final TaskRepository repository; >+ >+ private WebQueryWizardPage queryPage; >+ >+ public WebQueryWizard(TaskRepository repository) { >+ this.repository = repository; >+ setNeedsProgressMonitor(true); >+ setWindowTitle(TITLE); >+ } >+ >+ @Override >+ public void addPages() { >+ queryPage = new WebQueryWizardPage(repository); >+ queryPage.setWizard(this); >+ addPage(queryPage); >+ } >+ >+ @Override >+ public boolean performFinish() { >+ >+ AbstractRepositoryQuery query = queryPage.getQuery(); >+ if (query != null) { >+ MylarTaskListPlugin.getTaskListManager().getTaskList().addQuery(query); >+ AbstractRepositoryConnector connector = MylarTaskListPlugin.getRepositoryManager().getRepositoryConnector(repository.getKind()); >+ if (connector != null) { >+ connector.synchronize(query, null); >+ } >+// filter.refreshHits(); >+ } >+ >+ return true; >+ } >+ >+ >+ >+ public boolean canFinish() { >+ if(queryPage.getNextPage() == null) { >+ return queryPage.isPageComplete(); >+ } >+ return queryPage.getNextPage().isPageComplete(); >+ } >+ >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 145123
:
44702
|
45141
|
45184
|
45736
|
45811
|
45814
|
45892
|
46105
|
46185
|
46217
|
46219
|
46247
|
46300