Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mylyn » [Own Connector] Prompt for password?
icon3.gif  [Own Connector] Prompt for password? [message #492741] Wed, 21 October 2009 15:07 Go to next message
Thomas SZADEL is currently offline Thomas SZADEL
Messages: 36
Registered: July 2009
Member
Hi all!

Is their a possibility to ask the user to enter his login/password if the authentification fails (or if he did't checked the "Save Password" in the Repository settings) ?

Thanks!

[Updated on: Wed, 21 October 2009 15:07]

Report message to a moderator

Re: [Own Connector] Prompt for password? [message #492797 is a reply to message #492741] Wed, 21 October 2009 17:57 Go to previous messageGo to next message
Peter Stibrany is currently offline Peter Stibrany
Messages: 37
Registered: July 2009
Member
Yes, you can. Instead of creating TaskRepositoryLocation, use
TaskRepositoryLocationUi (created by TaskRepositoryLocationUiFactory),
which implements dialog like this in its requestCredentials method.

-Peter

Thomas SZADEL wrote:
> Hi all!
>
> Is their a possibility to ask the user to enter his login/password if
> the authentification fails (or if he did't check the "Save Password" in
> the Repository settings) ?
>
> Thanks!
Re: [Own Connector] Prompt for password? [message #492878 is a reply to message #492797] Thu, 22 October 2009 08:13 Go to previous messageGo to next message
Thomas SZADEL is currently offline Thomas SZADEL
Messages: 36
Registered: July 2009
Member
Thanks Peter for your answer, but it's in the internal part of tasks.ui (org.eclipse.mylyn.internal.tasks.ui)... so the access is restricted Sad

By the way, I think it should be a mylyn feature (so maybe I should open a feature request)?! According to me, we need a specific exception (such as CredentialsException) that can be thrown by the performQuery method and than leads to the opening of a login / password dialog (as it is done in the eclipse team plugin for instance)
Re: [Own Connector] Prompt for password? [message #492885 is a reply to message #492878] Thu, 22 October 2009 08:38 Go to previous messageGo to next message
Peter Stibrany is currently offline Peter Stibrany
Messages: 37
Registered: July 2009
Member
Hello Thomas,

you can still use it through TaskRepositoryLocation interface, which is public and contains this method. You simply need to replace TaskRepositoryLocationFactory with TaskRepositoryLocationUiFactory, and you'll get TaskRepositoryUiLocation. When you call requestCredentials method, you won't get unsupported operation, but dialog which asks for credentials. Take a look at how other connectors use it. I use it in Foglyn, and it works for me.

-Peter
Re: [Own Connector] Prompt for password? [message #492913 is a reply to message #492885] Thu, 22 October 2009 10:59 Go to previous messageGo to next message
Thomas SZADEL is currently offline Thomas SZADEL
Messages: 36
Registered: July 2009
Member
Great it works Razz Thanks!

... but I needed to add an UI dependency in my core plugin (as I didn't found any relevant listener)...
Re: [Own Connector] Prompt for password? [message #492919 is a reply to message #492913] Thu, 22 October 2009 11:30 Go to previous messageGo to next message
Peter Stibrany is currently offline Peter Stibrany
Messages: 37
Registered: July 2009
Member
What I do (if I remember correctly Wink) is to initialize my location factory reference to standard factory, and when my UI plugin starts, it reinitializes factory reference to UI factory (I am using final AtomicReference<TaskRepositoryLocation> for this). This way my core plugin doesn't need to depend on UI plugin.

-Peter
Re: [Own Connector] Prompt for password? [message #492926 is a reply to message #492919] Thu, 22 October 2009 11:52 Go to previous messageGo to next message
Thomas SZADEL is currently offline Thomas SZADEL
Messages: 36
Registered: July 2009
Member
Great :!::!: That's it!

Using the org.eclipse.ui.startup extension point in the UI plugin, I can inject an UI class in the core Smile

Thank you very much Very Happy
Re: [Own Connector] Prompt for password? [message #493065 is a reply to message #492926] Thu, 22 October 2009 22:41 Go to previous messageGo to next message
Steffen Pingel is currently offline Steffen Pingel
Messages: 706
Registered: July 2009
Senior Member
Thomas, please feel free to file an enhancement request to provide a simpler
way to access TaskRepositoryLocationUiFactory from connector cores e.g.
through an extension point. It's a common requirement for connectors.

Steffen


> Great :!::!: That's it!
>
> Using the org.eclipse.ui.startup extension point in the UI plugin, I can
> inject an UI class in the core :)
>
> Thank you very much :d

--
Steffen Pingel
Committer, http://eclipse.org/mylyn
Senior Developer, http://tasktop.com
Re: [Own Connector] Prompt for password? [message #493137 is a reply to message #493065] Fri, 23 October 2009 10:57 Go to previous messageGo to next message
Thomas SZADEL is currently offline Thomas SZADEL
Messages: 36
Registered: July 2009
Member
Done.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=293152
Re: [Own Connector] Prompt for password? [message #599811 is a reply to message #492797] Thu, 22 October 2009 08:13 Go to previous messageGo to next message
Thomas SZADEL is currently offline Thomas SZADEL
Messages: 36
Registered: July 2009
Member
Thanks Peter for your answer, but it's in the internal part of tasks.ui (org.eclipse.mylyn.internal.tasks.ui)... so the access is restricted :(

By the way, I think it should be a mylyn feature (so maybe I should open a feature request)?! According to me, we need a specific exception (such as CredentialsException) that can be thrown by the performQuery method and than leads to the opening of a login / password dialog (as it is done in the eclipse team plugin for instance)
Re: [Own Connector] Prompt for password? [message #599816 is a reply to message #599811] Thu, 22 October 2009 08:38 Go to previous messageGo to next message
Peter Stibrany is currently offline Peter Stibrany
Messages: 37
Registered: July 2009
Member
Hello Thomas,

you can still use it through TaskRepositoryLocation interface, which is public and contains this method. You simply need to replace TaskRepositoryLocationFactory with TaskRepositoryLocationUiFactory, and you'll get TaskRepositoryUiLocation. When you call requestCredentials method, you won't get unsupported operation, but dialog which asks for credentials. Take a look at how other connectors use it. I use it in Foglyn, and it works for me.

-Peter
Re: [Own Connector] Prompt for password? [message #599823 is a reply to message #599816] Thu, 22 October 2009 10:59 Go to previous messageGo to next message
Thomas SZADEL is currently offline Thomas SZADEL
Messages: 36
Registered: July 2009
Member
Great it works :p Thanks!

... but I needed to add an UI dependency in my core plugin (as I didn't found any relevant listener)...
Re: [Own Connector] Prompt for password? [message #599829 is a reply to message #492913] Thu, 22 October 2009 11:30 Go to previous messageGo to next message
Peter Stibrany is currently offline Peter Stibrany
Messages: 37
Registered: July 2009
Member
What I do (if I remember correctly ;)) is to initialize my location factory reference to standard factory, and when my UI plugin starts, it reinitializes factory reference to UI factory (I am using final AtomicReference<TaskRepositoryLocation> for this). This way my core plugin doesn't need to depend on UI plugin.

-Peter
Re: [Own Connector] Prompt for password? [message #599835 is a reply to message #599829] Thu, 22 October 2009 11:53 Go to previous messageGo to next message
Thomas SZADEL is currently offline Thomas SZADEL
Messages: 36
Registered: July 2009
Member
Great :!::!: That's it!

Using the org.eclipse.ui.startup extension point in the UI plugin, I can inject an UI class in the core :)

Thank you very much :d
Re: [Own Connector] Prompt for password? [message #599842 is a reply to message #599835] Thu, 22 October 2009 22:41 Go to previous messageGo to next message
Steffen Pingel is currently offline Steffen Pingel
Messages: 706
Registered: July 2009
Senior Member
Thomas, please feel free to file an enhancement request to provide a simpler
way to access TaskRepositoryLocationUiFactory from connector cores e.g.
through an extension point. It's a common requirement for connectors.

Steffen


> Great :!::!: That's it!
>
> Using the org.eclipse.ui.startup extension point in the UI plugin, I can
> inject an UI class in the core :)
>
> Thank you very much :d

--
Steffen Pingel
Committer, http://eclipse.org/mylyn
Senior Developer, http://tasktop.com
Re: [Own Connector] Prompt for password? [message #599846 is a reply to message #493065] Fri, 23 October 2009 10:57 Go to previous message
Thomas SZADEL is currently offline Thomas SZADEL
Messages: 36
Registered: July 2009
Member
Done.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=293152
Previous Topic:[Own Connector] Prompt for password?
Next Topic:How to access the data of the task list through public API?
Goto Forum:
  


Current Time: Thu Sep 18 05:38:13 GMT 2014

Powered by FUDForum. Page generated in 0.04434 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software