DocumentFinderGetDocumentsBySnapshot Method (Guid, Guid, String, SearchCriteria, ColumnSelector, Int32, Int32) |
Finds documents which fulfills specified search criteria and retrieves a single page of data.
This the main method in the API for finding documents in FileHold. It will use the specified criteria to get a list of documents.
For efficiency, it will store the result set as a snapshot in the database and return a page of documents of the specified size
starting from the specified row. If necessary, a previous snapshot id can be invalidated when a new one is created.
Namespace:
FileHold.LibraryManager
Assembly:
FileHold.LibraryManager (in FileHold.LibraryManager.dll) Version: 17.0.0.0
Syntaxpublic ColumnsWithValues GetDocumentsBySnapshot(
Guid prevSnapshotId,
ref Guid snapshotId,
string viewContainerType,
SearchCriteria searchCriteria,
ColumnSelector[] sortOrder,
int firstRowIndex,
int pageSize
)
Parameters
- prevSnapshotId
- Type: SystemGuid
Id of a previously created snapshot that should be disposed of. If there is no previous snapshot this should be set to Guid.Empty (00000000-0000-0000-0000-000000000000).
If the snapshot provided no longer exists, no error is raised and a new snapshot is created. - snapshotId
- Type: SystemGuid
Id of the created or updated snapshot. If this value is Guid.Empty a new search will be created.
If it is not Guid.Empty, information from the specified snapshot will be retrieved. If the snapshot exists, but the sort criteria is changed,
the results will be returned with the new sort criteria.
If the value is not Guid.Empty, but does not exist, it will be treated as though it was Guid.Empty.
If a new snapshot guid is created as the result of this search it will be returned in this parameter. - viewContainerType
- Type: SystemString
The id of the view that will be used determine which system and metadata columns will be returned, for example "FLD" for a folder view.
The actual view will depend on the default view configuration for the current user. The view can be changed by individual users and by administrators. - searchCriteria
- Type: FileHold.LibraryManagerSearchCriteria
Determine which documents will be searched for. - sortOrder
- Type: FileHold.LibraryManagerColumnSelector
The sort order and group by definition for the results. When this value is null results will be returned in undetermined order. - firstRowIndex
- Type: SystemInt32
The row number of the first row in the result set that will be loaded to the snapshot and returned. - pageSize
- Type: SystemInt32
The maximum number of rows that will be returned. Care should be taken with the size of the page as RAM will be consumed to hold the results.
Return Value
Type:
ColumnsWithValuesField name and value details.
Remarks
STEPS:
1. If prevSnapshotId not empty - remove specified snapshot
2. Check snapshotId
A) null - perform search with specified criteria
B) not null - check in database whether snapshot exists
a)snapshot doesn not exist - treat it as null
b)snapshot exists - check whether sort criteria changed; if changed reorder result
3. For specific snapshotId get document's metadata ids between firstRowIndex and ( firstRowIndex + pageSize - 1 )
from snapshot table and retrieve data for them using fields from the specified view.
See Also