2014年domino学习小结



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


MsgBox dbview.Allentries.Count '返回视图中文档数目


2.如何取到复制冲突文档,可参考发文中“复制冲突”视图
2.1建立视图,条件为:SELECT @IsAvailable($conflict)


3.判断文档中某个域的值是否包含某个文档
3.1
如:以下用于多值域中是否包含某个字段的方法
Set item =adoc.Getfirstitem("fld_SelOperateName")
If item.Contains("分发跟踪") Then 
msgbox "11111111111"
end if
3.2用于判断文本域中是否包含某个字段
InStr(item.Text,"(报领导批示)]]>")>0


4---将firefly上数据库模板替换到测试服务器方法
前提条件:先取sharecode,上传到服务器后签名


将firefly上数据库模板替换到测试服务器方法:
4.1.同步本地firefly,确保本地的模板库和firefly上的一致
4.2.ftp将模板传到ntf文件夹下,替换原模板
4.3.签名:在administrator端签名
4.4.在服务器端load模板库 load design -f ntf/branch/tcwsendfile.ntf
4.5.在服务器端load数据库load design -f tianjinoa/tcwsendfile.nsf--公文监控库
load design -f public/tcworg.nsf
load design -f ntf/tcwmobileinterface.ntf
load design -f tcwmobileinterface.nsf、
load design -f foshanoa/kkss.nsf
load design -f sgsoa/tcwsmsmanage.nsf


load design -f ntf/branch/tcwreceivefile_sp.ntf




4.6
刷分行
load design -d sgsoa 
刷整体数据库
load design 


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


8.使用代理,根据模板创建数据库并且继承模板中的ACL
服务器:oazh05bj 模板路径:ntf/public/tcwautofinish.ntf 需创建的数据库路径:ntf/public/tcwautofinish.nsf


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) 






!(@IsMember(@UPPercase(@username);@UPPercase(fld_CurStepPerformers))|@IsMember(@UPPercase(@username);@UPPercase(fld_CurStepRestPerformers))|@IsMember("[公文管理员]";@UserRoles)|fld_FlowIsEnd="1")




10.msgbox 打印后台报错信息通用版


MsgBox |数据库| & curdb.FilePath & |中代理| & session.CurrentAgent.Name & |在第| & Erl & |行出现错误:"| & Error & |"|


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


12.公式及代理
@Dbname:显示服务器及数据库名称:
如:CN=oazh05bj/OU=serves/O=CITICB; sgsoa\testniexz.nsf
@Subset(@Dbname;1)显示服务器名称
如:CN=oazh05bj/OU=serves/O=CITICB;
@Subset(@Dbname;-1)显示数据库路径
以下表示返回:数据库路径
curDbPath=Evaluate(|@leftback(@LowerCase(@ReplaceSubstring(@Subset(@DbName;-1);"\\";"/"));"/")|)


@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
}


14.公式中替换字符串的值
laiwendanwei:=@ReplaceSubstring(tmpendstr;"﹨";"");


15.如何用公式获取路径所在目录,如获取sgsoa


dbtempPath:=@Subset(@DbName;-1);
tempFilePath:=@If(@Contains(dbtempPath;"\\");@LeftBack(dbtempPath;"\\");@Contains(dbtempPath;"/");@LeftBack(dbTempPath;"/");"");
tempFilePath1:=@ReplaceSubstring(tempFilePath;"\\";"/");


16.如何使用公式获取传过来的参数--请参考kkss.nsf-strvalue域,在表单上存在一个域Query_String_Decode
方法一:
ref:=Query_String_Decoded;
str:=@Right(ref;"&searchvalue=");


@Left(@Right(QUERY_STRING_DECODED;"&StepName=");"&")
str
方法二:
使用代理传过来的为,可参考sgsoa/tcwsupervisory.nsf--公文监控库
"http://"+dContext.Server_Name(0)+":"+dContext.Server_Port(0)+"/"+DbPath(0)"/tcwfilesupervisory.nsf"+"/frm_VirtualDoc?openform&username="+username+"&dbpath="+DbPath0+"&UNID="+docFound.UniversalID
新增域为:fld_FlowDocDBName,设置为
@UrlQueryString("dbpath")


17.CGI variable names
Query_String_Decoded




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




http:oatest1.citicbank.com:8080/tcwmobileinterface.nsf/SubmitDispension?wsdl

