Skip to main content
Skip table of contents

Generate resource keys - SysAdmin

The resource key of an asset is a unique identifier of a resource in censhare. Resources are Module assets that provide a functionality, a script, or a configuration in a censhare system.

Resource keys can be created with one click according to the defined pattern.

Context

Asset resource keys are a mandatory property of Module assets, and an optional property of production assets.

Prerequisites

None.

Introduction

When you create a new asset, censhare automatically creates an asset ID. This asset ID is a unique identifier of this asset in the context of the censhare system where the asset was created. When an asset is migrated to another system, for example from a staging system to a production system, a new asset ID is generated in the target system. This intended behavior ensures that no duplicate IDs exist in a censhare system.

For Module assets that are part of the system and not production assets, this is not desired. To ensure that Module assets are portable between different censhare systems, the Asset resource key was introduced. The Asset resource key can be generated in two ways:

  • Automatically, according to the pattern that is defined in the System asset.

  • Manually, according to your own conventions.

Besides that, there are resource keys of Module assets that are part of the censhare standard configuration. These resource keys are built with the following pattern:

  • censhare:asset-type.asset-name

Besides their portability, a great advantage of resource keys is that they are self-explanatory and human-readable, in contrast to the asset ID.

The Module assets and the respective resource keys are imported whenever you run the following actions in the censhare Admin Client:

  • Synchronize module assets

  • Synchronize dedicated solutions

Usage

Whenever you create a Module asset, a resource key is required. This can be a workspace configuration, transformation or dialog, for example.

Resource keys can also be used to reference assets in many contexts:

  • If you create new Features, a resource key is required as features are represented as assets. This can be a product features for a PIM system, for example. For more information, see Create asset features and Create product features.

  • In Properties widgets, resource keys reference the metadata templates that control the display and edit dialog. For more information, see Configure the Properties widget.

  • In Dynamic value lists, resource keys reference the list items. For more information, see Create dynamic value lists.

Define resource key pattern

The resource key pattern is used to generate a unique resource key with one click. The pattern is defined in the System asset. 

Generate a resource key

Note: The resource key is only mandatory in Module assets. If you create other asset types, the Create asset dialog does not display the Resource key field. If you need a resource key in these assets, use the Administration widget as described in the following section.

To generate a resource key, do the following:

  1. In the Top navigation, click Create asset and select any Module asset.

  2. In the dialog, enter a name.

  3. In the Resource area, next to the Key field, click 

     . The resource key displays in the field. Generating a resource key enables the resource automatically.

  4. Some resources require a Usage. If necessary, select the desired usage.

  5. Click OK to save the asset.

The resource key is only mandatory in Module assets. If your create other asset types, the Create asset dialog does not display the Resource key field. If you need a resource key in these assets, use the Administration widget. For more information, see the following section.

Manually add a resource key

Warning: Changing the resource key can break functionality in your system. For example: dialogs or value lists. Never change the resource key of the system relevant assets (censhare:asset-type.asset-name). This can severely damage your system!

To manually add a resource key, do the following:

  1. Open the asset on a new asset page.

  2. Go to the Administration tab.

  3. In the Generic asset administration widget, click 

     .

  4. In the Resource area, next to the Key field, click  . The new resource key displays in the field. Alternatively, enter a resource key according to the defined pattern.

  5. Click OK to save the asset.

Result

You understand the resource key concept and know how to generate resource keys.

JavaScript errors detected

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

If this problem persists, please contact our support.