3.1.5.40 proc_GetTpWebMetaDataAndListMetaData

The proc_GetTpWebMetaDataAndListMetaData stored procedure retrieves metadata for a particular site (2) or list (1).

 PROCEDURE proc_GetTpWebMetaDataAndListMetaData(
       @WebSiteId                     uniqueidentifier,
       @WebId                         uniqueidentifier,
       @Url                           nvarchar(260),
       @ListId                        uniqueidentifier,
       @ViewId                        uniqueidentifier,
       @RunUrlToWebUrl                bit,
       @DGCacheVersion                bigint,
       @SystemId                      varbinary(512)     = NULL,
       @AppPrincipalName              nvarchar(256),
       @IsHostHeaderAppPrincipalName  bit,
       @MetadataFlags                 int                = 0,
       @ThresholdScopeCount           int                = 0,
       @CurrentFolderUrl              nvarchar(260)      = NULL,
       @RequestGuid                   uniqueidentifier   = NULL OUTPUT
 );

@WebSiteId: The site collection identifier for a site collection containing the site (2).

@WebId: The site identifier of the site (2) for which metadata is requested, or of the site containing the list for which metadata is requested. This parameter is ignored if the @MetadataFlags has the METADATA_WEB flag set and if values in @WebSiteId and @URL are valid.

@Url: The store-relative form URL of the site (2) or list to retrieve metadata for.

@ListId: The list identifier of the list for which metadata is requested. This parameter is optional and MUST be NULL if no list metadata is required.

@ViewId: The Web Part identifier that is registered for the list specified by the @ListId parameter. If this parameter is set to NULL, then the tp_AllUsersProperties, tp_PerUserProperties, and tp_Cache columns returned by the List Web Parts Result Set (section 2.2.4.15) (found in the Common Result Sets (section 2.2.4)) will be set to NULL.

@RunUrlToWebUrl: A bit flag specifying whether the @URL parameter is for a site (2) or for a list within a site. If this value is set to "1", the value in @URL is for a list, and MUST be converted to a store-relative form URL for the containing site (2).

@DGCacheVersion: The version number of the Domain Group Map Cache in the front-end Web server. This can be compared with the Domain Group Map Cache version number on the back-end database server returned in the Domain Group Cache Versions Result Set (section 2.2.4.4) to determine whether updates are needed. A @DGCacheVersion value of -2 specifies that information about the Domain Group Map Cache is not requested, and the Domain Group Cache BEDS Update Result Set (section 2.2.4.3) and the Domain Group Cache WFE Update Result Set (section 2.2.4.5) MUST NOT be returned.

@SystemId: The SystemId of the current user requesting the metadata.

@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 1, the @AppPrincipalName parameter MUST be the app principal identifier, else it MUST be the app web domain identifier.

@MetadataFlags: A bit field used to determine the types of metadata returned by this procedure. The only valid values of the @MetadataFlags bits are specified as follows.

Symbolic name, Value

Description

METADATA_NONE,

0x00000000

Do not provide any metadata.

METADATA_FETCH_VIEWS,

0x00000001

Retrieve list views. This flag is set in combination with METADATA_LISTMETADATA_NOFETCH and the @ListID variable and will result in the List Web Parts Result Set (section 3.1.5.40.21).

METADATA_PREFETCH_SCOPES, 0x00000002

Retrieve security scopes. If this flag is set and @ListId is not NULL and METADATA_LISTMETADATA_NOFETCH is not set, then the List Unique Permissions Result Set (section 3.1.5.40.18) will be returned.

METADATA_SAVE_SCOPE_DATA, 0x00000004

Save scope data. This flag is currently unused.

METADATA_FIGURE_TYPE,

0x00000008

Setting this flag in combination with NULL ListID will result in retrieving the ListID values directly from the AllDocs table (section 2.2.6.1).

METADATA_WEB,

0x00000010

Retrieve information pertaining to the provided site (2) information. This flag is used in combination with other flags to further define the set or sets of information to be retrieved.

METADATA_URL,

