ConnectorLib C++ 25.1
ConnectorLib C++ SDK Programming Guide

# Update Documents in a Repository

The following table lists fetch actions that update documents in a repository.

Action | Description | Method to override
--- | --- | ---
`/action=fetch&fetchaction=Delete` | Delete specified documents from the repository. | `deleteDocs`
`/action=fetch&fetchaction=Insert` | Insert a document or documents into a repository. | `insert`
`/action=fetch&fetchaction=Update` | Update the metadata for specified documents in the repository. | `update`
`/action=fetch&fetchaction=Hold` | Apply a legal hold to the specified documents in the repository. | `hold`
`/action=fetch&fetchaction=ReleaseHold` | Remove a legal hold from the specified documents in the repository.

Like the `Collect` fetch action (see Retrieve Documents from a Repository), these actions are passed a collection of `DocInfo` objects, each of which contains an identifier. Like the `Collect` fetch action, `s` `uccess` or `f` `ailed` must be called on each object to indicate whether the document was processed successfully.

The `DocInfo` objects passed to `delete`, `hold`, `releasehold` and `update` contain identifiers of documents that exist in the repository. The `DocInfo` objects passed to `Update` also contain the metadata to set in the repository.

The `DocInfo` objects passed to `insert` contain document content and metadata, including information about where in the repository the new file should be inserted. This information could be part of the reference, identifier, or metadata. It is up to you to specify what information is required.

If you want to use the `Insert` action to insert documents that contain only metadata, you must include `insert_allow_metadata_only` in the list of features returned by the `features` function on `ConnectorBase` to enable insertion of metadata only documents:

           Features::feature_type features()
           {
              return Features::synchronize|Features::insert_allow_metadata_only;
           }

## Implement ReleaseHold

You can implement the ReleaseHold action in one of the following ways:

- Override the `hold` method. When a document is to be released, the method is called with the Boolean release argument set to `true`.

      void hold(const HoldTask& task, bool release);

- Override both the `hold` and `releasehold` methods:

      void hold(const HoldTask& task);

      void releasehold(const HoldTask& task);

Copyright 2024 Open Text
Version 25.1 | Last updated January 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: Knowledge Discovery ConnectorLib C++ 25.1

Topic Title: Update Documents in a Repository