Open topic with navigation

# Retrieve the URI of a Document

A connector's `GetUri` action takes a document identifier and returns a URI for the document in the repository.

Before you implement the `GetUri` action, enable the action by updating the `features()` function on the connector so that it returns `Features::get_uri`:

            Features::feature_type MyConnector::features()
            {
                return ... | Features::get_uri;
            }

To implement the `GetUri` action, override the `GetUri` function in your derived connector implementation class. For example, within the `MyConnector` class that extends `ConnectorBase`:

           void MyConnector::getUri(const GetUriTask& task)
           {
              DocInfo docInfo = task.document();
              std::string reference = docInfo.id().reference();
              task.setUri(reference);
           }

This example returns the reference of the document as the URI (be aware that the reference and URI are usually not the same). A typical implementation would use the reference and identifier properties to retrieve or construct the full URI of the document in the repository where the document resides. If the document does not exist in the repository or the identifier properties are invalid, throw an exception to indicate failure.

© 2018 Micro Focus or one of its affiliates | Send documentation feedback to Micro Focus Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm