﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-爪哇哇-随笔分类-DOMINO</title><link>http://www.blogjava.net/nikon/category/28513.html</link><description /><language>zh-cn</language><lastBuildDate>Sun, 30 Dec 2007 04:01:42 GMT</lastBuildDate><pubDate>Sun, 30 Dec 2007 04:01:42 GMT</pubDate><ttl>60</ttl><item><title>关于 DOMINO LS里面 view的Ftsearch的 "entry is no longer in view"的研究</title><link>http://www.blogjava.net/nikon/archive/2007/12/29/171527.html</link><dc:creator>李立波</dc:creator><author>李立波</author><pubDate>Sat, 29 Dec 2007 06:40:00 GMT</pubDate><guid>http://www.blogjava.net/nikon/archive/2007/12/29/171527.html</guid><wfw:comment>http://www.blogjava.net/nikon/comments/171527.html</wfw:comment><comments>http://www.blogjava.net/nikon/archive/2007/12/29/171527.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/nikon/comments/commentRss/171527.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/nikon/services/trackbacks/171527.html</trackback:ping><description><![CDATA[1：<br />
原因主要是 数据的不唯一性<br />
<br />
domino文档数据库的弊病<br />
<br />
而且 FTSearch查询起来也不很准确，三字符一下查询，命中率不是十分高，大约 80%-95%<br />
<br />
2：<br />
entry is no longer in view错误的避免方法是<br />
<br />
用NotesViewEntry.IsValid方法先判断那 Entry是否能调用<br />
<br />
如果不是调用里面很多方法 都会报&nbsp;&nbsp;entry is no longer in view，就算 IsDocument也没用处<br />
<br />
但这样，如果是自己手动分页，就会出现 GetNthEntry时候不太准确<br />
<br />
但没办法了，两者弊，取其轻<br />
<br />
主要是客户体验受点影响了<br />
<br /><img src ="http://www.blogjava.net/nikon/aggbug/171527.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/nikon/" target="_blank">李立波</a> 2007-12-29 14:40 <a href="http://www.blogjava.net/nikon/archive/2007/12/29/171527.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>近期负责公司的OA改造，接触了ext-js框架，自己动手写了些代码，最有成就感的是 extnd里分页的修改，一下是部分修改心得</title><link>http://www.blogjava.net/nikon/archive/2007/12/29/171521.html</link><dc:creator>李立波</dc:creator><author>李立波</author><pubDate>Sat, 29 Dec 2007 06:32:00 GMT</pubDate><guid>http://www.blogjava.net/nikon/archive/2007/12/29/171521.html</guid><wfw:comment>http://www.blogjava.net/nikon/comments/171521.html</wfw:comment><comments>http://www.blogjava.net/nikon/archive/2007/12/29/171521.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/nikon/comments/commentRss/171521.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/nikon/services/trackbacks/171521.html</trackback:ping><description><![CDATA[<p style="color: red">一：<br />
<br />
<span style="color: #000000">分页要自己重写：在 extnd-all-debug重写拿取数据部分<br />
</p>
<p>//自己重写分页拿数据的方法，这样数据行数会正确现实<br />
&nbsp; var ds = new Ext.nd.data.DominoViewStore({<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy: new Ext.data.HttpProxy({<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; url: Ext.nd.extndUrl+'GetView?OpenAgent',<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; method: "GET"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; baseParams: {db: "/"+Ext.nd.Session.CurrentDatabase.FilePath, vw: this.viewName },<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader: viewEntryReader,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; remoteSort: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });</p>
<p>。。。。。。。。。。。。。。。<br />
<br />
getView的ls代理如下<br />
<br />
</p>
<p>'GetView: </p>
<p>Option Public<br />
Option Explicit</p>
<p><br />
Sub Initialize<br />
%REM<br />
This agent can be called from the web to search any view and return results in the<br />
same format as the ?ReadViewEntries command. This was created for use with the <br />
NotesView2 class v1.3 and above.<br />
%END REM<br />
&nbsp;<br />
&nbsp;On Error Goto ErrorHandler<br />
&nbsp;<br />
&nbsp;Dim session As New NotesSession<br />
&nbsp;Dim dbSearch As NotesDatabase<br />
&nbsp;Dim colEntries As NotesViewEntryCollection<br />
&nbsp;Dim vwSearch As NotesView<br />
&nbsp;Dim entryResult As NotesViewEntry<br />
&nbsp;Dim docCurrent As NotesDocument<br />
&nbsp;Dim docResult As NotesDocument<br />
&nbsp;Dim col As NotesViewColumn<br />
&nbsp;Dim strQuery As String<br />
&nbsp;Dim strDb As String<br />
&nbsp;Dim strView As String<br />
&nbsp;Dim strCategory As String<br />
&nbsp;Dim intMax As Integer<br />
&nbsp;Dim lngCount As Long, i As Long<br />
&nbsp;Dim lngStart As Long, lngEnd As Long<br />
&nbsp;Dim strParameters As String<br />
&nbsp;Dim lngResults As Long<br />
&nbsp;Dim x,n As Integer<br />
&nbsp;Dim xmlStr,resortdescending ,resortascending As String<br />
&nbsp;Dim nav As NotesViewNavigator<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;'start the xml document<br />
&nbsp;Print "Content-Type:text/xml;"<br />
&nbsp;Print "&lt;?xml version=""1.0"" encoding=""gb2312""?&gt;"<br />
&nbsp;<br />
&nbsp;'first we get the search parameters out of the querystring<br />
&nbsp;'db, vw, query, searchmax, count, and start<br />
&nbsp;Set docCurrent = session.DocumentContext<br />
&nbsp;<br />
&nbsp;strParameters = docCurrent.GetItemValue("Query_String")(0)<br />
&nbsp;'Msgbox strParameters<br />
&nbsp;strDb = GetParameter("db",strParameters)<br />
&nbsp;strDb = Replace(Strright(strDb,"/"),"/","\")<br />
&nbsp;strView = GetParameter("vw",strParameters)<br />
&nbsp;strQuery = GetParameter("query",strParameters)<br />
&nbsp;strCategory= GetParameter("RestrictToCategory",strParameters)<br />
&nbsp;resortdescending=GetParameter("resortdescending",strParameters)<br />
&nbsp;resortascending=GetParameter("resortascending",strParameters)<br />
&nbsp;<br />
&nbsp;intMax = 0<br />
&nbsp;If Isnumeric(GetParameter("searchmax",strParameters)) Then intMax = Cint(GetParameter("searchmax",strParameters))<br />
&nbsp;lngCount = 20<br />
&nbsp;If Isnumeric(GetParameter("count",strParameters)) Then lngCount = Clng(GetParameter("count",strParameters))<br />
&nbsp;lngStart = 1<br />
&nbsp;If Isnumeric(GetParameter("start",strParameters)) Then lngStart = Clng(GetParameter("start",strParameters))<br />
&nbsp;<br />
&nbsp;'now we get the view to search<br />
&nbsp;Set dbSearch = session.GetDatabase("",strDb,False)<br />
&nbsp;Set vwSearch = dbSearch.GetView(strView)<br />
&nbsp;<br />
&nbsp;'Msgbox resortdescending +" &amp;&amp; "+resortascending<br />
&nbsp;<br />
&nbsp;'now we run the search<br />
&nbsp;If&nbsp;&nbsp; strCategory="" Then<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;Set colEntries = vwSearch.AllEntries&nbsp;<br />
&nbsp;Else<br />
&nbsp;&nbsp;Set colEntries = vwSearch.GetAllEntriesByKey(strCategory)<br />
&nbsp;End If&nbsp;<br />
&nbsp;<br />
&nbsp;lngResults=colEntries.Count<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;'now we spit out the results<br />
&nbsp;Print "&lt;viewentries toplevelentries=""" &amp; Cstr(lngResults) &amp; """&gt;"<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;'set the starting point for the loop<br />
&nbsp;If lngStart &gt; lngResults Then lngStart = lngResults<br />
&nbsp;<br />
&nbsp;'set the ending point for the loop<br />
&nbsp;lngEnd = lngStart + lngCount - 1<br />
&nbsp;If lngEnd &gt; lngResults Then lngEnd = lngResults<br />
&nbsp;'now loop through the appropriate subset of results and print out a viewentry tag for each one<br />
&nbsp;i = lngStart<br />
&nbsp;While i &lt;= lngEnd<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;If i = lngStart Then <br />
&nbsp;&nbsp;&nbsp;Set entryResult = colEntries.GetNthEntry(i)&nbsp;<br />
&nbsp;&nbsp;Else <br />
&nbsp;&nbsp;&nbsp;Set entryResult = colEntries.GetNextEntry(entryResult)<br />
&nbsp;&nbsp;End If<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;If Not entryResult Is Nothing&nbsp;&nbsp; Then<br />
&nbsp;&nbsp;'If Not entryResult Is Nothing And entryResult.IsValid&nbsp; Then<br />
&nbsp;&nbsp;&nbsp;'If entryResult.IsDocument Then<br />
&nbsp;&nbsp;&nbsp;Set docResult = entryResult.Document<br />
&nbsp;&nbsp;&nbsp;Print&nbsp; "&lt;viewentry position=""" &amp; Cstr(i) &amp; """ unid=""" &amp; Cstr(docResult.universalID) &amp; """ noteid=""" &amp; Cstr(docResult.NoteID) &amp; """ siblings=""" &amp; Cstr(entryResult.SiblingCount) &amp; """&gt;"<br />
&nbsp;&nbsp;&nbsp;x = 0 <br />
&nbsp;&nbsp;&nbsp;n=0<br />
&nbsp;&nbsp;&nbsp;Forall value In entryResult.ColumnValues<br />
&nbsp;&nbsp;&nbsp;&nbsp;Set col=vwSearch.Columns(x)<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;If Not col.isCategory And&nbsp; Not col.IsHidden&nbsp; Then<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Print "&lt;entrydata columnnumber=""" &amp; Cstr(n) &amp; """ name=""" &amp; col.itemName &amp; """&gt;"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Print&nbsp; "&lt;text&gt;" &amp; XMLEscape(GetValue(value,Cstr(docResult.universalID))) &amp; "&lt;/text&gt;"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Print&nbsp; "&lt;/entrydata&gt;"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n=n+1<br />
&nbsp;&nbsp;&nbsp;&nbsp;End If<br />
&nbsp;&nbsp;&nbsp;&nbsp;x = x + 1<br />
&nbsp;&nbsp;&nbsp;End Forall<br />
&nbsp;&nbsp;&nbsp;Print "&lt;/viewentry&gt;"<br />
&nbsp;&nbsp;&nbsp;'End If<br />
&nbsp;&nbsp;End If<br />
&nbsp;&nbsp;i = i + 1<br />
&nbsp;Wend<br />
AtEnd:<br />
&nbsp;Print "&lt;/viewentries&gt;"<br />
&nbsp;<br />
&nbsp;''''Msgbox xmlStr<br />
&nbsp;Print xmlStr<br />
&nbsp;vwSearch.Clear<br />
&nbsp;Set dbSearch=Nothing<br />
&nbsp;Set vwSearch=Nothing<br />
&nbsp;Exit Sub<br />
ErrorHandler:<br />
&nbsp;Msgbox "&lt;error&gt;" &amp; "Error in ($Ext.nd.SearchView): " &amp; Error &amp; "---at " &amp; Erl &amp; "&lt;/error&gt;"<br />
&nbsp;Print "&lt;error&gt;" &amp; "Error in ($Ext.nd.SearchView): " &amp; Error &amp; "---at " &amp; Erl &amp; "&lt;/error&gt;" <br />
&nbsp;Resume AtEnd<br />
End Sub<br />
Function GetParameter(strParamName As String, strQuery As String) As String<br />
&nbsp;'this gets a parameter out of a querystring<br />
&nbsp;Dim i As Integer<br />
&nbsp;Dim s As String<br />
&nbsp;Dim v As Variant<br />
&nbsp;<br />
&nbsp;GetParameter = ""<br />
&nbsp;<br />
&nbsp;i = Instr(Ucase(strQuery),"&amp;" &amp; Ucase(strParamName) &amp; "=")<br />
&nbsp;If i &lt;&gt; 0 Then<br />
&nbsp;&nbsp;s = Strright(Mid(strQuery, i),"=")<br />
&nbsp;&nbsp;If Instr(s, "&amp;") Then<br />
&nbsp;&nbsp;&nbsp;s = Strleft(s, "&amp;")<br />
&nbsp;&nbsp;End If<br />
&nbsp;&nbsp;v = Evaluate("@UrlDecode(""Domino""; """ &amp; s &amp; """)")<br />
&nbsp;&nbsp;GetParameter = Cstr(v(0))<br />
&nbsp;End If<br />
End Function<br />
Function XMLEscape(strValue As String) As String<br />
&nbsp;'this escapes a string so it can be printed out to xml safely<br />
&nbsp;strValue = Replace(strValue, "&amp;" , "&amp;amp;")<br />
&nbsp;strValue = Replace(strValue, "&lt;" , "&amp;lt;")<br />
&nbsp;strValue = Replace(strValue, "&gt;" , "&amp;gt;")<br />
&nbsp;XMLEscape = strValue<br />
End Function</p>
<p><br />
Function GetValue(strValue As Variant,id As String) As String<br />
&nbsp;On Error Goto sErr<br />
&nbsp;<br />
&nbsp;'Forall vs In strValue<br />
&nbsp;'&nbsp;Msgbox "vs=" &amp;&nbsp; Cstr(vs)<br />
&nbsp;'End Forall<br />
&nbsp;GetValue=Cstr(strValue)<br />
&nbsp;Exit Function<br />
sErr:<br />
&nbsp;GetValue="文档" &amp; id<br />
&nbsp;Exit Function<br />
End Function</p>
<p>&nbsp;</p>
<p>有兴趣可以研究下 ext-js的AJAX框架，确实很有趣<br />
</p>
</span><img src ="http://www.blogjava.net/nikon/aggbug/171521.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/nikon/" target="_blank">李立波</a> 2007-12-29 14:32 <a href="http://www.blogjava.net/nikon/archive/2007/12/29/171521.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>