CodeStore Now Easier to Navigate
Anybody noticed anything different round here? That's right, CodeStore now uses the new navigation code! Hopefully you've noticed the increase in usability and not any decrease in performance.
Each view has a different WQO agent and I've tailored the code to use the best approach for each one. The all articles and by area views only have 250 documents in them (with no risk of any sudden massive increase). For these I used the NotesViewNavigator technique with no noticable performance hit. I tried db.search with the formula:
"form='article' & draft!='1' & area='"+area+"'"
But it seams that "complicated" searches really do slow this approach down, so I had to scrap this.
The all feedback view is different. Here there are 2000+ documents and the search is simple ("Form='comment'") so I used .search() and, again, there was no real performance hit. Then Jon suggested I use a view property I'd not heard of before, called EntryCount. Using this seems really quick and so I used that instead.
So, as you can see, which method you use depends on the size of the view and the complexity of the selection formula. Horses for courses, as they say.
I've also added next and previous links to blogs and articles. In the blog entry they appear at the top and list the title of the entry in each direction, as below:
In the articles the links are at the bottom. I also added some meta information to the head tag to tell the browser about these links. If you use browsers (Opera / Mozilla type) that allow it, you can then navigate using special toolbars. In Firefox (due for v1.0 release today) you can install one from here, which looks like this:
So, things might be ever so slightly slower round here as of today. Hopefully you'll agree it's worth it.
I'm away for a day or two. I'll leave you with a great time-wasting Flash game.
Your 'By area' link bugs.
Maybe this function could be interesting for performance consideration ?
Function FPViewGetNumberOfDocs(vw As NotesView) As Long
REM From RedBook "Performance Considerations for Domino Applications"
Dim docLo As NotesDocument
Dim docHi As NotesDocument
Dim done As Integer
Dim fellOff As Integer
Dim rCtr As Integer
Dim inc As Long
Dim posLo As Long
Dim posHi As Long
Dim VwCount As Long
'*** Initialise
VwCount& = 0
done% = False
fellOff% = False
rCtr% = 0
If (vw Is Nothing) Then
'*** No view
Exit Function
End If
Set docLo = vw.GetFirstDocument()
If (docLo Is Nothing) Then
'*** Empty view
Exit Function
End If
rCtr% = rCtr% + 1
posLo& = 1
'*** Start somewhere (must be a power of 2)
inc& = 512
'*** Scan forward 'til we fall off the end
'*** (but double our increments each loop)
Do While (Not done%)
Set docHi = vw.GetNthDocument(posLo& + inc&)
rCtr% = rCtr% + 1
While (docHi Is Nothing And Not done%)
'*** We fell off the end - come on back
fellOff% = True
If (inc& = 1) Then
'*** If we get this far we know we found
'*** what we're after
VwCount& = posLo&
done% = True
Else
'*** Try a smaller increment
inc& = inc& \ 2
Set docHi = vw.GetNthDocument(posLo&+inc&)
rCtr% = rCtr% + 1
End If
Wend
'*** Jump ahead
If (Not done%) Then
posLo& = posLo& + inc&
If (fellOff%) Then
'*** If we've seen the end,
'*** we halve our increments
If (inc& > 1) Then
'*** but only if we can halve them
inc& = inc& \ 2
Else
'*** Hey - we're done
VwCount& = posLo&
done% = True
End If
Else
'*** If we haven't a clue how big this is,
'*** we double our increments
inc& = 2 * inc&
End If
End If
Loop
FPViewGetNumberOfDocs = VwCount&
End Function
when clicking on by area link in the todays blog it is showing error...pleas check
Looks great. How about some "First Page" and "Last Page" links for the navigation at the bottom?
375 points, that proofs I'm male. ;-)
411 points - dito.