当前位置: 代码迷 >> Lotus >> lotusscript基础有关问题
  详细解决方案

lotusscript基础有关问题

热度:79   发布时间:2016-05-05 06:56:52.0
lotusscript基础问题
Sub Initialize
On Error Goto er
Dim session As New notessession
Dim doc As notesdocument
Dim sURL As String
Dim filepath As String 

Set mUtil = New Util
Set mOAfactory = New OAfactory

Dim db_WF As NotesDatabase
Set db_WF = mOAfactory.getSelfWF()
Set mWorkFlow = New WorkFlow(db_WF)
Set mDispense = New Dispense
Set mFlowLog = New FlowLog

filepath = Replace(session.CurrentDatabase.FilePath, "\", "/")
sURL = Lcase("/" + filepath)

Dim sAlert As String
sAlert = ""
Set doc = session.DocumentContext

If doc.UniversalID=doc.fld_CurrentDocUNID1(0) Then
doc.saveoptions="1"
Else
sAlert = "当前文档已被占用,请稍候重新打开此文件进行操作。"
Goto ResultMsg
End If

Call setreaddoc(doc) 
Dim CurAppDoc As New AppDoc(doc)

Dim TmpDoc As NotesDocument
Dim dc_WF As NotesDocumentCollection
Dim doc_WF As NotesDocument
Dim DB As NotesDatabase
Set DB = session.CurrentDatabase

If gotLock Then
releaseLock = Codeunlock(lockID)
deleteLock=Destroylock(lockID)
End If
ResultMsg:
Print |<script>|
If sAlert <> "" Then
Print |alert("| + sAlert + |");|
End If
CurStepSendType = doc.fld_CurStepSendType(0)
usernameV = Evaluate("@name([ABBREVIATE];@username)",doc)

  If CurStepSendType="11" Or CurStepSendType="8" Or CurStepSendType="6" Or CurStepSendType="23"Or CurStepSendType="25" Then
Print |parent.location.href = "|+ sURL +|";|
Else
Print |self.close()|

End If

Print |</script>|

Exit Sub
er:
Set mError=New FlowError
Call mError.TreatWithError("Sub ini,Agent AG_WkSave")
End Sub

分析解析,我实在是看不懂。谢谢!

------解决方案--------------------
Set mUtil = New Util
Set mOAfactory = New OAfactory

这两个类的 定义代码没给出来啊,
------解决方案--------------------
BS里面生成JAVASCRIPT来做什么跳转之类的?类库么给