Generate Document of Record for adaptive forms or adaptive form fragments generate-document-of-record-for-adaptive-forms
Adobe recommends using the modern and extensible data capture Core Componentsfor creating new Adaptive Formsor adding Adaptive Forms to AEM Sites pages. These components represent a significant advancement in Adaptive Forms creation, ensuring impressive user experiences. This article describes older approach to author Adaptive Forms using foundation components.
Overview overview
After submitting a form, your customers generally want to keep a record, in print or in document format, of the information they have filled in the form for their future reference. This is referred to as a document of record.
This article explains how you can generate a document of record for Adaptive Forms or Adaptive Form fragment.
Adaptive form types and their documents of record adaptive-form-types-and-their-documents-of-record
When you create an adaptive form, you can select a form model. Your options are:
-
Form Templates
Lets you select an XFA template for your adaptive form. When you select an XFA template, you can use the associated XDP file for document of record as described above. -
XML Schema
Lets you select an XML schema definition for your adaptive form. When you select an XML schema for your adaptive form, you can:- Associate an XFA template for document of record. Ensure that associated XFA template uses the same XML schema as your adaptive form
- Automatically generate document of record
-
None
Lets you create an adaptive form without a form model. The document of record is automatically generated for your adaptive form.
When you select a form model, configure document of record using options available under Document of Record Template Configuration. See Document of Record Template Configuration.
Automatically generated document of record automatically-generated-document-of-record
A document of record lets your customers keep a copy of submitted form for printing purpose. When you automatically generate a document of record, everytime you change your form, its document of record is updated immediately. For example, you remove age field for customers who select United States of America as their country. When such customers generate a document of record, the age field is not visible to them in the document of record.
Automatically generated document of record has the following advantages:
- It takes care of data binding.
- It automatically hides fields which are marked exclude from document of record at the time of submission. No extra effort is required.
- It saves time for designing document of record template.
- It lets you try different styling and appearance using different base templates and choose best style and appearance for Document of Record. Styling appearances are optional, and if you do not specify styling, system styles are set as default.
- It ensures any change in form is immediately reflected in document of record.
Components to automatically generate a document of record components-to-automatically-generate-a-document-of-record
To generate a document of record for adaptive forms, you need the following components:
Adaptive form Adaptive form for which you want to generate a document of record.
Adaptive form fragment Adaptive form fragment for which you want to generate a document of record.
Base template (recommended) XFA template (XDP file) created in AEM Designer. Base template is used to specify styling and branding information for document of record template.
See Base template of a document of record
Document of record template XFA template (XDP file) generated from an adaptive form.
See Document of Record Template Configuration.
Form data Information filled in by a user in the adaptive form. It merges with the document of record template to generate the document of record.
Mapping of adaptive form elements mapping-of-adaptive-form-elements
The following sections describe how adaptive form elements appear in document of record.
Fields fields
Containers containers
Static components static-components
Tables tables
The adaptive forms table components such as header, footer, and row map to corresponding XFA components. You can map repeatable panels to tables in document of record.
Base template of a document of record base-template-of-a-document-of-record
Base template provides styling and appearance information to document of record. It lets you customize default appearance of auto generated document of record. For example, you want to add your company logo in the header, and copyright information in the footer of the document of record. The master page from base template is used as a master page for document of record template. The master page can have information such as page header, page footer, and page number that you can apply to document of record. You can apply such information to document of record using base template for auto generation of document of record. Using base template enables you to change default properties of fields.
Be sure you follow Base template conventions when you design base template.
Base template conventions base-template-conventions
A base template is used to define header, footer, styling, and appearance for a document of record. The header and footer can include information like the company logo and copyright text. The first master page in the base template is copied and used as a master page for the document of record, which contains header, footer, page number, or any other information that should appear across all pages in the document of record. If you are using a base template which does not conform to base template conventions, the first master page from the base template is still used in document of record template. It is highly recommended that you design your base template as per its conventions, and use it for auto generation of document of record.
Master page conventions
-
In the base template, you should name the root subform as
AF_METATEMPLATE
and the master page asAF_MASTERPAGE
. -
The master page with the name
AF_MASTERPAGE
located under theAF_METATEMPLATE
root subform is given preference for extracting header, footer, and styling information. -
If
AF_MASTERPAGE
is absent, the first master page present in the base template is used.
Styling conventions for fields
-
To apply style on the fields in the document of record, the base template provides fields in the
AF_FIELDSSUBFORM
subfrom under theAF_METATEMPLATE
root subform. -
The properties of these fields are applied to the fields in the document of record. These fields should follow the
AF_<name of field in all caps>_XFO
naming convention. For example, the field name for check box should beAF_CHECKBOX_XFO
.
To create a base template, do the following in AEM Designer.
-
Click File > New.
-
Select the Based on a template option.
-
Select the Forms - Document of Record category.
-
Select DoR Base Template.
-
Click Next and provide the required information.
-
(Optional) Modify the styling and appearance of fields that you want to apply on the fields in the document of record.
-
Save the form.
You can now use the saved form as a base template for document of record.
Do not modify or remove any scripts present in the base template.
Modifying base template
- If you are not applying any styling over fields in base template, it is advisable to remove those fields from base template so any upgrades to base template are automatically picked up.
- While modifying base template, do not remove, add, or modify scripts.
Document of Record Template Configuration document-of-record-template-configuration
Configure the document of record template of your form to let your customers download a print friendly copy of the submitted form. An XDP file serves as the document of record template. The document of record customers download is formatted according to the layout specified in the XDP file.
Perform the following steps to configure a document of record for adaptive forms:
-
In AEM author instance, click Forms > Forms and Documents.
-
Select a form, and click View Properties.
-
In the Properties window, select Form Model.
You can also select a form model when you create a form.note note NOTE In the Form Model tab, ensure that you select Schema or None from the Select From drop-down. Document of record is not supported for XFA-based or adaptive forms with Form Template as form model. -
In the Document of Record Template Configuration section of the Form Model tab, select one of the following options:
None Select this option if you do not want to configure document of record for the form.
Associate Form Template as Document of Record Template Select this option if you have an XDP file that you want to use as a template for the document of record. On selecting this option, all XDP files available in AEM Forms repository are displayed. Select the appropriate file.
The selected XDP file gets associated with the adaptive form.
Generate Document of Record Select this option to use an XDP file as a base template for defining the styling and appearance for the document of record. On selecting this option, all XDP files available in AEM Forms repository are displayed. Select the appropriate file.
note note NOTE Ensure that schema used to create adaptive form and schema (data schema) of XFA Form are same if: code language-none * Your Adaptive form is schema based * You are using **Associate Form Template as the Document of Record Template** option for document of record
-
Click Done.
Customize the branding information in document of record customize-the-branding-information-in-document-of-record
While generating a document of record, you can change branding information for the document of record on the Document of Record tab. The Document of Record tab includes options such as logo, appearance, layout, header and footer, disclaimer, and whether or not you want to include unselected check box and radio button options.
To localize the branding information that you enter in the Document of Record tab, you need to ensure the locale of the browser is set appropriately. To customize the branding information of document of record, complete the following steps:
-
Select a panel (root panel) in the document of record and then select .
-
Select . The Document of Record tab appears.
-
Select either the default template or a custom template for rendering the document of record. If you select the default template, a thumbnail preview of the document of record appears below the Template drop-down.
If you choose to select a custom template, browse a select an XDP on your AEM Forms server. If you want to use a template that is not already on your AEM Forms server, you need to first upload the XDP to your AEM Forms server.
Master Page Properties (#master-page-properties)
Based on whether you select a default or a custom template, some or all the following Master Page Properties appear in the Document Of Record tab as shown in the image above. Specify these appropriately:
-
Logo Image: You can either choose to use the logo image from the adaptive form, choose one from DAM, or upload one from your computer.
-
Form Title
-
Header Text
-
Disclaimer Label
-
Disclaimer
-
Disclaimer Text
If the custom XDP template that you select includes multiple master pages, the properties for those pages appear in the content section of the Document of Record tab.
The master page properties include Logo Image, Header Text, Form Title, Disclaimer Label, and Disclaimer Text. You can apply adaptive form or XDP template properties to the Document of Record. AEM Forms applies the template properties to the Document of Record by default. You can also define custom values for the master page properties. For information on how to apply multiple master pages in a Document of Record, see Apply multiple master pages to a Document of Record.
note note NOTE If you are using an adaptive form template created with a version of Designer prior to 6.3, for Accent Color and Font Family properties to work, ensure that the following is present in your adaptive form template under the root subform: code language-xml <proto> <font typeface="Arial"/> <fill> <color value="4,166,203"/> </fill> <edge> <color value="4,166,203"/> </edge> </proto>
- To save the branding changes, select Done.
Table and column layouts for panels in Document of Record table-and-column-layouts-for-panels-in-document-of-record
Your adaptive form may be a lengthy one with several form fields. You may not want to save a document of record as an exact copy of the adaptive form. Now you can choose a table or column layout for saving one or more adaptive form panels in the document of record PDF.
Before generating a document of record, in a panel’s settings, select Layout For The Document Of Record for that panel as Table or Column. The fields in the panel get organized accordingly in the document of record.
Fields in a panel rendered in a table layout in the document of record
Fields in a panel rendered in a column layout in the document of record
Document of Record settings document-of-record-settings
Document of record settings let you choose options you want to include in the document of record. For example, a bank accepts name, age, social security number, and phone number in a form. The form generates a bank account number, and branch details. You can choose to display only the name, social security number, bank account, and branch details in document of record.
The document of record settings of a component are available under its properties. To access the properties a component, select the component and click in the overlay. The properties are listed in the sidebar, and you can find the following settings in it.
Field level settings
-
Exclude From Document Of Record: Setting the property true excludes the field from document of record. This is script-able property named
excludeFromDoR
. Its behavior depends on Exclude fields from DoR if hidden form level property. -
Display panel as table: Setting the property displays panel as table in document of record if panel has less than 6 fields in it. Applicable for panel only.
-
Exclude title from Document of Record: Setting the property excludes title of the panel/table from document of record. Applicable for panel and table only.
-
Exclude description from Document of Record: Setting the property excludes description of the panel/table from document of record. Applicable for panel and table only.
-
Pagination > Place: Determines where you select to place the panel.
- Place > Following Previous: Places the panel after the previous object in the parent panel.
- Place > In Content Area > Name of content area: Places the panel in the specified content area.
- Place > Top of Next Content Area: Places the panel at the top of the next content area.
- Place > Top of Content Area > Name of content area: Places the panel at the top of the specified content area.
- Place > On Page > Name of master page: Places the panel on the specified page. If a page break is not inserted automatically, AEM Forms adds a page break.
- Place > Top of Next Page: Places the panel at the top of the next page. If a page break is not inserted automatically, AEM Forms adds a page break.
- Place > Top of Page > Name of master page: Places the panel at the top of the page, when the specified page is rendered. If a page break is not inserted automatically, AEM Forms adds a page break.
-
Pagination > After: Determines which area to fill after a panel is placed.The following fields are available in the After section:
- After > Continue Filling Parent: Continues merging data for all objects remaining to be filled in the parent panel.
- After > Go to Next Content Area: Starts filling the next content area after placing the panel.
- After > Go To Content Area > Name of content area: Starts filling the specified content area after placing the panel.
- After > Go To Next Page: Starts filling the next page after placing the panel.
- After > Go To Page > Name of page: Starts filling the specified page after placing the panel.
-
Pagination > Overflow: Sets an overflow for a panel or a table that spans pages. The following fields are available in the Overflow section:
- Overflow > None: Starts filling the next page. If a page break is not inserted automatically, AEM Forms adds a page break.
- Overflow > Go to Content Area > Name of content area: Starts filling the specified content area.
- Overflow > Go To Page > Name of page: Starts filling the specified page.
note note NOTE Pagination property is not available for adaptive form fragments.
For information on how to apply page breaks and apply multiple master pages in a Document of Record, see Apply page break in a Document of Record and Apply multiple master pages to a Document of Record.
Form level settings
-
BASIC
- Template: You can select the template Default or Custom.
- Accent Color: You can predefine the template Color of the Document of Record.
- Font Family: Select Font type for the Document of Record texts.
- Include unbound fields in DoR: Setting the property includes unbound fields from Schema based adaptive form in Document of Record. By default it is true.
- Exclude fields from DoR if hidden: Set the property to exclude the hidden fields from Document of Record at form submission. When you enable Revalidate on server, the server recomputes the hidden fields before excluding those fields from the Document of Record
- Template: You can select the template Default or Custom.
-
FORM FIELD PROPERTIES
-
If you tick the option For Check Box and Radio Button component, show only the selected value(s), it will generate DoR output with only selected value(s).
-
You can select Separator for multiple selected value(s) or you can choose any other separator type.
-
Options Alignment
- Vertical
- Horizontal
- Same as Adaptive Form
note note NOTE Vertical and Horizontal alignment is applicable for only Radio Button and Check Box * **MASTER PAGE PROPERTIES** Click for more information on [Master Page properties](#master-page-properties-master-page-properties)
-
Apply a page break in a Document of Record apply-page-breaks-in-dor
You can apply page breaks in a Document of Record using multiple methods.
To apply a page break to a Document of Record:
-
Select the panel and select
-
Expand Document of Record to view the properties.
-
In the Pagination section, select in the Place field.
-
Select Top of Next page and select Select. You can also select Top of Page, select the master page, and select Select to apply the page break.
-
Select to save the properties.
The selected panel moves to the next page.
Apply multiple master pages to a Document of Record apply-multiple-master-pages-dor
If the custom XDP template that you select includes multiple master pages, the properties for those pages appear in the content section of the Document of Record tab. For more information, see Customize the branding information in document of record.
You can apply multiple master pages to a Document of Record by applying different master pages to the components of an adaptive form. Use the Pagination section of the Document of Record properties to apply multiple master pages.
The following is an example of how to apply multiple master pages to a Document of Record:
You upload an XDP template that includes four master pages to the AEM Forms server. AEM Forms applies the template properties to the Document of Record by default. AEM Forms also applies the first master page properties in the template to the Document of Record.
To apply the second master page properties to a panel and the third master page properties to the panels that follow, execute the following steps:
- Select the panel to apply the second master page and select .
- In the Pagination section, select in the Place field.
- Select On page, select the second master page and select Select.
AEM Forms applies second master page to the panel and all subsequent panels in the adaptive form. - In the Pagination section, select in the After field.
- Select Go To page, select the third master page and select Select.
- Select
to save the properties.
AEM Forms applies third master page to the panel and all subsequent panels in the adaptive form.
Key considerations when working with document of record key-considerations-when-working-with-document-of-record
Keep in mind the following considerations and limitations when working on document of record for adaptive forms.
- Document of record templates do not support rich text. Therefore, any rich text in the static adaptive form or in the information filled in by the end user appears as plain text in the document of record.
- Document fragments in an adaptive form do not appear in the document of record. However, adaptive form fragments are supported.
- Content binding in document of record generated for XML Schema based adaptive form is not supported.
- Localized version of document of record is created on demand for a locale when the user requests the rendering of the document of record. Localization of document of record occurs along with localization of adaptive form. For more information on localization of document of record and adaptive forms see Using AEM translation workflow to localize adaptive forms and document of record.
Use a custom XCI file
An XCI file helps you set various properties of a document. You can use a custom XCI file to override one or more default properties specified in the existing XCI file. For example, you can choose to embed a font into a document or enable tagged property for all the documents. The following table specifies the XCI options:
Use a custom XCI file in your local Forms development environment
- Upload the XCI file to your local development environment.
- Open configuration manager.
- Locate and open the Adaptive Forms and Interactive Communication Web Channel configuration.
- Specify path of the XCI file and click Save.