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 52731 Details for
Bug 151602
[Web connector] Support queries that require login
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]
Naive patch that just adds a loginUrl
mylar-sandbox-web-login-patch.txt (text/plain), 6.55 KB, created by
Erkki Lindpere
on 2006-10-26 06:45:28 EDT
(
hide
)
Description:
Naive patch that just adds a loginUrl
Filename:
MIME Type:
Creator:
Erkki Lindpere
Created:
2006-10-26 06:45:28 EDT
Size:
6.55 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylar.sandbox >Index: src/org/eclipse/mylar/internal/sandbox/web/WebQuery.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/sandbox/org.eclipse.mylar.sandbox/src/org/eclipse/mylar/internal/sandbox/web/WebQuery.java,v >retrieving revision 1.3 >diff -u -r1.3 WebQuery.java >--- src/org/eclipse/mylar/internal/sandbox/web/WebQuery.java 20 Jul 2006 10:24:39 -0000 1.3 >+++ src/org/eclipse/mylar/internal/sandbox/web/WebQuery.java 26 Oct 2006 10:46:53 -0000 >@@ -20,14 +20,17 @@ > > private final String regexp; > private final String taskPrefix; >+ private final String loginUrl; > > public WebQuery(String description, String queryUrl, String taskPrefix, String regexp, >- TaskList taskList, String repositoryUrl) { >+ TaskList taskList, String repositoryUrl, String loginUrl) { > super(description, taskList); > this.taskPrefix = taskPrefix; > > this.regexp = regexp; > >+ this.loginUrl = loginUrl; >+ > setUrl(queryUrl); > setRepositoryUrl(repositoryUrl); > } >@@ -44,4 +47,8 @@ > return this.taskPrefix; > } > >+ >+ public String getLoginUrl() { >+ return loginUrl; >+ } > } >Index: src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizardPage.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/sandbox/org.eclipse.mylar.sandbox/src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizardPage.java,v >retrieving revision 1.18 >diff -u -r1.18 WebQueryWizardPage.java >--- src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizardPage.java 25 Oct 2006 21:46:49 -0000 1.18 >+++ src/org/eclipse/mylar/internal/sandbox/web/WebQueryWizardPage.java 26 Oct 2006 10:46:53 -0000 >@@ -63,6 +63,7 @@ > private AbstractRepositoryConnector connector; > private WebQuery query; > private UpdatePreviewJob updatePreviewJob; >+ private Text loginUrlText; > > public WebQueryWizardPage(TaskRepository repository) { > this(repository, null); >@@ -120,6 +121,16 @@ > > new Label(composite, SWT.NONE); > >+ Label loginUrlLabel = new Label(composite, SWT.NONE); >+ loginUrlLabel.setText("Login URL:"); >+ >+ loginUrlText = new Text(composite, SWT.BORDER); >+ loginUrlText.addModifyListener(new ModifyListener() { >+ public void modifyText(final ModifyEvent e) { >+ webPage = null; >+ } >+ }); >+ new Label(composite, SWT.NONE); > Label queryUrlLabel = new Label(composite, SWT.NONE); > queryUrlLabel.setText("URL:"); > >@@ -195,8 +206,9 @@ > String queryUrl = queryUrlText.getText(); > String taskPrefix = taskPrefixText.getText(); > String regexp = regexpText.getText(); >+ String loginUrl = loginUrlText.getText(); > return new WebQuery(description, queryUrl, taskPrefix, regexp, >- TasksUiPlugin.getTaskListManager().getTaskList(), repository.getUrl()); >+ TasksUiPlugin.getTaskListManager().getTaskList(), repository.getUrl(), loginUrl); > } > > synchronized void updatePreview() { >@@ -204,7 +216,7 @@ > updatePreviewJob = new UpdatePreviewJob("Updating preview"); > updatePreviewJob.setPriority(Job.DECORATE); > } >- updatePreviewJob.setParams(queryUrlText.getText(), regexpText.getText()); >+ updatePreviewJob.setParams(queryUrlText.getText(), regexpText.getText(), loginUrlText.getText()); > if(!updatePreviewJob.isActive()) { > updatePreviewJob.schedule(); > } >@@ -246,6 +258,7 @@ > private final class UpdatePreviewJob extends Job { > private volatile String url; > private volatile String regexp; >+ private volatile String loginUrl; > private volatile boolean active = false; > > private UpdatePreviewJob(String name) { >@@ -256,9 +269,10 @@ > return active; > } > >- public void setParams(String url, String regexp) { >+ public void setParams(String url, String regexp, String loginUrl) { > this.url = url; > this.regexp = regexp; >+ this.loginUrl = loginUrl; > } > > protected IStatus run(IProgressMonitor monitor) { >@@ -270,7 +284,7 @@ > final List<AbstractQueryHit> queryHits = new ArrayList<AbstractQueryHit>(); > try { > if(webPage==null) { >- webPage = WebRepositoryConnector.fetchResource(currentUrl, repository.getUserName(), repository.getPassword()); >+ webPage = WebRepositoryConnector.fetchResource(currentUrl, repository.getUserName(), repository.getPassword(), loginUrl); > } > > QueryHitCollector collector = new QueryHitCollector(TasksUiPlugin.getTaskListManager().getTaskList()) { >Index: src/org/eclipse/mylar/internal/sandbox/web/WebRepositoryConnector.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/sandbox/org.eclipse.mylar.sandbox/src/org/eclipse/mylar/internal/sandbox/web/WebRepositoryConnector.java,v >retrieving revision 1.30 >diff -u -r1.30 WebRepositoryConnector.java >--- src/org/eclipse/mylar/internal/sandbox/web/WebRepositoryConnector.java 25 Oct 2006 21:46:49 -0000 1.30 >+++ src/org/eclipse/mylar/internal/sandbox/web/WebRepositoryConnector.java 26 Oct 2006 10:46:53 -0000 >@@ -137,6 +137,7 @@ > IProgressMonitor monitor, QueryHitCollector resultCollector) { > if (query instanceof WebQuery) { > String queryUrl = query.getUrl(); >+ String loginUrl = ((WebQuery) query).getLoginUrl(); > String regexp = ((WebQuery) query).getRegexp(); > String taskPrefix = ((WebQuery) query).getTaskPrefix(); > String repositoryUrl = query.getRepositoryUrl(); >@@ -145,7 +146,7 @@ > > try { > // if (regexp != null && regexp.trim().length() > 0) { >- return performQuery(fetchResource(queryUrl, repositoryUser, repositoryPassword), regexp, >+ return performQuery(fetchResource(queryUrl, repositoryUser, repositoryPassword, loginUrl), regexp, > taskPrefix, repositoryUrl, monitor, resultCollector); > // } else { > // return performRssQuery(queryUrl, taskPrefix, repositoryUrl, repositoryUser, repositoryPassword, >@@ -269,11 +270,17 @@ > } > */ > >- public static String fetchResource(String url, String user, String password) throws IOException { >+ public static String fetchResource(String url, String user, String password, String loginUrl) throws IOException { > HttpClient client = new HttpClient(); > Proxy proxySettings = TasksUiPlugin.getDefault().getProxySettings(); > WebClientUtil.setupHttpClient(client, proxySettings, url, user, password); > >+ GetMethod getLogin = new GetMethod(loginUrl); >+ try { >+ client.executeMethod(getLogin); >+ } catch (Exception e) { >+ // TODO: handle exception >+ } > GetMethod get = new GetMethod(url); > try { > client.executeMethod(get);
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 151602
:
52731
|
52732
|
52749
|
52821
|
52824
|
52838
|
54090
|
54115
|
54116
|
54122
|
54124
|
54125
|
54126
|
54128
|
54277
|
54288
|
54299
|
54456
|
54457