Writing extensions
IDocumentEnrichmentHandler
Namespace: Lisa.Modules.Documents.Domain.DocumentHandlers
The IDocumentEnrichmentHandler interface allows you to create "enrichment" logic for manipulating document data asynchronously using the Document enrichment task in the Task Daemon. Configure that task to run when you want, and assign an implementation of the IDocumentEnrichmentHandler interface to to.
The InitializeAsync() method will be called when the task starts. This allows you to do some initialization, like fetching data from external services.
The EnrichAsync() method will then be called for each document in the model. This allows you to update the document data.
Finally, the FinalizeAsync() method will be called, which allows you to perform some cleanup if required, or to send a notification to someone that the enrichment handler has been executed.
IDocumentHandler
Namespace: Lisa.Modules.Documents.Domain.DocumentHandlers
The IDocumentHandler interface allows you to create custom logic which can be applied to models. The interface allows you to create custom validation logic which is performed when documents are added and/or updated. The Validate() method has a default implementation so you don't have to implement it - usually the IDocumentHandler interface is used in conjuction with the IDocumentAddedHandler, IDocumentUpdatedHandler or IDocumentDeletedHandler interfaces to further specify what it does.
IDocumentUpdatedHandler
Namespace: Lisa.Modules.Documents.Domain.DocumentHandlers
The IDocumentUpdatedHandler is used in conjunction with the IDocumentHandler interface, to further specify that the handler should be executed before and after documents are updated.
IManuallyTriggeredHandler
Namespace: Lisa.Modules.Documents.Domain.DocumentHandlers
The IManuallyTriggeredHandler interface allows you to add custom handlers to models, which can be manually triggered/activated by users within the Document system admin. If there are manually triggered handlers registered, Veva will show a new menu in the document system admin where there will be a menu item for each handler.
The ActionType can be "Action" or "OpenUrl". For handlers which have a action type of "OpenUrl", the Run() method needs to return that URL as a string. Once activated, the URL returned from the Run() method will simply be opened in a new window. Handlers which have a action type of "Action" will be executed async, i.e Veva will call the Run() method asynchronously, so those handlers are meant to perform some server side-processing.
If you want the user to confirm the action before it's executed, then make sure to let ShowConfirmation return true. If your handler is of the type "Action", it can have public properties marked with the [EditorBrowsable] attribute and then Veva will present those properties to the user for filling out. That way you can add settings to your handler which the user can configure before running it.
IDocumentView
Namespace: Lisa.Modules.Documents.Domain.DocumentViews
The IDocumentView interface allows you to implement your own "views" on top of documents in the documents system in Veva. The documents system includes one standard view, called the Generic HTTP View. It has various settings to control which documents to expose, such as filtering and paging. It allows the user to assign endpoints which are implementations of the IDocumentViewEndpoint interface - those control how the data is formatted and returned.
By implementing the IDocumentView interface, you can create your own view, even though the Generic HTTP View, along with the appropriate endpoints should be sufficient for most use cases.
IDocumentViewEndpoint
Namespace: Lisa.Modules.Documents.Domain.DocumentViews
The IDocumentViewEndpoint interface is used by the IDocumentView implementations, to provide functionality which takes the output of the IDocumentView and returns it in a certain format, such as XML, JSON, RSS, iCal etc. Each IDocumentViewPort implementation has an alias, which will become a part of the URL to call, a MimeType which dictates what kind of data it returns, and finally the GetData() method which takes in a DocumentQueryResult object and a context, and returns the data as a byte-array.
IDocumentExporter
Namespace: Lisa.Modules.Documents.Domain.Services
The IDocumentExporter interface allows you to implement document exporters to export data from the document system. When document exporters are registered, a "Export" button will be shown in the document system backend within each model. When the button is clicked, there will be a menu item for each registered exporter. The document system includes a couple of exporters, the JsonExporter and the XmlExporter. By adding the Lisa.Modules.CvsHelper and Lisa.Mofules.Office.EPPlus modules, additional exporters will become available. The TextDelimitedExporter and ExcelExporter respectively.
If you need to be able to export data from the document system in your own format, you can simply implement your own document exporter.
IModelTemplate
Namespace: Lisa.Modules.Documents.Domain.Services
The IModelTemplate interface allows you to define Model templates for the Document system, in code. The only method you need to implement is a read only property called JsonData. It needs to return a JSON Model definition, just like the JSON that can be viewed in the model designer in the Document system backend in Veva.
IComponentInitializer
Namespace: Veva.Core.Domain.Interfaces
This interface allows you do define initializers which can populate the properties of components when they are added onto a page. This can be used to apply default values to properties, either hard-coded or dynamic depending on where the component is being added.