IP*Works! V9 - Online Help
IP*Works! V9
Questions / Feedback?

LockResource Method

Obtain a lock for a specified resource.

Syntax

webdav.lockResource(resourceURI, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

The LockResource method will request a new lock to be placed on ResourceURI in the user's name so that only the user can operate on it. The method is linked to a number of properties that it uses to generate the lock request:

LockOwnerThe principle that will own the lock.
LockScopeThe scope of the lock. The class only currently supports locks of scope "exclusive" and "shared".
LockTimeoutThe amount of time that the lock is allowed to exist before ResourceURI is automatically unlocked by the server.
LockTokensThe lock itself. If the user sets this before making the request, the timeout on the existing lock will be refreshed (reset to 0). Otherwise, a new set of lock tokens will be returned.
LockTypeThe type of lock. The class only currently supports of type "write".

After a successful call to the LockResource method the class will receive the new lock values, which it will parse and store in the lock properties.

This method is associated with the Depth property. If Depth is set to "0", the class will lock only ResourceURI and its properties. If Depth is set to "infinity", the class will lock ResourceURI and its entire subtree.

If MoveResource or CopyResource are used to place a resource or collection in a location under a resource locked with "infinity", the new resource or collection will be added to the lock. Any lock on a collection will prevent non-lock owners from adding resources to that collection.

 
 
Copyright (c) 2018 /n software inc. - All rights reserved.
Build 9.0.6635.0