Skip to main content

How-To Configure Content Meta Data Editor

1 Overview

The user can show the content metadata editor from Flatplan, both in Grid Planning and List Planning. The tab can be found in the detail panel on the right hand side. Only single selection is allowed.

cmdPanel.png

Additionally, content metadata can also be edited directly in the List Planning grid:

cmdPanel_listCmd.png

The user can add a new item, edit and remove existing items from this window, depending on the configuration of the content metadata entities. Note especially, that for deleting the tags em.crud:DELETE_YES and ui.em.crud:DELETE_YES must be set.

2 Configuration of Specific Content MetaData

Using content metadata window, it is possible to configure different editors for different entity types of content metadata and/or key names of content meta data. The default configuration file DefaultEditorsConfig.xml can be found in Ison – Administration. Full path to this file: com.priint.pubserver.plugins.priintplanner.PriintPlannerPlugin/<tenant>/custom/editors/DefaultEditorsConfig.xml. This file is part of the update process, therefore any custom change is overwritten in each Pubserver update. For custom configuration you should create the configuration file custom_DefaultEditorsConfig.xml in the same repository path.

2.1 Example 1 – Combobox for Value Editing

This example shows the configuration assuming that the user wants to use a combobox with two values: yes and no, when the user edits content metadata of type content_creation and when key is equal to content_creation_new.

Then configuration for this could be:

<con:PluginConfig xmlns:con="com.priint.pubserver.config.manager/20130620">
<con:name>custom_DefaultEditorsConfig.xml</con:name>
<con:type>DefaultEditorsConfig</con:type>
<con:custom>
<cfg:editors xmlns:cfg="http://priint.com/pubserver.appserver.config/v1">
<cfg:editor entity="content_creation" key="content_creation_new" type="ComboBox">
<cfg:values>
<cfg:value sort="1" translation="Yes" value="yes"/>
<cfg:value sort="2" translation="No" value="no"/>
</cfg:values>
</cfg:editor>
</cfg:editors>
</con:custom>
<con:dependencies/>
<con:instances/>
</con:PluginConfig>

img.png

2.2 Example 2 – Combobox with Values from Data Provider

This example shows the configuration assuming that the user wants to use a combobox with values loaded from example data provider, when the user edits content metadata of type content_creation and when key is equal to content_creation_new. The data from data provider are in form List<Map<String, Object>> each element of the list is a map where key will be used as value for save and value will be used as a label in the combobox.

Then configuration for this could be:

<con:PluginConfig xmlns:con="com.priint.pubserver.config.manager/20130620">
<con:name>custom_DefaultEditorsConfig.xml</con:name>
<con:type>DefaultEditorsConfig</con:type>
<con:custom>
<cfg:editors xmlns:cfg="http://priint.com/pubserver.appserver.config/v1">
<cfg:editor entity="content_creation" key="content_creation_new" type="ComboBox">
<cfg:values dataProvider="comboBoxTestData" />
</cfg:editor>
</cfg:editors>
</con:custom>
<con:dependencies/>
<con:instances/>
</con:PluginConfig>

Example methods used as query and data mapping for this data provider:

@PubServerMethod(label = "generateIdentifierLabelMap", type = PluginMethod.MethodType.DATA_QUERY, 
description = "Generates map with random identifier and label")
public Map<String, String> generateIdentifierLabelMap(
@PubServerMethodParameter(name="parameters", description="list of additional parameters",
defaultValue="<DataProvider.Parameters>")
Map<String, Object> parameters) {
Map<String, String> result = new HashMap<>();
for (int n=0; n<60; n++) {
String nString = Integer.toString(n);
result.put(nString, "Label ident: " + nString);
}
return result;
}

@PubServerMethod(type=PluginMethod.MethodType.DATA_MAPPING, label="Pass map of string",
description="Passes Map of String, String")
public Map<String, String> passMapOfStringString(
@PubServerMethodParameter(name="inputList", description="Passes Map of String, String",
defaultValue="<Entity.ResultList>")
Map<String, String> inputList) {
return inputList;
}

Please note that the data mapping method is part of the standard delivery.

img.png

2.3 Example 3 – Checkbox

This example shows the configuration assuming that the user wants to use the checkbox, when the user edits content metadata of type content_creation and when key is equal to content_creation_new.

Then configuration for this could be:

<con:PluginConfig xmlns:con="com.priint.pubserver.config.manager/20130620">
<con:name>custom_DefaultEditorsConfig.xml</con:name>
<con:type>DefaultEditorsConfig</con:type>
<con:custom>
<cfg:editors xmlns:cfg="http://priint.com/pubserver.appserver.config/v1">
<cfg:editor entity="content_creation" key="content_creation_new" type="CheckBox" />
</cfg:editors>
</con:custom>
<con:dependencies/>
<con:instances/>
</con:PluginConfig>

img.png

2.4 Example 4 – Checkbox with "showOnParent" attribute

This example shows the configuration of the special feature which shows on parent level value of children content metadata. The children must be of a type CheckBox and key and entity attributes must be filled with proper values.

Then configuration for this could be:

<con:PluginConfig xmlns:con="com.priint.pubserver.config.manager/20130620">
<con:name>custom_DefaultEditorsConfig.xml</con:name>
<con:type>DefaultEditorsConfig</con:type>
<con:custom>
<cfg:editors xmlns:cfg="http://priint.com/pubserver.appserver.config/v1">
<cfg:editor entity="table_attribute" key="visible" type="CheckBox" showOnParent="true" />
</cfg:editors>
</con:custom>
<con:dependencies/>
<con:instances/>
</con:PluginConfig>

When you run editor after the config is checked-in you can see the checkbox on the parent level:

img.png

Note: This checkbox is read only.