http://oatest1.citicbank.com/tcwmobileinterface.nsf/SubmitDispension?wsdl


22.window.confirm
function FullFinishDoc(){
var temp = window.confirm("此举将结束当前文档流程并退出,是否继续?");
if (temp) {
SubmitDoc("90")
}








liangwanghong
1.JavaScript怎样使一个div的内容发生变化.
答案:innerText
2.JavaScript怎样创建一个对象并给属性赋值.答案:符合以下方式即可,
var obj = {'id':1,'name':'liangwanghong'}
function obj(){this.id = 1;this.name = 'liangwanhong'}
function obj(){obj.prototype.id = 1;obj.prototype.name = 'liangwanhong';}


3.英文题,JSON数据格式
4.英文题,想最小开销的快速查询数据,怎么样建立索引
5.英文题,AB两台服务器,如果邮件发送不通,应该执行什么命令(route)


1.代理有几种调用方式
(1)按钮直接执行公式调用代理@Command([ToolsRunMacro];"CacExcleDown");
(2)按钮执行js,js调用某按钮的click,ajax调用、dom对象调用;
(3)表单submit触发webquerySave执行代理


2.jsheader,webQueryOpen执行顺序.
答案:WebQueryOpen,JsHeader, onload


3.查询某一文档几种方式,效率.
答案:db.search,效率最慢;db.ftsearch(); view.getDocumentByKey,效率适中,db.getDocumentByUNID,效率最快


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


9月
1.如何在代理中取时间
MsgBox "now======="&Now()
MsgBox "now======="&Format$(Now(),"HH:MM:SS")
2.NotesItem使用
可以使用noteitem创建域,并给域赋值,文本域,数字域,时间域,多值域
参数(文档doc,域名称,域值,域权限)
如下代码,位于网关库中 SendOneDept 方法
       '创建一个接收方的路由文件
Set NewDoc = RouteDoc.CopyToDatabase(CurDB)

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";


2.对话框列表中值
返回值用“|”隔开,“|”前面表示下拉框显示的值,后面显示的真正的值。值的形式为数组,可用“:”隔开表示。
如下表示下拉表中第一个值为空
strServer := @Subset(@DbName;1);
strPath := @LeftBack(@ReplaceSubstring(@Subset(@DbName;-1);"\\";"/");"/") + "/tcwworkflow.nsf";
tasks := @DbColumn("":"";strServer:strPath;"vws_TaskName";2);
tasksID := @DbColumn("":"";strServer:strPath;"vws_TaskName";1);
"":tasks + "|" +  "":tasksID
3.js中代码转码,使用escape
4.使用ajax 调用代理
eval("var myAjax = new Ajax.Request( urllast, { method: 'get', parameters: paramsnew,onComplete: BuildLinesArray})");
urllast:


5.使用产品代码调用ajax //请研究resttest返回值是什么
$ct.get(strurlnew,function(xhr){
restext = xhr.responseText;
},false);


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);
}
}
}
},

14.js中调用代理汇总
使用Ajax
try{
argumentxml = new ActiveXObject("MSXML.DOMDocument");
if(argumentxml != null){
argumentxml.async = false;
if(argumentxml.load(url)) {
//alert(argumentxml.xml);
return argumentxml.selectSingleNode("//result").text
}
}

}catch(err) {}

14.2使用产品的
var argumentxml = $ct.loadXML(url);
alert(argumentxml.xml)

15.可参考短信发送数据库
鼠标放在按钮上,变成手状的代码:style="cursor:pointer"

点击某个按钮打开一个窗口
var url = filepath+"/tcworg.nsf/frmw_showusergroup?open&field="+strfieldname+"&fvalue="+strfieldValue;
    if($ct.getNavi()=="MSIE"){
    var heightconst=650;
var widthconst=850;
var leftconst=(screen.availWidth-widthconst)/2;
var topconst=(screen.availHeight-heightconst)/2;
wZoom="dialogLeft:"+leftconst+"px;dialogTop:"+topconst+"px;dialogHeight:"+heightconst+"px;dialogWidth:"+widthconst+"px; center: no; help: no; status:no";
//s1 = showModalDialog(url,document,'dialogWidth:850px,dialogHeight:600px,scroll:no');
s1 = showModalDialog(url,document,wZoom);
//s1 = showModalDialog(url,document,'dialogWidth:600px,dialogheight:400px');
}else{
$ct.showModalOther(url,document,650,580,"","0","选择人员");
}


