Arbortext Command Language > Hooks > entitylockhook
  
entitylockhook
entitylockhook
 
Function prototype:
hook (oid, entname)
Synopsis
Use with:
add_hook(hookname, func[, prepend])
remove_hook(hookname, func)
where hookname is entitylockhook.
This hook will be called before an entity is locked, either explicitly (for example, by using the oid_entity_lock function) or implicitly (for example, by typing in the expanded entity). It will only be called if the entity is a locally stored file (entity files stored in a Document Management System cannot be locked this way). It can override or cancel the locking operation similar to using the editbeforehook to detect when the user is about to edit an entity in a separate window.
If the lock operation is not a result of inline editing, then the oid parameter will be null. If this hook returns 0 the code proceeds as if the hook was not called and locks the entity. If it returns –1 the lock operation is cancelled and the attempted locking operation fails, unless the hook locked the entity itself.
Arguments
oid is the oid of the reference to the entity.
entname is the name of the entity being locked.