Access document lineage from plugin?
Is there a way to access the details of a file's lineage from a plugin? I could not find a way in the API documentation.
The best way to get the lineage for an Annotated Plugin Document is to call APD.getDescendantOperationRecords() and/or APD.getParentOperationRecords(). This will give you a URN that can be used to retrieve an OperationRecordDocument via DocumentUtilities.getDocumentByURN(URN). An OperationRecordDocument contains adjacent parent/child nodes in the lineage tree and can be traversed using any basic tree-traversal algorithm. I would recommend having a read of the documentation and methods for OperationRecordDocument for more details.
Hope that answers your question,
Thanks a lot for the clear response, much appreciated.
Please sign in to leave a comment.