16.使用代理判断某个文档是不是新文档
If CurDoc.IsNewNote Then
Else
End If


17.关注文档代码学习
请看行发文关注文档功能中页面跳转
function Gzwd(){
UNID = document.forms[0].fld_CurrentDocUNID.value;
DeptID = document.all("fld_CurUserDeptID").value;
StepID = document.all("fld_CurStepID").value;
UserName = document.all("fld_CurUserName").value;
location.href = "/<计算的值>/AG_GzDoc?openAgent&UNID="+UNID+"&StepID="+StepID+"&DeptID="+DeptID+"&UserName="+UserName;
}
AG_GzDoc中:
Print ||
代理中去空格取唯一Arrayunique及FullTrim方法
MainDoc.fld_GzwdReaders = FullTrim(ArrayUnique(MainDoc.fld_GzwdReaders))
加锁:
lockID = CreateLock(SharesResources)
gotLock = CodeLock(lockID)
解锁---begin
If gotLock Then
releaseLock = CodeUnlock(lockID)
deleteLock=DestroyLock(lockID)
End If
解锁---end
19.组织机构人员排序中有关于xml转化的代码,
“此处为代理生成的一个xml文件”
//格式转换

20.旧文档显示按钮,新文档不显示按钮。使用按钮中的隐藏条件
@IsNewDoc




10月
1.xml加载代码---可参考configuration.nsf库下frm_jd表单
var url = pathname1+"/AG_JDJudge?openAgent"+searchstring


try{
argumentxml = new ActiveXObject("MSXML.DOMDocument");
if(argumentxml != null){
argumentxml.async = false;
if(argumentxml.load(url)) {
return argumentxml.selectSingleNode("//result").text
}
}
}catch(err) {}

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;}

}
}
1.xpath 中 xmldoc为xml文件
下面的例子会选取所有价格高于 35 的 price 节点:
xmlDoc.selectNodes("/bookstore/book[price>35]/price")
2.ArrayGetIndex("")




11月
1.代理中ArrayUnique 方法用于数组去重
2.this.style.height=this.scrollHeight +'px'
tell amgr run "tcwinitagent.nsf" 'bank_searchlink'
3.域值的类型notesitem.type,以下表示为富文本格式
rtitem_atta.Type = RICHTEXT
4.Mid$(start,end) start=0 表示从第一个字符开始
5.规范时间
Format$(docCur.fld_enddate(0),"yyyy-mm-dd")
6.文件上载控件-在创建-》嵌入元素-》文件上载控制
7.str = "abcd1234.doc"
len(str) = 12
instr(str,".") = 9
right$(str,3)= "doc"
8. HTTP 任务重新启动
Tell HTTP Restart
重启服务器
res s
9.char(10) 表示空格


