DocumentFinderGetDocumentsBySnapshot(Guid, Guid, String, SearchCriteria, ColumnSelector, Int32, Int32) Method
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.LibraryManagerAssembly: FileHold.LibraryManager (in FileHold.LibraryManager.dll) Version: 17.1.0.0
[WebMethodAttribute(Description = "Finds documents which fulfills specified search criteria and retrieves a single page of data.")]
[XmlIncludeAttribute(typeof(DropdownFieldChoice[]))]
[XmlIncludeAttribute(typeof(DrilldownFieldChoice[]))]
[XmlIncludeAttribute(typeof(int[]))]
public ColumnsWithValues GetDocumentsBySnapshot(
Guid prevSnapshotId,
ref Guid snapshotId,
string viewContainerType,
SearchCriteria searchCriteria,
ColumnSelector[] sortOrder,
int firstRowIndex,
int pageSize
)
- prevSnapshotId Guid
- 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 Guid
- 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 String
- 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 SearchCriteria
- Determine which documents will be searched for.
- sortOrder ColumnSelector
- The sort order and group by definition for the results. When this value is null results will be returned in undetermined order.
- firstRowIndex Int32
- The row number of the first row in the result set that will be loaded to the snapshot and returned.
- pageSize Int32
- 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.
ColumnsWithValuesField name and value details.
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.