http://oatest1.citicbank.com/sgsoa/testniexz.nsf/recorddispaly?OpenForm
20140716
1.如何取删除整个视图文档
if not vw_rep is nothing then
call vw_rep.refresh
call vw_rep.AllEntries.RemoveAll(true)
end if
3.判断文档中某个域的值是否包含某个文档
3.1
如:以下用于多值域中是否包含某个字段的方法
Set item =adoc.Getfirstitem("fld_SelOperateName")
If item.Contains("分发跟踪") Then
msgbox "11111111111"
end if
3.2用于判断文本域中是否包含某个字段
InStr(item.Text,"(报领导批示)]]>")>0
5.数组for循环的使用
5.1使用for --to-------
Dim UserPosNoArr As Variant
UserPosNoArr=Split(UserPosNoStr,"↑") For loopfjq=0 To Ubound(UserPosNoArr)
If UserPosNoArr(loopfjq)<>"" Then
UserPosNoStr=UserPosNoStr+"↑"+UserPosNoArr(loopfjq)
End If
Next
5.2使用forall in
Dim DeptListNo As Variant
ForAll x In DeptListNo '部门文书所在的部门ID
--------------
End ForAll
6.如何执行其他数据库上代理
Dim dbAutoFinish As NotesDatabase
Dim agAutoFinish As NotesAgent
Set dbAutoFinish = s.Getdatabase(CurDB.Server,"public/tcwautofinish.nsf")
Set agAutoFinish = dbAutoFinish.Getagent("ag_autofinishdoc")
Call agAutoFinish.Runonserver()
7.ftsearch的用法
7.1
FTSearch(query:string, max:int, sortopt:int, otheropt:int)
说明:
sortopt Integer. Use one of the following constants to specify a sorting option:
8 (default) sorts by relevance score. When the collection is sorted by relevance, the highest relevance appears first. To access the relevance score of each document in the collection, use the FTSearchScore property in NotesDocument.
1542 sorts by document creation date in descending order.
1543 sorts by document creation date in ascending order.
32 sorts by document date in descending order.
64 sorts by document date in ascending order.
otheropt Integer. Use the following constants to specify additional search options. To specify more than one option, use a logical or operation.
16384 specifies a fuzzy search.
512 uses stem words as the basis of the search.
实例:
if (database.isFTIndexed()) {
database.updateFTIndex(false)
} else {
database.createFTIndex(0, true)
}
var list = "";
var dc = database.FTSearch("new");
var doc = dc.getFirstDocument();
while (doc != null) {
list = list + doc.getItemValueString("Subject") + "\n";
doc = dc.getNextDocument();
}
return list
set createDB = session.getdatabase("oazh05bj","ntf/public/tcwautofinish.nsf")
if not createDB.isopen then
set tempDB= session.getdatabase("oazh05bj","ntf/public/tcwautofinish.ntf")
set createDB= tempDB.createfromtemplate("oazh05bj","ntf/public/tcwautofinish.nsf",true)
end if
将原来的ACL添加"[]",如“-default-”修改为"[-default-]"
9.如何获取并添加数据库的acl操作
set acl=db.ACL
set entry= acl.getfirstentry
while not entry is nothing
if entry.name="文档管理员" then
entry.name="$_分行管理员" '修改ACL名称
entry.level=ACLLEVEL_DESIGNER '修改设计权限---ACLLEVEL_MANAGER
entry.UserType=ACLTYPE_PERSON_GROUP '修改用户类型
entry.enableroles
entry.remove '删除ACL
end if
wend
acl.save
acllevel:
ACLLEVEL_AUTHOR (3)
ACLLEVEL_DEPOSITOR (1)
ACLLEVEL_DESIGNER (5)
ACLLEVEL_EDITOR (4)
ACLLEVEL_MANAGER (6)
ACLLEVEL_NOACCESS (0)
ACLLEVEL_READER (2)
acltype:
ACLTYPE_UNSPECIFIED (0)
ACLTYPE_PERSON (1)
ACLTYPE_SERVER (2)
ACLTYPE_MIXED_GROUP (3)
ACLTYPE_PERSON_GROUP (4)
ACLTYPE_SERVER_GROUP (5)
11.notesviewentry方法
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim entry As NotesViewEntry
Dim nav As NotesViewNavigator
Set db = session.CurrentDatabase
Set view = db.GetView("By Category")
view.AutoUpdate = False
Set nav = view.CreateViewNav
Set entry = nav.GetNth(2)
Messagebox entry.NoteID
@Subset的用法----:
@Subset("New Orleans":"London":"Frankfurt":"Tokyo";2)---This example returns New Orleans;London.
@Subset("New Orleans":"London":"Frankfurt":"Tokyo";-3)---London;Frankfurt;Tokyo.
@ReplaceSubstring的用法-----
@ReplaceSubstring( "I like apples" ; "like" ; "hate" )--This example returns "I hate apples".
@ReplaceSubstring( "I like apples" ; "like" : "apples" ; "hate" : "peaches")
--This example returns "I hate peaches".
@Username:CN=admin/O=CITICB
视图中从多个表单中取到文档:
SELECT @Contains(form;"frm_Org_")
13.用js获取当前时间
function GetCurTime(){
var time = new Date()
var hours = time.getHours()
if (hours <=9) { hours="0"+hours }
var minutes = time.getMinutes()
if (minutes <=9) { minutes="0"+minutes }
var seconds = time.getSeconds()
if (seconds <=9) { seconds="0"+seconds }
var year=time.getYear()
var month=time.getMonth()+1
var day=time.getDate()
var Timestr=year+"年"+month+"月"+day+"日"+" "+hours+":"+minutes+":"+seconds
//GetCurTime=year+"年"+month+"月"+day+"日"+" "+hours+":"+minutes+":"+seconds
return Timestr
}
18. notesname及common方法
Dim simplecurStepname As NotesName '当前环节处理人中文名
Set simplecurStepname=session.Createname(curPerformer)
'当前环节处理人中文名 curPerformer为 CN=蔡志诚/OU=汽车金融中心/OU=总行/O=CITICIB
msgbox simplecurStepname.Common '当前环节处理人简称
19.NotesDOMNode
20. session.getEffectiveUserName() -This is the name of the user logged into the server session running the script.
creator = session.EffectiveUserName
21.@name([CANONICALIZE];"|+UserName+|")|)的用法
Public Sub initCurUser(UserName As String , DeptID As String)
On Error Goto er
temp=Evaluate(|@name([CANONICALIZE];"|+UserName+|")|)
Me.sUserName = temp(0)
Me.sDeptID = DeptID
Exit Sub
er:
Call mError.TreatWithError("sub initCurUser,class Appdoc")
End Sub
'******************************************************************************
' 名称 runAutoAgent(sAgentName)
' 参数定义 sAgentName-要运行的代理名称
' 作者 wq
' 创建时间 2005-8-22
' 版本号 1.0
' 定义说明 按sAgentName名称,运行特定的代理
'*******************************************************************************
Public Sub runAutoAgent(sAgentName As String)
On Error Goto er
Dim agent As NotesAgent
'Set db = s.CurrentDatabase
Set agent = mAppDB.GetAgent(sAgentName)
If agent.Run(mAppDoc.NoteID) <> 0 Then
Call mError.TreatWithError("sub runAutoAgent agent is run false,class Appdoc")
End If
Exit Sub
er:
Call mError.TreatWithError("sub runAutoAgent,class Appdoc")
End Sub
1.增加select的一个option.答案:
var obj = document.createElement("option");
obj.text = "测试";
obj.value = "01"
document.forms[0].select.add(obj);
2.表单subject域值判断后台是否存在同subject文档,如有,提示,但是前台数据不能丢失,写出JS及LS.答案:
JS:
var ajax = new ActiveXObject("Msxml2.XMLHTTP");
ajax.open("POST", "代理名称?OpenAgent", True);
ajax.send(subject域值);
ajax.onreadystatechange = function(){
if(ajax.readyState == 4){
var value = ajax.responseText;
if(value == "Y"){
alert("已经存在!");
}else{
//提交文档保存
}
}
}
fld_routerelatekey
LS:
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim doc As NotesDocument
Set doc = session.DocumentContext
Dim subject As String
subject = doc.Request_Content(0)
Dim dc As NotesDocumentCollection
Set dc = db.Search("subject='" + subject + "'")
Print "Content-Type:text/xml"
If dc.Count > 0 Then
Print "Y"
Else
Print "N"
End If
NewDoc.form = "frm_DocRouteInfo"
Dim newValues( 1 To 6) As String
newValues( 1 ) = "CN=孙航/OU=信息技术部/OU=总行/O=CITICIB"
newValues( 2 ) = "OAZH05BJ/Servers/CITICIB"
newValues( 3 ) = "LocalDomainServers"
newValues( 4 ) = "$$系统管理员"
newValues( 5 ) = "#CITIC_NSC"
newValues( 6 ) = "OAZH06BJ/Servers/CITICIB"
Dim item_edit As New NotesItem(newdoc, "fld_docAuthors", _
newValues, AUTHORS)
This script creates a new text item in a document and gives it multiple values. The values in the text list are Bicycle, Train, and Foot.
Dim doc As NotesDocument
Dim textListItem As NotesItem
Dim newValues( 0 To 2 ) As String
'...set value of doc...
newValues( 0 ) = "Bicycle"
newValues( 1 ) = "Train"
newValues( 2 ) = "Foot"
Set textListItem = New NotesItem _
( doc, "Choices", newValues )
Call doc.Save( True, True )
1.如何取到当前浏览器的路径
var urlold=window.location.pathname.toString()
var strurl= urlold.substring(0,urlold.indexOf(".nsf"))+".nsf/getsearchfield?openagent";
if (restext=="2"){document.getElementById("displaysearch").innerHTML="没有该数据库 !";return false}
if (restext=="0"){document.getElementById("displaysearch").innerHTML="No database Select";return false;}
if (restext=="1"){document.getElementById("displaysearch").innerHTML="No search string";return false}
if (restext.indexOf("ErrorSystem")!=-1){document.getElementById("displaysearch").innerHTML=restext;return false}
get : function(url, callback, /* optional */async,/* Cache */cache) {
if (url.substring(0, 1) != "/" & url.substring(0, 5) != "http:"){
url = this.getLocalDbName() + "/" + url;
}
if (!cache)
url += (/\?/.test(url) ? "&" : "?") + "_=" + (new Date).getTime();
var xhr = this.xhr();
async = typeof(async) == "boolean" ? async : true;
xhr.open("GET", url, async);
xhr.send(null);
if (!async) {
if (this.isFunction(callback))
callback(xhr);
return;
}
var me = this;
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
if (me.isFunction(callback))
callback(xhr);
}
}
}
},
2.option下拉框中删除一个元素的方法。elSel.remove(i)
function removeOptionUnChecked(tarField){
//elSel = eval("window.parent.document.all(\"tmpSendTo\")");
elSel = (window.parent.document.forms[0].tmpSendTo);
for (var i = elSel.length-1; i >= 0; i--){
if(elSel.options[i].text.indexOf(tarField)!="-1"){
elSel.remove(i);
}
}
}
添加一个元素的方法
function AddItem(obj,text,value){
var varItem = new Option(text,value);
obj.options.add(varItem);
}
AddItem(oSelect,tmpvalue1,tmpvalue);
3.style中字体加粗
font-weight:bold
4.遍历视图中取首列为key的文档集合
Dim vc_Notify As NotesViewEntryCollection
Dim entry_Notify As NotesViewEntry
Set vc_Notify = OpView.GetAllEntriesByKey(unid)
Set entry_Notify = vc_Notify.GetFirstEntry() '取第一条文档
Set entry_Notify = vc_Notify.GetNextEntry(entry_Notify) '取下一条文档
5.向一个集合中添加文档
Dim docs As NotesDocumentCollection
Set docs = mUtil.initDocCollection(db)
Call docs.AddDocument(doc)
'----------------------------------------------
Public Function initDocCollection(db As NotesDatabase)
Dim doc As New NotesDocument(db)
Call doc.save(True,False)
Dim dc As NotesDocumentCollection
Set dc = doc.Responses
Set initDocCollection = dc
Call doc.Remove(True)
End Function
'------------------------------------------------------
6. NotesDocumentCollection
NotesViewEntryCollection
7. GetFormattedText方法
Set rtfitem=doc.GetFirstItem("fld_NoteAll") rtfstring =rtfitem.GetFormattedText( False, 0 )
8.代理中replace方法:"<","<";">",">"
strSource = Replace(strSource,"&","&")
9.死循环后,在控制台输入 res s 或者res ser重启服务器
10.使用代理创建excel文件
Dim excelApplication ,excelbook,excelsheet As Variant
Set excelApplication= CreateObject("Excel.Application")
Set excelbook=excelApplication.workbooks.add
Set excelsheet=excelbook.Worksheets.add
excelApplication.statusbar="正在创建,请稍等............."
excelApplication.Visible = True
excelsheet.name="test"
excelsheet.cells(1,1).value="fld_title"
excelsheet.cells(1,2).value="数量"
Dim i As Integer
i=1
While Not doc Is Nothing
i=i+1
excelsheet.cells(i,1)= doc.fld_title(0)
excelsheet.cells(i,2)= doc.fld_count(0)
Set doc = vwsAllView.Getnextdocument(doc)
Wend
Call excelsheet.UsedRange.Columns.AutoFit()
excelApplication.statusbar="创建完成"
11.使用js创建excel
var oXL = new ActiveXObject("Excel.Application");
oXL.Visible = true;
var oWB = oXL.Workbooks.Add();
var oSheet = oWB.ActiveSheet;
oSheet.Cells(1,1).value = "拟稿时间";
oSheet.Cells(1,2).value = "办结时间";
12.如何计算数据库大小和数据库文档数
db.Size
db.Alldocuments.Count
13.ajax方法总结
1.使用httprequest获取文档
function ajaxFunction()
{
var xmlhttp=null;
if(window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
}
else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4 )
{
var xmldoc=xmlhttp.responseXML
alert(xmldoc.xml)
}
}
url="http://oatest1.citicbank.com/sgsoa/org.xml"
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
2.使用load方法获取文档
var url="http://oatest1.citicbank.com/sgsoa/org.xml"
try{
var agrxml=XMLDOM()
if(agrxml!=null){
agrxml.async = false;
agrxml.onreadystatechange=function(){
if(agrxml.readyState==4){
alert(agrxml.selectSingleNode("//ID").text)
}
}
agrxml.load(url)
}
}catch(err){
}
function XMLDOM() {
var xmlDomVers = [
"Microsoft.XmlDom",
"MSXML2.DOMDocument",
"MSXML2.DOMDocument.3.0",
"MSXML2.DOMDocument.4.0",
"MSXML2.DOMDocument.5.0"
];
for (var i=xmlDomVers.length-1;i>=0;i--) {
try {
var xmlDom = new ActiveXObject(xmlDomVers[i]);
return xmlDom;
} catch(e) {continue;}
}
3.atoblen = "C:\Documents and Settings\citic\桌面\记录\ecworgbydeptid.xsl"
var natoblen = atoblen.split("\\")
var strfilenamesuffix = natoblen[natoblen.length-1];
strfilenamesuffix======为ecworgbydeptid.xsl
alert(natoblen.length)========为6
4.Arraygetindex 用于判断数组中是否存在某个元素
If arrReceiveDeptID(0)<>"" Then
index = Arraygetindex(arrReceiveDeptID,Cstr(v))
End If
If Isnull(index) Then
todept = todept + {}+Chr(10)
todept = todept + {} & doc_WF.fld_SelDeptList(i) & {}+Chr(10)
todept = todept + {} & Cstr(v) & {}+Chr(10)
todept = todept + {}+Chr(10)
End If
9.domino中调用代理有多种方式,请对各种方式进行简单描述?
9.1 执行其他数据库上代理
Dim dbAutoFinish As NotesDatabase
Dim agAutoFinish As NotesAgent
Set dbAutoFinish = s.Getdatabase(CurDB.Server,"public/tcwautofinish.nsf")
Set agAutoFinish = dbAutoFinish.Getagent("ag_autofinishdoc")
Call agAutoFinish.Runonserver()
9.2 使用公式运行代理@Command([ToolsRunMacro]; "CreateCPBH");
9.3从js中通过URL调用代理
9.4后台执行代理 tell amgr run "shujuku.nsf" 'agent'
10.linux/AIX系统与windows系统开发时,有什么不同
10.1 数据库路径 linux aix 下为“sgsoa/tcworg.nsf”,window 下为 “sgsoa\tcworg.nsf”
--只包含执行部分的PL/SQL块
--set serveroutput off
begin
dbms_output.put_line('Hello,everyone!');
end;
select * from emp;
--包含定义部分和执行部分的PL/SQL块
declare
v_ename varchar2(5);
begin
select
转:http://stackoverflow.com/questions/6352208/how-to-solve-plugin-execution-not-covered-by-lifecycle-configuration-for-sprin
maven报错:
Plugin execution not covered by lifecycle configuration:
要使用MonkeyRunner,就要学习使用Python,哎
先抄一段官方doc里的代码
作用是启动一个程序(应该是启动程序默认的Activity),然后按MENU键,并截屏
# Imports the monkeyrunner modules used by this program
from com.android.monkeyrunner import MonkeyRun