12月
1.通过代理向服务器发送命令
Dim strCommand As String
strcommand = "push OAZH05BJ sgsoa\tcwpersonalwork.nsf"
Call session.SendConsoleCommand(session.CurrentDatabase.Server,strCommand)
2.检查附件本地附件大小功能。请参考publictooljs
checkFileSize:function(filename){
    filesizeKb = 12;//先暂时写死为12M
try{
if(document.all){
var fso = new ActiveXObject("Scripting.FileSystemObject");
if(!fso.FileExists(filename)){
alert("上传文件不存在,请重新输入!");
return false;
}
var file = fso.getfile(filename);
var fileSize = file.size ; //单位:b
var cfileSizeKb = fileSize/1024; //转为kb
if(parseFloat(cfileSizeKb) > parseFloat(filesizeKb*1024)){
alert("当前文件的大小为" + (parseFloat(cfileSizeKb)/1024).toFixed(1) + "M,最大上传文件不能超过" + filesizeKb + "M");
window.location.reload();
}
}
}catch(err){
if(err.description == "Automation 服务器不能创建对象"){
alert("文件大小检验未生效! \r\n 请如下修改浏览器设置:工具->Internet选项->安全->Internet/本地Internet->自定义级别->ActiveX控件和插件->对没有标记为安全的ActiveX控件进行初始化和脚本运行->启动!");
}
window.location.reload();
}
}
if($ct.isIE()){
//调用公用方式检查附件大小
if(atoblen!=""){
$ct.checkFileSize(atoblen);
}
}else{
if(atoblen!=""){
filesize=document.forms[0].atob.files[0].size;
var cfileSizeKb = filesize/1024; //转为kb
if(parseFloat(cfileSizeKb) > parseFloat(12*1024)){ //不能超过12M
alert("当前文件的大小为" + (parseFloat(cfileSizeKb)/1024).toFixed(1) + "M,最大上传文件不能超过12M");
window.location.reload();
return false
}
}


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


5.使用公式,取到视图中某列中某条文档的某个值
server:=@Subset(@DbName;1);
dbname:=@LeftBack(@ReplaceSubstring(@Subset(@DbName;-1);"\\";"/");"/")+"/tcwworkflow.nsf";
tmp:=@DbLookup("":"NoCache";server:dbname;"vws_TaskName";fld_TaskID;"fld_FieldNameByMark");
tmp


7.解释http中,get和post有什么区别?
HTTP请求:get与post方法的区别
             相同点;
l          Get与post(对于“post”除非相应里有cache-control或者expires头域指示其相应不可缓存)请求的相应是可缓存的;
          不同点:
1.         Get是从服务器上获取数据,post是向服务器传送数据
2.         Get是把参数数据队列加到提交表单的action属性所指定的URL中,值和表单中各个字段一一对应,在URL中可以看到,post是通过HTTP post机制,将表单内各个字段与其内容放置在html header内一起传送到action属性所指的URL地址,用户看不到这个过程;
3.         get传送的数据量较小,不能大于2kb;post传送的数据量较大,一般被默认为不受限制的。但理论上,IIS4中最大量为80kb,IIs5中为100kb;
4.         get安全性非常低;post安全性较高;
5.         get适用于多请求,而保留post仅用于更新站点;
6.         在form提交的时候,如果不指定method,则默认为get请求,form中提交的数据将会附加在url之后,以?与URL分开。字母数字字符原样发送,但空格转换为“+”号,其它符号转换为%xx,其中xx为该符号为16进制表示的ASCII(或ISO Latin-1)值;
7.         get请求提交的数据放置在HTTP请求协议头中,而post提交的数据则放在实体数据数据中;
GET 请求
  //JS
  var xhr = XHR();
  xhr.open("get","test.php?qs=true&userName=abc&pwd=123456",true);
  xhr.onreadystatechange = function () {
  if (xhr.readyState==4 && xhr.status ==200) {
  alert(xhr.responseText);
  }
  };
  xhr.send(null);
  //PHP
  print_r($_GET);
POST 请求
  //JS
  var xhr = XHR();
  xhr.open("post","test.php",true);
  xhr.onreadystatechange = function () {
  if (xhr.readyState==4 && xhr.status ==200) {
  alert(xhr.responseText);
  }
  };
  //比GET请求多了一步
  xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  //另外,数据是通过send方法发送的
  xhr.send("qs=true&userName=abc&pwd=123456");
  //PHP


8.解释css中,padding 和magin 有什么区别?
margin:层的边框以外留的空白
padding:层的边框到层的内容之间的空白


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”


11.想要通过特定条件在数据库中查找文档(如某个字段等于、包含特定的值),使用lotuscript有哪些方法,各有什么优缺点?
db.FTSearch :使用了数据库索引,此外,根据服务器的Notes.ini 设置,对返回的文件集合的大小施加了限制
db.Search:它不需要全文索引和预先创建的视图,因此它是一种非常方便的查询方法
view.GetAllDocumentsByKey:为检索文件集合最快的方式。唯一的缺点是需要建立相关的视图
view.GetDocumentByKey




12.编程题
实现以下代码:文档以subject字段为关键字,提交时做唯一性检测(如检测已有同关键字文档,给出提示但填写信息不能丢失),文档对应视图为vwDocbySubmit,检测包括前台javascript和后台lotuscript
答案:
url="oa1/Testagent?opentagent&subject="+subject
try{
agrxml=XMLDOM(); //"MSXML2.DOMDocument"
if(agrxml!=null){
 agrxml.async = true;
 if(agrxml.load(url)){
 alert(agrxml.xml)
 alert(agrxml.selectSingleNode("//ID").text)
 }
  } 
}catch(e){}




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;}
   
  }
 }


Print {Content-Type: text/xml}
 Print {}




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);
 }

















你可能感兴趣的:(domino,lotus,domino,notes)