On OpenNTF: XPages Document Locker Managed Bean
The project includes a managed bean with methods to lock and unlock documents. The mechanism works if all users access the same replica. The documents are not physically locked but instead a programming convention is used to check whether documents are locked before someone tries to change them.
Watch the video to see the control in action.