Skip to main content
Skip table of contents

Asset Deletion 3 - Check constraints for deletion

Asset Deletion 3 does not delete an asset version if any constraint exists. To see all constraints for the versions of an asset, execute the report in Asset Deletion 3. This article explains the different constraints and how to work with the report.

Context

  • Asset Deletion 3 deletes asset versions that are no longer needed.

  • Asset version policies define which versions of an asset are kept.

  • An automatic server action or an individual server action execute the deletion process.

  • The deletion report is available in the censhare Client and in censhare Web.

Prerequisites

  • Common knowledge about censhare, especially asset types, relations, and domains.

  • Common knowledge about the technical setup and configuration of the censhare Server and the relational database.

Introduction

Asset version policies define, which versions of an asset you want to keep. The policies are customizable constraints that prevent an asset version from being deleted. The policies are defined by the administrator in the censhare Admin Client.  

Besides that, censhare must maintain data integrity when marking asset versions for deletion. This is done with fixed constraints that cannot be changed. For examples, see the section below.

Different constraints can apply to different versions of an asset. To check if your asset version policies and other constraints work as expected, the report in Asset Deletion 3 was implemented.

Constraint types

  • on asset version level

  • on asset level

  • by asset version policies

  • on asset file level

  • on database level

Constraints on the asset version level relate to certain versions of an asset.

Example asset relations

For example, an image is placed in a layout. The different layout versions can relate to different image versions:

Relations between different versions of an Image asset and a Layout asset.


In the graphic above, the Image version (3) has a placement relation with the Layout version (4). The image cannot be marked/deleted if it has a placement relation to a layout. 

Constraints on the asset level relate to all versions of an asset. For example, if an asset is checked out, no asset version is marked for deletion.  

Asset version policies are defined for a domain, 2nd domain, and an asset type.

Constraints on the asset file level prevent an asset file (storage item) from being removed. For example, if an asset file is not deleted if there is any asset version that still references this file.  

Handling database constraints

For data integrity, the database executes constraint checks. For performance reasons, Asset Deletion 3 only executes the most common database constraints checks.

In some rare cases, a database error can occur later when censhare tries to mark an asset version for the deletion or tries to delete an asset version physically. In these cases, censhare rolls back the database operation and writes the information into the server log.  

Asset deletion report

The Asset Deletion 3 report shows, which versions of an individual asset are kept and why. It is available in the censhare Client and in censhare Web. The report is configured in the censhare Admin Client.

The asset deletion report

The report shows the following items:

  • The asset ID.

  • The total number of versions of the asset.

  • The domain, 2nd domain, and asset type of the applied policy.

  • The number of versions that are marked for deletion. This only occurs if versions that are marked for deletion have not yet been deleted physically.

  • A list of asset versions.

  • A list of constraints for each version.

The report only lists asset versions that have at least one constraint. For example, an asset has 350 versions. The asset version policy definitions keep the last three and the first three versions. The only constraint, in this case, applies to the first version. The report shows six versions. All other versions are marked for deletion:


Asset version

Constraints

1

Holds a content version that is still used in later asset versions (asset_feature_fk16) - Keep the first (3) version(s) policy

2

Keep the first (3) version(s) policy

3

Keep the first (3) version(s) policy

348

Keep the last (3) version(s) policy

349

Keep the last (3) version(s) policy

350

Keep the last (3) version(s) policy


