There is the possibility in Riena to provide an application with an login dialog/view. In this dialog authenication information (i.e. user, password) may be requested from the user. By configuration this dialog appears before the application starts and additionally in case there is no user activity for some specified time while the application is running. This feature is supported in two different ways:
- Login via some dialog view and
- Login via the eclipse splash view.
This feature is demonstrated in the Riena example (SWT ExampleApplication) using the second alternative.
Provide 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:
1. Create product configuration:
1.1. In Splash - Customization - Template select option "Interactive"
1.2. In Overview - Testing click the Synchronize link. Effects:
1.2.1. 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>
1.2.2. In the products defining plugin a splash icon is added: splash.bmp
1.2.3. In the products defining plugin a generated splash handler class is added: org.eclipse.riena.example.client.splashHandlers.InteractiveSplashHandler
2. 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.
3. 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.