HotDocs.Server.Session Class

A Session represents an instance of HotDocs Server for an individual user of your host application. For example, when a new user logs on to your host application, you would first create a Session for that user, which would keep track of which templates the user selects for assembly. As templates are selected for assembly, they are added to the Assemblies queue. Then, after HotDocs Server has assembled the documents, they are moved to the CompletedAssemblies queue.

Namespace: HotDocs.Server
Assembly: HotDocs.Server in HotDocs.Server.dll

This class implements the following interfaces:

  • IDisposable: The class can be disposed.

Methods

Method Description
Session (Constructor) This constructor initializes a new instance of the Session class.
AddLogEntry This method adds an entry to the HotDocs Server log file. Although this method is frequently used for error messages, you could use it to record any kind of information in the HotDocs Server log file. For example, you could add a log entry when a user first logs on to your host application.
AppendDocumentFile This method appends one document to the end of another document. For example, if you assemble two separate documents, you could then use this method to combine them into one document.
ConvertHTMLToRtf This method converts an HTML document to an RTF document.
ConvertRTFToHTML This method converts an RTF document to an HTML document. For example, HotDocs Server uses this method when it displays a document preview during the interview.
ConvertRTFToPDF This method converts an RTF document to a PDF document.
Dispose This method is an implementation of the IDisposable.Dispose method that releases unmanaged resources held by an instance of the Session class.
GetDocumentFileExtension This method returns the file name extension of documents assembled from a specific template. For example, if you are assembling a HotDocs form (.HFT) template, the file name extension for an assembled document is .HPD. Likewise, the file name extension for an assembled Word RTF template is .RTF.
GetHotDocsVersion This method returns the version of HotDocs that was used to publish a given template.
GetInterviewVersion Deprecated. This method returns the HotDocs version number that was used to publish the template for use with HotDocs Server.

Properties

Property Description
Assemblies [Read-only] This property returns an AssemblyCollection object, which represents a collection of all assemblies in the current session that have not been completed. Along with the CompletedAssemblies property, this property represents the assembly queue, which is the list of templates that will be assembled during the lifespan of the current Session object. As each Assembly in the collection is completed, HotDocs Server moves it from the "incomplete" queue to the "complete" queue.
CompletedAssemblies [Read-only] This property returns an AssemblyCollection object, which represents a collection of all assemblies completed during the current session. Along with the Assemblies property, this property represents the assembly queue, which is the list of templates that will be assembled during the lifespan of the current Session object. As each Assembly in the collection is completed, HotDocs Server moves it from the "incomplete" queue to the "complete" queue.
CurrentAssembly [Read-only] This property returns the current, active Assembly, which is the first item in the Assemblies collection.
DefaultHotDocsCSSUrl [Read/Write] This property represents the URL of the default user cascading style sheet (e.g., http://MachineName/HDServerFiles/stylesheets/hdsuser.css) that HotDocs Server should use each time it creates a new Assembly for the current Session.
DefaultAssembleMarkupDocument [Read/Write] This property indicates whether or not documents will be assembled in Markup View by default for each Assembly created in the current Session.
DefaultDocumentPreviewUrl [Read/Write] This property represents the URL of the default document preview handler page.
DefaultHotDocsJavascriptUrl [Read/Write] This property represents the default URL that HotDocs Server should use for Javascript files. For example, whenever a new Assembly object is created, it uses this URL by default. (If the DefaultHotDocJavascriptUrl property is not set, you must set the Javascript URL for each assembly individually.)

DefaultInterviewDefinitionUrl

[Read/Write] This property represents the URL where the interviews will request the definition by default.
DefaultStatelessInterview [Read/Write] This property indicates whether or not interviews created for each assembly in the current Session will be stateless by default. (In a stateless interview, the complete answer collection is sent to and returned from the interview, which means the server does not need to keep any state information between requests to get an interview and assemble a document.)
ID [Read-only] This property returns a unique identifier (GUID) for the Session object.
PDFAdvantageInstalled [Read-only] This property returns a Boolean value indicating whether or not HotDocs Server can assemble PDF-based templates. You should check this property before assembling a PDF-based form (.HPT) template to avoid errors generated by attempting to assemble an .HPT template without PDF Advantage.