Enabling Events for Microsoft Documents
Note: The information below assumes you have knowledge of programming in C# and .NET, and in using Microsoft Visual Studio.
Accolade can perform various actions on documents with Microsoft file extensions in response to the following events in Accolade:
- BeforeDocumentRefresh
- AfterDocumentRefresh
- BeforeDocumentSave
- AfterDocumentSave
- BeforeDocumentDownload
- AfterDocumentDownload
To specify what action is taken in response to each event, create an assembly to respond to the events and then edit the CustomEvents.config file to enable the assembly.
To create the assembly:
Important! The assembly must be created using a .NET language such as C# or VB.NET.
- Create a new class library project in Visual Studio with any assembly name and namespace.
- Create references to the following components:
- Sopheon.Accolade.Models.Domain
- Sopheon.Global.Utilities
- (Optional) Sopheon Global Utilities Logging (if logging)
- Create public, non-static classes with default constructors.
You can create a single class to implement any or all of the following interfaces, or create a class for each interface described below:
- Sopheon.Sgm.Accolade.Models.Domain.Interfaces.CustomEventing.
IDocumentRefresh - Contains signatures for methods for BeforeDocumentRefresh and AfterDocumentRefresh events - Sopheon.Accolade.Models.Domain.Interfaces.CustomEventing.
IDocumentSave - Contains signatures for methods for BeforeDocumentSave and AfterDocumentSave events. - Sopheon.Accolade.Models.Domain.Interfaces.CustomEventing.IDocumentDownload - Contains signatures for methods for BeforeDocumentDownload and AfterDocumentDownload events.
You can implement interfaces either implicitly or explicitly.
BLL classes can be instantiated from the Sopheon.Sgm.BusinessLayer namespace to retrieve additional data as needed.
Find the data types for the interfaces in the following namespaces:
Data Type | Namespace |
---|---|
SgmID |
Sopheon.Global.Utilities.IDs |
EventDocument |
Sopheon.Accolade.Models.Domain.Entities. |
CustomEvent |
Sopheon.Accolade.Models.Domain.Entities. |
CustomEvent |
Sopheon.Accolade.Models.Domain.Entities. CustomEventing |
- Compile the assembly and copy it to the following location on the application server: C:\Program Files\Sopheon\Accolade\Website\Bin.
To enable the assembly:
- On the application server, open the CustomEvents.config file located in C:\Program Files\Sopheon\Accolade\Configuration.
- Uncomment the customEvents element.
- For each custom event that you want to be handled, ensure that the enabled attribute is set to True. Change the attribute value to False for events that you do not want to enable.
- For each enabled event, enter the fully qualified class name into the event's Type attribute.
The fully qualified class name uses the format <namespace.class name>, <assembly name>
Notes:
|