HotDocs Integration - tsgrp/HPI GitHub Wiki

What does it do?

HotDocs integration allows HPI to merge data into a pre-defined template to generate a Word document. Currently this is used by the contract management scenario by gathering information using a Wizard form to generate a contract. First, the Wizard is launched as a folder action (launch from the folder where the final merged document should be stored). The Wizard form should then be filled out and finished. When the Generate Contract action is executed from the Wizard PDF, the action will look for the template name that matches the Wizard form, generate the XML answer string that HotDocs accepts from the Wizard form answers, and send both the answer XML and template to the HotDocs cloud server. The generated Word document is attached to the Wizard form as a supporting document and placed in the folder the Wizard form was launched from.

HotDocs can be set up as an on-premise server or the cloud services can be used. OpenContent is only set up to use HotDocs cloud services at this time.

How do I set it up?

1. Get a HotDocs developer account

Sign up for a HotDocs developer account - you'll need a subscriber key and signing key for this to work.

2. Download HotDocs developer tools and create a template

You can go to http://www.hotdocs.com/products/hotdocs-developer to download the HotDocs delevoper tool. This will install the developer tool that will manage the templates as well as a Microsoft Word add-on that allows you to work with HotDocs templates in Word. Once that is all installed:

  1. Drag your Word document into the developer tool.
  2. Select the template and choose the Edit tool. This will launch Word.
  3. Using the HotDocs tab in the ribbon, create variable fields. Remember these variables because they need to match the question labels in the Wizard form.
  4. Once your variables are set up and the form is saved, go back to the developer tool.
  5. Right click on your template and choose component manager.
  6. Select Component File Manager on the left.
  7. In the HotDocs Server tab make sure Enable template for use with HotDocs Server is checked and click OK.
  8. Right click on your template and choose Upload, then Save Locally
  9. Click on Save Locally and this will generate a hdpgk file, which will be uploaded to the repository later.

3. Create a Wizard Form

Create a Wizard form to collect the information you would like to send to the HotDocs template. The convention for mapping Wizard questions to HotDocs template variables assumes the Wizard question label matches the Hotdocs template variable.

4. OC Setup

  1. In your project-placeholders.properties add the below two properties with your HotDocs account information:
  • hot.docs.subscriber.id
  • hot.docs.signing.key
  1. In the repository, create the following folder structure: /hpi/{app-id}/data-merge-templates. Place your hdpkg file here. It must be named the same as the Wizard form, lowercase, with all spaces replaces with underscores. For example, the form Master Services Agreement should be named master_services_agreement (note the absence of the hdpkg extension).

5. HPI Setup

  1. Add the createWizardForm-wfDocumentDestination to your desired trac. This trac should be where the generated document will be placed. Ex: for the contract management scenario, this is the contractManagement trac.
  2. Add the generateContract action to the Wizard trac