3 Protocol Details
3.1 Server Details
3.1.4 Message Processing Events and Sequencing Rules
3.1.4.18 proc_CopyUrl
@SiteId: The site collection identifier of the site collection which contains the specified list (1).
@ListId: The list identifier of the list (1) containing the specified lookup field.
@FieldId: The field identifier of the specified lookup field.
@ColName: The name of the column in the AllUserData Table which corresponds to the specified lookup field.
@RowOrdinal: The row ordinal of the specified lookup field.
@RequestGuid: The optional request identifier for the current request.
Return Code Values: An integer that MUST be zero.
Result Sets: MUST NOT return any result sets.
3.1.4.18 proc_CopyUrl
The proc_CopyUrl stored procedure is called to copy a site collection, or subsite to a new location specified by a new URL. The T-SQL syntax for the stored procedure is as follows:
PROCEDURE proc_CopyUrl(
@SiteId uniqueidentifier, @SubWebId uniqueidentifier, @OldUrl nvarchar(260), @NewUrl nvarchar(260),
@UserId int, @TresholdRowCount int, @NewDoclibRowIdInput int, @MaxNewRowsInput int, @RenameFlags int = 0, @PutFlags int = 0, @ReturnFlags int = 0, @AttachmentOp int = 3,
@ParseDocsNow tinyint = NULL OUTPUT, @FailedUrl nvarchar(260) = NULL OUTPUT, @RequestGuid uniqueidentifier = NULL OUTPUT );
@SiteId: The site collection identifier of the site collection.
@SubWebId: A site identifier that uniquely identifies the subsite. MUST NOT be NULL.
@OldUrl: Current URL of the item being copied.
@NewUrl: URL which is to replace the @OldUrl.
@UserId: User identifier of the requester.
@ThresholdRowCount: If the requester has permissions to ignore the throttling restrictions, this MUST be zero, else this MUST specify the max number of documents the container represented by
@OldUrl can have. If there are more than the @ThresholdRowCount documents in the container, the stored procedure MUST return the error code of 36 and fail the operation. It MUST be zero or the same as the throttling limit.
@NewDoclibRowIdInput: The next available item identifier in the new list (1) where this item is being copied. This value is obtained by the call to proc_GetNewListItemId (section 3.1.4.61)
@MaxNewRowsInput: The number of items that are being copied.
@RenameFlags: A 4-byte integer bit mask determining the object rename options. This can have one or more flags set. The default value is zero, but it MUST NOT be NULL. The valid flags are described in the following table.
Value Description
0x00000000 Default behavior: Rename all dependent items.
0x00000001 Do not update all related documents.
0x00000002 Create directories if they do not exist.
0x00000004 Server MUST find backward links to rename them and update the original document.
0x00000008 Return thicket folders or files.
0x00000010 Fix links within the same URL subtree. Used when doing link fixup after a directory has been renamed.
0x00000020 Allow renaming of sites (2).
0x00000040 Allow the setting of the "CanBeParsed" document flag when a file's extension changes.
0x00000080 Allow update of the "CanHaveLinks" document flag when a file's extension changes.
Value Description
0x00000100 Allow renaming of sites (2) and directory names.
0x00000200 Allow move into the forms directory.
0x00000400 Current user can view draft documents.
0x00000800 Allow move operation on a thicket with missing thicket supporting files.
@PutFlags: A 4-byte integer bit mask determining document change options. This can have one or more flags set. The default value is zero, but it MUST NOT be NULL. The valid flags are described in the following table.
Value Meaning
0x00000008 Keep the document checked out.
0x00000020 Check in the document.
0x00001000 Create a new displayed version of the document, even if it is in a short-term check-out.
0x00002000 Use client metadata for user, date and time for creation, last modification, and check-in comments.
0x00010000 Publish the document.
0x00020000 Overwrite the document without updating its displayed version.
0x00100000 The document is being added or updated as part of a system update. Do not update the last modification time and user.
0x00800000 Do not increment the internal version number for the document. This flag SHOULD be set only if the user can tolerate having their changes overwritten by another user in the event of a conflict.
0x02000000 Keep the document checked out to the user's local disk.
@ReturnFlags: A 4-byte integer bit mask determining the result sets returned from stored
procedures called by proc_CopyUrl. This can have one or more flags set. The default value is zero, but it MUST NOT be NULL. The valid flags are in the following table.
Value Description
0x00 Return no result set data.
0x01 Return result sets pertaining to renamed documents
0x02 Return result sets pertaining to moved documents with patched links.
@AttachmentOp: An integer value which governs the type of security checks that SHOULD be performed by the stored procedure on this document's URL based on whether it appears to be an attachment. The integer value MUST be listed in the following table.
Value Description
0 Document is not an attachment. Do not perform attachment flag update.
Value Description
1 Update the item's flags only.
2 Update the item's version. In addition to performing an update on the attachment flag, the version number for the attachment is to be updated along with the timestamp for when the document was modified, the publishing level, and the editor of the document. This flag is set only if the user requesting the update has permissions to modify the list (1).
3 Update the item's modification state. In addition to performing an update on the attachment flag, the modification timestamp, the level, and the associated editor of the attachment is to be updated.
@ParseDocsNow: Bit indicator that a document needs further information gathering. Whenever a document is moved into a new document library, the metadata needs to be updated and
@ParseDocsNow is set to 1. If the document is left in the same document library or moved within a document library, @ParseDocsNow MUST be set to zero or NULL.
@FailedUrl: If a delete, copy, or move operation fails because of invalid parameters or permissions, this is filled in with the site-relative URL for the specific failed document.
Return values: An integer that MUST be listed in the following table.
Value Description
0 Successful execution.
2 The specified destination was not found.
3 The specified site (2) or subsite was not found.
5 User is not authorized to make this change.
15 Attempt to rename an excluded directory type.
32 There was a sharing or lock violation.
33 Attempted to move directories that contain checked out files.
36 There are more than the @ThresholdRowCount documents in the container represented by
@OldUrl.
50 Attempt to rename a site (2) inside a list (1).
51 Attempted to rename a Forms folder.
53 There is an inconsistency between the specified and the expected value of @SubWebId. The only way this happens is if there are concurrent attempts made to change affected objects.
80 Invalid @PutFlags for a file operation.
87 There is an inconsistency between the expected number of documents to be modified and the observed number which would be modified. The only way this happens is if there are concurrent attempts made to change affected objects.
130 Attempted to rename the thumbnail or image part of a thicket.
138 Attempted to copy folders that span lists (1).
Value Description
144 Old and new URL object types are not the same.
161 Attempted to copy folders that span sites (2).
190 Attempted to create a thicket.
206 Attempted to move folders that exceed file name range.
212 Write Lock Error when creating a file or directory.
214 Attempted to copy a thicket.
266 Specified old and new URL are the same.
1150 Concurrency violation.
1359 Internal error occurred.
1816 Disk quota exceeded
8389 At least one of the lists (1) could not be deleted.
Result sets: The stored procedure returns zero or more result sets depending on conditions
described in the result set. Some of the result sets are returned zero or more times depending upon input parameters and type of URL to be copied. All result sets that are returned MUST be returned in the order listed.
3.1.4.18.1 NULL List Metadata Result Set
If the copied URL has no lists (1), this MUST be returned zero, one or two times. It is returned twice if the @ReturnFlags does not have the 0x01 bit set; once for the old URL, and once for the new URL. If the @ReturnFlags does have the 0x01 bit set, a NULL List Metadata Result Set will be returned if the old URL location does not have a containing list (1), or if the new URL location does not have a containing File result set. This result set MUST be returned if the specified object is a file.
It returns a log of the old file name and the new file names including the directory path information.
The T-SQL syntax for the result set is as follows:
{OldUrlDirName} nvarchar(256), {OldUrlLeafName} nvarchar(128), {NewUrlDirName} nvarchar(256), {NewUrlLeafName} nvarchar(128), {Type} int;
{OldUrlDirName}: Directory path as it exists before any transformation takes place.
{OldUrlLeafName}: The file name before any transformation takes place.
{NewUrlDirName}: Directory path as it exists after any transformation takes place.
{NewUrlLeafName}: The file name after any transformation takes place.
{Type}: Type of URL being transformed. This value MUST be zero.
3.1.4.18.2 Copied Directory Result Set
The Copied Directory Result Set MUST be returned if the specified object is a directory. It returns a log of the old directory name and new directory name including directory path information. The T-SQL syntax for the result set is as follows:
OldDirName nvarchar(256), OldLeafName nvarchar(128), NewDirName nvarchar(256), NewLeafName nvarchar(128), Type int;
OldDirName: Directory path as it exists before any transformation takes place.
OldLeafName: The directory name before any transformation takes place.
NewDirName: Directory path as it exists after any transformation takes place.
NewLeafName: The directory name after any transformation takes place.
Type: Type of URL being transformed. This value MUST be 1.