Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The proc_FetchDocForRead stored procedure is invoked to request the metadata information and document stream of a document.
-
PROCEDURE proc_FetchDocForRead( @DocSiteId uniqueidentifier, @DocWebId uniqueidentifier, @DocDirName nvarchar(256), @DocLeafName nvarchar(128), @DocFullUrl nvarchar(260), @LooksLikeAttachmentFile bit, @GetContent bit, @GetWebListForNormalization bit, @bGetContainingList bit, @bCheckout bit, @GetCurrentMetaInfo bit, @GetLinkInfo bit, @UserId int, @Version int, @ChunkSize int, @MaxLevel tinyint, @StreamPartition tinyint, @Level tinyint OUTPUT, @UIVersion int OUTPUT, @RequestGuid uniqueidentifier = NULL OUTPUT );
@DocSiteId: The Site Collection Identifier (section 2.2.1.1.9) of the site collection containing the requested document.
@DocWebId: The Site Identifier (section 2.2.1.1.11) of the site (2) containing the requested document.
@DocDirName: The directory name of the requested document.
@DocLeafName: The leaf name of the requested document.
@DocFullUrl: This parameter MUST be NULL and MUST be ignored.
@LooksLikeAttachmentFile: Specifies whether the requested document appears to the front-end Web server to be an attachment to a list item. If this flag is set to 1, then this stored procedure MUST determine whether the current user has sufficient permissions to retrieve the requested document as an attachment. In addition, if this flag is set to 1, then the NeedManageListRight column of the Attachment State Result Set (section 3.1.5.20.14) will indicate if the ManageLists bit of the WSS Rights Mask (section 2.2.2.15) is set.
@GetContent: A bit flag specifying whether to return the document stream of the document or not (0).
@GetWebListForNormalization: A bit flag specifying whether to return the subsite of the site (2) specified by @DocWebId. If this flag is set to 1, then this procedure MUST return a list of subsites in the Subsite List Result Set (section 3.1.5.20.1).
@bGetContainingList: Specifies whether to return the event receivers information about the list (1) containing the requested document. If this flag is set to 1, then this procedure MUST return the Event Receivers Result Set (section 3.1.5.20.6).
@bCheckout: Specifies whether the current user is requesting to check out the document. If this flag is set to 1, and the @LooksLikeAttachmentFile parameter is set to 1, then this stored procedure MUST determine whether the current user has sufficient permissions to check out the requested document as an attachment. The result of this is returned by the Attachment State Result Set (section 3.1.5.20.14).
@GetCurrentMetaInfo: If this parameter is set to 1, then the Document Version Metadata Result Set (section 3.1.5.20.4) MUST return the document's metadata in the {MetaInfo} column. If this parameter is not set to 1, then the result set MUST return NULL as the document's metadata in the {MetaInfo} column.
@GetLinkInfo: Specifies whether to return the link information about the requested document. If this flag is set to 1, then this procedure MUST return the Link Info Single Doc Result Set (section 3.1.5.20.2).
@UserId: The User Identifier (section 2.2.1.1.13) for the current user requesting the information.
@Version: Specifies the user interface (UI) version number of the document that is being requested. A value of -1 specifies the most recent version of the document.
@ChunkSize: Specifies the maximum size, in bytes, of the document content to be returned in the {Content} column in the Document Information and Content (Read) Stream Result Set (section 3.1.5.20.11) and the Document Version Information and Content Stream Result Set (section 3.1.5.20.13). For an uncustomized document, this MUST be NULL. Otherwise, if the data in the {Content} column is larger than the value specified in the @ChunkSize parameter, only the first @ChunkSize bytes MUST be returned, and the front-end Web server can request individual chunks of content in a subsequent request.
@MaxLevel: A Publishing Level Type (section 2.2.2.6) value that indicates the maximum publishing level of the document to be returned in the @Level parameter if multiple levels of the document are available and the current user is not the owner of the draft or does not have the document checked out.
@StreamPartition: Specifies the stream partition of the document to fetch.
@Level: The Publishing Level Type value of the requested version of the document visible to the current user, returned as an output parameter. This value MUST be returned as NULL if the document does not exist.
@UIVersion: Output parameter. The user interface version number associated with the document. This value MUST be NULL in the case of a document that does not exist, or if the @GetContent flag is not 1.
@RequestGuid: The optional request identifier for the current request.
Return Values: This procedure returns an integer return code that MUST be in the following table.
Value |
Description |
---|---|
0 |
Successful execution. |
3 |
The document does not exist. |
This stored procedure returns a Publishing Level Type value in the parameters as described earlier. This stored procedure MUST return multiple result sets. Some of the result sets MUST NOT be returned depending upon input parameters or calculations performed in this stored procedure, and all result sets that are returned MUST be sent in the order defined as follows.