It is easy to provide your Riena application with a login dialog that request authenication information (i.e. user name, password) from the user.
The login dialog appears in two cases:
- before the application proper starts, and
- in case there is no user activity for some specified time lapse while the application is running.
The login-dialog feature is supported in two different ways:
- Login via a dialog view, or
- Login via the Eclipse splash view.
The feature is demonstrated in the Riena example (SWT ExampleApplication) using the second alternative.
Providing an own login dialog view
Example for a login dialog view:
To provide a customized login dialog you have to create a dialog view and refer to it in the extension which also has to be configured. This means that you have to specify the following login dialog view definition as extension in your applications plugin project (plugin.xml):
<extension point="org.eclipse.riena.navigation.ui.loginDialogViewDefinition"> <loginDialogViewDefinition nonActivityDuration="0" viewClass="org.eclipse.riena.example.client.views.LoginDialogView"> </loginDialogViewDefinition> </extension>
The view class may subclass DialogView to use the controller, ridget support from riena. The attribute nonActivityDuration in extension loginDialogViewDefinition specifies the duration of non activity in the application, after which the login dialog is presented to the user again for a duration greater than 0. For a duration equal or less than 0 the login timer is not used at all.
== Provide own splash login view ==
Example for a splash login view:
To provide a customized splash login view you have also to create a dialog view and refer to it in the extension which has to be configured. Further you have to create a product configuration which specifies a specific splash handler and a splash handler product binding via extension in your applications plugin project (plugin.xml). The necessary steps are outlined in detail below:
- Create product configuration:
- In Splash - Customization - Template select option "Interactive"
- In Overview - Testing click the Synchronize link. Effects:
- In the products defining plugin in file plugin.xml an extension for extension point org.eclipse.ui.splashHandlers is added:
<extension point="org.eclipse.ui.splashHandlers"> <splashHandler class="org.eclipse.riena.example.client.splashHandlers.InteractiveSplashHandler" id="org.eclipse.riena.example.client.splashHandlers.interactive"> </splashHandler> <splashHandlerProductBinding productId="org.eclipse.riena.example.client.example_product" splashId="org.eclipse.riena.example.client.splashHandlers.interactive"> </splashHandlerProductBinding> </extension>
- In the products defining plugin a splash icon is added: splash.bmp
- In the products defining plugin a generated splash handler class is added: org.eclipse.riena.example.client.splashHandlers.InteractiveSplashHandler
- Edit the products defining plugin.xml to configure your splash handler class: In
<extension point="org.eclipse.ui.splashHandlers"> <splashHandler class="org.eclipse.riena.example.client.splashHandlers.InteractiveSplashHandler" id="org.eclipse.riena.example.client.splashHandlers.interactive"> </splashHandler> </extension>
- replace org.eclipse.riena.example.client.splashHandlers.InteractiveSplashHandler by your own splash handler class. This class has to be a subclass of org.eclipse.riena.navigation.ui.swt.splashHandlers.AbstractLoginSplashHandler and by default no futher code in this class has to be implemented.
- Edit the products defining plugin.xml to configure your splash login view defintion:
<extension point="org.eclipse.riena.navigation.ui.swt.loginSplashViewDefinition"> <loginSplashViewDefinition nonActivityDuration="0" viewClass="org.eclipse.riena.example.client.views.LoginSplashView"> </loginSplashViewDefinition> </extension>
- The view class may subclass AbstractLoginSplashView to use the controller/ridget support from Riena.