Special changes to pages, tabs, and widgets
Learn about special modifications of the standard workspace structure. For example, deactivating assets in the standard structure, hiding tabs, creating a widget configuration, dynamic visibility, and widget selection lists.
Deactivating pages, tabs or widgets
You do not need resource replace variants to deactivate assets in the standard workspace structure. Instead, you just set the asset to "Not active". This feature remains even after an update. Using this way, you also deactivate workspace templates.
Unneeded pages (green), tabs (blue) or widget configurations/widgets (red) in censhare Web can be deactivated in the standard workspace structure.
Look for the desired asset in the standard workspace structure and open it in an asset page. Go to the "Resource" widget. You'll typically find that on the "Overview" tab or in the "Details" tab. Open the widget to edit it and remove the check in the "Active" field.
Hiding the editor tabs
censhare Web provides you with an editor for a certain asset type in its own tab on the asset page. For users with specific roles, this can be hidden. They have access to the asset itself and to the data stored in the features, but can't actually edit the asset data.
Using resource replace variants, tabs of an asset page can be hidden for certain user roles.
To do that, create a resource replace variant for the corresponding asset-type page. Open the replace variant in an asset page and go to the "Containers" widget, which lists all of the tabs for that page. Go to the "Editor" tab in the list and remove it with the "Delete relation" option from the asset action menu of the entry.
You also need to configure the roles for the replace variant that the "Editor" tab is not supposed to see. The roles are saved to the relation between the asset-type page and the replace variant. You add roles using the "Edit relation metadata" command.
Creating widget configurations
Introduction
The standard workspace structure already has a number of widget configurations. They contain the configuration for a certain workspace widget. However, censhare does not have configuration widgets for all settings options, so it gives you the chance to create your own and add them to the tabs.
Some configuration widgets (red) can be added to a tab (green) using resource replace variants (green).
For all static pages or asset-type pages where the user is allowed to place new widget configurations, you need to add these to the widget selection list for the page definition. Only then will the user see the new widget configuration in the selection list as well.
In addition, you need to place the widget configuration on the desired tabs. To do this, create a resource replace variant for the container (tab) and add the widget configuration to the replace variant of the "Widget configuration" widget on the "Overview" tab.
Resource replace variants will then be created for the desired workspace pages and containers (tabs).
Creating widget configuration assets
Create an asset of the type "Left workspace navigation item" using the "New asset" option in the "Create asset" function. When doing so, give it a suitable name and resource key.
censhare then opens the widget configuration in an asset page. Then you assign a name and description that will be shown when the widget configuration appears in the "Add widget" selection list. If you forget this step, censhare takes the asset name and the description field remains empty in the selection list.
You can also create names and descriptions for different languages or create one name and description for all languages. In both cases, go to the "General" widget on the "Details" tab and edit the widget. If there should only be one description for all languages, enter that in the "Description" field.
The field "Name localized" is for the name of a specific language. Here you enter the name and the associated language. Use the + button to add entries for other languages.
There is also the "Description (localized)" field for descriptions in the various languages. There is a + button here as well for adding languages.
Configuration parameters for widgets
Two things are required for the actual configuration of the associated workspace widget. You have to specify once which widget the widget configuration applies to. Furthermore, you need to save the necessary configuration parameters in an XML snippet in the widget configuration for the widget.
To link the widget configuration asset with the widget asset, go to the widget configuration on the "Overview" tab of the "Widget configuration from" widget. Click the + button and select the associated widget asset.
Enter the XML configuration in the workspace in the field "Internal workspace configuration" in the "Properties" area. The XML snippet looks different depending on the widget in question.
You can look for a suitable widget configuration in censhare and then copy and modify the XML snippet. The configuration widget for the standard structure can be found as XML files in the directory:
~/censhare/censhare-Server/install/system/required/web/workspace/02_preconfigured-widgets
The XML snippet for the configuration can be found in the XML tag <asset_feature feature="censhare:workspace.configuration"> ...
Purpose | Displaying metadata |
XML snippet | <configuration editable="true" templateKey="{dialog-template-resource-key}"/> |
Note | dialog-template-resource-key = Resource key for the suitable dialog template |
Purpose | Widget uses a transformation |
XML snippet | <configuration transformationKey="{transformation-resource-key}"/> |
Note | transformation-resource-key = Resource key for the transformation |
Purpose | Displaying search results in a list |
XML snippet | <configuration editable="true" storedSearchId="censhare:search_images"/> |
Note | storedSearchId = Resource key for the saved search |
Purpose | Displaying the linked/referenced assets in a list |
XML snippet | <configuration relationType="{relType}." direction="{direction}" fileDnDEnabled="true" listSize="2"/> |
Note | relType = Type of relation, for example "user.author.", |
Purpose | Displaying a web site in a widget |
XML snippet | <configuration sourceURL="XXX"/> |
Note | XXX = URL of the web site, for example "https://www.censhare.com/en" |
Configuring widget selection lists
Every workspace page that configures a static page or an asset page will contain a list of widget configurations. These are the only ones a user can add to a page. If the selection list is empty, the user can instead add workspace widgets. He/she has to configure them first, however.
Every workspace page has the widget "Available widget configurations".It lists the allowed widget configurations. The list saves the resource keys for the widget configurations in order to reference them. For every resource key, there is a feature "Workspace widget configuration" in the workspace container asset.
Use the + button to add widget configurations. Use the menu option "Delete relation" for an entry in the list to then remove a widget configuration again.
Configuring dynamic visibility
It is not always desirable for a tab or widget to be visible on a page. For example, if the widget is only supposed to appear when a certain percentage of a completeness check has been reached. Or if a tab should only be visible when the asset displayed in the asset page is also active.
Visibility of a tab or widget can be configured dynamically.
The condition for visibility is specified by an XPATH expression.
"/asset/asset_feature[@feature='censhare:enabled']/@value_long=1
For example, the expression above specifies that the widget or tab should only appear if the asset on the page is active. The XPATH expression is always related to the current asset. If the current page shows no specific asset, then the XPATH expression relates to the user asset.
The XPATH expression is determined in the "Condition" field. You can find the field in the "Visibility condition" area of the "Workspace container" widget on the "Details" tab of the workspace container asset. For widget or widget configuration assets it is the "Workspace widget".
censhare assesses the XPATH expression every time a page is opened with the tab or widget. If an XPATH expression is on both the widget configuration asset and on the widget asset, censhare assesses the asset placed on the current page. As a rule, this will be the widget configuration. Widgets can only be added in admin mode.One exception is if the widget selection list is empty for a certain workspace page.
We recommend only defining dynamic visibility where it is really needed. Every XPATH expression affects performance. The more expressions censhare has to assess for a page, the greater effect it has on performance.
Use resource replace variants instead of an XPATH expression if a widget configuration is supposed to appear depending on a certain role. Replace variants are only assessed once when a user logs in, unlike XPATH expressions.
In this case, create a replace variant for the workspace page or container on which the container or widget configuration should not appear. Then remove the container or the widget configuration on the replace variant and assign the desired role.