Predefined Document Type Part (ttrpi2560m100)

Use this session to specify the details for a predefined document type part of type Email Body or Overlay.

This session can be started from the Predefined Document Type Parts (ttrpi2560m000) session.

The lines on the Variables tab refer to the Variables (ttrpi2561m000) session.

Actions menu

  • Select – Used to upload or replace an existing file from the file system. This action is not available when the content source of the predefined document type part is retrieved through a download expression.
  • Extract Variables from File - Used to retrieve variables from a client file, which is useful when overlays and email bodies are stored in a Document Management System (DMS). In such cases, no file exists on the LN server, so values for the variables are only retrieved at distribution time (when the body or overlay is downloaded). Nothing is done with the selected file, only the variables are retrieved and stored in the Variables (ttrpi2561m000) session, which is linked to this session.

    This action can be performed only if the content source of the predefined document type part is retrieved through a download expression.

  • View File – Used to view the content in the browser. This action is not available when the content source of the predefined document type part is retrieved through a download expression.
  • Delete file – Used to remove the file. This action is not available when the content source of the predefined document type part is retrieved through a download expression.

Related information

  • Using predefined overlays from DMS

Field Information

Sequence

A (generated) unique number of the predefined document part.

Name

The name of the predefined document part.

Description

The description of the predefined document part.

Part Type
The type of this predefined document part.
Allowed values
  • Overlay: Indicates that this part is an overlay. The document will be overlaid with the PDF uploaded to this part.
  • Email Body: Indicates that this part is the email body used for email and fax distributions.
Language
Specify a language code if the content of the predefined document part is language-specific. Leave this field blank when the content applies to all languages.
Content Source

The content source of the predefined document part.

  • Uploaded File : Use this option to upload a file for the predefined document part. Variables are automatically retrieved from the file and added to the Variables (ttrpi2561m000) session.
  • Download Expression : Use this option to download a file based on the specified download expression for the predefined document part. Variables are automatically retrieved from the download expression and added to the Variables (ttrpi2561m000) session.
Download Expression
Specify the download expression used at runtime to download the predefined document type part content from outside LN, such as IDM. The download expression can contain document type variables (#varname#).

If you modify the download expression and the predefined part is used in a document type, a message is displayed indicating that the document type must be validated. This is required because the generated document type object contains the expression.

Example

Expression to download a file from IDM using an MDS query:

string query(2000)
long docnum, i, ret
string path(256)

query = "/MDS_File[@MDS_Name = ""emailbodyfile""]"
docnum = dom.idm.list.documents.by.xquery(query)
for i = 1 to docnum
     ret = dom.idm.get.document(dom.idm.get.document.pid(i), 
          dom.idm.get.document.filename(i), path)
     if ret = 0 then
         o.file = path
         o.mimetype = dom.idm.get.document.mimetype(i)
    endif
endfor
return(true)

Explanation

When running the Document Rendering and Distribution (ttrpi3210m000) session, this download expression queries an MDS file named ‘emailbodyfile’ and sets these variables:
  • o.file

    Identifies which file to render/distribute.

  • o.mimetype

    Ensures the correct handling of the file type.

The document type object that drives rendering and distribution already declares o.file and o.mimetype. You do not need to declare these variables in the download expression—they are predefined and expected by the document type logic.