Definition
Editor attributes are used to define the style to be used in read and write mode for an attribute.
This avoids having to redefine the style for each functional configuration. It's always possible to overload the configuration if, for a given feature, the attribute is to appear differently from the standard.
An Attribute Editor is made of two main parts:
-
The display part: the "display" part is used to describe how the Attribute value is displayed when it is inserted in a view where it is not supposed to be edited at all.
-
The edit part: the "edit" component is used to describe how the Attribute value is displayed when it can be edited by the user.
A default Attribute Editor is initialized at creation of the Attribute definition. It is however possible to modify the different parameters according to the Attribute Definition.
Configuration
You can access the Attribute Editor configuration :
-
by clicking on "Portal" → "Attribute Editors"
-
directly from the attribute configuration page by clicking on “Attribute Definition Editor”
-
by clicking on "System" → "Configurations" → "Data Model" and perform an import/export. For the ObjectReference attribute editor, the display part (popup attributes, side panel actions) can be configured in the interface. The other advanced properties can only be configured by import/export.
Properties
The properties to be configured for an attribute editor depend on the type of attribute concerned. For example, the properties to be configured for a string-type attribute will not be the same as for an identity-type attribute.
The interfaces will therefore guide the configurator through the properties to be set according to the type of attribute.
For advanced xml configuration of an attribute editor, the various properties are described for each attribute widget on a dedicated page.
Edit part example
Usage
Below you'll find two examples of how to configure the display of an attribute in a feature, one using the attribute editor and the other not (with a specific style for the feature).
|
Configuration example (for a string attribute) |
Preview |
|---|---|
|
Display of an attribute using the default attribute editor : XML
|
|
|
Display an attribute in a special way for a specific feature, thus overloading the attribute editor configuration : XML
In the case of configuration overloading, the With override=true, the feature ignores the whole attribute editor configuration. This includes the side panel actions of an Object Reference attribute: no link is displayed in this feature. |
|
We therefore recommend configuring and, above all, using the editor attribute for all attributes whose style is common to all contexts, thus avoiding the need to redefine style properties for every feature. As shown in the example above, configuring an attribute using the attribute editor is much simpler. Of course, for specific contexts where the style must be different, overriding is always possible.
Object Reference: open the referenced object in a side panel
In read mode, an Object Reference attribute shows the excerpt of the referenced object, for example the manager of an identity. You can configure this excerpt as a link. When the user clicks the link, a side panel opens and shows a feature for the referenced object.
Behavior in read mode
The excerpt is displayed as a link when all these conditions are true:
-
The attribute is displayed in read mode. In edit mode, the excerpt is plain text.
-
A side panel action is configured on the display part of the attribute editor, and it matches the type of the referenced object.
-
The current user has the access right to the target feature.
-
The attribute is not displayed in a side panel or a modal. A side panel cannot open another side panel.
If any condition is false, the excerpt is plain text.
The link is always underlined. It takes the link color of the theme on hover. The hover popup (popup attributes) still works on the link. For a multivalued attribute, each value is a separate link that opens its own object.
Configuration
-
Open the attribute editor of the Object Reference attribute ("Portal" → "Attribute Editors", or "Attribute Definition Editor" from the attribute configuration page).
-
In the display part, go to Side panel actions and add an action:
-
Object types: the types of the referenced object this action applies to. Leave it empty to apply the action to all types.
-
Feature link:
feature://followed by the id of the feature to open, for examplefeature://identity-internal-sidePanel-read/{dataKey.id}.{dataKey.id}is replaced by the id of the referenced object.
-
-
Save.
If you add several actions, the first action whose object types match the referenced object is used.
The link must start with feature://. Other links are rejected with this error: "The action of an object reference display widget must have a feature://featureId link". This rule exists because the access rights of the user can only be checked on a feature.
XML equivalent, in the config of the ObjectReferenceDisplayWidgetType display widget:
<displayWidget xsi:type="ctdbum:ObjectReferenceDisplayWidgetType">
<hidden>false</hidden>
<config>
<displayActions>
<displayAction>
<objectTypes>
<objectType>internal</objectType>
</objectTypes>
<target>
<link>feature://identity-internal-read/{dataKey.id}</link>
<sidePanelSize>SM</sidePanelSize>
<onDismiss>NONE</onDismiss>
</target>
</displayAction>
</displayActions>
<conditional>false</conditional>
<displayPopup>false</displayPopup>
</config>
</displayWidget>
Set onDismiss to REFRESH to reload the current page when the side panel closes.
Prerequisites and common mistakes
-
Target feature: the target feature (for example
identity-internal-sidePanel-read) is usually a READ feature with a short screen. It needs an access right in a feature access policy, and the i18n keysui.features.<featureId>.titleandui.features.<featureId>.subtitle. Users without the access right see the excerpt as plain text. -
Override: in the feature screen, the attribute widget must have
<override>false</override>. Withoverride=true, the attribute editor configuration is ignored, and no link is displayed (see Usage above). -
Multivalued attributes: do not set
<multiValued>false</multiValued>on the widget of a multivalued attribute. Leave the line out, so the value is read from the attribute definition. If it is forced tofalse, the values are not split, and no link is displayed.
Read Next
- Object Types
An Object Type allows to define the types of Object that will be managed in the Memority Portal application and used in Features, rules etc...
- Reference Table
A Reference Table allows to manage a list of “static” values, such as a list of countries, which can then be exposed and accessed in script rules, to ultimately present a list of choices to users in a form for example.