ITPub博客

首页 > Linux操作系统 > Linux操作系统 > [LotusScript] 簽認資料庫

[LotusScript] 簽認資料庫

原创 Linux操作系统 作者:withwangzhen 时间:2011-06-21 11:14:33 0 删除 编辑

1  代理   DB簽認
Sub Initialize
 
 
 On Error Goto ErrHandler
 Dim systemview As NotesView
 Dim systemdoc As NotesDocument
 Set s = New NotesSession
 Set db=s.CurrentDatabase
 Dim SearchFormula As String
 
 totalnum=0
 RefreshInfo=""
 theInstantV = Now
 Set EmpDB=s.getdatabase(db.Server,"SYSTEM\\UGOP.nsf")
 Set EmpOldView= EmpDB.GetView("(ByOldEName)")
 
 Set DBView = db.getView("Vw_APList")
 Set DBDC = DBView.AllEntries
 Set DBDE= DBDC.GetFirstEntry( )
 While Not(DBDE Is Nothing)
  Set DBDoc = DBDE.Document
  Set refreshDB = s.GetDatabase(DBDoc.ServerIp(0),DBDoc.ApPath(0))
  serverName = DBDoc.ServerName(0)
  apNames = apNames +serverName
  Call refreshDB.sign(DBSIGN_DOC_ALL)
  Call DBDoc.replaceitemvalue("phase2","Y")
  Call DBDoc.Save(True,False) 
  Set DBDE= DBDC.GetNextEntry(DBDE)
  Print totalnum
  totalnum = totalnum + 1
 Wend
 Messagebox Cstr(totalnum)
 '錯誤處理
 
 Set mdoc=db.createdocument
 Set rtitem=New notesrichtextitem(mdoc,"Body")
 mdoc.Form="memo"
 Dim adminmail(0)
 adminmail(0) ="With Wang/CN/CMINL@CMINL"
 mdoc.sendto=adminmail
 mdoc.subject=Cstr(Today)+" Domain Change Phase(SignACL)"+"For ALL"
 ErrorMsg = apNames +" OK !"+ ErrorMsg
 ErrorMsg="執行時間 From:"+ theInstantV+Chr(13)+ErrorMsg
 ErrorMsg="執行時間 To:"+ Cstr(Now)+Chr(13)+ErrorMsg
 ErrorMsg="已更新DB :"+Chr(13)+ErrorMsg
 ErrorMsg="已處理"+Cstr(totalnum)+"筆資料"+Chr(13)+ErrorMsg
 Call rtitem.AppendText( ErrorMsg )
 Call rtitem.AddNewline(3)
 Call rtitem.AppendText(RefreshInfo)
 mdoc.send(True)
 
 Print "更新Acl結束~!"
 Exit Sub
 
ErrHandler:
 ErrorMsg=ErrorMsg+Chr(13)+serverName+ "[Error #" & Cstr(Err) & "]: " + Error$ + Cstr(Erl())
 Resume Next
End Sub

2  Function UserNames
Function UserNames (Action As String, Username As Variant) As String
 Dim InputName As New NotesNAME(Username) 
 Action=Ucase(Action)
 Select Case Action
 Case "[CANONICAL]"
  UserNames=InputName.Canonical
 Case "[ABBREVIATE]"
  UserNames=InputName.Abbreviated
 Case "[CN]"
  UserNames=InputName.Common
 Case "[C]"
  UserNames=InputName.Country
 Case "[OU1]"
  UserNames=InputName.OrgUnit1
 Case "[OU2]"
  UserNames=InputName.OrgUnit2
 Case "[OU3]"
  UserNames=InputName.OrgUnit3
 Case "[O]"
  UserNames=InputName.Organization
 Case Else
  UserNames=InputName.Canonical
 End Select   
End Function

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24998103/viewspace-700381/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-05-15

  • 博文量
    24
  • 访问量
    44508