0x00000020

Setting this flag will populate the ListId column for all results, including those which are not list items.

When used in combination with a valid @WebSiteId, if @ListId is NULL or doesn't match the list contained within the site (2) identified by @WebSiteId, the Document Metadata Result Set (section 2.2.4.8) is returned.

METADATA_USERINFOLIST,

0x00000040

Return User information. Setting this flag when METADATA_USERINFOLIST_NOFETCH is not set opens the option for List Metadata Result Set (section 2.2.4.14), List Unique Permissions Result Set (section 3.1.5.40.18), Event Receivers Result Set (section 2.2.4.11), and the List Web Parts Result Set (section 3.1.5.40.21).

METADATA_USERINFOLIST_FULL, 0x00000080

Return full User information. Setting this flag in combination with METADATA_USERINFOLIST when METADATA_USERINFOLIST_NOFETCH, is not set, along with a valid Site Identifier in @WebSiteId, where @ListId is NULL or does not match a list identifier contained within the site (2) specified by @WebSiteId, returns the Event Receivers Result Set (section 3.1.5.40.20) and the List Web Parts Result Set (section 3.1.5.40.21).

METADATA_WEB_PROP,

0x00000100

Return site data. Setting this flag in combination with METADATA_WEB will retrieve the Site Metainfo Result Set (section 2.2.4.25).

METADATA_WEB_FEATURES,

0x00000200

Return site features. Setting this flag in combination with METADATA_WEB will retrieve the Site Feature List Result Set (section 2.2.4.23).

METADATA_WEB_NAVSTRUCT, 0x00000400

Return navigation structure. Setting this flag in combination with METADATA_WEB will retrieve the Site Unique Permissions Result Set (section 3.1.5.40.10).

METADATA_LISTMETADATA_NOFETCH, 0x00000800

Do not return list metadata. Setting this flag will suppress the retrieval of the List Metadata Result Set (section 3.1.5.40.16), Unique Permissions Result Set (section 3.1.5.40.23), and the Event Receivers Result Set (section 3.1.5.40.20) using the List identification parameters.

METADATA_USERINFOLIST_NOFETCH, 0x00001000

Do not return User information. Setting this flag will suppress the retrieval of the List Metadata Result Set (section 3.1.5.40.16), Unique Permissions Result Set (section 2.2.4.26), Event Receivers Result Set (section 3.1.5.40.20), and the List Web Parts Result Set (section 3.1.5.40.21) using the User identification parameters.

METADATA_URL_REALLY,

0x00002000

Return single document metadata. Setting this flag will return the Document Metadata Result Set (section 3.1.5.40.27).

METADATA_WEB_WELCOMEPAGE,

0x00004000

Redirect welcome page. Setting this flag in combination with METADATA_WEB will retrieve the Redirect URL Result Set (section 3.1.5.40.13).

METADATA_PREFETCH_RELATEDFIELDS,

0x00008000

Return the List Related Fields Result Set (section 2.2.4.28) if the @MetadataFlags parameter does not contain METADATA_LISTMETADATA_NOFETCH.

@ThresholdScopeCount: This parameter MUST be set to a value greater than 0. If the @MetadataFlags parameter does not contain METADATA_LISTMETADATA_NOFETCH and contains METADATA_PREFETCH_SCOPES, this parameter MUST specify the maximum number of security scopes returned by the List Unique Permissions Result Set (section 3.1.5.40.18).

@CurrentFolderUrl: If this value is set to NULL or an empty string, this parameter MUST be ignored. Otherwise, it MUST be the root folder URL that the specified list is contained within.

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

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

Value

Description

0

Successful operation.

1

Cross Site attack detected.

2

The attempt to retrieve a redirected URL failed.

3

The specified URL was not found.

1168

The site collection specified by @WebSiteId was not found.

1271

Access to the site (2) is blocked because the site collection is locked.

Result Sets: The proc_GetTpWebMetaDataAndListMetaData stored procedure returns up to 30 result sets, depending on the state of the input parameters.