3.1.5.19 proc_FetchDocForHttpGet

The proc_FetchDocForHttpGet stored procedure is called to fetch a document stream and provide information necessary to render the document on a front-end Web server.

 PROCEDURE proc_FetchDocForHttpGet(
       @DocSiteId                     uniqueidentifier,
       @DocDirName                    nvarchar(256),
       @DocLeafName                   nvarchar(128),
       @LooksLikeAttachmentFile       bit,
       @IfModifiedSince               datetime,
       @FetchType                     int,
       @ValidationType                int,
       @ClientVersion                 int,
       @ClientId                      uniqueidentifier,
       @PageView                      tinyint,
       @FetchBuildDependencySet       bit,
       @SystemID                      varbinary(512),
       @AppPrincipalName              nvarchar(256),
       @IsHostHeaderAppPrincipalName  bit,
       @CurrentVirusVendorID          int,
       @PrefetchListScope             bit,
       @ChunkSize                     int,
       @DGCacheVersion                bigint,
       @MaxCheckinLevel               tinyint,
       @HonorLevel                    bit,
       @CurrentFolderUrl              nvarchar(260),
       @ThresholdRowCount             int,  
       @StreamPartition               tinyint,
       @Level                         tinyint            OUTPUT,
       @FetchStreamIfNeeded           bit = 1,
       @RequestGuid                   uniqueidentifier = NULL OUTPUT
 );

@DocSiteId: The site collection identifier for a site collection containing the document.

@DocDirName: The directory name of the requested document.

@DocLeafName: The leaf name of the requested document.

@LooksLikeAttachmentFile: Boolean flag that specifies if the document is an attachment to a list item or an attachment folder.

@IfModifiedSince: Specifies the datetime in UTC of the last modified time stamp of the document. If @ValidationType is "2" or "3", the document MUST only be fetched if this value is earlier than the current last modified time stamp value in the back-end database server.

@FetchType: Specifies the type of request. If this parameter is "0", information to satisfy an HTTP GET request MUST be returned, including the stream of the document. If this parameter is "1", information needed only to satisfy an HTTP HEAD request MUST be returned, which does not include the stream of the document. All nonzero values MUST also be treated as "1".

@ValidationType: This parameter MUST have a value of "0", "1", "2", or "3". If this parameter is "0", @ClientVerson, @ClientId, and @IfModifiedSince MUST be ignored and the document MUST be fetched.

@ClientVersion: Specifies the internal version number of the document to fetch. If @ValidationType is "1" or "3", the document MUST only be fetched if this value is equal to the current internal version number of the document on the back-end database server.

@ClientId: Specifies the document identifier of the document to fetch. If @ValidationType is "1" or "3", the document MUST only be fetched if this value is equal to the current document identifier of the document on the back-end database server.

@PageView: Non-NULL values indicate that the document is a view Web page or an implementation-specific Web page that renders an item or items in a list (1) or document library. This also indicates that information is needed to enable front-end Web server rendering based on metadata about the view page, the item or items being rendered, the user's browsing context, the overall site's navigation scheme, and the user's security privileges. Information requested includes site metadata, containing list (1) metadata, users and permission levels metadata, Web Parts, and related list (1) metadata. In addition, a value of one indicates that the metadata is security trimmed to the user specified by @SystemId. The value zero or other non-NULL values indicate that information is requested as seen by all users. A NULL value indicates that the document is not a view Web page.

@FetchBuildDependencySet: If this parameter is "1" and the document being fetched has a publishing level of published, the Document Build Dependency Set Result Set (section 3.1.5.19.12) and Document Build Dependency Metadata Result Set (section 3.1.5.19.13) MUST be returned. Otherwise, the result sets MUST NOT be returned.

@SystemID: The security identifier (SID), as specified in [MS-DTYP] section 2.4.2, of the current user, or NULL to indicate an anonymous user.

@AppPrincipalName: The app principal identifier or the app web domain identifier associated with the current user. If the current user is not associated with an app principal, this parameter MUST be NULL.

@IsHostHeaderAppPrincipalName: If this parameter is set to one, the @AppPrincipalName parameter MUST be the app principal identifier, else it MUST be the app web domain identifier.

@CurrentVirusVendorID: Specifies an identifier for an anti-virus scanner. If this value is not NULL and does not match the current anti-virus scanner registered for the document, the document MUST NOT be fetched.

@PrefetchListScope: If this parameter is set to "1", the metadata of the list (1) scope that contains the document MUST be returned.

