How to Execute Standard Data Workflows
When you work with data in Experience Management, you use its standard data workflows. These data workflows allow you to add, edit or delete data items.
When you add or edit a data item, a data editing form opens specific to the data type in question. You can however customize the form in many cases by editing its form markup.
If you use data elements of a specific type in your console application, you can use these standard Experience Management-specific data workflows to manage the data items.
Three actions are available for executing the standard data workflows:
- AddDataAction
- EditDataAction
- DeleteDataAction
Please note that EditDataAction and DeleteDataAction can be only used with DataElements and DataFolderElements.
How to Add Data
When you want to add a child element to a tree element in C1 CMS (for example, a sub page to a page, or a data item to a data type), you use its standard Add Data workflow. Normally, you select the parent element and click Add on the toolbar or in the context menu.
It opens a specific “Add Data” form.
When added, the new item appears as a child element under the parent element.
To attach the Add Data workflow to an element, you should use an AddDataAction element:
- Locate an element you want to attach the action to.
- Add an Actions element within the element if necessary.
- Add an AddDataAction element within the Actions element.
- Set the required attribute:
- Type: The data type to add an item to
If necessary, set its optional attributes:
- Label: A custom label of the action
- Tooltip: A custom tooltip of the action
- Icon: The icon of the action that appears on the toolbar and in the context menu
- CustomFormMarkupPath: The path to an alternate Form UI XML file
<Element Label="Blog Entries" Id="Root">
<Actions>
<AddDataAction Label="Add Blog Entry" Type="Composite.Community.Blog.Entries"/>
</Actions>
</Element>
Listing 25: Attaching an Add Data action
Note that the type you specify in the Type attribute (Step 4) must match that of the child elements contained in the parent element.
When you want to edit a tree element in Experience Management (for example, a page, a datatype, or a data item), you use its standard Edit Data workflow. Normally, you select the element and click Edit on the toolbar or in the context menu.
It opens an “Edit Data” form.
To attach the Edit Data workflow to a tree element, you should use an EditDataAction element:
- Locate an element you want to attach the action to.
- Add an Actions element within the element if necessary.
- Add an EditDataAction element within the Actions element.
If necessary, set its optional attributes:
- Label: A custom label of the action
- Tooltip: A custom tooltip of the action
- Icon: The icon of the action that appears on the toolbar and in the context menu
- CustomFormMarkupPath: The path to an alternate Form UI XML file
<DataElements Type="Composite.Community.Blog.Entries" Label="${C1:Data:Composite.Community.Blog.Entries:Title}" Display="Auto">
<Actions>
<EditDataAction Label="Edit Blog Entry" />
</Actions>
</DataElements>
Note that the EditDataAction is only available for DataElements and DataFolderElements.
How to Delete Data
When you want to delete a tree element in Experience Management (for example, a page, or a data item), you use its standard Delete Data workflow. Normally, you select the element and click Delete on the toolbar or in the context menu.
To attach the Delete Data workflow to a tree element, you should use a DeleteDataAction element:
- Locate an element you want to attach the action to.
- Add an Actions element within the element if necessary.
- Add a DeleteDataAction element within the Actions element.
If necessary, set its optional attributes:
- Label: A custom label of the action
- Tooltip: A custom tooltip of the action
- Icon: The icon of the action that appears on the toolbar and in the context menu
<DataElements Type="Composite.Community.Blog.Entries" Label="${C1:Data:Composite.Community.Blog.Entries:Title}" Display="Auto">
<Actions>
<DeleteDataAction Label="Delete Blog Entry" />
</Actions>
</DataElements>
Please note that the DeleteDataAction is only available for DataElements and DataFolderElements.
When you use AddDataAction and EditDataAction, C1 CMS displays default editor forms.
Along with editing the Form Markup as described in Editing Form Markup (An Advanced Guide to Data Types) to customize the default forms, you can create your own forms and use them with these actions instead.
Refer to the form schema definition files located at:
~\Composite\schemas\FormsControls
You will normally keep the form definition files on the website in a specific folder. To start using them, you should specify the relative path to them in the CustomFormMarkupPath attribute:
<EditDataAction Label="Edit Task" CustomFormMarkupPath="~\Frontend\Tasks\Forms\EditTask.xml" />