Creating a custom EDM provider

Note: A custom provider can only be used in an on-premises environment.

This topic provides general guidelines for creating a custom EDM provider, rather than detailed instructions. In addition to these guidelines, there are two resources in the Infor Public Sector Reference Guide that will assist you in creating a provider:

  • DocumentManagement.chm, in the API\NextGen\Core\DocumentManagement folder, contains complete documentation for the EDM interface.
  • The CodeSamples\Code\DocumentManagement folder contains some sample providers.

When you create your provider, include references to Hansen.Core and Hansen.Core.DocumentManagement. The Hansen.Core.DocumentManagement namespace includes two supporting classes that you can use to work with documents in the EDM system: Container and Document.

The Container class represents a container within the EDM system. Some EDM systems use containers to organize documents, somewhat similar to directories in a file system. Note that not all EDM systems use containers.

This table describes the properties of the Container class:

Property Type Description
ID string Unique ID for the container.
Metadata SortedDictionary<string, string> The container’s metadata.
Name string Name of the container as it is displayed in the EDM system.
Thumbnail URI string URI of the thumbnail image associated with the container.

The Document class represents a document in the EDM system. This table describes the properties of the Document class:

Property Type Description
Container Container Container in the EDM system where the document is located.
DisplayName string Name of the document as it is displayed in the EDM system.
DocumentURI string URI of the document.
ID string Unique ID for the document.
Metadata SortedDictionary<string, string> The document’s metadata.
ThumbnailURI string URI of the thumbnail image associated with the document.
DisplayMethod DisplayMethods enumeration Indicates how the EMD provider will show attachments to the end user. Attachments can be shown in the browser or in the download dialog box.
MimeType string Defines a mime type when the EDM provider shows attachments in the browser. This property is ignored if the download dialog box is shown.

You can use one of two interfaces to create your provider, depending on whether your EDM system supports document types.

  • If document types are supported, use the IEDMSDocumentTypeProvider interface.
  • If document types aren't supported, use the IEDMSBasicProvider interface.

If you're using the IEDMSDocumentTypeProvider interface, you must implement these methods. (The parameters are described below.)

  • AddDocument: Adds a new document to the EDM system.

    Document AddDocument(Container container, IComponent parent, Stream stream, string referenceId, DocumentProperties properties, DocumentType documentType);

  • GetDocuments: Searches for documents in the EDM system based on a parent component or document metadata.

    IEnumerable<Document> GetDocuments(IComponent parent, DocumentProperties properties, params string[] documentTypes);

  • UpdateDocument: Updates a document in the EDM system.

    Document UpdateDocument(Document document, IComponent parent, Stream stream, DocumentProperties properties, DocumentType documentType);

  • DeleteDocument: Deletes a document from the EDM system.

    void DeleteDocument(IComponent parent, Document document);

  • GetContainers: Searches for containers in the EDM system.

    IEnumerable<Container> GetContainers(IComponent parent, IDictionary<string, string> metadata);

The methods for the IEDMSBasicProvider interface are the same as for IEDMSDocumentTypeProvider, but with different parameters.

  • AddDocument: Adds a new document to the EDM system.

    Document AddDocument(Container container, IComponent parent, Stream stream, string referenceId, DocumentProperties properties);

  • GetDocuments: Searches for documents in the EDM system based on a parent component or document metadata.

    IEnumerable<Document> GetDocuments(IComponent parent, DocumentProperties properties, params);

  • UpdateDocument: Updates a document in the EDM system.

    Document UpdateDocument(Document document, IComponent parent, Stream stream, DocumentProperties properties);

  • DeleteDocument: Deletes a document from the EDM system.

    void DeleteDocument(IComponent parent, Document document);

  • GetContainers: Searches for containers in the EDM system.

    IEnumerable<Container> GetContainers(IComponent parent, IDictionary<string, string> metadata);

This table describes the parameters used in the methods listed above:

Parameter Description
container Container to which a document will be added. This is the first container returned by the GetContainers method.
document Document to be updated or deleted.
documentType Document type of the document to be added or updated.
documentTypes List of document types to search for when using the GetDocuments method.
parent Component with which a document is associated.
properties Document properties, such as file name, title, and description.
referenceId Not used. This parameter is only included for backwards compatibility.
stream Content of the document being added or updated, represented as a stream.

After you compile your provider, the assembly must be placed on a server where it can communicate with both Infor Public Sector and the EDM system. Infor Public Sector does not require the provider to be installed in any particular location, because you will specify the full path to the provider when you configure it in Infor Public Sector.

See Adding a custom provider.