Show/Hide Toolbars

Additional Resources

To start creating your own provider, derive a class from ProviderBase and implement all abstract methods.

 

info

Note:
Your new class must be in the Therefore.DocumentDownload.Service.Providers namespace.

 

The available providers are found via reflection and all classes that derive from ProviderBase and are in the Therefore.DocumentDownload.Service.Providers namespace are used.

 

The class name must end with "Provider". The name before the "Provider" suffix, is used in the path.

For example:

You want to create a "My" provider, the class name must be "MyProvider", and the path will then be <Host>/Download/My.

 

Request Classes

 

Most request classes, for example GetPendingRequest, DownloadDocumentRequest, etc. will have these members:

 

LoginInfo

Contains the login information which was configured in the provider dialog.

 

ProviderConfiguration

The provider settings configured in the provider dialog window. These settings are custom for each provider. See GetSettings function.

AR_DownloadServiceProvider_001

SourceConfiguration

The source settings from the download service monitor dialog. These settings are also given by the GetSettings function.

AR_DownloadServiceProvider_002

 

GetPending

In GetPending you should return unique IDs that are ready to be downloaded.

 

info

Note:
The unique ID must not contain the character '|'.

 

When there are many pending items, you do not have to return all of them. For example, if there are 100 pending items, it is more efficient to return only 20 of them and let the Thereforeā„¢ Content Connector process these first.

When this finishes, another GetPending call is made (ignoring the Polling interval set in the Thereforeā„¢ Content Connector configuration).

 

The GetPendingResponse also has a ProviderPendingData dictionary, which can be optionally set. You can set this dictionary and add arbitrary data you need for your GetPending implementation. For example you could save when  "LastCheck" is used as a string. The supported data types for values are int and string.

 

In the next GetPending call, the GetPendingRequest will contain the dictionary set from a previous call in its ProviderPendingData.

 

 

DownloadDocument

This is the main function to download a single document.

 

The document ID from the request will be one of the unique IDs you have returned from the GetPending call.

The retrieved document or file has to be returned as base64 in the response.

 

While it is possible to return multiple files, you will need a metadata file, which contains the names of the other files to save.

By default only the first file is saved (the file index in the Files array within the Response class is set to 0). To change this to save other files, the Profile.FilesToSave property in scripting must be reconfigured.

 

An alternative to returning multiple files is to use a .zip archive with all the files. The .zip can be processed with the zip data extractor. This can be configured while creating an indexing profile for the Thereforeā„¢ Content Connector. There you can select to save all files under a .zip file.

 

The response has a size restriction by default of 30 000 kB. This can be changed in the Thereforeā„¢ Solution Designer under "Download Service Max file size" in the Advanced Settings dialog.

 

You can return arbitrary json metadata in the response by using the Metadata member. See the test provider for a sample.

 

 

PostProcess

The PostProcess function is called when the document was successfully saved. In case any errors occur while processing the document, this function will not be called.

 

This function can be used to inform the provider of the success, and in case the function encounters an error, it will be ignored by the Thereforeā„¢ Content Connector. In this case, the Thereforeā„¢ Content Connector will continue processing, and the document is still considered successfully saved.

 

 

CheckConnection

This function is used to test settings and confirm if a connection to the provider is possible.

 

 

GetSettings

This function returns the values for the two different setting types:

 

Provider settings (shown in the provider configuration dialog)

Source settings (shown in the download service monitoring dialog for the Thereforeā„¢ Content Connector)

 

To select which of the values to retrieve, use providerConfiguration or sourceConfiguration respectively.

 

 

GetProviderInfo

This function returns the name and path of the provider.

 

The path refers to what should be used in the URL. For the example mentioned above with "MyProvider", the path would be "My" because the URL should be "<Host>/Download/My".

 

The name is what will be shown in the provider configuration dialog in the drop down menu.

Ā© 2024 Therefore Corporation, all rights reserved.