Search

September 29, 2009

Advanced file handling

Beyond the standard folder configuration, XpressDox gives template authors fine-grained control over where documents and data are saved, and what they are named. This is done through five template commands: SetSavedDocumentFolder, SetSavedDocumentFileName, SetSavedDataFolder, SetSavedDataFileName and SetDocumentName.

 

File Path Merge Fields

All five commands support File Path Merge Fields: data element values enclosed in <> that are merged into the file path or name at assembly time. For example, <AccountNumber> in a path will be replaced with the value of the AccountNumber data element captured during the interview.

 

Three system values are also available as File Path Merge Fields:

  • TemplateName: the template filename, excluding the path and file extension.
  • DocumentName: a name set by the template author using SetDocumentName (see below).
  • WindowsLogonUser: the Windows username of the current user.

 

SetSavedDocumentFolder

Overrides the Document Save Folder set in XpressDox configuration. If a relative path is specified, it is prefixed with the configured Document Save Folder to produce an absolute path.

«SetSavedDocumentFolder(Documents\<AccountNumber>)»

In this example, if the AccountNumber captured was AA000123, the document will be saved to Documents\AA000123 (relative to the configured Document Save Folder).

 

SetSavedDocumentFileName

Overrides the filename pattern set in configuration. If a relative path is given, it is made absolute using either the path from SetSavedDocumentFolder (if present in the same template) or the configured Document Save Path.

«SetSavedDocumentFileName(<DocumentName><PartyName>)»

 

SetSavedDataFolder

Overrides the Data Save Folder set in XpressDox configuration. File Path Merge Fields and relative/absolute path rules apply in the same way as for SetSavedDocumentFolder. The data filename always mirrors the document filename, with the extension .xddata.xml instead of .xml.

 

SetSavedDataFileName

Overrides the data filename in the same way that SetSavedDocumentFileName overrides the document filename.

 

SetDocumentName

Sets a document name that can then be referenced as the <DocumentName> File Path Merge Field in any of the commands above.