Share via


4.9 Folder: Move Folder OM

This example describes the requests and responses made when a folder is moved within a list using an object model call.

Folder: Move Folder OM

Figure 20: Folder: Move Folder OM

This scenario is initiated by a call to the SPFolder.MoveTo() object model command. This example assumes that:

  • the code has already instantiated the site collection (SPSite), site (SPWeb), list (SPList), and list folder (SPFolder) objects.

  • the folder destination location is valid.

  • the current user has permissions to view the folder.

The following actions happen:

  1. The front-end Web server builds a dynamic query that invokes the proc_SecUpdateUserActiveStatus stored procedure.

  2. The front-end Web server builds a dynamic query that invokes the proc_SecGetIndividualUrlSecurityCheckEventReceivers stored procedure against the source folder.

  3. The back-end database server returns a return code of 0, and returns the following result sets:

    • Individual URL Security Result Set. This returns security information about the specific source folder.

  4. The front-end Web server builds a dynamic query that invokes the proc_SecGetIndividualUrlSecurityCheckEventReceivers stored procedure against the destination folder.

  5. The back-end database server returns a return code of 0, and returns the following result sets:

    • Individual URL Security Result Set. This returns security information about the specific destination folder.

  6. The front-end Web server builds a dynamic query that invokes the proc_GetNewListItemId stored procedure.

  7. The front-end Web server builds a transactional dynamic SQL query to move the folder.

    • The query begins a new SQL transaction.

    • The query attempts to rename the URL for the folder using the proc_RenameUrl stored procedure. The back-end database server returns a return code of 0, and returns the Rename Result Set, which gives basic information about the old and new URLs for the renamed folder.

    • The query attempts to get Audit Flags information about the new folder using the proc_GetAuditMaskOutput stored procedure.

    • The query rolls back the SQL transaction if any of the previous procedures were not successful.

    • Assuming the previous procedures were successful, the query updates the disk spaced used for the site (2) by calling the proc_UpdateDiskUsed stored procedure, and commits the transaction