Locks (checks out) a document or documents in the specified path.

Syntax

Visual Basic (declaration)
Public Function Lock( _ 
ByVal AuthenticationTicket as String, _ ByVal Path as String) as XmlNode

C# (declaration)
public XmlNode Lock( 
string AuthenticationTicket, string Path)

Parameters

AuthenticationTicket
    string infoRouter ticket
Path
    string The path of a document or a folder to be locked (checked out)

Return Value

Returns XML fragment.
<response success="true" error="">
if success = "true" the document has been locked (checked-out).
if success = "false" the error attribute returns the error description.

Remarks

The caller must have at least "Change" permissions on the document(s) or must be the owner of the document(s).

minus gif Example

Visual Basic Example
Option Explicit On
Option Strict On

Module Module_Lock
    Sub Lock(ByVal ServiceURL As String, ByVal AuthenticationTicket As String)
        Const IR_DocumentPath As String = "TestDomain/Samples/SummerPlan.doc"
        Dim IR_OBJ As InfoRouter.srv

        Try
            IR_OBJ = New InfoRouter.srv
            IR_OBJ.Url = ServiceURL

            Dim xmlResponse As System.Xml.XmlNode = IR_OBJ.Lock(AuthenticationTicket, IR_DocumentPath)

            If xmlResponse.Attributes("success").Value.ToUpperInvariant() = "TRUE" Then
                Console.WriteLine("The document has been Locked.")
            Else
                Console.WriteLine("The document cannot be Locked.")
                Console.WriteLine("server response:" & xmlResponse.Attributes("error").Value)
            End If
            xmlResponse = Nothing

        Catch ex As Exception
            Console.WriteLine("Error:" & ex.Message)
        Finally
            IR_OBJ = Nothing
        End Try
    End Sub

End Module

See Also