|
notes
在web全文检索中提交查询的代理
(阿瑞)
notes在web中执行全文检索时,需要通过代理执行。先看一下查询表单页面:
单击“确定”按钮后,就会执行wsearchsubmit代理,以下是在公文流转中的web全文检索中wsearchsubmit代理的Initialize源代码:
Sub Initialize
'This code creates the search condition by using the form wsearch
Dim ResultDoc As notesdocument
Dim targetview As notesview
Dim iNum As Integer
Set session = New NotesSession
Set db = session.CurrentDatabase
Set note = session.DocumentContext
Set targetview=db.getview("($all)")
If db.IsFTindexed Then
If ( db.LastModified > db.LastFTIndexed ) Then
Call db.UpdateFTIndex( False )
End If
Else
Call db.updateftindex(True)
End If
ProcessConditions
'searchstr是检索条件
iNum=targetview.ftsearch(strformula,0)
If iNum=0 Then
Print "没有找到符合条件的文档"
Exit Sub
End If
Print|<style type="text/css">|
Print| <!-- .font9pt { font-family: "宋体"; font-size: 9pt; font-style:
normal; line-height: 15pt; color: #000000} .font9ptwhite { font-family:
"宋体"; font-size: 9pt; font-style: normal; line-height: 15pt; font-weight:
bold; color: #FFFFFF} A:hover { COLOR: red; TEXT-DECORATION: underline }
A:link { TEXT-DECORATION: none } -->|
Print| </style>|
Print |<table width="23%" class="font9pt" align="left">|
Print |<tr>|
Print |<td align=right>|
Print |<div align=left>|
Print|<img src="../images/unoa/query.gif">|
Print |</div>|
Print |</td>|
Print |</tr>|
Print|<tbody> |
Print|</tbody> |
Print |</table>|
Print |<br>|
Print |<table border=0 width="518" class="font9pt" align="left">|
Print |<tbody> |
Print |<tr> |
Print |<td class=lemon1 colspan="2"> |
Print |</td>|
Print |</tr>|
Print |<tr> |
Print |<td class=chinese width="40" height="6">|
Print |<span class=lemon1>|
Print |<b>|
Print |<font color="#FF0000">查看:</font></b><font color="#FF0000">|
Print |<span class=chinese>|
Print |</span>|
Print |</font>|
Print |</span>|
Print|</td>|
Print|<td width="437" height="6">|
Print|<a href="/|+GetMyDBPath+|/($all)?openview">|
Print|<b>|
Print "【按时间】"
Print|</b>|
Print|</a>|
Print|<a href="/|+getmydbpath+|/reviewstatus?openview">|
Print|<b>|
Print "【按状态】"
Print|</b>|
Print|</a>|
Print|<a href="/|+getmydbpath+|/byauthor?openview">|
Print|<b>|
Print "【按部门】"
Print|</b>|
Print|</a>|
Print|<a href="/|+getmydbpath+|/bycategory?openview">|
Print|<b>|
Print "【按类别】"
Print|</b>|
Print|</a>|
Print|</td>|
Print|</tr>|
Print|</tbody>|
Print|</table>|
Print|<br>|
Print|<br>|
Print|<br>|
Print|<br>|
Print |<p class=font9pt>|
Print "找到"+"<font
color=#cc0000> "+Cstr(iNum)+" </font>"+"个符合条件的文档<br>"
Print |</p>|
Print |<table class=font9pt>|
Dim nameQicao As notesname
Print |<td width=50 nowrap>序号</td><td width=150>日期</td><td
width=200>标题</td><td>作者</td>|
Print |<hr size=1 width=500px align=left color=#3333ff>|
For i=1 To iNum
Set ResultDoc=targetview.getnthdocument(i)
Print |<tr>|
Print |<td width=50 nowrap>|+Cstr(i)+|</td>|
Print |<td width=150 nowrap><a
href="/|+GetMyDBPath+"/"+"($all)"+"/"+ResultDoc.universalid+|">|
Print resultdoc.riqi(0)+|</a></td>|
Print |<td width=200 nowrap><a
href="/|+GetMyDBPath+"/"+"($all)"+"/"+ResultDoc.universalid+|">|
Print ResultDoc.subject(0)+|</a></td>|
Print |<td><a
href="/|+GetMyDBPath+"/"+"($all)"+"/"+ResultDoc.universalid+|">|
Set nameQicao=New notesname(resultdoc.qicaoren(0))
Print nameQicao.common+|</a></td></tr>|
Next
Print |</table>|
Print |<hr size=1 width=500px align=left color=#3333ff>|
End Sub
执行结果如下:
以上页面都是在浏览器端执行。在执行其他工作流程中的全文检索时,需要将相应的选项进行修改。
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?会员注册
x
|