Page Blocks

Hosting sponsored by:

Point In Space

 

API: Actn

Filename:
fwpActn_unlock.ctag

Released With:
5.2.0

Current Version:
2.0

Status: Active

Min Lasso Tested: 8.1.0

Max Lasso Tested: 8.5.3

Related:

Still don't get it?

Check out the talk list archives, or join and ask your questions.

Documentation Error or Request?

Email documentation corrections or comments

API Reference

fwpActn_unlock (Tag)

Description

Checks for a cookie with record lock data, retrieves the data, and unlocks the record. This is a backup method to release the lock of an inadvertently abandoned record lock. Normally, the completion of a record delete or update action would automatically clear the record lock. However, if a user abandons a delete form or update form page, the record lock will be left intact. The lock will eventually time out, but to clear it as soon as possible for other users, the fwpActn_unlock tag can be placed in commonly visited pages such a record lists, or admin menu pages so the record can be proactively unlocked (assuming the user visits one of the pages without using the browser back button).

The unlock system has been updated in 5.2 to store multiple record locks. This prevents scenarios where a user would abandon one lock in the same act as creating a new one. Or abandon several without visiting a page with fwpActn_unlock. Now multiple abandoned locks can be unlocked at the same time.

Syntax

[fwpActn_unlock]

Examples

[fwpActn_unlock]

Source Code

View in separate window

<?lassoscript
//............................................................................
//
//    pageblocks: (c) 2002-2007 http://www.pageblocks.org/
//
//............................................................................
/*

    {fileName=        fwpActn_unlock.ctag }
    {rsrcType=        tag }
    {rsrcName=        fwpActn_unlock }
    {rsrcHTTP=        www.pageblocks.org/refc/fwpActn_unlock }

    {lassoVrsnMin=    8.1.0 }
    {lassoVrsnMax=    8.5.3 }

    {author=        Greg Willits }
    {authorEmail=    subscribe to pbTalk at www.pageblocks.org/talk/ }
    {authorHTTP=    www.pageblocks.org }

    {desc=            This routine is used to force a record to unlock. It is 
                    typically employed in places where a user is likely to 
                    fail to use the "Cancel" button and jump to another page. 
                    If this routine is placed on that page, it will load the 
                    lockID and unlock the record. (This is most effective 
                    on the List page). This will not catch the case of a user 
                    using the browser back button to return to a page with
                    this tag. }

    {maintvsrn=        2.0 }
    {maintrelease=    5.2.0 }
    {maintdate=        2007-06-09 }
    {maintauthor=    Greg Willits }
    {maintnotes=    updated to use multiple lock handling of fwp_recordLockStore }

    {maintvsrn=        1.1 }
    {maintrelease=    5.1.0 }
    {maintdate=        2006-05-26 }
    {maintauthor=    Greg Willits }
    {maintnotes=    converted timers to fwp_timer ctype,
                    added tagTrace }

    {maintvsrn=        1.0 }
    {maintrelease=    5.0.0 }
    {maintdate=        2006-01-16 }
    {maintauthor=    Greg Willits }
    {maintnotes=    initial release }

*/
//.............................................................................

define_tag:'fwpActn_unlock', -priority='replace';

    $fw_debug ? $fw_tagTracer->(add:'fwpActn_unlock');

    !(var_defined:'fw_recordLockStore' )
        ?    var:'fw_recordLockStore'= fwp_recordLockStore;
    $fw_recordLockStore->init;
    $fw_recordLockStore->unlockAll;

/define_tag;
?>

© 2002-2010, pageblocks.org