@ChunkSize: Specifies the maximum size, in bytes, of the document content to be returned in the {Content} column in the Document Information (Get) Stream Result Set (section 3.1.5.19.9). 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.

@DGCacheVersion: Specifies an internal version number for the domain group map cache of the site collection that contains this document being request. If this parameter is "-2", the Domain Group Cache BEDS Update Result Set (section 3.1.5.19.3) and the Domain Group Cache WFE Result Set (section 3.1.5.19.4) MUST NOT be returned. Otherwise, the Domain Group Cache BEDS Update Result Set MUST be returned, and the Domain Group Cache WFE Update Result MUST only be returned if @DCCacheVersion is less than the current internal version number of the domain group map cache.

@MaxCheckinLevel: Specifies the publishing level of the document to fetch. If @HonorLevel is equal to "0", this parameter MUST be ignored.

@HonorLevel: If this parameter is not equal to "0", the document with publishing level specified in @MaxCheckInLevel MUST be fetched. Otherwise, the document with the maximum publishing level available to the current user MUST be fetched.

@CurrentFolderUrl: The URL of the folder that the user was browsing before the specified document was requested. This is used to preserve the browsing context when the fetch request is redirected to a view page. When fetching an item in a list (1) or a file in a document library, an attachment to an item, a folder, or a list view, the specified document will be a view page, and @CurrentFolderUrl will be used to render the browsing context.

@ThresholdRowCount: Specifies the maximum number of security scopes to be fetched. If @PrefetchListScope is not equal to "1", this parameter MUST be ignored.

@StreamPartition: Specifies the stream partition of the document to fetch.

@Level: An output parameter specifying the publishing level of the document to be fetched.

@FetchStreamIfNeeded: Specifies if the stream of the document is fetched.

@RequestGuid: The optional request identifier for the current request.

Return Values: The proc_FetchDocForHttpGet stored procedure returns an integer return code, which MUST be one of those listed in the following table.

Value

Description

0

Successful execution.

2

The document specified by @DocSiteId, @DocDirName, @DocLeafName (and @MaxCheckinLevel, if provided) was not found, or the document is an attachment folder; or the document is a folder, but no welcome page, home page, view Web page, or other redirect Web page was found for it.

18

Successful execution; based on values of @ValidationType, @ClientId, @ClientVersion, and @IfModifiedSince, the document was not fetched.

146

The document does not exist, but a welcome page was found, as specified by the Welcome Page Redirect Information Result Set.

1168

The site collection specified by @DocSiteId was not found.

1271

The site (2) is read locked.

Result Sets: The proc_FetchDocForHttpGet stored procedure MUST return zero or more result sets upon successful execution. If the document is not found, zero result sets MUST be returned. The following result sets MUST be returned only if the document has a Document Store Type (section 2.2.2.4) of zero (File):

  • Site Collection Audit Mask Result Set (section 3.1.5.19.10)

  • List Audit Mask Result Set (section 3.1.5.19.11)

  • Document Build Dependency Set Result Set (section 3.1.5.19.12)

  • Document Build Dependency Metadata Result Set (section 3.1.5.19.13)

  • Domain Group Cache Versions Result Set (section 3.1.5.19.2)

  • Site Metadata Result Set (section 3.1.5.19.14)

  • Event Receivers Result Set (section 3.1.5.19.15)

  • Web Event Receiver Result Set (section 3.1.5.19.16)

  • Site Features List Result Set (section 3.1.5.19.17)

  • WebParts Metadata, Personalized Result Set (section 3.1.5.19.18)

  • WebParts Metadata, Nonpersonalized Result Set (section 3.1.5.19.19)

  • ListMetadata Result Set (section 3.1.5.19.20)

  • List Event Receivers Result Set (section 3.1.5.19.21)

  • List Security Information Result Set (section 3.1.5.19.22)

  • Site Collection Custom Actions Result Set (section 3.1.5.19.23)

  • Site Custom Actions Result Set (section 3.1.5.19.24)

  • List Custom Actions Result Set (section 3.1.5.19.25)

  • List Web Parts Result Set (section 3.1.5.19.26)

  • Content Type Order Result Set (section 3.1.5.19.27)

  • Current Folder Scope Result Set (section 3.1.5.19.28)

  • Navigation Context Security Information Result Set (section 3.1.5.19.29)

  • NULL Navigation Context Security Information Result Set (section 3.1.5.19.30)

  • Empty Navigation Context Security Information Result Set (section 3.1.5.19.31)

Other proc_FetchDocForHttpGet result sets return conditionally, as described in each result set section, in the following sections.