Type BlockID
hPool As Long
Block As Integer
End Type
Type FTINDEX 'Type used to pass the options to set in the index
Indexed As Integer 'Create index true / false
IndexAttachments As Integer 'Index attachments true / false
IndexAttachmentsFormat As Integer 'Index format true = raw text only, false = binary
EncryptedFields As Integer 'index encrypted fields true / false
IndexBreaks As Integer 'index sentence and paragraph breaks true /false
CaseSensitive As Integer 'case sensitive index true / false
UpdateFrequency As Integer 'update frequency : 0 = Daily | 1 = Scheduled | 2 = Hourly | 3 = Immediate
LastIndexedOn As String 'last index date/time
End Type
Public Type TIMEDATE
innards (1) As Long
End Type
Declare Function NSFDbOpen Lib "NNOTES" Alias "NSFDbOpen" ( ByVal P As String, hDB As Long) As Integer
Declare Function NSFDbClose Lib "NNOTES" Alias "NSFDbClose" ( ByVal hDB As Long) As Integer
Declare Function NSFDbGetExtendedInfo Lib "nnotes.dll" Alias "NSFDbGetExtendedInfo" _
(ByVal hDB As Long, hB As BLOCKID) As Integer
Declare Function FTGetLastIndexTime Lib "nnotes.dll" Alias "FTGetLastIndexTime" _
(ByVal hDB As Long, T As TIMEDATE) As Integer
Declare Function ConvertTIMEDATEToText Lib "nnotes.dll" Alias "ConvertTIMEDATEToText" _
(ByVal zI As Long, ByVal zT As Long, T As TIMEDATE, ByVal S As String, ByVal nS As Integer, _
nT As Integer) As Integer
Declare Function OSLoadString Lib "nnotes.dll" (ByVal hModule As Long, ByVal StringCode As Long, _
ByVal retBuffer As String, ByVal BufferLength As Integer) As Integer
Declare Function OSPathNetConstruct Lib "NNOTES" Alias "OSPathNetConstruct" ( ByVal NullPort As Long, _
ByVal Server As String, ByVal FIle As String, ByVal PathNet As String) As Integer
Declare Function OSLockObject Lib "NNOTES" Alias "OSLockObject" ( ByVal H As Long) As Long
Declare Sub Peek Lib "MSVCRT" Alias "memcpy" ( D As Any, ByVal P As Long, ByVal N As Long)
Declare Sub OSUnlockObject Lib "NNOTES" Alias "OSUnlockObject" ( ByVal H As Long)
Function GetFTIndexInfo(Server As String, FilePath As String, Index As FTINDEX) As Integer
Dim FullPath$, strError$, LastIndexedOn$, hDB&, p&, idx%, opt%, frq%, rc%,l%
Dim hB As BLOCKID
FullPath = Space(1024)
rc = OSPathNetConstruct (0, Server, FilePath, FullPath)
NSFDbOpen FullPath, hDB
If hDB = 0 Then Exit Function
rc = NSFDbGetExtendedInfo (hDB, hB)
If rc And ERR_MASK = 0 Then
strError = String(255, " ")
Call OSLoadString(0, rc, strError, 255)
Print "Fehler bei FT-Index Daten lesen" & "L: " & strError, 0, DLGTITLE
GetFTIndexInfo = False
Exit Function
End If
If hB.hPool = 0 Then
NSFDbClose hDB
Exit Function
Else
p& = OSLockObject(hB.hPool) + hB.Block
Peek idx, p& + 2, 2
Peek opt, p& + 6, 2
Peek frq, p& + 8, 2
OSUnlockObject hB.hPool
End If
Dim T As TimeDate
FTGetLastIndexTime hDB, T
If Not T.Innards(0) = 0 Then
LastIndexedOn = Space(256)
ConvertTIMEDATEToText 0, 0, T, LastIndexedOn, 256, L
LastIndexedOn = Left$(LastIndexedOn, L)
End If
NSFDbClose hDB
If idx% = 0 Then Index.Indexed="0" Else Index.Indexed="1" : Index.LastIndexedOn = LastIndexedOn
If (opt% And &H20) Then Index.IndexAttachments="1" Else Index.IndexAttachments="0"
If (opt% And &H80) Then Index.IndexAttachmentsFormat="1" Else Index.IndexAttachmentsFormat="0"
If (opt% And &H40) Then Index.EncryptedFields="1" Else Index.EncryptedFields="0"
If (opt% And &H10) Then Index.IndexBreaks="1" Else Index.IndexBreaks="0"
If (opt% And &H02) Then Index.CaseSensitive="1" Else Index.CaseSensitive="0"
Index.UpdateFrequency=CStr(frq%)
End Function