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

Question

Question

SDK performance

SDK
asked on November 15, 2014

Dears,

 

I'm creating an application that integrates with Laserfiche through SDK.

It has a folder browser which allows user to select a folder then select a document from  within this folder.

I'm getting the documents from the selected folder using Children property of LFFolder object in SDK.

it returns a collection of entries, then I have to cast each one to its relative class and then get the fields metadata to be displayed in a grid view.

to make the above scenario, it takes long time if the children is too many. However, in Laserfiche Client, it can display the same quickly even if the folder contains thousands of documents.

 

How I can achieve such performance using SDK, Is there a way to do so using SDK? Should I cash the entries on at the client memory? Please it's an urgent and I need the best way of loading data from Laserfiche.

 

Thank you.

 

0 0

Answer

SELECTED ANSWER
replied on November 17, 2014

Here is an example that gets all of the documents in the folder:

 

ILFEntryListingParamsPtr listingParams;
listingParams.CreateInstance(CLSID_LFEntryListingParams);
listingParams->PutTocTypeFilter(ENTRY_FILTER_DOCUMENTS);

ILFEntryListingPtr entryListing = folder->GetEntryListing(listingParams, 100);

int rowCount = entryListing->GetRowCount()
for (int row = 1; row <= rowCount; row++)
{
    CString entryName = (LPCTSTR)entryListing->GetDatumByColTypeAsString(row, COLUMN_TYPE_DISPLAYNAME);

    int entryId = entryListing->GetDatumByColType(row, COLUMN_TYPE_ID).lVal;

   // Do something here with the entry
}

 

2 0

Replies

replied on November 15, 2014

Use LFFolder::GetEntryListing to get the folder's children, this returns an LFEntryListing which reads the folder contents in chunks. You pass in an LFEntryListingParameters object which lets you specify the sort order, columns, etc.. This is what the LF client uses.

1 0
replied on November 16, 2014

Thank you Robert, it was a helpful reply, greatly appreciated.

Could you add any best use example?

0 0
SELECTED ANSWER
replied on November 17, 2014

Here is an example that gets all of the documents in the folder:

 

ILFEntryListingParamsPtr listingParams;
listingParams.CreateInstance(CLSID_LFEntryListingParams);
listingParams->PutTocTypeFilter(ENTRY_FILTER_DOCUMENTS);

ILFEntryListingPtr entryListing = folder->GetEntryListing(listingParams, 100);

int rowCount = entryListing->GetRowCount()
for (int row = 1; row <= rowCount; row++)
{
    CString entryName = (LPCTSTR)entryListing->GetDatumByColTypeAsString(row, COLUMN_TYPE_DISPLAYNAME);

    int entryId = entryListing->GetDatumByColType(row, COLUMN_TYPE_ID).lVal;

   // Do something here with the entry
}

 

2 0
replied on November 18, 2014

Thank you Robert. smiley

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

Sign in to reply to this post.