Difference between revisions of "Riena/Login support"

From Eclipsepedia

Jump to: navigation, search
(Provide own splash login view)
(Provide own splash login view)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Login support ==
+
{{RienaBreadcrumbs |
 +
[[Riena Project]] | [[Riena Getting started|Getting Started]] | Login Dialogs}}
  
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.
+
It is easy to provide your Riena application with a '''login dialog''' that request authenication information (i.e. user name, password) 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 ===
+
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 [[FAQ_Who_shows_the_Eclipse_splash_screen%3F|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:
 
Example for a login dialog view:
Line 17: Line 23:
 
This means that you have to specify the following login dialog view definition as extension in your applications plugin project (plugin.xml):
 
This means that you have to specify the following login dialog view definition as extension in your applications plugin project (plugin.xml):
 
<source lang="xml">
 
<source lang="xml">
<extension
+
<extension point="org.eclipse.riena.navigation.ui.loginDialogViewDefinition">
      point="org.eclipse.riena.navigation.ui.loginDialogViewDefinition">
+
 
       <loginDialogViewDefinition
 
       <loginDialogViewDefinition
 
             nonActivityDuration="0"
 
             nonActivityDuration="0"
Line 28: Line 33:
 
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.
 
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 ===
+
== Provide own splash login view ==
  
 
Example for a splash login view:
 
Example for a splash login view:
Line 37: Line 42:
 
and a splash handler product binding via extension in your applications plugin project (plugin.xml). The necessary steps are outlined in detail below:
 
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:<br>
+
* Create product configuration:
1.1. In Splash - Customization  - Template select option "Interactive"<br>
+
* In Splash - Customization  - Template select option "Interactive"
1.2. In Overview - Testing click the Synchronize link. Effects:<br>
+
* 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:<br>
+
* In the products defining plugin in file plugin.xml an extension for extension point org.eclipse.ui.splashHandlers is added:
<source lang="xml">
+
<source lang="xml"><extension point="org.eclipse.ui.splashHandlers">
<extension
+
      point="org.eclipse.ui.splashHandlers">
+
 
       <splashHandler
 
       <splashHandler
 
             class="org.eclipse.riena.example.client.splashHandlers.InteractiveSplashHandler"
 
             class="org.eclipse.riena.example.client.splashHandlers.InteractiveSplashHandler"
Line 54: Line 57:
 
</extension>
 
</extension>
 
</source>
 
</source>
1.2.2. In the products defining plugin a splash icon is added: splash.bmp<br>
+
* 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<br>
+
* 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<br>
+
* Edit the products defining plugin.xml to configure your splash handler class: In
<source lang="xml">
+
<source lang="xml"><extension point="org.eclipse.ui.splashHandlers">
<extension
+
      point="org.eclipse.ui.splashHandlers">
+
 
       <splashHandler
 
       <splashHandler
 
             class="org.eclipse.riena.example.client.splashHandlers.InteractiveSplashHandler"
 
             class="org.eclipse.riena.example.client.splashHandlers.InteractiveSplashHandler"
Line 66: Line 67:
 
</extension>
 
</extension>
 
</source>
 
</source>
replace org.eclipse.riena.example.client.splashHandlers.InteractiveSplashHandler by your own splash handler class. This class has to be a subclass of
+
*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.<br />
org.eclipse.riena.navigation.ui.swt.splashHandlers.AbstractLoginSplashHandler and by default no futher code in this class has to be implemented.<br>
+
* Edit the products defining plugin.xml to configure your splash login view defintion:
3. Edit the products defining plugin.xml to configure your splash login view defintion:<br>
+
<source lang="xml"><extension point="org.eclipse.riena.navigation.ui.swt.loginSplashViewDefinition">
<source lang="xml">
+
<extension
+
      point="org.eclipse.riena.navigation.ui.swt.loginSplashViewDefinition">
+
 
       <loginSplashViewDefinition
 
       <loginSplashViewDefinition
 
             nonActivityDuration="0"
 
             nonActivityDuration="0"
Line 78: Line 76:
 
</extension>
 
</extension>
 
</source>
 
</source>
The view class may subclass AbstractLoginSplashView to use the controller, ridget support from riena.
+
* The view class may subclass AbstractLoginSplashView to use the controller/ridget support from Riena.
  
 
[[Category:Riena]]
 
[[Category:Riena]]

Latest revision as of 08:42, 16 March 2011

Riena ProjectGetting Started ▶ Login Dialogs

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:

The feature is demonstrated in the Riena example (SWT ExampleApplication) using the second alternative.

[edit] Providing an own login dialog view

Example for a login dialog view:

Riena Login Dialog.PNG

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:

Riena Login Splash.PNG

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.