You are viewing limited content. For full access, please sign in.

Question

Question

Local Repository Path for use in SQL

asked on August 17, 2017

I need to access the local path of pdf documents that are stored in the repository for use in a Workflow script activity.  I have previously been able to find the path by combining information stored in sql tables and breaking apart the edoc_storeid into sequential 2 digit path sections followed by the edoc_storeid (padded with leading 0's to 8 digits).  It looks like when the files are written to the repository for this client (version 10.2.1.953).  The paths aren't parsed the same way as they had been in the past - My query is  returning d:\Laserfiche Repository\DEFAULT\DEFAULT000000\00\00\0B\00000BB4.PDF  when the path is actually d:\Laserfiche Repository\DEFAULT\DEFAULT000000\e00\00\0B\00000BB4.PDF.  The e00 is throwing the logic off because I am expecting two characters/digits not three.  

I am hoping a developer and/or programmer can tell me if the pattern changed that LF is using to store files in the local repository.

0 0

Answer

SELECTED ANSWER
replied on August 17, 2017

Here's a basic example,

// Get the document info object
DocumentInfo doc = Document.GetDocumentInfo(this.BoundEntryId,RASession);

// Retrieve document stats to get eDoc path
DocumentStatistics dStats = doc.GetStatistics();

// Get the volume info object
VolumeInfo vInfo = Volume.GetInfo(doc.VolumeName,RASession);

// Physical path of the volume
string volumePath = vInfo.FixedPath;

// Folder path of the eDoc
string eDocPath = dStats.ElecDocumentPath;

// Complete path of the eDoc to Token
SetTokenValue("FilePath",(volumePath + @"\" + eDocPath)); 

In summary

  1. Pass the Entry to the Script
  2. Get your DocumentInfo object
  3. Use the DocumentInfo object to
    • Get the DocumentStatistics
    • Get the VolumeInfo
  4. VolumeInfo gives you the physical path of the Volume on the server
  5. DocumentStatistics gives you the folder path of the eDoc file
  6. Combine the volume path and eDoc path to get the complete path of the file

 

A couple important items to note:

  1. Make sure to add a reference for RepostoryAccess to your SDK Script activity
  2. If you are using Removable Paths, use that method instead of Fixed Path
  3. If you're not using UNC paths to map your volumes, you'll need to account for that
    • For example, if the path you get back is D:\repo\volume\e00\00\00\09090B.pdf
    • WF would see that as the local D drive
0 0

Replies

replied on August 17, 2017

Do you know the entry ID of the document(s) in advance? The reason I ask is that an SDK Script within workflow would provide the necessary tools to retrieve the volume path of the file rather than piecing it together from the database.

0 0
replied on August 17, 2017

Thank you Jason for the reply. Yes, I will be able to identify the entry ID that I need to use in the script.  Do you by chance have a copy of the workflow script that returns the local path for PDFs?  I really appreciate it!

0 0
SELECTED ANSWER
replied on August 17, 2017

Here's a basic example,

// Get the document info object
DocumentInfo doc = Document.GetDocumentInfo(this.BoundEntryId,RASession);

// Retrieve document stats to get eDoc path
DocumentStatistics dStats = doc.GetStatistics();

// Get the volume info object
VolumeInfo vInfo = Volume.GetInfo(doc.VolumeName,RASession);

// Physical path of the volume
string volumePath = vInfo.FixedPath;

// Folder path of the eDoc
string eDocPath = dStats.ElecDocumentPath;

// Complete path of the eDoc to Token
SetTokenValue("FilePath",(volumePath + @"\" + eDocPath)); 

In summary

  1. Pass the Entry to the Script
  2. Get your DocumentInfo object
  3. Use the DocumentInfo object to
    • Get the DocumentStatistics
    • Get the VolumeInfo
  4. VolumeInfo gives you the physical path of the Volume on the server
  5. DocumentStatistics gives you the folder path of the eDoc file
  6. Combine the volume path and eDoc path to get the complete path of the file

 

A couple important items to note:

  1. Make sure to add a reference for RepostoryAccess to your SDK Script activity
  2. If you are using Removable Paths, use that method instead of Fixed Path
  3. If you're not using UNC paths to map your volumes, you'll need to account for that
    • For example, if the path you get back is D:\repo\volume\e00\00\00\09090B.pdf
    • WF would see that as the local D drive
0 0
replied on August 17, 2017

Thank you Jason!  This will work!

0 0
replied on August 17, 2017 Show version history

Image and text documents go into the NN paths. Electronic documents go into the folder path starting with eNN. Each volume has both sets of subfolders. This has always been the pattern for storing documents in volumes. The extension is stripped from electronic documents on disk, so you should see d:\Laserfiche Repository\DEFAULT\DEFAULT000000\e00\00\0B\00000BB4 not d:\Laserfiche Repository\DEFAULT\DEFAULT000000\e00\00\0B\00000BB4.pdf.

0 0
replied on August 17, 2017

Thank you Miruna!!! I have only pulled image documents in the past so this had me stumped.  I can adjust my query accordingly.

0 0
replied on September 10, 2019 Show version history

Hi Terri Neal ,

 

Could you guide me on how to pull documents via Java sdk. 

I'm trying to use Document.getByPath( "\\ path", session);

it is not throwing error or not downloading also.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.