• No results found

3 Protocol Details

3.1 Server Details

3.1.4 Message Processing Events and Sequencing Rules

3.1.4.5 proc_AddGhostDocument

The proc_AddGhostDocument stored procedure is called to create an uncustomized file. The T-SQL syntax for the stored procedure is as follows:

PROCEDURE proc_AddGhostDocument(

@SiteId uniqueidentifier, @WebId uniqueidentifier, @DocId uniqueidentifier, @DocDirName nvarchar(256), @DocLeafName nvarchar(128), @Level tinyint, @UIVersion int, @EnableMinorVersions bit, @DocSize int, @DocFlags int, @OnRestore bit = 0,

@Overwrite bit OUTPUT, @UserId int, @HasDeleteListItemsRight bit, @UpdateSiteQuota bit, @SetupPathVersion tinyint, @SetupPath nvarchar(255), @SetupPathUser nvarchar(255),

@ListId uniqueidentifier = NULL, @DoclibRowId int = NULL,

@fCheckQuotaAndWriteLock bit = 0, @fCheckIfWebWelcomePage bit = 0,

@DTM datetime = NULL OUTPUT

@RequestGuid uniqueidentifier = NULL OUTPUT );

@SiteId: The site collection identifier of the site collection that contains the site (2).

@WebId: The site identifier of the site (2) which will contain the uncustomized file.

@DocId: The document identifier (2) for the new uncustomized file to be created. An existing file with the specified document identifier (2) MUST NOT exist.

@DocDirName: The directory name for the new uncustomized file.

@DocLeafName: The leaf name for the new uncustomized file.

@Level: The publishing level for the new uncustomized file. Refer to [MS-WSSFO2] section 2.2.2.6.

@UIVersion: The user interface (UI) version number for the new uncustomized file.

@EnableMinorVersions: This parameter is not used and MUST be ignored.

@DocSize: The size, in bytes, of the new uncustomized file.

@DocFlags: The document flags, as specified in section 2.2.3.5, for the new uncustomized file o be created.

@OnRestore: Whenever an uncustomized file is successfully created, an event object type flag, as specified in section 2.2.3.1, of "0x00000010" with an event type flag, as specified in section 2.2.3.2, of "0x00001000" is recorded in the change log with the datetime in Coordinated Universal Time (UTC) when the uncustomized file was created. An additional event object type flag of

"0x00000010" with an event type flag of "0x00100000" is recorded in the change log. If this parameter is "1", the datetime recorded is NULL. No datetime is recorded in the change log. If this parameter is set to something other than "1", the datetime recorded is the current UTC.

@Overwrite: If this parameter is set to a value other than "1" on input, this parameter MUST be ignored. However, if it is set to "1" on input and an existing file is found specified by the

@DocDirName and @DocLeafName parameters and the @HasDeleteListItemsRight parameter is set to "1", the existing file is deleted and replaced with the new uncustomized file being created. If the existing file is successfully deleted, the @Overwrite parameter is set to "1" on output. If the existing file is not successfully deleted, the @Overwrite parameter is set to zero ("0") on output.

@UserId: The user identifier of the user requesting the operation. If the specified @Level

parameter is set to publishing level of type draft, then the draft owner for the file will be set to this user identifier. If the specified @Level parameter is set to publishing level of checked out, then the checked out owner for the file will be set to this user identifier.

@HasDeleteListItemsRight: This parameter is only used if the @Overwrite parameter is set to "1"

on input. When set to "1", the impact of this parameter is described in the definition for the

@Overwrite parameter.

@SetupPathVersion: This parameter specifies the directory path fragment where the

uncustomized file content is located on the front-end Web server's file system. This parameter MUST be one of the values in the following table.

Value Description

"2" The @SetupPath parameter value supplied is relative to the install location of Windows®

SharePoint® Services 2.0 on the front-end Web server (for example Program Files\Common Files\Microsoft Shared\Web Server Extensions\60).

"3" The @SetupPath parameter value supplied is relative to the install location of Windows®

SharePoint® Services 3.0 on the front-end Web server (for example Program Files\Common Files\Microsoft Shared\Web Server Extensions\12).

"4" The @SetupPath parameter value supplied is relative to the install location of Microsoft®

SharePoint® Foundation 2010 on the front-end Web server (for example Program Files\Common Files\Microsoft Shared\Web Server Extensions\14).

@SetupPath: This specifies the Unicode directory path fragment relative to the base directory path specified by the @SetupPathVersion parameter. Taken together, the @SetupPath and

@SetupPathVersion parameters specify where the uncustomized file can be found on the front-end Web server's file system.

@SetupPathUser: This specifies the Unicode of the login name of the user that is creating the uncustomized file.

@ListId: This parameter is optional and defaults to NULL if not specified. If this parameter is not NULL, it MUST be the list identifier of a list (1) contained within the specified site. If this parameter is NULL, the uncustomized file to be created will not be contained within a list (1).

@DoclibRowId: This parameter is optional and defaults to NULL if not specified. If this parameter is not NULL, then it MUST be the document library row identifier for the new uncustomized file. If the uncustomized file will not be contained within a list (1), this parameter and the @ListId parameter MUST be NULL.

@fCheckQuotaAndWriteLock: This parameter is optional and defaults to zero ("0") if not specified. If this parameter is set to zero ("0"), it MUST be ignored. However, if it is set to a value other than zero, the stored procedure verifies that adding the uncustomized file will not exceed the specified site collection's site collection quota and that the site collection's site collection flag does not contain the 0x00000001 bit. As specified in [MS-WSSFO2], section 2.2.2.9.

@fCheckIfWebWelcomePage: This parameter is optional and defaults to zero ("0") if not specified. If this parameter is set to zero, it MUST be ignored. However, if it is set to a value other than zero, the stored procedure compares the URL of the uncustomized file to the URL of the Welcome page of the site (2). If the Welcome page exists and its URL matches the URL of the uncustomized page, the document flag 0x00040000 is set to "1". If the Welcome page does not exist or the URL of Welcome page does not match the URL of the uncustomized page, the document flag 0x00040000 is set to zero ("0").

@DTM: This parameter is optional and defaults to NULL if not specified. If specified, the input value is ignored and the value set on output will be the datetime in UTC when the uncustomized file is created.

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

Return values: An integer that MUST be listed in the following table.

Value Description

"0" Successful execution.

"3" This return code MUST be returned if any of the following are true:

If the site collection specified by the @SiteId parameter does not exist.

If the site (2) specified by the @WebId parameter does not exist.

The site collection specified by the @SiteId parameter exists, but its directory name does not match the value specified by the @DocDirName parameter.

"5" This return code is returned if the uncustomized file failed to be created. This is because either the user identifier specified by the @UserId parameter does not have the appropriate

permissions, or the @Overwrite parameter is set to "1" and the @HasDeleteListItemsRight parameter is set to "1" and an existing file was not found specified by the @DocDirName and

@DocLeafName parameters.

"80" The uncustomized file failed to be created because an existing file was found specified by the

@DocDirName and @DocLeafName parameters and the @Overwrite parameter was set to a value other than "1".

"212" If the @fCheckQuotaAndWriteLock parameter is set to any value other than zero ("0"), the creation of the uncustomized file will fail with this return code if the specified site collection has its WRITELOCK (0x00000001) site collection flag bit set. As specified in [MS-WSSFO2], section 2.2.2.9.

"1816" If the @fCheckQuotaAndWriteLock parameter is set to any value other than zero ("0"), the creation of the uncustomized file will fail with this return code if adding the uncustomized file will exceed the site collection quota for the specified site collection.

Result sets: MUST NOT return any result sets.