Dimino Web开发技术积累_第1页
Dimino Web开发技术积累_第2页
Dimino Web开发技术积累_第3页
Dimino Web开发技术积累_第4页
Dimino Web开发技术积累_第5页
已阅读5页,还剩271页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Lotus Domino WEB 开发技术积累目录:1. 选取视图的列的内容 Trim DbColumn52. 隐藏判断常用的命令53. 判断当前用户是否是“某个组”的成员,然后来显示和隐藏54. 在Lotus Domino 中显示图55. 链接JS文件56. 删除文档的方法57. $return 域的使用58. 将表单设计为视图或导航器模板69. 为 Web 定制“表单已处理”确认信息710. 定制出错信息811. $HtmlHead几种常用的技巧712. Domino Designer 模板表913. 角色判断1014. 判断文档是否正在被修改1015. 在只读的方式下返回($return

2、716. 刷新表单1117. 怎样在文档里存照片?1118. 后台lotusscript如何取得前台表单中复选框所选择的项目列表(b/s结构)1219. 试图的列公式:附件下载1220. 有没有好一点的分页处理代码1321. 同一用户重复登录1522. Return to sender1623. Agent to copy values from 1 form to another 在同一个数据库中进行1924. 超越OLE 通过COM结合MS Office与Notes应用2025. 读写关系数据库资料2426. 视图-excel,表单-word2827. 关于Web上的检索问题3028. 如

3、何使用Notes与关系数据库进行信息交互?3129. 如何在IE里面实现notes中的 对话框列表?3330. LotusDomino环境下编写Web浏览器多数据库检索程序3431. WINAPI函数3732. 用PowerBuilder访问Lotus Notes数据库4633. 如何在表单中加入计数器4834. 实现两个数据库间的数据追加 C/S 结构5035. 如何防止他人使用旧id和旧口令访问Domino服务器?5136. 在你的WEB站点上使用DOMINO群集5237. 在你的DOMINO WEB站点中插入.SWF文件6138. DOMINO R5的域搜索功能在WEB上的实现6539.

4、 Display Rich Text fields in a view7340. Auto-Launch a file attachment7441. Showing a response count without showing the responses7642. 常用的几个按钮收集7843. 在WEB上从视图删除文档技巧8044. 在Domino Designer中使用XML数据8245. 在Domino Designer上执行XML8646. Show single category view, the next stage9247. Checkboxes in a list box

5、9348. Formatting a Notes view in HTML table for WEB9449. Jump to the end of a view (web agent)9550. Disabling actions until a page finishes loading9751. Web-based, fully customizable search9852. 从复选框中删除文档Deleting selected docs on Web10253. Debugging LotusScript Agents10354. Displays the contents of

6、the Subject field in the first document in theExamples view.10555. Example: GetLastDocument method10656. Examples: GetNextDocument method10657. Example: GetFirstDocument method10758. Examples: FTSearch method10859. Examples: DeleteDocument method10960. Example: Deleting a document11061. Example: Cre

7、ating a document11062. Examples: Locating documents within a view or folder11063. Example: Adding a document11664. Export to Excel11765. 连接ODBC11866. 特效错误!未定义书签。67. notes和Excel交换数据12168. NOTES的ODBC:(LS:DO)12269. Managing JavaScript popup windows 第一稿12470. HEAD元素使用集锦12671. 主页javascript特效19则12772. 关于创

8、建、删除、编辑、打开和保存文档的 URL 命令13473. Domino URL 命令13674. 在打开有下面这段代码的页面时将会跳出一个468x60大小的小窗口13875. javascript的容错脚本13976. Web search with JavaScript14077. 如何防止他人使用旧id和旧口令访问Domino服务器14278. Fixing the Domino CheckBox Bug14379. Managing JavaScript popup windows14980. Quick, easy, foolproof field level help15181.

9、Quick edit document link15282. Managing JavaScript popup windows15383. Svg: Pie-Eyed15784. Recebt Entries15885. Xin Calendar Mods15986. 答复文档16187. 公式语言16288. Resuable way to get URL parameters into fields17289. JSHeader 使用17490. JavaScript 帮助17491. Examples: Collecting documents by searching18092. 关

10、于DOcumentContext 的属性18293. About data types 关于lotus Domino 的数据类型18394. CLng function18595. Using the DOM to replace No documents found18596. What you need and want to know about errors18997. Processing multiple documents from a view19398. Forcing attachments to always download19699. ODBCExample: Get

11、Value method216100. ODBCResultSet class217101. Create a Login anchor link220102. 分类视图的开发技巧221103. 公式语言223104. Copy documents from one database to another233105. 定制搜索表单234106. UserName的属性及使用240107. Dynamic Content for Popup Windows241108. Shortcut when printing from a Java Agent242109. Lotus Script:

12、Write # statement244110. Lotus Script: Input # statement245111. 使用代理生成 XML249112. 使用视图生成 XML251113. 执行算术运算252114. Keep URLs simple by making them relative256115. Quick, easy, foolproof field level help258116. Hiding attachments (without noscript tag!)259117. Listing search results in groups260118. 如

13、何在表单中加入计数器?264119. 怎样限制一个WEB用户只有登陆才能使用数据库266120. Complete control when printing HTML from an agent268121. Simple multi-lingual forms using Domino270122. Stop double form submissions2721.选取视图的列的内容 Trim DbColumn代码Trim(DbColumn(:nocache;DbName;bjialist;1)2.隐藏判断常用的命令代码IsDocBeingEdited|!IsMember(admin;Us

14、erRoles)3.判断当前用户是否是“某个组”的成员,然后来显示和隐藏备注代码IsMember(names.nsf中的用户组;UserNamesList)4.在Lotus Domino 中显示图程序代码img:=;If(AttachmentNames!=;img; )5.链接JS文件代码6.删除文档的方法程序代码REM Do not show delete link on a new document;If(IsNewDoc; ; Delete Document.)REM Do not show delete link on a new document;If(IsNewDoc;

15、; )7.$return 域的使用程序代码返回到另外的一个页面增加到另外页面的链接Lotus个人化信息 谢谢您的文档,namecn;userName+!返回到文档,查询刚才输入的信息Rem Anchors to document view + 查询输入的内容在$Return域中使用JavaScript :back2:=”history.go(-2);”back3:=”history.go(-3);”if(IsNewdoc;back2;back3)Create a view (All) with all documents of your db.In you

16、r form create a computed field called Doc_ID with formula Text(DocumentUniqueId) and a $Return field with: dominoserver:=Name(CN;Subset(DbName;1);filename:=Subset(DbName;-1);Doc_Id:=Doc_Id;http:/+dominoserver+/+filename+/All/+Doc_Id+?opendocument.8.将表单设计为视图或导航器模板备注程序代码在 Web 应用程序中,要创建表单与视图或导航器之间的关联,可

17、为表单指派一个保留名称。用户打开视图或导航器时 Domino 将表单用作模板。这对于在站点上创建视图和导航器的标准显示来说是一种好方法。使用以下保留表单名称创建表单与视图或导航器之间的关联。请注意 Domino 要求表单上必须有嵌入视图或 $ViewBody 域,但可以不考虑其值。表单名称必需的设计元素注释$ViewTemplate for viewname嵌入视图或$ViewBody 域将表单与特定视图关联。表单名包括 viewname,即视图的别名,如果没有别名,就包括视图的名称。$NavigatorTemplate for navigatorname 嵌入导航器或$NavigatorBo

18、dy 域将表单与特定导航器关联。表单名包括 navigatorname,即导航器名称。例如:被命名为 $NavigatorTemplate for World Map 的表单将与 World Map 导航器关联。Domino 忽略在表单上创建和读取存取列表。$ViewTemplateDefault嵌入视图或$ViewBody 域使该表单成为所有与另一表单不关联的 Web 视图的模板。$NavigatorTemplateDefault嵌入导航器或$NavigatorBody 域使该表单成为所有与另一表单不关联的 Web 导航器的模板。9.为 Web 定制“表单已处理”确认信息程序代码Web 用户

19、提交文档后,Domino 使用缺省的“表单已处理”的确认信息回应用户。要重新设置缺省答复,可将计算文本域添加到表单中,给此域命名为 $Return,并使用 HTML 作为计算值来创建定制的批准。显示个人化答复下面的 $Return 公式返回答复“Thank you”,并附加上用户姓名:who:= If(Left(From; ) = ; From; Left(From; );Return(Thank you, + who + Main View);显示定制的错误消息要定制显示给 Web 用户的错误消息外观,向数据库中添加定制的错误消息表单。如果发生错误条件,且其定制表单存在,则 Domino 使

20、用定制表单来显示错误消息。否则,Domino 使用缺省错误消息表单。添加到数据库的消息表单将覆盖由管理员设置的服务器范围内的消息。要在表单和错误条件之间创建关联,创建拥有下列名称之一的表单。然后创建名为 MessageString 的可编辑的文本域来保存错误消息。添加要与错误消息一起显示的其他文本、链接以及其他表单对象。表单名称条件$ReturnAuthenticationFailure不能校验用户名称和口令。$ReturnAuthorizationFailure用户对该数据库没有足够的存取级别。$ReturnDocumentDeleted成功删除文档。$ReturnGeneralError出

21、现了其他错误条件。链接到另一页面根据提交文档中的域值,在 HTML 中包括链接到另一页面的 URL。下面的 $Return 公式根据用户选择的范围返回答复。例如:如果用户选择欧洲,则消息“在意大利访问我们的站点”将显示一个链接,可链接到意大利的 Web 站点(假定公式中的“stdAnswer”和“stdFooter”已预先定义。)。If(Region=Asia; stdAnswer + Visit our site in Japan + stdFooter;Region=Europe; stdAnswer + Visit our site in Italy + stdFooter;stdAns

22、wer + stdFooter);返回另一页面要跳转到不同的 Web 页面,可将页面的 URL 用括号括起来放入页面。当用户提交文档时,Web 客户机将显示引用的文档。例如:下面的 $Return 公式显示 Lotus 日本站点的主页。10.$HtmlHead几种常用的技巧程序代码自动刷新WEB页面: a http-equiv=”refresh” content=2”自动链接到另外的页面: URL:=””;“”例子:url:=20/jjxmxx.nsf/jjxmxx_view

23、?OpenForm;11.在只读的方式下返回($return)程序代码比如修改$return 再比如在按钮里面写公式: jspath:=/+ReplaceSubstring(Subset(DbName;-1);/); Command(FileSave);URLOpen(jspath+/0/+docid+?opendocument)12.定制出错信息备注程序代码要想在发生一个错误之后,向用户返回定制的出错信息,可以使用如下的表单:表单名称描述$ReturnDocumentDeleted用户成功删除了文档$ReturnAuthenticationFailure用户的名称和密码无法验证$Return

24、AuthorizationFailure用户没有足够高的权限来访问数据库$ReturnGeneralError发生了任何其他类型的错误13.Domino Designer 模板表备注程序代码模板在开发流程的后期被更新。当 Domino Designer 可以使用时,下表列出的模板可能已经改变,或者附加了一些可用模板。如果使用 Domino Designer 安装模板,则可以在 Notes 程序目录下找到它们。 数据库标题文件名及设计模板名面向对象描述讨论- Notes & Web (R5.0) (*)discsw50.ntfStdR50DiscNotes 的一般用户和 Web 浏览器用户电子会

25、议室。 特性: 具有内置用户简要表来自动邮寄感兴趣的项目链接的线程化讨论。 匿名答复、归档和创建公用/私有线程。Web 浏览器用户的多导航器、备用视图模板和热点操作。文档集-Notes & Web (R5.0) (*)doclbw50.ntfStdR50WebDocLibNotes 的一般用户和 Web 浏览器用户文档存储。特性:评阅工作流程(串行和并行)和归档。Microsoft Office 文档集 (R5.0)doclbm50.ntfStdR50DocLibMSNotes 的一般用户为此应用程序套件开发的文档集的特殊版本。自动装载 OLE 对象并将 OLE 对象放大到窗口大小;并存储和支

26、持文档(由套件创建)的评阅流程。个人日志 (R4)journal4.ntfStdR4JournalNotes 的一般用户电子日记,用户可使用它来记录个人想法和个人文档。其中包括定制设计的指令。站点注册 5.0siregw50.ntfStdSite50RegWeb 浏览器用户一个样例,演示如何为基于 Domino 的应用程序注册 Web 用户。不用手动干涉用户即可自动创建帐号。 工作室 (R5.0) (*)teamrm50.ntfStdR50TeamRoomNotes 的一般用户和 Web 浏览器用户工作组协同工作的模型。维护若干文档交流类型来提交会议、讨论和操作项目。功能并行, 评阅进程、归档

27、和新闻简报。14.角色判断备注程序代码!IsMember(admin; UserRoles)15.判断文档是否正在被修改备注程序代码Isdocbeingedited16.刷新表单备注程序代码calling _doClick($Refresh, this, _self) through javacript will refresh the form and reloads the tables17.怎样在文档里存照片?备注程序代码建一个域(RTF),将该域设置成热点,然后对其click编写如下公式:command(FileImport;文件类型;所在目录)其中文件类型对于图片可以是gif/jpe

28、g格式的,可以省略所在目录,可选18.后台lotusscript如何取得前台表单中复选框所选择的项目列表(b/s结构)备注程序代码Dim DQsessionnew As New notessessionDim workspace As New NotesUIWorkspaceDim DQdocument As NotesdocumentDim DQdatabase As NotesdatabaseDim Dqitem As NotesItemDim DQuid Set DQdatabase = DQsessionnew.CURRENTDATABASESet DQuid = workspace.

29、CurrentDocumentSet DQdocument=DQuid.documentSet DQitem = DQdocument.GetFirstItem(A)Forall v In DQitem.ValuesMessagebox( v ) End ForallA为复选域名同意 gwmdj(gw) ;最好将 A为复选域名 改为$SelectDoc19.试图的列公式:附件下载备注程序代码_docRef := 0/ + Text(DocumentUniqueID);_attachRef := ReplaceSubstring(AttachmentNames; ; +);_href := _d

30、ocRef + /$File/ + _attachRef + ?OpenElement;_aTag := +  + title + ;_html := + Implode(_aTag; , ) + ;If(Attachments = 0; title; _html)20.同一用户重复登录备注程序代码var ConflictResult=document.forms0.ConflictResult.value; if (ConflictResult.indexOf(同一用户重复登录!)!=-1) | (ConflictResult.indexOf(文档锁定!)!=-1) whi

31、le(ConflictResult.indexOf(n)!=-1) ConflictResult=ConflictResult.replace(n,n); alert(ConflictResult); document.forms0.ConflictResult.value=;就是用户对于同一份文档重复登录时,提示此文档已被锁定,由某用户正在编辑。仅供参考。21.有没有好一点的分页处理代码备注程序代码在clpclub上看到的 该代理在webqueryopen里面打开 文章主题:RE: 有没有好一点的分页处理代码?呵呵 :) 狂雷天牢 2002-03-15 11:43:26 - Sub Init

32、ialize Dim s As New NotesSession Dim doc As NotesDocument Set doc=s.DocumentContext Dim db As NotesDatabase Set db=s.CurrentDatabase Dim view As NotesView Set view=db.GetView(doc.v_view(0) If view Is Nothing Then Msgbox view is Nothing! Goto bz End If Dim viewdc As NotesViewEntryCollection If doc.v_

33、keysort(0) Then Set viewdc=view.GetAllEntriesBykey(doc.v_keysort(0) Else Set viewdc=view.AllEntries End If Dim numdoc,rowsperpage As Integer numdoc=viewdc.count rowsperpage=Val(doc.v_rowsperpage(0) If (numdoc Mod rowsperpage)=0 Then doc.v_pagenum=numdoc/rowsperpage Else doc.v_pagenum=Int(numdoc/rows

34、perpage)+1 End If Dim start As Variant start=Evaluate(middle(query_string;start=;&),doc) If start(0) Then doc.v_currentpage=Int(Val(start(0)/rowsperpage)+1 Else doc.v_currentpage=1 start(0)=1 End If Dim item As NotesItem Set item=doc.GetFirstItem(v_dispage) If Cstr(doc.v_gopage(0) Then start(0)=(doc

35、.v_gopage(0)-1)*rowsperpage+1 End If For i=Int(Val(start(0)/rowsperpage)-4 To Int(Val(start(0)/rowsperpage)+4 If i=0 Then If i=doc.v_pagenum(0) Then Exit For End If If i=Int(Val(start(0)/rowsperpage) Then Call item.AppendToTextList(当前第+Cstr(i+1)+页) Else Call item.AppendToTextList(+Cstr(i+1)+) End If

36、 End If Next bz: Print Print End Sub22.Return to sender备注This Lotus developer was trying to come up with a clever solution to forward incoming emails to recipients text enabled mobile phones. Instead he ended up setting off a mail bomb on himself and his ASP. The following story is a good example of

37、 how a clever idea can blow up in your face, or your inbox.程序代码This Lotus developer was trying to come up with a clever solution to forward incoming emails to recipients text enabled mobile phones. Instead he ended up setting off a mail bomb on himself and his ASP. The following story is a good exam

38、ple of how a clever idea can blow up in your face, or your inbox. I was doing some development work to create an agent that would run when a new mail arrives and send a summary to the mobile phone text service (SMS). I had set the agent to run on new mail received but for each mail received it sent

39、summaries of all e-mails in my DB! Anyway the poor ASP that was forwarding my smss had a limit of 100 per day so any subsequent sms was rejected with an e-mail, which in turn triggered another flood of emails which in turn resulted in a stream of rejections which in turn. well you get the picture. I

40、 left this running overnight! The result: Some 40,000 e-mails outbound with a similar number inbound and a very cranky ASP. I was very red-faced then next morning to return to the office with a lot of phone messages from ASP. It was an easy fix though, but now I have lifetime ban from the ASP, I hav

41、e now fixed the agent (below) which looks in the calendar profile for details of SMS email address the Agent is set to run AfterNew mail Has Arrived on Newly Received Mail Documents. Code: OptionsOption PublicOption DeclareSub Initialize Dim session As New NotesSession Dim dbCurrent As NotesDatabase

42、 Dim collUnprocessed As NotesDocumentCollection Dim docCurrent As NotesDocument Dim itemBody As NotesItem Dim strPriority As String, strImportance As String Dim varBody As Variant Dim strSendTo As String Dim m_calprofile As notesdocument Dim sendsms As String Set dbCurrent = session.CurrentDatabase

43、Set m_calprofile = dbCurrent.GetProfileDocument(CalendarProfile) strSendTo = M_calprofile.SMSAddress(0) Celluar pager address sendsms = M_calprofile.SMSOwner(0) If sendsms = Yes Then I want to be notified If (dbCurrent Is Nothing) Then Nothing to Process Else Set collUnprocessed = dbCurrent.Unproces

44、sedDocuments If collUnprocessed.Count 1 Then Else Set docCurrent = collUnprocessed.GetFirstDocument If (docCurrent Is Nothing) Then No handle for Current Doc Else Do strPriority = docCurrent.DeliveryPriority(0) strImportance = docCurrent.Importance(0) If (docCurrent.Form(0) = Memo) And(strPriority =

45、 H Or strImportance = 1) Then Need to create new memo & send to pager. Dim docPagerMemo As NewNotesDocument(dbCurrent) Dim varFrom As Variant, strSubject AsString, strBodyText As String docPagerMemo.SendTo = strSendTo varFrom = Evaluate(Name(CN; From),docCurrent) strSubject = docCurrent.Subject(0) S

46、et itemBody = docCurrent.GetFirstItem(Body) If (itemBody Is Nothing) Then Body can not be read docPagerMemo.Body = Text can notbe read. Check your email. | From: & varFrom Else If Body can be read, return only 200characters strBodyText = Fr: & varFrom(0)& : & Left(itemBody.Abstract(1000,1,0), 200) docPagerMemo.Subject = strSubject docPagerMemo.Body = strBodyText docpagermemo.inetfrom= b2b End If Call docPagerMemo.Send(False) Callse

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论