The report lists all constraints that apply to a version. For example, an asset version has the constraints:

  • Keep the last (5) version(s) policy.

  • The asset version holds a content version that is still used in other asset versions (asset_fk16).

  • Keep (1) days before deletion policy (it will expire in 1 day(s).

The report shows the constraints at the date/time of execution. Therefore, the result can vary when done at different times. For example, a policy defines to keep asset versions for 6 hours. If you execute the report 3 hours after the asset version was marked for deletion, the result is different than after 9 hours.

The different constraints for deletion

Constraints on asset level


Constraint

Comment

Asset checked out

If the asset is checked out, the deletion process skips it completely. The report does not show this as a constraint.

The asset version is undeletable

Certain assets cannot be deleted. The deletion asset attribute of the asset then is set to "2". For example, the system asset cannot be deleted.

The asset is archived

Assets are not considered for the deletion process if they are archived or the archiving process has started. The current state is stored in the storage_state asset attribute. Only, if the storage_state is "0" or "1", the asset is processed by the deletion process.


Constraints on asset version level

If an asset version has a certain constraint, this does not affect other versions of the same asset. But these versions can also have the same constraint.


Constraint

Comment

Version of the asset is used as an actual placement.

For example, an image is placed in a layout. Version(s) of an image placed in a layout are not deleted. The related database constraint is asset_rel_fk3.

Version of the asset has a variant.

If a version of an asset has any kind of variant relation, this version is not deleted.

Version of the asset holds a content version that is still used in later asset versions.

The version that holds the latest content version is not deleted. The version number is equal to the latest content version number. Versions that are a content version are only deleted if it is an older content version. The related database constraint is asset_rel_fk16.

Version is the current version.

The latest version is never deleted even the deletion mode is set to Delete all versions.

Version has a snapshot flag.

Snapshots are used in the Online Channel. Use this if you want to ensure that certain versions are kept even if an asset version policy applies.

Version has a live-tag.

Live-tags are used within the Online Channel. They indicate that a certain asset version is published on the website. If you do not use the Online Channel, you can deactivate the Live-tag check in the server actions for Asset Deletion 3.


Asset version policies

Asset Deletion 3 only checks an asset if there is at least one matching asset version policy that matches. Constraints defined by asset version rules can be changed.

Asset files

The storage_deletion_queue table stores a list of asset files that can be deleted after the corresponding asset version has been deleted. Before deleting a file physically, censhare checks if the asset file is stilled used by another asset, is available online or is offline/archived.

Database constraints

censhare checks for the following database constraint in the asset deletion process:  

  • asset_rel_fk8: Asset version has an associated variant.

  • asset_fk16: Asset version stores a content version that is used in a newer version.

  • asset_rel_fk3: Asset version is used in an actual placement.

  • asset_feature_fk7: Asset version is referenced by an asset feature.

Steps

Configure the report

In the censhare Admin Client:

  1. Go to the "Configuration/Modules/Asset Deletion 3" folder.

  2. Open the Asset Deletion 3 Report server action.

  3. Check the Enabled.

  4. Max rows to be displayed field: Select the desired number of rows in the drop-down field.

    In the censhare Client, a maximum size of entries is set that the report can show. This prevents a large number of versions that might slow down the performance of the report.

    Note: The maximum number of entries is 1000.

  5. Click OK.

  6. Execute Update server configuration in the censhare Admin Client.

  7. If there are remote servers: Execute Synchronize remote servers in the censhare Admin Client.

Execute and show the report

censhare Web

How to execute the report for a certain asset from an asset list:  

  1. Click the asset action menu of the asset list entry.

  2. Select Asset Deletion report in the sub-menu Deletion.

How to execute the report for an asset opened in an asset page:  

  1. Click the asset page action menu of the top right of the asset page.

  2. Select Asset Deletion report in the sub-menu Deletion.

If there is no asset version policy, there is a warning when you try to execute the report:

Missing deletion policies: This asset has no deletion policies, please configure them on the admin client.

You can also call the report directly using the following URL: https://HOST_URL:9443/censhare5/client/asset-deletion-report?assetId=ASSET_ID

HOST_URL is the server URL that you enter to access censhare Web. ASSET_ID is the ID of the asset for which you want to call the report.

When you execute the Asset Deletion report server action, censhare shows the results in the Asset deletion report asset. There are two widgets:  

  • Report metadata: It shows the total number of versions of the analyzed asset and the number of asset versions that are already marked for deletion.

  • Report details: It shows all asset versions that have at least one constraint not to delete it.

Here is an example report:


Report metadata

Name

Basic_image.jpg

Asset ID

15349

Versions

350

Versions marked for deletion

0

Applied policy

Type

picture.

Domain

root.accnt.

Domain 2

root.



Report details

icon

Please, note that the following list of versions would not be deleted

Asset versions

Constraints

1

v

This asset version holds a content version which is still used in later asset versions (asset_fk16)

2


Keep the first (3) version(s) policy

3


Keep the first (3) version(s) policy

348


Keep the first (3) version(s) policy

349


Keep the last (3) version(s) policy

350


Keep the last (3) version(s) policy

Maximum versions per page [10  v ] 1 - 6 of 6   <   >


If there is more than one entry, censhare only shows the first one. This is done for a better overview. Click the Dropdown icon "v" left to the entry to see all constraints for this version.  

As there can be many asset versions that cannot be deleted, the report shows only a certain amount of it per page. To switch between the pages, click the ">" icon to step one page forward. Click the "<" to step one page back.  

You can configure the number of versions that the report shows per page. Click the drop-down field behind Maximum versions per page in the bottom line and select the desired number.      

censhare Client

How to execute the report for a certain asset:

  1. Click the asset to want to inspect.

  2. Click the Server actions in the top bar of the asset list.

  3. Select Asset Deletion 3 Report.

If there is no asset version policy that applies, the report shows a warning:

Asset ID: ASSET_ID - WARNING: This asset type has no policies. Add one in the asset versions table.

ASSET_ID is the ID of the selected asset.

The report in the censhare Client is shown in a simple window. If the report cannot show all version entries in the dialog window, you can scroll down/up.

Here is a sample report:

Asset ID: 15349 - Total version(s): 350 - Total marked for deletion: 0 - Policy applied from type: "picture.", domain: "root.accnt." and domain2: "root."

Please, note that the following list of versions would not be deleted

Asset version(s)

Message

1

This asset version holds a content version which is still used in later asset versions (asset_fk16) - Keep the first (3) version(s) policy

2

Keep the first (3) version(s) policy

3

Keep the first (3) version(s) policy

348

Keep the last (3) version(s) policy

349

Keep the last (3) version(s) policy

350

Keep the last (3) version(s) policy


If there are more asset versions than the report is configured to show, it displays information in the top line of the report:

Versions analyzed for this report: MAX_NUMBER".

MAX_NUMBER is the number that is defined in the configuration of server action for the report.

When you are finished with the report, click OK to leave the report.

Result

You have configured the server action for the report. You can execute the report in the censhare Client and in censhare Web. You understand the results that the report is showing. You know the difference between constraints on the asset, asset versions, asset version policy, asset file, and database level. You understand how the different constraints prevent the deletion of asset versions and asset files.  


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.