Creating Custom HotDocs Templates
Using HotDocs Developer, you can create a template to be accessed from the Reports module in Secretariat or eCounsel or from the Corporate Meeting Wizard or Global Appoint/Promote/Retire Wizard in Secretariat. For the wizards in Secretariat, Mitratech recommends using a standard template as a basis for customizations (see below). Since no standard templates exist for eCounsel, a new template must be created (see Creating a New Template).
Setting Macro Security in Microsoft Word
If the macro security setting in your word processing program is set to high, you will not be able to edit a HotDocs template. Change the setting to medium. Ask your System Administrator or IT department if you need instructions. The instructions below refer to Microsoft Word 2010.
To Set Macro Security in Microsoft Word:
- Open Microsoft Word.
- On the File ribbon, click Options.
- On the Word Options dialog box, select Trust Center.
- Click the Trust Center Settings button.
- Click on the Enable all macros option.
Setting the security to Disable all macros with notification means that you will need to enable macros each time you open a template. Setting the security to Enable all macros does not require enabling macros. - Click OK.
- Click OK.
Creating a Template from an Existing Standard Template
HotDocs Developer, which must be available on your computer in order to edit document templates is needed to test and compile the template for upload into Suite.
Copying a Standard Template
When creating a new template for Secretariat, Mitratech recommends starting with an existing standard template and making changes to that template.
To Copy a Standard Template:
- Create a folder on your computer to temporarily hold the template files.
- Copy and rename a template (both the *.rtf and *.cmp files) you want to use as the base for a new customized template (HotDocs templates are available on the installation media in the Templates\HotDocs directory), saving it in the folder from Step 1. Mitratech recommends selecting a template similar to the one you would like to produce.
Creating a New Library
Every template in HotDocs Developer must reside in a library, which is only used to classify the templates while developing them.
To Create a New Library:
- Open HotDocs Developer.
- On the HotDocs Developer window, click the New Library button.
- On the New Library dialog box, type a name in the File Name field (such as “Custom Templates”), then press the <TAB> key twice to add the library extension to the filename and populate the Title field.
- Click OK.
Adding a Template
Existing templates can be added to a library as long as the RTF and CMP files are available for the template.
To Add the Copied Template:
- On the HotDocs Developer window, click the Add Item button.
- On the Add Item dialog box, leave the type as is, then click the Browse button to select the template from Step 2 in “To Copy the Standard Template”.
- Click OK.
Editing a Template
Once a template has been added to HotDocs Developer, it can be previewed and edited in Microsoft Word as needed.
To Edit the Custom Template:
- On the HotDocs Developer window, click the Preview tab to verify the correct template has been selected.
- Click the Edit button.
- Modify the template as needed in Microsoft Word, adding any necessary variables to the template. Be careful not to remove any variables (in blue text) that you want to contain values in the generated document. See Using HotDocs to Customize a Standard Template for more information.
Saving a Template
After a template has all the customizations completed, you can save the template for testing and publishing.
To Save the Custom Template:
- When you have finished editing the template in Microsoft Word, click the Save button on the HotDocs ribbon. Do not save the document using the Microsoft Word save functionality.
- Close the document; again using the Save and Close button on the HotDocs ribbon not the word processor ribbon.
Testing a Template
Each template should be tested in a browser because Suite integrates with HotDocs Web application. Any errors that are encountered must be resolved before publishing the template.
To Test the Template:
- Right-click on the template in the left pane of the HotDocs Developer window, select Test in Browser from the popup menu, and select JavaScript.
- On the Answer File dialog box, click OK.
- The Interview wizard will start. This wizard prompts the user for information for template variables that it was unable to fill from the database. At this time, do not enter any information; click Finish.
- Click OK on the message box that unanswered questions remain.
- Click Don’t Save on the message box asking to save changes to the answer file.
- The document will open again. Close the document without saving.
Publishing a Template
Publishing a template creates the files needed by Suite to import and run the template from within Secretariat or eCounsel.
To Publish the Template:
- On the HotDocs Developer window, click the Tools menu and select the Publishing Wizard menu command.
- On the Publishing Wizard dialog box, click the Template files for use with HotDocs Server option.
- Browse to a location to create the published files or enter a location in the Local folder for published files text box, and click Next.
Do not use the location of the templates for publishing but create a new subdirectory.
- On the File Security screen, click Next.
- On the Additional Files screen, click Finish.
- On the confirmation message box, click OK.
- Locate the new files created from the steps above (<NewFileName>.CMP, <NewFileName>.RTF, and
<NewFileName>.RTF.MANIFEST.XML). These files should reside in the directory specified in Step 3.
If your Suite HotDocs Web application is hosted on an operating system that is case sensitive, make sure that the case for the <NewFileName> matches for all four files. If not, correct the naming before uploading the files. - Add the HotDocs template to the application (see Adding HotDocs Templates to Suite).
Using HotDocs to Customize a Template
When editing a template using HotDocs functionality within your word processor, the following information will aid you in this process:
- Always click the Save button on the HotDocs ribbon not the word processor command. This action is necessary to ensure that the template and the companion component file are linked. Saving the file creates a Rich Text Format (RTF) file for the document itself and a CMP component file that contains the HotDocs variables associated with the template.
- Always close the template using the Save and Close button on the HotDocs ribbon not the word processor ribbon.
- The file in the word processor window has two types of text: regular static text (typically in a black font color) and text variables/components (in a blue font color) that retrieve values from Secretariat into the template). Make sure that you do not edit a variable inadvertently when changing text in the document. Doing so will cause the variable to be unusable and the template to be invalid.
- To add a Mitratech-provided HotDocs variable to a document that is not already in the document, select the variable you want to use from the list of provided variables (see the HotDocs Variables for Secretariat/eCounsel Document Assembly technical notes for a list of variables).
Click the Component Manager button on the HotDocs ribbon. On the Component Manager dialog box, click the New Component button.
On the New Component dialog box, select the Text Variable component type and click OK.
All variables provided by Mitratech are text variables with the exception of any variable that ends with “_datetype”. For variables ending with “_datetype”, see below.
On the Text Variable Editor dialog box, type the name of the selected variable and click OK. Close the Component Manager dialog box.
In the word processor window, click the mouse pointer at the point where you want to create the variable. Click the Variable Field button on the HotDocs ribbon. On the Variable Field dialog box, select the variable you entered above and click OK.
- For variables ending with “_datetype”, these Mitratech-provided HotDocs variables can be added by selecting the Date Variable component type.
On the Date Variable Editor dialog box, type the name of the selected variable, select how you want the date to be formatted, and click OK. Close the Component Manager dialog box.
All dates from eCounsel or Secretariat will use the ISO format of YYYY/MM/DD by default.
In the word processor window, click the mouse pointer at the point where you want to create the variable. Click the Variable Field button on the HotDocs ribbon. On the Variable Field dialog box, select the variable you entered above and click OK.
- To change properties of a Mitratech-provided HotDocs variable, simply double-click the variable name in the word processor to open the Variable Field dialog box. From this dialog box, you can change the formatting for the value.
Do not change the Variable Type of any Mitratech provided variable. Doing so will cause a data type mismatch and render the template unusable.
For example, if a variable includes a forced return as part of the variable, you can specify to remove the forced returns. On the Variable Field dialog box, click the clear the checkmark from the Use default checkbox and click on the Non-breaking checkbox to select it.
- To create multiple REPEAT statements within a table in a template, you must use a computation variable. Computations can be used to format results, and require writing a script using the HotDocs scripting language. To create a computation variable, click the Variable Field button on the HotDocs ribbon. On the Variable Field dialog box, select the Computation variable and click the Edit button next to the Variable menu.
On the Computation Editor dialog box, type the name of the variable, and build the script to retrieve results and format them as needed. For example:
Creating a New HotDocs Template
HotDocs Developer, which must be available on your computer in order to edit document templates, is needed to test and compile the template for upload into Suite.
If the macro security setting in your word processing program is set to high, you will not be able to edit a HotDocs template. Change the setting to medium. Ask your System Administrator or IT department if you need instructions.
Creating a New Library
Every template in HotDocs Developer must reside in a library, which is only used to classify the templates while developing them.
To Create a New Library:
The first step in HotDocs Developer is to create a library that will contain all the templates files.
- Create a folder on your computer to temporarily hold the template files.
- Open HotDocs Developer.
- On the HotDocs Developer window, click the New Library button.
- On the New Library dialog box, type a name in the File Name field (such as “eCounsel”), then press the <TAB> key twice to add the library extension to the filename and populate the Title field. Click OK.
Creating a New Template
When creating a new template, open an existing document to copy the contents into the template or select the option to create from a new (blank) document.
To Create a New Template:
Next, a new template can be created that will reside in the library.
-
On the HotDocs Developer window, click the New Template button.
-
On the New Template dialog box, change the type to Word RTF Template (.rtf).
-
Type a file name, and then press the <TAB> key twice. Replace the title if needed, and type a description.
-
Leave the initial contents as Empty unless you have a current file to use.
-
Click OK. Microsoft Word will open a new document with the file name specified.
Creating Variables for a Template
When you create a new template, you must specify the variables for Secretariat or eCounsel that you want to use within that template.
To Create Variables for the Template:
When creating variables for Suite, use the HotDocs Variables for eCounsel/Secretariat Document Assembly technical notes for lists of available variable names. Also, any custom variables created for your company can be added using these steps.
-
On the HotDocs Developer window or HotDocs ribbon for the new template file in Microsoft Word, click the Component Manager button.
The first variable that must be created is a select variable that is used with Suite to allow the user to select a record on which the output is based. Available variables include selectentity, selectinvoice, selectmatter, and selectpeople for eCounsel, and SelectSecretariatEntity and SelectSecretariatPeople for Secretariat.
Each of these will open a list dialog box to select an entity, invoice, matter, or person, respectively. -
On the Component Manager dialog box, click the New Component button.
-
On the New Component dialog box, leave the Component type as Text Variable, and click OK.
-
On the New Text Variable dialog box, type “selectmatter” as the variable name, and then type “Select Matter” as the title (this text appears on the dialog box when preparing the document in eCounsel). Optionally, type the text that will appear as a tooltip when running the template. Click OK.
The new variable will appear in the Component Manager dialog box. -
Repeat Steps 2-4 for each variable that you want to use.
All variables provided by Mitratech are text variables with the exception of any variable that ends with “_datetype”. For variables ending with “_datetype”, select the Date Variable component type.
For subsequent templates, copy the variables from a component file by clicking the right arrow in the upper-left corner of the Component Manager dialog box. This button expands the dialog box and allows you to open a component file to select variables to copy. Select one or more variables from the existing component file, then click the left arrow to move them to the new component file.
-
Click Save to save the component file.
Adding Variables to a Template
Once a component file has been created with variables from Secretariat or eCounsel, you can add these variables to the new template.
To Add Variables to the Template:
Once you have created the variables, it’s just a matter of dragging-and-dropping the appropriate variable onto the Microsoft Word document.
- In the template file in Microsoft Word, first drag the appropriate select variable from the Component Manager dialog box onto the template.
- Next, type the text that you want to appear in the finished document.
- Where needed, drag additional variables onto the template file.
To change properties of a Mitratech-provided HotDocs variable, simply double-click the variable name in the word processor to open the Variable Field dialog box. From this dialog box, you can change the formatting for the value.
For example, if a variable includes a forced return as part of the variable, you can specify to remove the forced returns. On the Variable Field dialog box, click the clear the checkmark from the Use default checkbox and click on the Non-breaking checkbox to select it.
Do not change the Variable Type of any Mitratech provided variable. Doing so will cause a data type mismatch and render the template unusable.
To change a date format, clear the Use default checkbox, and select a format for the date.
Creating REPEAT and IF Statements
REPEAT statements are needed if a record can have multiple values for a field. For example, to return every player on a matter, you would need a REPEAT statement; otherwise, eCounsel will return only the first record found.
IF statements are useful to target data for return from Suite. For example, if only one primary attorney exists per matter, use an IF statement to specify the role you want returned so only the data you want in the document is returned.
To Create REPEAT and IF Statements:
In order to return multiple records in the document, you must use a REPEAT field. Within the REPEAT field, you also can specify an IF field to filter the data that is returned.
- In the template file in Microsoft Word, click the REPEAT Field button on the HotDocs ribbon.
- On the REPEAT Field dialog box, leave the field type as REPEAT Dialog.
- Click the New Dialog button to the right of the Dialog menu.
- On the New Dialog dialog box, type a name for the dialog variable, drag-and-drop any components to the contents list box, and click OK. Note that any field used in an IF field to filter the results must be included in the dialog.
- Click OK.
- In Microsoft Word, place the cursor between the REPEAT and END REPEAT statements, and click the IF Field button on the HotDocs ribbon.
- On the IF Field dialog box, click on the IF Expression option. Create an expression that can be used to filter the results by dragging and dropping items onto the text box. Click OK when finished.
- In Microsoft Word, place the cursor between the IF and END IF statements. Add the variables that you want to appear in the completed document. If multiple variables are placed on the document, make sure to include any punctuation to be included.
Multiple IF statements can be specified as criteria for the results by using an AND or OR operator within the IF statement.
For example, the following statements return a player name and primary address for a player with the role of “Partner” with no end date specified (notice that the additional lines of address only appear if they have data):
This construct returns the following with test data:
Retrieving Data from User Fields
For matters in eCounsel, you can include user fields in your assembled documents provided you construct your HotDocs template to retrieve the applicable values for the user field based on the tab on which the user field appears in the Matters module. The Mitratech provided variables include a “_userfieldprofileid” variable for each of the tabs in the Matters module. The profile identifier can be determined in the User Fields component of Suite Manager as follows:
Both single-record tabs and multi-record tabs use nested REPEAT statements to return user field information.
Retrieving User Fields from Single Record Tabs
For tabs with single records (such as the Patent tab above), the HotDocs template must contain a REPEAT for the tab and then a REPEAT for the user fields on the tab so that the document assembly process can return the user fields in the context of the tab on which the fields reside.
The Repeated Series dialogs contain only the variables that will be returned (including unused variables in a dialog can cause problems with the result set):
To filter the results on criteria such as a specific user field, an IF statement can be created as part of the template:
All user fields on the Patent tab are returned as shown in the interview below:
However, the IF statement restricts the assembled document to only contain the user field value that matches the filter:
Retrieving User Fields from Multi-record Tabs
For tabs with multiple records (such as the Player tab), the HotDocs template must contain a REPEAT statement to return all records on the tab with a nested REPEAT to retrieve the appropriate user field value. The Repeated Series dialogs contain only the variables that will be returned (including unused variables in a dialog can cause problems with the result set):
To filter the results on criteria such as a specific user field, an IF statement can be created as part of the template (or as shown in this example, a filter has been created and applied to the Players dialog):
All user fields on the Player tab are returned as shown in the interview below:
However, the filter restricts the assembled document to only contain the user field value that matches:
Saving a Template
After a template has all the customizations completed, you can save the template for testing and publishing.
To Save the Template:
- When you have finished editing the template in Microsoft Word, click the Save button on the HotDocs ribbon. Do not save the document using the Microsoft Word save functionality.
- Close the document; again using the Save and Close button on the HotDocs ribbon not the word processor ribbon.
Preparing a Template for Upload
When copying an existing template for Secretariat, certain settings that make the template run with HotDocs Server are already specified. However, when you create a new template, you must configure these settings for each template.
To Prepare the Template for Upload:
-
On the HotDocs Developer window, click the Component Manager button.
-
On the Component Manager dialog box, click the Properties button.
-
On the Component File Properties dialog box, click on the HotDocs Server tab, and verify that the Enable template for use with HotDocs Server checkbox is checked. If not, click in the checkbox to enable it. Click OK.
-
On the Component Manager dialog box, click the Save Component File button.
-
Close the Component Manager dialog box.
Testing a Template
Each template should be tested in a browser because Suite integrates with HotDocs Web application. Any errors that are encountered must be resolved before publishing the template.
To Test the Template:
- Right-click on the template in the left pane of the HotDocs Developer window, select Test in Browser from the popup menu, and select JavaScript.
- On the Answer File dialog box, click OK.
- The Interview wizard will start. This wizard prompts the user for information for template variables that it was unable to fill from the database. At this time, do not enter any information; click Finish.
- Click OK on the message box that unanswered questions remain.
- Click Don’t Save on the message box asking to save changes to the answer file.
- The document will open again. Close the document without saving.
Publishing a Template
Publishing a template creates the files needed by Suite to import and run the template from within Secretariat or eCounsel.
To Publish the Template:
- On the HotDocs Developer window, click the Tools menu and select the Publishing Wizard menu command.
- On the Publishing Wizard dialog box, click the Template files for use with HotDocs Server option.
- Browse to a location to create the published files or enter a location in the Local folder for published files text box, and click Next.
Do not use the location of the templates for publishing but create a new subdirectory.
- On the File Security screen, click Next.
- On the Additional Files screen, click Finish.
- On the confirmation message box, click OK.
- Locate the new files created from the steps above (<NewFileName>.CMP, <NewFileName>.RTF, and <NewFileName>.RTF.MANIFEST.XML). These files should reside in the directory specified in Step 3.
- Add the HotDocs template to the application (see Adding HotDocs Templates to Suite).
Adding HotDocs Templates to Suite
When a template is enabled for use with HotDocs Server, the following three file types are created:
When converting the HotDocs template for use with eCounsel or Secretariat, HotDocs may generate files with case that does not match. For example:
- abc_doc_boardconsent.rtf
- abc_doc_boardconsent.cmp
- Abc_Doc_Boardconsent.rtf.manifest.xml
Although you can import the files into eCounsel or Secretariat, they will not generate properly. Before importing the files, change the case of all files to match (Mitratech recommends all lowercase).
To Add a HotDocs Template to the Reports Module:
- On the Reports List page, click Documents.
- Click the New button.
- On the Welcome to the Documents Wizard dialog box, click the Browse in each field in the wizard screen and navigate to the holding directory. Select the appropriate file as shown below. Click Continue when you are done.
- For Template, select the .rtf file.
- For Component File, select the .cmp file.
- For Manifest File, select the .rtf.manifest.xml file
- When the upload is completed, click OK on the confirmation message.
- On the New Template dialog box, the Name and Category are required fields. Description is an optional, but recommended, field.
For eCounsel templates, make sure and click the checkbox for eCounsel product visibility if you use both eCounsel and Secretariat at your site.
- Click Continue.
- Click Close.
To Add a HotDocs Template to a Wizard:
HotDocs templates can only be added to the Corporate Meeting and Global Appoint/Promote/Retire Positions wizards in Secretariat.
- On the Wizards List page, click on the wizard to which you want to add a template.
- Click Edit.
- On the Wizards dialog box, click Templates.
- On the Template List dialog box, click New.
- On the Wizards dialog box, type a name for the template, select a document type, select a narrative subtype, and click Save.
- On the Welcome to the Documents Wizard dialog box, click the Browse in each field in the wizard screen and navigate to the holding directory. Select the appropriate file as shown below. Click Continue when you are done.
- For Template, select the .rtf file.
- For Component File, select the .cmp file.
- For Manifest File, select the .rtf.manifest.xml file
- When the upload is completed, click OK on the confirmation message.