PM Document | Uploading Attachment Revisions to Project Objects
  • 16 Feb 2024
  • 1 Minute to read
  • Dark
    Light

PM Document | Uploading Attachment Revisions to Project Objects

  • Dark
    Light

Article summary

Introduction:

To retrieve the metadata of the documents (e.g. attachments) stored in the CMiC system, the {{CMIC_BaseUrl}}/sys-rest-api/rest/1/sysrelateddocquery endpoint, combined with the selectByObjectKey finder is a great tool for this purpose. It retrieves the metadata of all documents that fits the input criteria (Object Keys). However, it only retrieves the latest revisions of the documents. This documentation aims to provide a clear understanding of how to retrieve data for older revisions of the documents.

Note that obtaining the correct doc id is critical to the success of operations with other endpoints, such as /pm-doc-rest-api/jersey/v1/downloadDoc/:DocID

Process Overview:

Each document entry contains a unique identifier called "SysrdVUuid." Additionally, there is a field named "SysrdRevisionVuuid," which represents the "SysrdVUuid" of the document's previous revision. To retrieve meta data for older revisions, one needs to trace back through the revisions using the "SysrdVUuid" and "SysrdRevisionVuuid" fields in a manner akin to a linked list.

Step-by-Step Guide:

  1. Retrieve the latest revision of the document
  2. Extract the "SysrdRevisionVuuid" values from the latest revision's metadata.
  3. Use the "selectByRevision" finder to query for the previous revision using that "SysrdRevisionVuuid".
  4. Continue this process of querying and retrieving metadata for older revisions, using the "SysrdRevisionVuuid" from the previously obtained revision.
  5. Repeat step 4 until the desired revision is reached.

By following the steps outlined above, you can successfully trace back and retrieve the meta data for older document revisions using the provided "SysrdVUuid" and "SysrdRevisionVuuid" fields. This approach allows you to navigate the revisions in a way similar to a linked list until you reach the original document (which has the same "SysrdRevisionVuuid" and "SysrdVUuid.")