Fetch Secure Document Sealed Version

Discuss your general Proclaim related queries here.
Post Reply
Archais
Posts: 9
Joined: Wed Jul 31, 2019 2:15 pm

Fetch Secure Document Sealed Version

Post by Archais » Wed Aug 14, 2019 5:07 pm

Hi all,

I'm looking at using the fetch command to send a copy of a signed incoming secure document to a network file path.

What I have so far is:

Code: Select all

varA = FETCH( "CONTENT" , "History" , "document_code" , "FOR LAST History NO-LOCK WHERE History.case_no = '" + {case.key} + "' AND (action_code = 'TESTDOCUMENT' )" ) 
varB = LENGTH( varA ) 
IF varB = 8 THEN 
    source_01 = SPLIT( varA , 1 , 2 ) 
    source_02 = SPLIT( varA , 3 , 2 ) 
    source_03 = SPLIT( varA , 5 , 2 ) 
    source_doc = {Archive Path.Text} + "\" + TEXT( source_01 ) + "\" + TEXT( source_02 ) + "\" + TEXT( source_03 ) + "\" + TEXT( varA ) + ".pdf" 
    dest_01 = TEXT( "\\EXAMPLEFILEPATH\FOLDERHERE" ) 
    destination_doc = TEXT( dest_01 ) + "\" + {Client (global).Full Name/Company Name} + ".pdf" 
    COPY-FILE( source_doc , destination_doc ) 
END 
That only returns the original document and deposits it into the network directory - what i'm trying to get is the signed document, but what I've noticed is that it gets appended with a string that seems to be based on the date and time that the secure doc came back.

Short question is: can I fetch a Sealed version of that particular document?
Longer question (when it comes to it with multiple clients) will be how do I determine which sealed version to use without user intervention?

Cheers

Archais
Posts: 9
Joined: Wed Jul 31, 2019 2:15 pm

Re: Fetch Secure Document Sealed Version

Post by Archais » Thu Aug 15, 2019 12:50 pm

After quite a lot of error and frustration, I've managed to come up with this; create a batch file with the same name as the pdf I require to copy every pdf which starts with the name of the batch file.

As a batch file

Code: Select all

SET filepath=%~dp0
SET filename=%~n0
SET batch=%filepath%%filename%.bat
SET fulldir=%filepath%%filename%*.pdf
SET copypath="\\NETWORKFILEPATH\"
copy %fulldir% %copypath%
SET fulldir=%copypath%%filename%.pdf
del %fulldir%
del %batch%
and in proclaim

Code: Select all

varA = FETCH( "CONTENT" , "History" , "document_code" , "FOR LAST History NO-LOCK WHERE History.case_no = '" + {case.key} + "' AND (action_code = 'TESTDOCUMENT' )" ) 
varB = LENGTH( varA ) 
IF varB = 8 THEN 
    source_01 = SPLIT( varA , 1 , 2 ) 
    source_02 = SPLIT( varA , 3 , 2 ) 
    source_03 = SPLIT( varA , 5 , 2 ) 
    source_bat = {Archive Path.Text} + "\" + TEXT( source_01 ) + "\" + TEXT( source_02 ) + "\" + TEXT( source_03 ) + "\" + TEXT( varA ) + ".bat" 
    PUT( source_bat , {FETCHDATA.Text} ) 
    UPDATE( {case.key} , "" ) 
    COPY-FILE( "\\PATHTOBATCH\batchfile.bat" , {FETCHDATA.Text} ) 
    EXTERNAL-APPLICATION( "ExternalApplication_Default Application , UseField_FETCHDATA.Text , CaseType_2" ) 
END 
I've got to run a little more testing but this achieves the result that I was initially after. The only snag now is the PDFs sent back through securedocs are password protected and I don't have the foggiest as to what that password could be...

Enigma
Posts: 54
Joined: Mon Mar 04, 2019 1:01 pm
Has thanked: 4 times
Been thanked: 6 times

Re: Fetch Secure Document Sealed Version

Post by Enigma » Thu Aug 15, 2019 1:02 pm

Amazing stuff that!

We've asked Eclipse about the password in the past...and they don't know it. I assume it's just a randomised password to encrypt the document.

Literally the only way to view it is via the case it was signed for.

Archais
Posts: 9
Joined: Wed Jul 31, 2019 2:15 pm

Re: Fetch Secure Document Sealed Version

Post by Archais » Thu Aug 15, 2019 3:52 pm

So they're password protecting documents with no idea / key to unlock it other than from within Proclaim?

I've noticed there's an xml that's created as part of the securedocs import job. Maybe that holds the key? Either that, or there's got to be a hidden database / matrix / sysparam somewhere that passes the password from somewhere in the case to the pdf viewer.

Guess I'm going to have to tear my database apart in some vain attempt at figuring out something that someone at Eclipse should know...

Archais
Posts: 9
Joined: Wed Jul 31, 2019 2:15 pm

Re: Fetch Secure Document Sealed Version

Post by Archais » Mon Aug 19, 2019 11:22 am

Update: I hadn't configured the client signature placeholder as editable by the client (clever me) so the sealed signature wasn't being placed onto the archive version.

All seems to be working now as far as I'm bothered - don't even need to use my batch file, can simply use copy-file within Proclaim. Ah well, was a useful exercise to be able to make a workaround.

Still slightly concerns me that we can't access the sealed version though.

Post Reply