ICEfaces
  1. ICEfaces
  2. ICE-8719

New client-side pending session-timeout warning event and dialog

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: EE-3.3.0.GA, 4.0.BETA, 4.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces
    • Assignee Priority:
      P1
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.)

      Description


      It is useful to inform the user when their session times out (or is about to time out). In the past, ICEfaces applications have often used Ajax Push for this feature, but Ajax Push should not be required.
       

        Activity

        Hide
        Ted Goddard added a comment - - edited

        A related JIRA is ICE-8138. However, this introduces a dependency on jQuery and may not have all the necessary features.
        The full implementation would allow a server-side component to encode the current session expiry time in the page. This would be updated with each user interaction. A JavaScript setTimeout would wake up just prior to this time and check whether the session was about to expire (if the expiry value had been updated, the setTimeout would be restarted).

        Show
        Ted Goddard added a comment - - edited A related JIRA is ICE-8138 . However, this introduces a dependency on jQuery and may not have all the necessary features. The full implementation would allow a server-side component to encode the current session expiry time in the page. This would be updated with each user interaction. A JavaScript setTimeout would wake up just prior to this time and check whether the session was about to expire (if the expiry value had been updated, the setTimeout would be restarted).
        Hide
        Mircea Toma added a comment -

        Implemented this feature by introducing a new system event listener that inserts a script element into the markup. The code in this inline script sets up a timeout countdown that will eventually trigger the invocation of all the callbacks registered with ice.onBeforeSessionExpiry function. The callbacks will receive one parameter that represents the time left (in seconds) until the session will expire.

        The interval between the callbacks are invoked and the session expiry can be configured with org.icefaces.warnBeforeSessionExpiryInterval context parameters, the provided parameter value will be assumed to be measured in seconds. When the context parameter is missing or its value is set to -1 the feature is disabled.

        By default there is a popup registered with ice.onBeforeSessionExpiry that will render just a warning. Developers can choose to override this UI behaviour by disabling all default indicators (see org.icefaces.disableDefaultErrorPopups context parameter).

        Show
        Mircea Toma added a comment - Implemented this feature by introducing a new system event listener that inserts a script element into the markup. The code in this inline script sets up a timeout countdown that will eventually trigger the invocation of all the callbacks registered with ice.onBeforeSessionExpiry function. The callbacks will receive one parameter that represents the time left (in seconds) until the session will expire. The interval between the callbacks are invoked and the session expiry can be configured with org.icefaces.warnBeforeSessionExpiryInterval context parameters, the provided parameter value will be assumed to be measured in seconds. When the context parameter is missing or its value is set to -1 the feature is disabled. By default there is a popup registered with ice.onBeforeSessionExpiry that will render just a warning. Developers can choose to override this UI behaviour by disabling all default indicators (see org.icefaces.disableDefaultErrorPopups context parameter).
        Hide
        Mircea Toma added a comment -

        Document test steps.

        Show
        Mircea Toma added a comment - Document test steps.
        Hide
        Mircea Toma added a comment -

        Here is the setup and procedure required for testing this issue:

        1) Setup an application without ICEpush enabled.
        2) Set org.icefaces.warnBeforeSessionExpiryInterval parameter to 20 (that's in seconds).
        3) Set application session expiry to 1 (minute).
        4) Load main application page.
        5) Wait for "User Session is about to expire in 20 seconds." popup.
        6) Reload page to interact.
        7) Wait again for the "User Session is about to expire in 20 seconds." popup.
        8) Wait until "User Session Expired" is shown (after 20 seconds).

        Show
        Mircea Toma added a comment - Here is the setup and procedure required for testing this issue: 1) Setup an application without ICEpush enabled. 2) Set org.icefaces.warnBeforeSessionExpiryInterval parameter to 20 (that's in seconds). 3) Set application session expiry to 1 (minute). 4) Load main application page. 5) Wait for "User Session is about to expire in 20 seconds." popup. 6) Reload page to interact. 7) Wait again for the "User Session is about to expire in 20 seconds." popup. 8) Wait until "User Session Expired" is shown (after 20 seconds).
        Hide
        Mircea Toma added a comment -

        Fixed delay calculations. Added callback invocation of the session expired callbacks after the warning interval has elapsed as well, this way the session expired popup will show up as expected. Also, introduced test for the existence on form.elements before trying to clear their callback, IE return null instead of empty array when form elements do not exist.

        Show
        Mircea Toma added a comment - Fixed delay calculations. Added callback invocation of the session expired callbacks after the warning interval has elapsed as well, this way the session expired popup will show up as expected. Also, introduced test for the existence on form.elements before trying to clear their callback, IE return null instead of empty array when form elements do not exist.
        Hide
        Mircea Toma added a comment -

        The deployed test should not have icefaces-compat.jar included. When the jar is found in the classpath the default indicators will not show up anymore since its assumed that the component indicators are going to be setup.

        Show
        Mircea Toma added a comment - The deployed test should not have icefaces-compat.jar included. When the jar is found in the classpath the default indicators will not show up anymore since its assumed that the component indicators are going to be setup.
        Hide
        Mircea Toma added a comment -

        Modified before session expiry popup to close when the session has expired.

        Show
        Mircea Toma added a comment - Modified before session expiry popup to close when the session has expired.
        Hide
        Mircea Toma added a comment -

        I did apply the change into ICEfaces code but there was one other change in bridge-support project (window.js). When I tried to port that change as well I discovered that the svn:external in 3.3.0.GA points to bridge-support (trunk). I will need a svn:external reference to point to the bridge-support revision that corresponds to when the 3.3.0.GA was created (or a tag) so that I can make proper modifications. Right now the EE tag will give lots of JS errors if any test would be run.

        Show
        Mircea Toma added a comment - I did apply the change into ICEfaces code but there was one other change in bridge-support project (window.js). When I tried to port that change as well I discovered that the svn:external in 3.3.0.GA points to bridge-support (trunk). I will need a svn:external reference to point to the bridge-support revision that corresponds to when the 3.3.0.GA was created (or a tag) so that I can make proper modifications. Right now the EE tag will give lots of JS errors if any test would be run.
        Hide
        Mircea Toma added a comment -

        Committed window.js change into the bridge-support/tags/icefaces-ee-3.3.0.GA branch.

        Show
        Mircea Toma added a comment - Committed window.js change into the bridge-support/tags/icefaces-ee-3.3.0.GA branch.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: