SearchFolderWithData

This call is used to search folders on the basis of the given criteria and returns the list of the folders along with the dataclass and the data field values.

 

Public Function SearchFolderWithData(FolderId() As Long,ByVal IncludeSubFolders As String, ByVal FolderName As String,
ByVal sOwner As String, ByVal sAuthor As String, ByVal CreationDateRange As String, ByVal AccessedDateRange As String, ByVal RevisedDateRange As String, ByVal ExpirydateRange As String, ByVal SearchOnDD As String, DDCriteria() As Byte, ByVal SearchOnGblId As String, GblCriteria() As Byte, ByVal SearchScope As Integer,ByVal DataDefCount As Long, _
DataDefList() As Long, ByVal FoldRefFlag As String, ByVal sOrderBy As String, ByVal PrevFolderCount As Long, FoldList() As Long, FolderCount As Long, ByVal StartPos As Long, ByVal FetchCount As Long, TotalRecCount As Long, ResultList() As Byte, ByVal bDDDataReq As String, DataDefFieldCount() As Long, DataDefFields() As Byte) As Long

 

Parameters

In/out

Name

Data type

Description

In/Out

FolderList

Long

Array of folder indexes within which search of folders is to be performed

In

IncludeSubFolders

String

Whether subfolders are to be included in the search or not

In

FolderName 

String

Name of the folder to be included as a search criteria

In

sOwner 

String

Name of the owner to be included as a search criteria

In

sAuthor 

String

Name of the author to be included as a search criteria

In

 

CreationDateRange

String

Creation Date range search criteria

In

 

AccessedDateRange

String

Accesed Date range search criteria

In

 

ReviseddateRange

String

Revised date range search criteria

In

 

ExpirydateRange

String

Expiry date range search criteria

In

 

SearchOnDD

String

Whether to search on dataclass 'Y'/'N'

In/Out

 

DDCriteria

Byte[TAGDDSEARCHEX]

Data class specific details on which search is to be performed

In

 

SearchOnGlobalId

String

Whether to search on global index Y'/'N'

In/Out

 

GblCriteria

Byte[TAGINDEXSEARCH]

Global index information on which search is to be performed

In

 

SearchScope

Integer

Scope of search

0 - for new search

1- Append to existing search

2- Search in existing list

In

 

DataDefCount  

Long

Number of dataclass on which fetch is desired

In/Out

 

DataDefList

Long

Array of dataclasses indexes that are to be included in the search criteria

In

 

FoldRefFlag

String

If references have to be fetched in the search result

'F' for only folders

'R' for only references

'B' for both reference and documents

In

 

sOrderBy

String

The order in which the search result is desired

In

 

PrevFolderCount   

Long

Folder count fetched till previous call

In/Out

FoldList

Long

Array of folder indexes fetched till previous call 

Out  

FolderCount 

Long

Number of folders fetched

In

FetchCount

 Long

Fetch count in case batching is to be implemented

In  

StartPos

Long

Starting position for performing search

Out  

TotalRecCount

Long

Total document count retrieved in the search

In

bDDDataReq

String

Whether dataclass related info has to be fetched along in the search result.

Out

DataDefFieldCount

Long

Array of field count corresponding to each dataclass

Out

 

DataDefFields

Byte[TagDataDefField]

Dataclass field info corresponding to each dataclass in the form of a byte array.

Out

 

ResultList

Byte [TagFolder]

Byte array of folders fetched as a result of search perform on some criteria

 

Description

This function is called in both local and shared cabinet for folder search according to the search criteria. Result comprises of folder list along with the associated dataclass information.

 

Return value

Name

Description

 1

In case of success

-1

Invalid cabinet name

-3

Cabinet not connected

-201

Insufficient rights for the current operation

-133

User not logged in

 

Example

Dim lFolderId()                         As Long
Dim DDCriteria()                      As Byte
Dim udtDDCriteria                    As TAGDDSEARCH
Dim lDataDefList()                     As Long
Dim lFetchCount                       As Long
Dim lTotalRecCount                   As Long
Dim SearchOnDD                        As String
Dim ResultList()                           As Byte
Dim lRetVal                                 As Long
Dim ldatadefindex                        As Long
Dim laDDDefFieldCount()             As Long
Dim btDDDefFields()                   As Byte
Dim udtDDField                         As TagDataDefField
Dim ldatadefcnt                         As Long
Dim gPDb                                 As PanDb.pdbCls

Dim IncludeSubFolders              As string

dim FolderName                        As string

dim sOwner                               As string

dim sAuthor                               As string

Dim btGblIndexCriteria()             As Byte

Dim SearchScope                      As Long

Dim lPrevFoldList()                     As Long

Dim PrevFolderCount                  As Long


Set gPDb = New PanDb.pdbCls

IncludeSubFolders= "Y"

FolderName = "Demo"

sOwner = "Nikesh"

sAuthor = "Ajay"


ReDim lFolderId(0)
lFolderId(0) = 0

Ldatadefindex = 2

ReDim lDataDefList(0)
lDataDefList(0) = 1
DataDefCount = 1
ReDim DDCriteria(Len(udtDDCriteria) - 1)

udtDDCriteria.Name = "Nikesh"
udtDDCriteria.Condition = "="
udtDDCriteria.DDId = 2

udtDDCriteria.IndexId = 3

udtDDCriteria.IndexType = 50 

udtDDCriteria.JoinCondition = "AND"
Call CopyMemory(DDCriteria(0) , udtDDCriteria, Len(udtDDCriteria))
SearchOnDD = "Y"

CreationDateRange = ""
AccessedDateRange = ""

RevisedDateRange = ""

ExpiryDateRange = ""
lFetchCount = 10

StartPos = 0

SearchScope = 0

FoldRefFlag = "F" ' only folder type

sOrderBy = "N'' for sorting on names


lRetVal = gPDb.SearchFolderWithData(lFolderId, IncludeSubFolders, FolderName, sOwner, sAuthor, CreationDateRange, AccessedDateRange, RevisedDateRange, ExpiryDateRange, SearchOnDD, DDCriteria, "N", btGblIndexCriteria, SearchScope, DataDefCount, lDataDefList, FoldRefFlag, sOrderBy, PrevFolderCount, lPrevFoldList, FolderCount, StartPos, lFetchCount, lTotalRecCount, ResultList, "Y", laDDDefFieldCount, btDDDefFields)

If lRetVal <> 1 Then

    msgbox gPDb.ErrDescription,vbinformation

End If