project BLF > class BDocumentLink > method DumpDocument

Description

Dump a stored document out to the file system.


Parameters


iiDocumentLink_IDinputintegeridentifier of the document
icFileNameinputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program1/bdocumentlink.p)

<M-1 run DataLoad (input  '' (icRowids), 
                   input  string(iiDocumentLink_ID) (icPkeys), 
                   input  '' (icObjectIds), 
                   input  '' (icFreeform), 
                   input  no (ilKeepPrevious), 
                   output viFcReturnSuper (oiReturnStatus)) in BDocumentLink>
if viFcReturnSuper <> 0
then oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0
then return.

for each tDocumentStorage where
         tDocumentStorage.DocumentLink_ID = iiDocumentLink_ID
         by tDocumentStorage.DocumentStorageSegmentNr:
    vpDocument = vpDocument + tDocumentStorage.DocumentStorageString.
end.
vmDocument = BASE64-DECODE(vpDocument).
COPY-LOB FROM vmDocument TO FILE icFileName.

finally:
    set-size (vmDocument) = 0.
end finally.