Managing Document Repositories

Infinity allows to use federated document repositories as described in chapter Federated Document Repositories in the Concepts part. You can manage these repositories via the provided DocumentManagementService API. The following sections describe how to use this API, e.g. for binding and unbinding repositories or retrieving information on all available repository providers.

Binding a new Repository Instance

Method

void bindRepository(IRepositoryConfiguration configuration)

allows to bind a new repository instance. The usage of this method is restricted to administrators. In case the user is not an administrator, the following exception is thrown:

DocumentManagementServiceException(BpmRuntimeError.DMS_SECURITY_ERROR_ADMIN_REQUIRED.raise());

The parameter of this method defines the configuration of type IRepositoryConfiguration for the repository to bind.

The repository id supplied via this configuration can be freely chosen, but has to differ from currently bound repository Ids. The provider Id supplied via the configuration has to match a registered repository provider.

You can retrieve a template configuration from IRepositoryProviderInfo#getConfigurationTemplate(). This template contains keys and template values that are required for the configuration of an new repository instance.

For details on how to create a custom repository configuration provider refer to chapter Implementing a Provider for arbitrary Repository Technologies.

Unbinding a previously Bound Repository

The following method unbinds a previously bound repository:

void unbindRepository(String repositoryId)

The usage of this method is restricted to administrators. In case the user is not an administrator, the following exception is thrown:

DocumentManagementServiceException(BpmRuntimeError.DMS_SECURITY_ERROR_ADMIN_REQUIRED.raise());

Parameter is the Id of the repository instance to unbind.

Retrieving Information about all bound Repositories

In case you like to retrieve information about all bound repositories, use the following method:

List<IRepositoryInstanceInfo> getRepositoryInstanceInfos();

It returns a list of type IRepositoryInstanceInfo.

Retrieving Information about all available Repository Providers

Method

List<IRepositoryProviderInfo> getRepositoryProviderInfos();

retrieves information about all available repository providers. It returns a list of type IRepositoryProviderInfo.

Setting a bound Repository as default Repository

The following method binds a repository as default repository:

void setDefaultRepository(String repositoryId);

The usage of this method is restricted to administrators. In case the user is not an administrator, the following exception is thrown:

DocumentManagementServiceException(BpmRuntimeError.DMS_SECURITY_ERROR_ADMIN_REQUIRED.raise());

The given parameter is the Id of the repository instance. Path based access targets the default repository, whereas Id based access targets the repository contained in the id. An id provided by the system is always prefixed with a repository id. If the id is not provided by the system and is not prefixed with a repository id, the default repository is targeted.

Identifying the currently set default Repository

To identify the currently set default repository, you can use the following method:

String getDefaultRepository();

It returns the Id of the currently set default repository.

Example Use Case