13. getAllEntriesByKey
Dim ss As New NotesSession
Dim db As NotesDatabase
Dim vw As NotesView
Dim ec As NotesViewEntryCollection
Dim entry As NotesViewEntry
Dim keys$( 0 )
Dim tmp As Variant
Set db = ss.Currentdatabase
Set vw = db.Getview( "byTitle“ )
vw.Refresh
vw.Autoupdate = False
keys( 0 ) = "果物#1“
Set ec = vw.getAllEntriesByKey( keys, True )
Set entry = ec.Getfirstentry()
While Not entry Is Nothing
tmp = entry.Columnvalues( 1 )
If IsArray( tmp ) Then
Print Join( tmp, “,” )
Else
Print tmp
End If
Set entry = ec.Getnextentry( entry )
Wend
ビューエントリの
集合
一致する全ての
エントリを取得
エントリから2列
目の値を出力
結果
いちご
いちご
びわ
バナナ
バナナ
14. getAllEntriesByKey
Dim ss As New NotesSession
Dim db As NotesDatabase
Dim vw As NotesView
Dim ec As NotesViewEntryCollection
Dim entry As NotesViewEntry
Dim keys$( 0 )
Dim tmp As Variant
Set db = ss.Currentdatabase
Set vw = db.Getview( "byTitle“ )
vw.Refresh
vw.Autoupdate = False
keys( 0 ) = "果物#1“
Set ec = vw.getAllEntriesByKey( keys, True )
Set entry = ec.Getfirstentry()
While Not entry Is Nothing
tmp = entry.Columnvalues( 1 )
If IsArray( tmp ) Then
Print Join( tmp, “,” )
Else
Print tmp
End If
Set entry = ec.Getnextentry( entry )
Wend
結果
いちご
いちご
びわ
バナナ
バナナ
16. 結果
いちご
バナナ
びわ
みかん
りんご
createViewNavFromKey
Dim ss As New NotesSession
Dim db As NotesDatabase
Dim vw As NotesView
Dim nav As NotesViewNavigator
Dim entry As NotesViewEntry
Dim keys$( 0 )
Dim tmp As Variant
Set db = ss.Currentdatabase
Set vw = db.Getview( "byTitle“ )
vw.Refresh
vw.Autoupdate = False
keys( 0 ) = "果物#1"
Set nav = vw.createViewNavFromkey( keys, True )
Set entry = nav.Getfirst()
While Not entry Is Nothing
tmp = entry.Columnvalues( 1 )
If IsArray( tmp ) Then
Print Join( tmp, “,” )
Else
Print tmp
End If
Set entry = nav.Getnext( entry )
Wend
ビューエントリの
位置
位置を決める
エントリから2列
目の値を出力
19. getAllEntriesByKey
Dim ss As New NotesSession
Dim db As NotesDatabase
Dim vw As NotesView
Dim ec As NotesViewEntryCollection
Dim entry As NotesViewEntry
Dim keys$( 0 )
Set db = ss.Currentdatabase
Set vw = db.Getview( "byCategory“ )
vw.Refresh
vw.Autoupdate = False
keys( 0 ) = "バナナ“
Set ec = vw.getAllEntriesByKey( keys, True )
Set entry = ec.Getfirstentry()
While Not entry Is Nothing
Print entry.Columnvalues( 1 )
Set entry = ec.Getnextentry( entry )
Wend
結果
果物#1
果物#2
果物#3
20. createViewNavFromKey
Dim ss As New NotesSession
Dim db As NotesDatabase
Dim vw As NotesView
Dim nav As NotesViewNavigator
Dim entry As NotesViewEntry
Dim keys$( 0 )
Set db = ss.Currentdatabase
Set vw = db.Getview( "byCategory“ )
vw.Refresh
vw.Autoupdate = False
keys( 0 ) = "バナナ"
Set nav = vw.createViewNavFromKey( keys, True )
Set entry = nav.Getfirst()
While Not entry Is Nothing
Print entry.Columnvalues( 1 )
Set entry = nav.Getnext( entry )
Wend
結果
果物#1
果物#2
果物#3
果物#1
果物#1
21. createViewNavFromKey
Dim ss As New NotesSession
Dim db As NotesDatabase
Dim vw As NotesView
Dim nav As NotesViewNavigator
Dim entry As NotesViewEntry
Dim keys$( 0 )
Set db = ss.Currentdatabase
Set vw = db.Getview( "byCategory“ )
vw.Refresh
vw.Autoupdate = False
keys( 0 ) = "バナナ"
Set nav = vw.createViewNavFromKey( keys, True )
Set entry = nav.Getfirst()
While Not entry Is Nothing
Print entry.Columnvalues( 1 )
Set entry = nav.Getnext( entry )
Wend
結果
果物#1
果物#2
果物#3
果物#1
果物#1
View.createViewNavFromKey (Java and LotusScript) - This method in the View class is now available with this release.
It functions the same as View.getAllEntriesByKey except that it returns a ViewNavigator instead of a ViewEntryCollection.
The advantage of using a ViewNavigator over a ViewEntryCollection is that a view with multiple catgories may have documents that appear twice in the view. Unfortunately, a ViewEntryCollection does not allow for the repeat entries. A ViewNavigator, however, will match the view as displayed AND with the repeated documents. This the ViewNavigator collection can be traversed faster when using the ViewNavigator.setCacheSize and View.setAutoUpdate(false) methods.
Java syntax: ViewNavigator createViewNavFromKey(java.util.Vector keys, boolean exact) throws NotesException;
LotusScript syntax: CreateViewNavFromKey(Keyarray, Optional Byval exactmatch as Boolean) as NotesViewNavigator
View.createViewNavFromKey(JavaおよびLotusScript) - Viewクラスのこのメソッドは、今回のリリースで使用可能になりました。
ViewEntryCollectionの代わりにViewNavigatorを返す点を除いて、View.getAllEntriesByKeyと同じ機能を果たします。
ViewNavigatorをViewEntryCollectionに使用する利点は、複数のCatgoryを持つビューに、ビューに2度表示されるドキュメントがある可能性があることです。
残念ながら、ViewEntryCollectionは繰り返しエントリを許可しません。
ただし、ViewNavigatorは表示されたビューと繰り返されるドキュメントとを一致させます。
このViewNavigatorコレクションは、ViewNavigator.setCacheSizeメソッドとView.setAutoUpdate(false)メソッドを使用すると、より高速にトラバースできます。
LotusScript構文:NotesViewNavigatorとして CreateViewNavFromKey (Keyarray、省略可能なByval exactmatchをBooleanとして使用)