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

Question

Question

How do I track down a document from the image filename in a volume?

asked on October 30, 2014

Yes, I realize the pain involved.

 

We have identified a few files in a repository with corruption.

We need to trace those files back to the document names.

 

I've done this in the past in the reverse order to restore a single deleted document from backup.  The mappings go both ways, so I should be able to reverse the filename from the volume to get an identifier in a table and trace back to a doc name.

 

Right?

 

Oh, this is V7.  I know I used to have a document that showed how to take a doc and get the page filenames, but I can't seem to find that either.

 

Can you offer any assistance?

0 0

Answer

APPROVED ANSWER
replied on November 4, 2014

You can try this query

select t1.tocid, t1.name, (t3.pagenum+1), t2.fixedpath
from toc t1
join vol t2
on t1.volumeid=t2.volumeid
join doc t3
on t1.tocid=t3.tocid
where t1.tocid in (select distinct(tocid) from doc where storeid=x)
and storeid=x

Just replace x with the storeid. Note that the page numbers in the doc table are 0 based so that's why we're adding 1 to it to get the actual page number you'd look for when reviewing the document.

1 0

Replies

replied on October 30, 2014

Check out https://support.laserfiche.com/forums.aspx?Link=viewtopic.php%3ft%3d17111%26amp from the old forums. You should be able to do it in reverse by converting the file name to the StoreID, determining the volID for the specific volume and use the two of those to find the specific page/document.

I believe the storeID is reference in the doc table (page) and the volID in the toc table (document), so you'll need to take both into account. You could either do some sql joins or just grab all the pages with a particular storeID and crossreference them against the TOC to find the one in that volume.

2 0
replied on October 30, 2014 Show version history

To add to what Justin mentioned, once you take the TIF file name in the volume and convert that value from hex to decimal to get the storeid, you can run the following query against the LF 7 database

select t1.tocid, t1.name, t2.fixedpath
from toc t1
join vol t2
on t1.volumeid=t2.volumeid
where t1.tocid in (select distinct(tocid) from doc where storeid=x)

Just replace "x" with the actual value. This query will return all instances of a document that has a page with a given storeid. Note that the storeid may not be unique since you could have multiple volumes with pages that end up using the same value so that's why you'd need to get a list of all documents and their volume paths so you're certain that you're manipulating the correct document.

2 0
replied on November 4, 2014

This is great!

 

I'm not the best SQL master - is it possible to add the page number to this?

 

I gave it a shot and got my joins all mixed up, I think.

0 0
APPROVED ANSWER
replied on November 4, 2014

You can try this query

select t1.tocid, t1.name, (t3.pagenum+1), t2.fixedpath
from toc t1
join vol t2
on t1.volumeid=t2.volumeid
join doc t3
on t1.tocid=t3.tocid
where t1.tocid in (select distinct(tocid) from doc where storeid=x)
and storeid=x

Just replace x with the storeid. Note that the page numbers in the doc table are 0 based so that's why we're adding 1 to it to get the actual page number you'd look for when reviewing the document.

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

Sign in to reply to this post.