ORF反垃圾邮件系统

邮件服务器-邮件系统-邮件技术论坛(BBS)

 找回密码
 会员注册
查看: 6377|回复: 0
打印 上一主题 下一主题

[原创] chinalotus技术代码经典之五:在web全文检索中提交查询的代理

[复制链接]
跳转到指定楼层
顶楼
发表于 2007-11-5 10:57:34 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
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>&nbsp"+Cstr(iNum)+"&nbsp</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
您需要登录后才可以回帖 登录 | 会员注册

本版积分规则

小黑屋|手机版|Archiver|邮件技术资讯网

GMT+8, 2024-5-4 11:34

Powered by Discuz! X3.2

© 2001-2016 Comsenz Inc.

本论坛为非盈利中立机构,所有言论属发表者个人意见,不代表本论坛立场。内容所涉及版权和法律相关事宜请参考各自所有者的条款。
如认定侵犯了您权利,请联系我们。本论坛原创内容请联系后再行转载并务必保留我站信息。此声明修改不另行通知,保留最终解释权。
*本论坛会员专属QQ群:邮件技术资讯网会员QQ群
*本论坛会员备用QQ群:邮件技术资讯网备用群

快速回复 返回顶部 返回列表