As per title I want to return the full path of all documents on the server. I found that the "dms_doc" table has everything I need for a specific task except the full path for each document. Any ideas which table I can look at that will contain the fully qualified path of each folder?
Hopefully once I know which table contains the full path it will also have either project GUID / project number; then I can relate that back to those columns in dms_doc to expand it to include a full path to each file.
The full path values are derived. There isn't a table in ProjectWise containing those values.
If I remember correctly, dms_doc has a guid of the folder it's in, then you have to jump to another table (I think it's called dms_vault or project, but I'm not on my work computer and can't look it up). In that table each folder lists its parent folder, so then you have to jump up to the parent and check it's parent, and so on until you find the root folder. Basically you have to walk the tree backwards to build it.
Why not use one of the PWPS_DAB cmdlets to do what you wan?. When I want to build a report with a large number of items I typically break it down a bit so I'll get all the folders at the root level then process each of those folders independently. That way I don't need gigabytes of local memory to hold all the objects.
I believe Get-PWFolders and Get-PWDocumentsBySearch can both return full paths.
Answer Verified By: Edward Ashbolt
You can get the o_projguid value for each document and pass that to the Get-PWFoldersByGUIDs cmdlet.
OK thanks Brian, I assume when you say they are derived that you mean I need to recurse through the folder tree to populate all the paths myself, as Kevin mentions below?
Thanks Kevin,There is a table called dms_proj that has all the folder names / guids, I assume that is the one you meant... Looking at that table there is o_pprjguid which should be the parent folder. With this information I can then build a fullpath by recursively walking backwards through the folder tree as you suggested; thanks for the tip that's a really good idea!
With regards to using the pwps_dab search cmdlets for returning paths, I did want to go that route however I found in practice it was far too slow to generate the list of documents when running on a very large datasource, hence looking to go the SQL route since I can download the tables I need 10x faster than a search, and then do my processing locally using PowerShell and an SQLite db.