Getting Full Path to Local Document via ProjectID and DocumentID

I'm looking to find a ProjectWise API function which will provide the full path to the local copy of the document. 

I've found the aaApi_FetchDocumentFromServer function which can be configured to copy out a document to the user's working directory knowing the ProjectID and DocumentID.  This function does return the full path to the local copy's file.

I've also found the aaApi_IsDocumentCopyUpToDate function which can check to see if the local and server copies are up-to-date based on it's project and document IDs.

What I can't find is a function to get the full path to a local copy of a document in the user's working directory knowing the document's project and document IDs.  I know I can always call the aaApi_FetchDocumentFromServer function again to capture the local path, but if the file has already been copied out and is up to date, why download again?

Alternatively, I suppose if there was a way to establish the user's working folder from a projectID, I could get the rest ... but I can't find this either.  I've only been able to find the aaApi_GetUserStringSetting function with the AADMS_PAR_WRK_WORKING_DIRECTORY flag ... but that's only part way there.

  • James,

    Try aaApi_SelectLocationsByProp() or aaApi_SelectLocations().  These functions return the information that ProjectWise is tracking for each document that has been copied out, checked out or exported.  Of course, if a user deletes the files from those locations outside of ProjectWise, then this information will be "incorrect" so if you are counting on a file actually being in a specific location, check that as well with a call to aaApi_FileExist() or your favorite Win32 function, etc.

    HTHs

  • Dan-

    Thanks for your reply!

    I tried the aaApi_SelectLocations routine, but it always returned zero (no records) for a several tested documents, even after the aaApi_FetchDocumentFromServer function was used to successfully copy out the files.

    However, I was surprised to find the aaApi_FetchDocumentFromServer function doesn't perform a file transfer if it finds that the file already exists locally ... so I suppose I don't really need to worry about the above.

    Thanks again,

    -Jim

  • Unknown said:
    However, I was surprised to find the aaApi_FetchDocumentFromServer function doesn't perform a file transfer if it finds that the file already exists locally ... so I suppose I don't really need to worry about the above.

    I'm not sure, but that behavior may be somewhat dependent upon the user setting for Documents "use up to date local copy on copy out". Just something to consider/check in your development process.