Server 5

Deleted Documents and Trash

Learn how Sophora handles the removal of documents.

After a document has been marked for deletion, there are two phases during which it is still available in Sophora:

  • Trash: Whenever a user deletes a document, the document is not removed immediately. It is moved to the trash and marked as deleted.
  • Delete Document: A document can be removed from the trash manually or automatically.

Deleting documents from the trash

Documents that are marked as deleted can be removed from the trash automatically after a configured period of time. This task is performed by the Deleted Documents Worker. It can be configured in the in the sophora.properties file. The names of the corresponding parameters start with sophora.deleteDocuments.

The Deleted Documents Worker does not delete documents from the live workspace.

Example configurations

Example: The following settings are used to automatically remove documents from trash after one day. The Deleted Documents Worker will be triggered every 5 minutes.

 
sophora.deleteDocuments.enabledOnStartup=true
sophora.deleteDocuments.blockSize=100
sophora.deleteDocuments.minimumAgeDays=1
sophora.deleteDocuments.cronTriggerExpression=0 0/5 * * * ?

This configuration can be useful for Sophora Staging Servers to delete documents when they are not used any more (offline, deleted). See Notes on different server modes later on this page.

Deleting documents from the live workspace

The live workspace contains the last live state of every published document. All documents that are moved to the trash or set offline in the default workspace will be automatically deleted from the live workspace by the Live Workspace Deleted Worker.

Notes on different server modes

It depends on the sever mode how the deletion of documents is handled.

Sophora Replication Servers: The Deleted Documents Worker does not run on Sophora Replication Servers. After a document has been deleted permanently on the Primary Server, the deletion will be replicated to the Replication Server. More information about replication can be found on the page Replication and Synchronization.

Sophora Staging Servers: Whenever a document is set offline on the Sophora Primary Server, this will be handled as a deletion by the Sophora Staging Server. The Deleted Documents Worker runs on the Staging Server to perform this task.

To learn more about the server modes, read the article Sophora Server Modes and Connected Sophora Servers.

Last modified on 5/25/21

The content of this page is licensed under the CC BY 4.0 License. Code samples are licensed under the MIT License.

Icon