3.1.5.97 proc_UncheckoutDocument

The proc_UncheckoutDocument stored procedure is called to release the short-term lock on a document, or to release a checked out document. The current document is set to the most recent previous published or draft version, or to the version currently checked out, depending on the document state and proc_UncheckoutDocument parameters. proc_UncheckoutDocument is defined using T-SQL syntax, as follows:

PROCEDURE proc_UncheckoutDocument (
@SiteId          uniqueidentifier
,@WebId          uniqueidentifier
,@DirName        nvarchar(256)
,@LeafName       nvarchar(128)
,@UserId         int
,@ShortTerm      bit
,@Force          bit
);

@SiteId: The Site Collection Identifier (section 2.2.1.17) of the site collection containing the document to have its short-term lock released or its checkout reverted.

@WebId: The Site Identifier (section 2.2.1.19) of the site containing the document.

@DirName: The document's directory name.

@LeafName: The document's leaf name.

@UserId: The User Identifier (section 2.2.1.24) of the current user.

@ShortTerm: Specifies whether to release a short-term lock on the document or to revert a check-out of the document. This parameter MUST NOT be NULL.

  • If @ShortTerm is set to 1 and either the current user holds a short-term lock on the document or @Force is set to 1, the lock MUST be release.

  • If @ShortTerm is set to 0 and either the current user has checked out the document or @Force is set to 1, the checkout MUST be reverted, proc_UncheckoutDocument MUST discard any draft document created for the checkout and MUST set the most recent previous draft or published version as the current version.

@Force: Specifies whether to force the release of a short-term lock or the reversion of a checkout of the document held by another user. If this parameter is set to 1, the short-term lock or checkout of the document (as specified by the @ShortTerm parameter) MUST be released, and the most recent previous draft or published version MUST be reverted to the current version, even if the current user is not the holder of the short-term lock or the user the document is checked out to. If @Force is not set to 1, the short-term lock or check-out of the document will not be released, and the most recent previous draft or published version will not revert to the current version if the current user is not the holder of the short-term lock or the user the document is checked out to.

Return Values: The proc_UncheckoutDocument stored procedure MUST return an integer return code, which MUST be in the following table.

Value

Description

0

Successful execution.

3

The document was not found at the specified location.

158

The document is already unlocked.

173

Another user has checked out the document or has a short-term lock on the document, and @Force is not set to 1.

Result Sets:

The proc_UncheckoutDocument stored procedure MUST return a Link Info Single Doc Result Set (section 2.2.4.29). The Link Info Single Doc Result Set returns information about all forward links and backward links associated with the document. The Link Info Single Doc Result Set MUST be returned and MUST contain one row for each forward links and backward link associated with the specified document.

The proc_UncheckoutDocument stored procedure MUST return a Document Metadata Result Set (section 2.2.4.13). The Document Metadata Result Set returns the metadata for the specified document. The Document Metadata Result Set MUST be returned and MUST contain one row for the specified document.

 
Show: