Document fragments are reusable parts/components of a correspondence using which you can compose letters/correspondence. The document fragments are of the following types:
A text asset is a piece of content that consists of one or more paragraphs of text. A paragraph can be static or dynamic. A dynamic paragraph contains references to data elements, whose values are supplied at runtime. For example, the customer name in a letter salutation could be a dynamic data element, with its value made available at runtime. By changing these values, the same letter template can be used to generate letters for different customers.
The Correspondence Management Solution supports two kinds to dynamic data items (variable data):
The Correspondence Management templates do not force you to create unique names when creating placeholders. If you create two placeholders with the same name, such as a text and a condition, and use them both in a letter template, the values of the placeholder last inserted is used for both placeholders. If two placeholders have the same name, their types are compared. If the types are different, then their type becomes String. Within a module, however, you cannot create multiple placeholders with the same name.
Select Forms > Document Fragments.
Tap Create > Text Or select a text asset and tap Edit.
Specify the following information for the text:
Tap Next. Correspondence Management displays the Editor page where you can add text paragraphs and data elements to the text.
The default spellchecker in your browser checks spelling in the Text editor. To manage the spelling and grammar checking, you can edit your browser’s spellchecker settings or install browser plugins/addons to check spelling and grammar.
You can also use the various keyboard shortcuts in the text editor to manage, edit, and format text. For more information on Text Editor keyboard shortcuts in Correspondence Management Keyboard Shortcuts.
A text editor opens, enter the text. Use the toolbar at the top of the page to format the text, insert conditions, link, and page breaks.
A text editor opens. Enter the text. The toolbar changes depending on the type of edits you choose to make: Paragraph, Alignment, or Listing:
Select type of toolbar: Paragraph, Alignment, or Listing
Paragraph toolbar
Alignment toolbar
Listing toolbar (Click to open full-sized image)
To reuse one of more paragraphs of text that exist in another application, such as from MS Word or HTML pages, copy and paste the text into the text editor. The formatting of the copied text is retained in the text editor.
You can copy and paste one or more paragraphs of text in an editable text module. For example, you may have an MS Word document with a bulleted list of acceptable proofs of residence such a following:
You can directly copy and paste the text from the MS Word document to an editable text module. The formatting such as bulleted list, font, and text color is retained in the text module.
The formatting of pasted text, however, has some limitations.
If required, insert special characters in the document fragment. For example, you can use the Special Characters palette to insert:
Correspondence Management has built in support for 210 special characters. The admin can add support for more/custom special characters by customization.
To highlight\emphasize parts of text in an editable inline module, select the text and tap Highlight Color.
You can either directly tap a basic color **[A]**
present in the Basic Colors palette or tap Select after using the slider **[B]**
to choose the appropriate shade of the color.
Optionally, you can also go to the Advanced tab to select the appropriate Hue, Lightness, and Saturation **[C]**
to create the precise color and then tap Select **[D]**
to apply the color to highlight the text.
From the data panel, drag-and-drop data dictionary elements and placeholder elements to the text.
To:
Placeholder elements as specified in sample data file of a Data Dictionary
Placeholder element values in the CCR view populated from the Data Dictionary variables as specified in the sample data file
You can also use the @ symbol to search and add data dictionary and placeholder elements to the text editor. Place the cursor where you want to insert the element. Type @ followed by the search string. The text editor performs the search operation on all data dictionary and placeholder elements available in the text document fragment. The search operation retrieves and displays the elements containing the search string as a drop-down list. Navigate through the search results and click the element that you want to insert at the cursor location. Press Esc to hide the search results.
You can use inline conditions and repeat to make your letter highly contextual and well structured. For more information on inline condition and repeat, see Inline conditions and repeat in letters.
Tap Save.
Execute the following steps to create a hyperlink in a text asset:
Select the text or the data model object in the text editor.
Tap Link. Tap Alt Text field to remove the existing data model object name or text.
Specify the URL and tap .
When working with text elements containing a large body of text, you need to search for a specific text string. You may also need to replace a specific string of text with an alternative string.
The Find and Replace feature allows you to search for (and replace) any string of text in a text element. The feature also includes a powerful regular expression search.
Open the text module in the text editor.
Tap Find & Replace.
Enter the text to search in the Find text box and press Find. The search text is highlighted in the text module.
To search for the next instance of the text, press Find again.
If you continue to press the Find button, the search continues down the page. After the last instance of the text is found, the message Reached end of module indicates that no more search results were found.
However, if no instance of the search text is found in the text module, the message displayed is: Match Not Found.
If you press Find again, the search continues at the top of the page.
Match Case: The search returns results with the same case only.
Whole word: Search returns only whole words.
If you enter any special characters in the Find text box, the Whole Word option is disabled.
Reg ex: Search using regular expressions. For example, the following regular expression searches for email addresses in a text module:
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}
Open the text module in the text editor.
Tap Find & Replace.
Enter the text to search in the Find text box and the text to replace the find text with and press Replace.
If the search text is found, the text is replaced by the Replace text.
If you press Find again, the search continues at the top of the page.
Use the Replace All option to replace all the instances of a text in the text module. When you do us ``, the number of replacements is displayed as a message in the Find and Replace dialog.
Use a consistent naming convention to avoid duplication.
Use appropriate data dictionary binding in text modules.
The following rules apply when using the Text Editor when changing a text asset:
A list is a group of document fragments, including text, (other) lists, conditions, and images. The order of the list elements can be fixed or editable. While creating a letter, you can use some or all of the list elements to replicate a reusable pattern of elements. Lists basically behave as targets that can be nested within other targets.
Implementing lists consists of two steps:
A list is a group of related content that can be used in a letter template as a single unit. Any kind of content can be added to a list. Lists can also be nested. List modules can be specified as:
Select Forms > Document Fragments.
Select Create > List.
Specify the following information for the list:
Tap Next.
Tap Add Asset.
To add assets to the list, select them in the Select Assets page and tap Done.
The assets are added to the List Items page.
To change the order of the assets within the list, tap and hold the arrows icon ( ) and drag-and-drop. When the user opens a letter template in the Create Correspondence user interface, the content is assembled in the order you defined here.
You can select the following options to specify how the list behaves in the CCR user interface:
Library Access: To enable library access for adding assets, tap Library Access. When Library Access is enabled, the claims adjustor can add more content to the list. Otherwise, the Claims Adjustor is limited to the content you have defined for the list.
Lock Order: To lock the order of the assets in the list so that the Claims Adjustor cannot change the order, tap Lock Order. If you do not select this option, the Claims Adjustor can change the order of the list items.
Add Bullets: Use this option to apply a bullet or numbering style to the module. You can use either a predesigned list style or a custom one. You can also specify the text to be displayed before and after each of the list items.
Page Break: Select this option ( ) to add a page break between the list contents. When this option is not selected (
), if the contents of the list are overflowing to the next page, the whole list is shifted to the next page instead of breaking in the page between the list.
Assignment Configuration: Use this option to specify minimum and maximum number of assets that can be added to the list.
You can select the following options to specify how each asset in the list behaves at runtime:
Tap Save.
Use a consistent naming convention to avoid duplication.
Use appropriate data dictionary binding
The following rules apply when using the List Editor to change a list:
Conditions enable you to define what content gets included at correspondence/ letter creation time, based on the supplied data. The condition is described in terms of control variables. When you add a condition, you can choose to include an asset based on the value that the control variable has.
Based on the options you choose, either only the first expression that is found to be true, based on current condition variable is evaluated or all the condition. When filling the letter in Create Correspondence (CCR), conditions behave as “white boxes”. If a condition results in a list, all the list’s mandatory and pre-selected items are output. If any of those items are conditions or lists themselves, their resulting content is output as well, in top-down, depth-first order as a flat list of text and image content. Condition results can be of any type (text, list, condition, or image).
The Condition Editor comes with an Expression Builder user interface that supports creating expressions using both multiple placeholders and Data Dictionary elements. You can use common operands and local / global functions in such expressions. Each expression can be associated with some content and optionally there could be a default section if none of the expressions evaluates to true. All expressions are evaluated in the sequence in which they are defined and the first expressions returning true is selected and its associated content is returned by that conditional module.
For example, if the terms and conditions text in a letter differs depending which state the customer is in, and the data dictionary contains an element called “state”, then you could add the condition as follows:
The Condition editor enables you to specify a default condition. If the value of the control variables does not match any of the conditions, then the content associated with the default condition is used. Following the previous example, you could add this condition row:
Select Forms > Document Fragments.
Select Create > Condition.
Specify the following information for the list:
Tap Next.
Tap Add Asset.
To add an asset to the Condition, select it in the Select Assets page and tap Done. The assets are added to the Expression pane.
You can select the following options to specify how the condition behaves at runtime:
To change the order of the assets within the condition, tap and hold the arrows icon ( ) and drag-and-drop. When the user opens a letter template in the Create Correspondence user interface, the content is assembled in the order you defined here.
Tap Delete to delete the row. If you tap Delete for the default row, only clears the asset information.
Tap Copy to duplicate a row.
Tap Edit to change the asset or edit the expression.
Further:
Use a consistent naming convention for easy search and to avoid duplication.
Conditions behave like case statements, so order of condition is important. The first match is returned.
Use appropriate data dictionary binding
The following rules apply when using the Condition Editor to edit a condition:
A layout fragment is based on XDPs created in Designer. For creating layout fragments, you need to create the XDPs and upload them to AEM Forms.
One or more layout fragments can form parts of a letter and define the graphical layout of those parts. A layout fragment can contain typical form fields, such as Address and Reference Number, and empty subforms that denote target areas. In addition, layout fragments allow you to create tables and insert them in letters.
A common use case is to locate reusable layout patterns in Letters and create layout fragments for them. For example, the salutation, address, and subject part of the letter, which appears in the same order multiple letters. Another example could be a table similar number of rows and columns used in multiple letters.
You can create a layout fragment based on an existing XDP. A layout fragment can either be made up of fields and target areas or one or more tables. The tables in a layout can be static or dynamic. An XDP is created in Designer and uploaded to AEM Forms. An XDP can form the structure either of a layout fragment or of a letter. More information on Layout Design.
Using fragments that are bound to target areas allows the letter to be changed at the time of authoring. Layout fragment with different dimensions can be created and the appropriate fragment can be bound to the target area. Layout fragments also allow you to customize some of the table properties:
Before performing this procedure, create an XFA fragment using Designer. The fragment can contain tables for organizing fields and target areas. Designer allows creation of two types of tables: static and dynamic. Static tables contain a fixed number of rows. Static tables can contain target areas and fields. These target area and fields cannot be bound to repeating DDEs. A dynamic table can have a single row also. The data bound to table cells determines the number of rows for dynamic tables. A dynamic table can contain only fields. DDEs can be repeating or non-repeating.
Consider the following points when designing tables:
For placeholder tables, you can customize following properties at the time of fragment creation.
For a non-placeholder table, you can customize following properties:
You can nest fragments in a letter. This implies that you can add a fragment within a fragment. The Correspondence Management solution supports up to four levels of nesting within a letter: Letter->Fragment->Fragment->Fragment->Fragment.
For a detailed example of using static and dynamic tables in layout fragments, see Example with sample files: using static and dynamic tables in a letter.
Select Create > Layout Fragment.
Correspondence Management displays the available XDPs. Select the XDP on which you want to base your layout fragment and tap Next.
Specify the following information for the layout:
Tap the Table tab and specify the following information for the layout:
Configuration for: Select the table being configured.As a suffix to the table name in the dropdown is (Static) if the table is a static one or (Dynamic) if the table is a dynamic table. Static tables contain a fixed number of rows. Static tables can contain target areas and fields. These target area and fields cannot be bound to repeating DDEs. The data bound to table cells determines the number of rows for dynamic tables.
Rows: Select the number of rows for the layout. The configured row count must be greater than or equal to the original row count.
Columns: select the number of columns for the layout. The configured column count must be greater than or equal to the original column count.
For each column following details are required:
For a detailed example of using static and dynamic tables in layout fragments, see Example with sample files: using static and dynamic tables in a letter.
Tap Save.
For instructions on uploading/importing an XDP to Correspondence Management, see Importing and exporting assets to AEM Forms.
When creating target areas in Designer, it helps to set the default binding for all new subforms to “none”.
To set the default binding:
In Designer, tap Tools > Options > Data Bindings > Subform Binding.
In the Default Binding for New Subforms list, select No Data Binding.
This ensures that subforms inserted using the Insert > Subform command or by drag-and-drop from the Object Palette has a binding of “none” by default. This means that by default, any new subform is a target area unless you add content to it, change its binding setting, or name the subform with an “_int” suffix.
If the finished letter created in the Create Correspondence user interface is used for filling in a later workflow. Follow these recommendations related to Section 508 when creating the layout. Otherwise, the letter PDF is for display, and you can disregard these recommendations:
/field/assist/speak@priority="toolTip"
and specifying tool tip text in /field/assist/toolTip
.
While designing a layout in Designer, ensure that the formats for date fields match the date formats specified in Data Display Formats in Correspondence Management Configuration Properties. For more information, see “Formatting field values and using patterns” in Designer Help.
When dealing with a combination of dates, such as startDate - endDate, use a single subform to ensure correct alignment in the finished letter, and to minimize the number of fields.
When a layout contains many fields and target areas that are mapped to single XML elements, use form-level binding and create a separate node for each element. Fields that are bound at the form level are ignored when mapping data in Correspondence Management.
Subform targets areas in a master page are not visible in the Manage Assets user interface and data cannot be mapped to them.
When designing the layout, take care when choosing subforms. If the layout contains a single subform, it can be a flowed type. After you position fields in the subform, you can wrap it in another subform so that the wrapped subform is also flowed and the layout will not be disturbed.
Note the following when you place a field on a master page:
Many letter templates contain tables. Tables can be static, such as a table of terms and conditions, where each row represents one condition and each part is shown in a separate column. Tables can also be dynamic such as account information, which contains information such as customer name, account id, transaction number, and transaction amount.
The DD has a collection element Nominee_details which has a composite element with three primitive elements: Nominee_name, Nominee_address, and Nominee_gender.
The dynamic XDP also has the same headers. So you can map the dynamic XDP fields with the above mentioned fields of DD.
This example shows how you can create a dynamic and a static table, bind the dynamic table to DDEs, and then create a letter that includes these two tables. While working with this example, you can either create files from scratch or use the input files given in the steps.
Create a Data Dictionary (DD) that you want to use in the example, as represented in the graphic.
Then select DD and export sample data. The XML file you get contains Employee data and three instances for Nominee_details (by default 3 instances are downloaded. You can add or delete according to your requirement). Update the values and then import test data in DD. The CMP file is the package and it has the DD in it. So, import the DD to Correspondence Management.
For more information on working with Data Dictionary and test data, see Data Dictionary.
In Designer, create two XDPs (layout fragments): a dynamic table and a static table. For both the layouts:
Or, use the static and dynamic XDPs attached with this step.
For more information on working with Layout Fragments, see Layout Fragments.
For more information on designing layouts, see Designer Help.
Upload the XDPs to AEM Forms.
Create a layout fragment based on the dynamic XDP. The Table tab of the properties displays that the table is dynamic (Configuration For field). The number of rows (1) and columns (3) are derived from the XDP/Layout Fragment.
This layout’s fields are later bound to the imported DD and in the letter, the number of rows are dynamically created based on the number of records in the test data file (the XML data file attached with the DD).
Click to open full-sized image
Create a layout fragment based on the static XDP. The Table tab of the properties displays that the table is static (Configuration For field). The number of rows (1) and columns (3) are derived from the XDP/Layout Fragment.
You can change the number of columns and rows here. According to what you choose in this screen, the number of rows and columns of a static table remain fixed in the letter that is created with this layout.
Create a letter using both the layout fragments in it. When you insert the dynamic XDP in the letter, set the binding of its fields to the Data Dictionary’s collection elements.
For more information on creating Letters and Letter templates, see Create Letter.
Save the letter and preview it. When you preview the letter, the values from the Data Dictionary show in the letter. For the dynamic table, there are three rows. This is because the test data has three records for these rows.
For the static table, there are as many rows and columns as you specified while creating the layout fragment.
For the dynamic table, the three rows appear according to the number of records in the test data file. This happened because while adding the layout to the letter, you created a binding between the dynamic table’s fields and the data dictionary’s collection elements. The Name, Address, and Gender values are populated from the test data file you used.
To quickly create a document fragment with properties and content similar to an existing document fragment, you can copy and paste it.