Page Deletion Management

Users can move pages to trash. Once in the trash, users can restore pages or they can permanently delete them.

Users can delete pages that are no longer used in SmartEdit by first moving the pages to trash. Once a page is in the trash, a user can restore the page to be used in the site again or permanently delete it. Users cannot move primary pages with variation pages to the trash. They must first move the variation pages to trash or assign them to another primary page. When a page is permanently deleted, it cannot be restored.

Page deletion management consists of:

  • Moving pages to the trash
  • Restoring trashed pages
  • Permanently deleting pages
  • Synchronizing trashed pages

Moving Pages to Trash

When a user moves a page to trash, SmartEdit performs a soft-delete operation. It makes a PUT request to the CMS Item API to update the page status from ACTIVE to DELETED.SmartEdit doesn't display any pages with a DELETED status.

The CmsPageStatus enum defines the page status. Its configuration is in the cms2-items.xml file.

Restoring Trashed Pages

A user can restore a page from the trash to the staged version of a content catalog so that it can be used in their site. When restoring a trashed page, SmartEdit performs validations to ensure that there are no conflicts with existing pages in the staged version of the target content catalog. If it detects a conflict, SmartEdit prompts the user with the corresponding corrective action, such as renaming the trashed page before restoring it, assigning a variation page to another primary page if its original primary page no longer exists, and so on.

The restore operation updates the page as necessary, updates the page status back to ACTIVE, and sends a PUT request to the CMS Item API. Once the page is restored, SmartEdit lists the page in the Pages view and users can preview it in the content catalog.

Permanently Deleting Pages

SmartEdit performs a hard-delete operation when a user permanently deletes a page. It makes a DELETE request to the CMS Item API to delete the entry from the database. Any pages that are permanently deleted cannot be restored or recovered.

Synchronizing Trashed Pages

When a user moves a page to trash, SmartEdit sets the page status to DELETED in the staged version. When the user synchronizes the trashed page to the online version, SmartEdit updates the page status to DELETED in the online version, but it doesn't update the page's content nor its meta data. SmartEdit doesn't display pages with DELETED status in the storefront; the page is essentially hidden from customers. If the trashed page was never synchronized to the online version of the catalog, that is, if the page never existed in the online version of the catalog, the user doesn't have to synchronize the trashed page to the online version of the catalog before permanently deleting it.

To permanently remove deleted pages from the online content catalog version, a user must synchronize the content catalog.

SmartEdit uses the Page Operations API defined in the cmssmarteditwebservices extension to update the page status from a source catalog to a target catalog, as shown in the following code example:

POST /cmssmarteditwebservices/v1/sites/{siteId}/catalogs/{catalogId}/pages/{pageUid}/operations


payload:
{
	operation: "TRASH_PAGE"
	sourceCatalogVersion: <sourceCatalaogVersion>,
	targetCatalogVersion: <targetCatalaogVersion>
}