ConnectorLib C++ 23.3

# Add Metadata

Often repositories store metadata about the files they contain, such as who created a file and when it was last modified. Metadata might also include repository-specific information. For example, a repository storing information about products for sale might include a price and a description for each item. You can add this metadata to a document's metadata fields so that it is indexed into IDOL Server.

You can add fields to a document like this:

           docInfo.doc().metadata().addField("MyField", "My Value");

This example adds a field `MyField` with the value `My Value`.

The following is the same but written out as separate statements:

           Document doc = docInfo.doc();
           Metadata metadata = doc.metadata();
           metadata.addField("MyField", "My Value");

You could also re-write the last line to use a `Field` object:

           Field field = metadata.addField("MyField");
           field.setValue("My Value");

You can use the `Field` object to build structured metadata:

           Field innerField = field.addField("MyInnerField", "InnerFieldValue");

Fields can also have multiple values:

           metadata.addField("SecondField", "First value");
           metadata.addField("SecondField", "Second value");

Copyright 2022 Open Text
Version 23.3 | Last updated June 2023

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 swpdl.idoldocsfeedback@microfocus.com.

We appreciate your feedback!

Product: IDOL ConnectorLib C++ 23.3

Topic Title: Add Metadata