Sets a new lock or updates an existing lock on the object. Calling this method has no effect in preventing others from updating a locked object (with the exception that others cannot re-lock the locked object). This lock mechanism is used for custom purposes only and has no bearing on the actual ability to update an object.
Namespace: FileNet.Api.Core
Assembly: FileNet.Api (in filenet.api.dll)
To successfully execute this method, the current user must have permission to modify this object's properties. For example, locking a
object requires
.
If the call succeeds:
- The object's LockOwner property is populated with the user name specified in the
parameter. (New lock only.)owner - The value specified by
is applied to the object's LockTimeout property.timeout - A LockToken (GUID) is internally created by the server. (New lock only.)
To update an existing lock, the objects needs to be in the locked state and the current user needs to match the user of the lock. Note that the user is the logged in user, not the
string. If the call succeeds, then only the LockTimeout property is updated with the timeout value. The
parameter in this case is ignored. (See the
method instead.)
Namespace: FileNet.Api.Core
Assembly: FileNet.Api (in filenet.api.dll)
Syntax
Visual Basic (Declaration) |
---|
Sub LockObject( _ ByVal timeout As Integer, _ ByVal owner As String _ ) |
C# |
---|
void LockObject( int timeout, string owner ) |
C++ |
---|
void LockObject( int timeout, String owner ) abstract |
J# |
---|
void LockObject( int timeout, string owner ) |
JScript |
---|
function LockObject( timeout : int, owner : String ) |
Parameters
- timeout
- An integer that represents the number of seconds after which the lock will expire. The range of values is 0 to 2147483647 (
) seconds.Integer.MAX_VALUE
- owner
- A
representing the user name to be assigned as the owner of the lock on this object. Defaults to the short principal name of the requesting user. The value is strictly advisory and is not validated against user or group names known to the Content Engine. The value can be used by applications such as WebDAV to identify the user who has locked the object.String
Exceptions
Exception Type | Condition |
---|---|
E_OBJECT_LOCKED | If the object is already locked and the current user does not match the user of the lock. |
E_OBJECT_NOT_LOCKED | If the user tries to update an existing lock but the object is not locked (absence of a LockToken). |