Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Newbie question: Login Transition(How to get the Login screen/view to be replaced by the application screen/view)
Newbie question: Login Transition [message #1794450] Thu, 30 August 2018 18:02 Go to next message
Terry Kilshaw is currently offline Terry KilshawFriend
Messages: 11
Registered: July 2009
Junior Member
I have read heaps of the documentation and forum posts and looked at many examples without being able to find the solution. Probably because this is really simple once you know how to do it

When my RAP application starts I show a simple form with Username and Password fields and a Login button.

When that button is clicked I want the login fields to disappear and my main application screen to appear.

How is that done?

thanks,

Terry

Re: Newbie question: Login Transition [message #1794463 is a reply to message #1794450] Thu, 30 August 2018 21:40 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 206
Registered: February 2011
Senior Member
Have your EntryPoint open a shell that contains controls for username and password.
After verification, start your main application.
Re: Newbie question: Login Transition [message #1794471 is a reply to message #1794463] Fri, 31 August 2018 06:09 Go to previous messageGo to next message
Fabrice Teichteil Koenigsbuch is currently offline Fabrice Teichteil KoenigsbuchFriend
Messages: 8
Registered: September 2017
Junior Member
If you are using e4, you can manage the login screen by connecting an application lifecycle hook, see the tutorial here: http://www.vogella.com/tutorials/Eclipse4LifeCycle/article.html

Instead of using the plugin.xml, you can declare your lifecycle hook class when adding your entry point like:

Map<String, String> properties = new HashMap<String, String>();
properties.put(WebClient.PAGE_TITLE, "[your app title]");
properties.put(WebClient.THEME_ID, RWT.DEFAULT_THEME_ID);
application.addEntryPoint("/", new E4EntryPointFactory(E4ApplicationConfig.create("platform:/plugin/[your project name]/Application.e4xmi",
				"bundleclass://[your project name]/[your lifecycle hook class name]")), properties);
Re: Newbie question: Login Transition [message #1794519 is a reply to message #1794463] Fri, 31 August 2018 18:40 Go to previous messageGo to next message
Terry Kilshaw is currently offline Terry KilshawFriend
Messages: 11
Registered: July 2009
Junior Member
Chris,

appreciate your help. Unfortunately I don't understand it. I am pretty new to RAP though I've been programming in Java for years..

You say:

"Have your EntryPoint open a shell that contains controls for username and password.
After verification, start your main application."

The example code that I have starts with:

protected void createContents( Composite oParent )
{
oParent.setLayout( new FillLayout() );
Composite oRoot = new Composite( oParent, SWT.NONE );
....

And then goes on to create the controls for username and password, etc.

How do I "open a shell that contains controls for username and password"?

After verification how do I "start my main application."

A little bit of example code would be greatly appreciated.

thanks,

Terry
Re: Newbie question: Login Transition [message #1794520 is a reply to message #1794471] Fri, 31 August 2018 18:44 Go to previous messageGo to next message
Terry Kilshaw is currently offline Terry KilshawFriend
Messages: 11
Registered: July 2009
Junior Member
Fabrice,

many thanks for your help. I'm very new to RAP so my questions may be quite dumb.

For example, what is e4? Does that refer to a version of Eclipse?

I'm using Eclipse Photon Release (4.8.0).

Or is e4 the name of a product, plugin or addon?

Terry

Re: Newbie question: Login Transition [message #1794561 is a reply to message #1794520] Mon, 03 September 2018 05:47 Go to previous messageGo to next message
Fabrice Teichteil Koenigsbuch is currently offline Fabrice Teichteil KoenigsbuchFriend
Messages: 8
Registered: September 2017
Junior Member
Terry,

e4 refers to Eclipse version 4. The v4 programming model is different than the v3 one: it uses dependency injection, the UI is modelled, styling uses CSS, etc... The latest releases of Eclipse are delivered with a compatibility layer that allows you to build your RCP / RAP app with either the v3 or v4 programming model. I would advise you to go with e4 as it improves greatly the programmer experience, however you need first to go through the tutorials... Here is a good link to start with e4:

http://www.vogella.com/tutorials/EclipseRCP/article.html

Then you can watch the following video which about building an e4 app on RAP:

https://www.youtube.com/watch?v=Z2PNgxJQK9c

Be careful when downloading your RAP target: it is not the same for Eclipse 3 and Eclipse 4:

https://www.eclipse.org/rap/downloads/

Fabrice
Re: Newbie question: Login Transition [message #1794616 is a reply to message #1794561] Tue, 04 September 2018 01:51 Go to previous messageGo to next message
Fabrice Teichteil Koenigsbuch is currently offline Fabrice Teichteil KoenigsbuchFriend
Messages: 8
Registered: September 2017
Junior Member
Terry,

Here is a link to an example RAP e4 application with a lifecycle hook for login:

https://drive.google.com/file/d/1j-ssCBv7yR0Ewvotr5ebJclP3wjkq0Uh/view?usp=sharing

Once you imported it in your workspace, go to Run Configurations..., choose org.eclipse.example.login, and on the bundles tab click on Validate Bundles to make sure you have the right target and all bundle dependencies are OK...

Fabrice
Re: Newbie question: Login Transition [message #1794617 is a reply to message #1794616] Tue, 04 September 2018 03:27 Go to previous messageGo to next message
Fabrice Teichteil Koenigsbuch is currently offline Fabrice Teichteil KoenigsbuchFriend
Messages: 8
Registered: September 2017
Junior Member
Forgot to write that the working credentials for the example are login: "Test" and password: "Test". If you enter anything else, an error message is displayed.
Re: Newbie question: Login Transition [message #1794662 is a reply to message #1794561] Tue, 04 September 2018 16:13 Go to previous messageGo to next message
Terry Kilshaw is currently offline Terry KilshawFriend
Messages: 11
Registered: July 2009
Junior Member
Many thanks Fabrice. I will look at the links you sent.

Could you just clarify what you wrote about "Be careful when downloading your RAP target: it is not the same for Eclipse 3 and Eclipse 4:".

I already have Eclipse Photon Release (4.8.0).

Will that have the correct RAP Target? Where in Eclipse can I look to see what my RAP Target is?

I know that these are very basic questions but its those that are hard to find answers to.

cheers,

Terry



Re: Newbie question: Login Transition [message #1794664 is a reply to message #1794616] Tue, 04 September 2018 16:45 Go to previous messageGo to next message
Terry Kilshaw is currently offline Terry KilshawFriend
Messages: 11
Registered: July 2009
Junior Member
Sorry to say that I don't know how to import this. There are many options.

Is this to be imported as a plug-in?

Do I put it in my workspace first?

thanks,

Terry

Re: Newbie question: Login Transition [message #1794670 is a reply to message #1794561] Tue, 04 September 2018 17:40 Go to previous messageGo to next message
Terry Kilshaw is currently offline Terry KilshawFriend
Messages: 11
Registered: July 2009
Junior Member
Fabrice,

your email said that e4 just means Eclipse version 4. But the first link that you gave me leads to a page that says:

3. Install the e4 tools
3.1. Using the update manager
The e4 tools provide the tools to develop Eclipse 4 RCP applications. They can be installed via the Eclipse default update site for your release.

This implies that e4 is not Eclipse version 4 but something that is added to it.

Do I need to install the e4 tools for RAP work? Is there any documentation that would tell me what the e4 tools do?

thanks,

Terry
Re: Newbie question: Login Transition [message #1794675 is a reply to message #1794616] Tue, 04 September 2018 18:42 Go to previous messageGo to next message
Terry Kilshaw is currently offline Terry KilshawFriend
Messages: 11
Registered: July 2009
Junior Member
Fabrice,

I imported your example as a normal project but get errors.

Mostly these are unresolved dependencies such as:

org.eclipse.rap.e4;bundle-version="3.2.0"

org.eclipse.e4.ui.workbench;bundle-version="1.3.0"

and in fact anything that has .e4. in its name.

Now, if e4 is just Eclipse 4 and I am using Eclipse 4.8 then it is unclear why those libraries would be missing.

Do I need to install e4 tools? At this point I am quite confused.

thanks,

Terry
Re: Newbie question: Login Transition [message #1794978 is a reply to message #1794675] Wed, 12 September 2018 05:22 Go to previous message
Fabrice Teichteil Koenigsbuch is currently offline Fabrice Teichteil KoenigsbuchFriend
Messages: 8
Registered: September 2017
Junior Member
Terry,

As I mentioned in a previous reply, you need to install the RAP e4 target on your Eclipse: https://www.eclipse.org/rap/downloads/

Once you have downloaded the e4 target, go to Preferences > Plug-in Development > Target Platform and set it up. Reboot your Eclipse and check your dependencies, it should be fine.

Fabrice
Previous Topic:RWT-OSGI and security
Next Topic:How to embed a RAP application into a JEE application
Goto Forum:
  


Current Time: Sat Sep 22 10:54:43 GMT 2018

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

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

Back to the top