2010年4月9日
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Master_Table_of_Contents_for_Building_Domino_Web_Applications_using_Domino_8.5.1
http://blog.csdn.net/samboy2002/archive/2006/04/03/648785.aspx
Teamstudio CIAO! Client Edition 2.50
Serial No. AP-24607 License Key PMSGQ-N4LXB-RTFKVT
Maintenance Expires 2009/08/31 Number Licenses 1
Teamstudio CIAO! Server Edition 2.40
Serial No. AP-24608 License Key XMSGA-BIAIV-SCI2RX
Maintenance Expires 2009/08/31 Number Licenses 1
如何部署Java Web应用程序到Tomcat中?
第一步配置tomcat
安装Tomcat后,在我的电脑->属性->高级->环境变量->系统变量中添加以下环境变量(假定你的tomcat安装在c:\tomcat):
CATALINA_HOME=c:\tomcat
CATALINA_BASE=c:\tomcat
然后修改环境变量中的classpath,把tomat安装目录下的common\lib下的(可以根据实际追加)servlet.jar追加到classpath中去,修改后的classpath如下:
classpath=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\common\lib\servlet.jar;
接着可以启动tomcat,在IE中访问http://localhost:8080,如果看到tomcat的欢迎页面的话说明安装成功了。
第二步:部署Servlet:
建立 Servlet
1.用你最熟悉的编辑器(建议使用有语法检查的java ide)新建一个servlet程序,文件名为Test.java,文件内容如下:
package test;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Test extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out=response.getWriter();
out.println("<html><body><h1>This is a servlet test.</h1></body></html>");
out.flush();
}
}
2 .编译
将Test.java放在c:\test下,使用如下命令编译:
C:\Test>javac Test.java
然后在c:\Test下会产生一个编译后的servlet文件:Test.class
3 .将结构test\Test.class剪切到%CATALINA_HOME%\webapps\myapp\WEB-INF\classes下,也就是剪切那个test目录到classes目录下,如果classes目录不存在,就新建一个。 现在webapps\myapp\WEB-INF\classes下有test\Test.class的文件目录结构
4 .修改webapps\myapp\WEB-INF\web.xml,添加servlet和servlet-mapping
编辑后的web.xml如下所示,红色为添加的内容:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>My Web Application</display-name>
<description>
A application for test.
</description>
<servlet>
<servlet-name>Test</servlet-name>
<display-name>Test</display-name>
<description>A test Servlet</description>
<servlet-class>test.Test</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Test</servlet-name>
<url-pattern>/Test</url-pattern>
</servlet-mapping>
</web-app>
这段话中的servlet这一段声明了你要调用的Servlet,而servlet-mapping则是将声明的servlet"映射"到地址/Test上
5 .好了,重启动Tomcat,启动浏览器,输入http://localhost:8080/myapp/Test 如果看到输出This is a servlet test.就说明编写的servlet成功了。
注意:修改了web.xml以及新加了class,都要重启Tomcat
参考:
http://blog.csdn.net/NetMicrobe/archive/2006/04/14/663031.aspx
http://read.newbooks.com.cn/info/196577.html
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/domino85-use-dojo-libraries.htm
http://ideajam.net/IdeaJam/P/ij.nsf/0/7E146908362FE350862576D500522C65?OpenDocument#
http://www.training-classes.com/programs/03/16/31617_domino_designer_8-5_browser_applications_and_dojo.php
https://www.ibm.com/developerworks/cn/web/wa-dojotoolkit/
http://www.ibm.com/developerworks/lotus/library/notes7-application-performance2/index.html?S_TACT=105AGX13&S_CMP=EDU
#!perl
use Win32::ODBC;
$Data = new Win32::ODBC("DSN=dhcp;UID=netman;PWD=netman;");
$Data2 = new Win32::ODBC("DSN=dhcp;UID=netman;PWD=netman;");
$Data1 = new Win32::ODBC("DSN=dhcp;UID=netman;PWD=netman;");
$Data3 = new Win32::ODBC("DSN=dhcp;UID=netman;PWD=netman;");
$Data->Sql("select ip,mac,host from dhcplist");
while ($Data->FetchRow())
{
($ip,$mac,$host) = $Data->Data;
print $host,"\n";
$Data1->Sql("select * from Employee ");
while ($Data1->FetchRow())
{
($cname,$dept,$dno,$id,$ext) = $Data1->Data;
print "$cname","\n";
print "$id","\n";
}
$Data1->Close();
$flag = '';
$Data2->Sql("select * from dhcp_data where host = '$host' and ip = '$ip' ");
#print "select * from dhcp_data where host = '$host' and ip = '$ip'" ;
while ($Data2->FetchRow())
{
#@flag = $Data2->Data;
if ( $flag ne "" )
{
print "ok";
$Data3->sql("update dhcp_data set ip = '$ip',host = '$host',mac ='$mac',cname = '$cname',dept = '$dept',dno = $dno',notesid = '$id',ext = '$ext',modifydate = getdate()");
$Data3->Close();
}
else
{
print "ok2";
$Data3->sql("insert into dhcp_data(ip,host,mac,cname,dept,dno,notesid,ext,modifydate) values('$ip','$host','$mac','$cname','$dept','$dno','$id','$ext',getdate())");
$Data3->Close();
}
}
$Data2->Close();
}
$Data->Close();
那怎么用LS创建TXT文件 Superhewei(360700686) 11:03:43 Dim fileNum As Integer, empNumber As Integer, n As Integer Dim fileName As String, empName As String fileNum% = Freefile() fileName$ = "H:\zcjn"+Format(Now,"yyyy-mm-dd")+".trs" ' fileName$ = "c:\zcjn"+Format(Now,"yyyy-mm-dd")+".trs" Open fileName$ For Output As fileNum%
Sub Initialize Dim session As New NotesSession Dim doc As NotesDocument '当前文档的后台文档 Dim tobeSearchDb As NotesDatabase '待搜索的数据库 Dim DstDocs As NotesDocumentCollection '搜索结果集 Dim RstDoc As NotesDocument '查询到的文档 Dim sRstView As NotesView '结果显示视图 Set Db=Session.CurrentDatabase Set doc=session.DocumentContext Dim con As ODBCConnection Dim userName As String Dim password As String Dim qry As ODBCQuery Dim result As ODBCResultSet Dim A As String Set con = New ODBCConnection Set qry = New ODBCQuery Set result = New ODBCResultSet Set qry.Connection = con Set result.Query = qry A=con.ConnectTo("CoprYW","sa","123") qry.SQL = " INSERT INTO mt(phone,msg_content,sm_flag) VALUES ('"+doc.SMSendTo(0)+"','"+doc.SMBody(0)+"','1'); " 'Call JSAction("Alert",Cstr(a)) If Not result.Execute Then 'Messagebox _ 'result.GetExtendedErrorMessage,, result.GetErrorMessage 'Exit Sub End If result.Close(DB_CLOSE) con.Disconnect End Sub
Sub SearchWeb()
Dim QryDB As NotesDatabase
Dim vwDBList As NotesView
Dim sQueryString As String
Dim sMinRecord,sMaxRecord,sSortMethod,sTemp,sQry,sOldQry,sSymbol As String
Dim sSearchFuzzy As String
Dim sUseCache As String
Dim sServername As String
Dim sDbName As String
Dim sViewName As String
Dim sPage As String
Dim sCondition As String
Dim sDBDocID As String
Dim sFields As String
Dim vResult() As Variant
Dim vTemp,vDBDocList As Variant
Dim i,j,iRecordNumber As Integer
Set session = New NotesSession
Set db = session.currentdatabase
Set doc = session.documentcontext
sQry = doc.Query_String_Decoded(0)
sOldQry = sQry
'-------------------------------- 获取查询参数 --------------------------------------
vTemp = Evaluate("@ReplaceSubstring('"+sQry+"';'+';' ')")
sTemp = vTemp(0)
sQry = sTemp
i = Instr(sTemp,"^")
sCondition = Mid(sTemp,i+1) '查询条件
sDBDocID = Left(sTemp,i-1)
i = Instr(sDBDocID,"&")
sDBDocID = Mid(sDBDocID,i+1)'查询视图参数
'sSortMethod = Mid(sCondition,Instr(sCondition,"~")+1,1)'排序方式
sSearchFuzzy = Mid(sCondition,Instr(sCondition,"!")+1,1)'是否使用模糊查询
sUseCache = Mid(sCondition,Instr(sCondition,"$")+1,1)'是否使用Cache
i = Instr(sCondition,"@")
j = Instr(i+1,sCondition,"@")
sMinRecord=Val(Mid(sCondition,i+1,j-i-1))'查询记录起始数
sMaxRecord=Val(Mid(sCondition,j+1))'查询记录每页最大结果数
sCondition = Mid(sCondition,1,i-1)'取得查询关键字
vDBDocList = Extract(sDBDocID,",") '获取查询视图参数的数组
Call ExtractArray(sCondition) '获取查询关键字列表
iRecordNumber = 0
sPage = ""
sSymbol = ""
If sSearchFuzzy = "1" Then
sSymbol = "*"
End If
'------------------------------------------------------------------------------------
'---------------------------------- 开始查询 ----------------------------------------
Forall x In vDBDocList
vTemp = Extract(Cstr(x),"!")'拆分查询参数(所在服务器!所在数据库!查询视图)
sServerName=vTemp(0)'查询数据库所在服务器
sDbName=vTemp(1)'查询数据库
sViewName = vTemp(2)'查询的视图名
Set QryDB = New NotesDatabase(sServerName,sDbName)'取得查询数据库对象
Set view = QryDB.getview(sViewName)'取得查询数据库视图
sQry=""
sQueryString = ""
Forall y In sQryKey
sQry = Replace(y,"""","''")
sTemp = ""
'当指定域查询时
If doc.Fields(0) <> "" Then
Forall z In doc.Fields
If sTemp = "" Then
sTemp = "FIELD "+z+{ contains "}+sSymbol+sQry+sSymbol+{"}
Else
sTemp = sTemp + " AND FIELD "+z+{ contains "}+sSymbol+sQry+sSymbol+{"}
End If
End Forall
If sQueryString = "" Then
sQueryString = "(" + sTemp +")"
Else
sQueryString = sQueryString + " OR (" + sTemp +")"
End If
Else'未指定域
If sQueryString = "" Then
sQueryString = sQry
Else
sQueryString = sQueryString + " AND " + sQry
End If
End If
End Forall
j = view.FTSearch( sQueryString, Cint(sMaxRecord))'开始查询
'将结果形成XML数据
If j>0 Then
For i = 1 To j
iRecordNumber = iRecordNumber + 1
Set qrydoc = view.getnthdocument(i)
sPage = sPage + {<row url="javascript:opendoc('/}+QryDB.Replicaid+{/0/}+qrydoc.Universalid+{?opendocument')">}
sPage = sPage + {<number>}+Cstr(iRecordNumber)+{</number>}
sPage = sPage + {<title>}+qrydoc.ColumnValues(0)+{</title>}
sPage = sPage + {<category>}+doc.Name(0)+{</category>}
sPage = sPage + {<score>}+Cstr(qrydoc.FTSearchScore)+{%</score>}
sPage = sPage + {</row>}
Next
End If
Call view.clear
End Forall
'------------------------------------------------------------------------------------
'---------------------------------- 输出结果 ----------------------------------------
Print {Content-type: text/xml}
Print {<?xml version='1.0' encoding="utf-8" ?>}
Print {<view name="查询结果" id="vgosearchresult.xml">}
Print {<header>}
Print { <number>序号</number>}
Print { <title>标题</title>}
Print { <category>位置</category>}
Print { <score>匹配度</score>}
Print {</header>}
Print {<action/>}
Print {<rows>}
Print sPage
Print {</rows>}
Print {</view>}
'------------------------------------------------------------------------------------
End Sub
import java.io.*;
import java.net.URL;
import java.sql.*;
import java.util.Properties;
import lotus.notes.*;
import java.util.*;
public class savetonewdatabase extends AgentBase {
public void NotesMain() {
Driver drv = null;
PrintWriter out = null;
try {
Session session = getSession();
AgentContext ac = session.getAgentContext();
Database db = ac.getCurrentDatabase();
Database SendDB = session.getDatabase(db.getServer(),"lt_getfile.nsf");
Document doc = ac.getDocumentContext();
out = getAgentOutput();
String docUnid;
//Get the new record's unid
docUnid = uniqueID();
//Get the sql insert statement
StringBuffer SqlUrl = new StringBuffer("Insert into Shouwen_stat (");
StringBuffer SqlValue = new StringBuffer(" values (");
String temp= doc.getItemValueString("F_hao");
if(temp!=null){
temp = doc.getItemValueString("F_ziTitle")+"〔"+doc.getItemValueString("F_zi")+"〕"+doc.getItemValueString("F_hao")+"号";
}else{
temp = "〔"+doc.getItemValueString("F_zi")+"〕";
}
if (temp!= null){
SqlUrl.append("doc_no");
SqlValue.append("'" + temp+"'");
}
String doc_id = doc.getItemValueString("CurDocId");
if (doc_id != null) {
SqlUrl.append(",doc_id");
SqlValue.append(",'" + doc_id + "'");
}
String sqlField = doc.getItemValueString("F_title");
if (sqlField != null) {
SqlUrl.append(",doc_title");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("shenghr");
if (sqlField != null) {
SqlUrl.append(",niban_people");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("F_BigSpecies");
if (sqlField != null) {
SqlUrl.append(",wen_zhong");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("text");
if (sqlField != null) {
SqlUrl.append(",file_content");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("timewrite"); //收文日期
if (sqlField != null) {
SqlUrl.append(",shouwen_date");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("F_FilekeyWord");
if (sqlField != null) {
SqlUrl.append(",title_word");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("F_emergency");
if (sqlField != null) {
SqlUrl.append(",huan_ji");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("F_UnitName");
if (sqlField != null) {
SqlUrl.append(",laiwen_unit");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("F_Secret");
if (sqlField != null) {
SqlUrl.append(",mi_ji");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("laiwfs");
if (sqlField != null) {
SqlUrl.append(",laiwen_mode");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("shengpyj");
if (sqlField != null) {
SqlUrl.append(",niban_date");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("shenghyj");
if (sqlField != null) {
SqlUrl.append(",niban_yijian");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("F_EndTime");
if (sqlField != null) {
SqlUrl.append(",banli_qixian");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("lind");
if (sqlField != null) {
SqlUrl.append(",chengban_yj");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("pisyj");
if (sqlField != null) {
SqlUrl.append(",piban_date");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("lindps");
if (sqlField != null) {
SqlUrl.append(",piban_yijian");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("banlyj");
if (sqlField != null) {
SqlUrl.append(",banli_jieguo");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("banlr");
if (sqlField != null) {
SqlUrl.append(",banli_people");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("banlsj");
if (sqlField != null) {
SqlUrl.append(",banli_date");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("chengbyj");
if (sqlField != null) {
SqlUrl.append(",piban_people");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("chengbr");
if (sqlField != null) {
SqlUrl.append(",chengban_people");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("chengbsj");
if (sqlField != null) {
SqlUrl.append(",chengban_date");
SqlValue.append(",'" + sqlField + "'");
}
sqlField = doc.getItemValueString("temp"); //流水号
if (sqlField != null) {
SqlUrl.append(",shouwen_bianhao");
SqlValue.append(",'" + sqlField + "'");
}
sqlField=doc.getItemValueString("shihgd"); //文件是否归档
if(sqlField!=null){
SqlUrl.append(",document_state");
SqlValue.append(",'"+sqlField+"'");
}
sqlField=doc.getItemValueString("wenjzx"); //文件走向
if(sqlField!=null){
SqlUrl.append(",send_file");
SqlValue.append(",'"+sqlField+"'");
}
SqlUrl.append(")");
SqlValue.append(")");
String Va = SqlValue.toString();
SqlUrl.append(Va);
// Connect to data source
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
drv = new sun.jdbc.odbc.JdbcOdbcDriver();
String url = "jdbc:odbc:is_archive";
Properties props = new Properties();
props.put("user","isa");
props.put("password","gxmi");
Connection con = drv.connect(url,props);
if (con==null){
out.println("<h1>Con't Connect to DB!</h1>");
return;
}
Statement stmt = con.createStatement();
//Insert a record to the Fwdj table
Va = SqlUrl.toString();
Va =new String(Va.getBytes("gb2312"),"ISO-8859-1");
stmt.executeUpdate(Va);
out.println("<link rel='stylesheet' href='/oa.css'><br><br><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>");
out.println("<TR VALIGN=top><TD WIDTH=232><IMG SRC='/Lt_getfile.nsf/c01a1dee4878d8a648256b270024a88c/$Body/0.25E!OpenElement&FieldElemFormat=gif' WIDTH=208 HEIGHT=21></TD>");
out.println("<TD WIDTH=416 VALIGN=middle><DIV ALIGN=center><B><FONT SIZE=5 COLOR='0000FF'>操作反馈信息</FONT></B></DIV></TD></TR></TABLE>");
out.println("<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR VALIGN=top>");
out.println("<TD WIDTH=689><IMG SRC='/Lt_getfile.nsf/c01a1dee4878d8a648256b270024a88c/$Body/0.CFA!OpenElement&FieldElemFormat=jpg' WIDTH=688 HEIGHT=4></TD></TR>");
out.println("</TABLE><BR><br><br><br><br><P><BR><BR><BR><BR>");
out.println("<table border=0 bgColor=#0099cc borderColorLight=#000000 cellPadding=1 cellSpacing=2 align='center'><tr><td bgcolor=#EFEFEF>文件发送给下一办理人"+doc.getItemValue("sendtobak")+"办理!</td></tr></table>");
} catch (Exception e) {
out.println(e.getMessage());
e.printStackTrace();
}
}
public static String uniqueID()
{
StringBuffer sb=new StringBuffer(20);
java.text.SimpleDateFormat formatter=new java.text.SimpleDateFormat("yyyy/MM/dd");
java.util.Date currentTime=new java.util.Date();
String sid=formatter.format(currentTime);
return sid;
}
public static String replaceAll(String operStr,String oldStr ,String replaceStr){
int fromIndex=0;
int index=0;
int oldStrLen=oldStr.length();
int replaceStrLen=replaceStr.length();
while((index=operStr.indexOf(oldStr,fromIndex))!=-1){
//新的位置起点
//fromIndex+replaceStrLen-oldStrLen+1
fromIndex=index + replaceStrLen;
operStr=operStr.substring(0,index)+replaceStr+
operStr.substring(index+oldStrLen,operStr.length());
}
return operStr;
}
}
在进行系统设计的时候用户要求对各文件能够实现组合条件的查询和统计,开发之初我选择了notes自身提供的综合查询表单$$Search Form来实现,但在用户使用了一段时间发现,采用$$Search Form来进行组合条件查询时常常会搜索到许多并不满足条件的文档或者搜索到的文档根本就不知道是什么,为了解决这个问题,我决定写代码来实现组合条件查询,下面就来讲讲实现的过程。 首先建立一个表单(Fsearch),主要用来现实和选择查询条件,表单的域元素如下表所示:
编号
域名
含义
类型
说明
01
SaveOptions
防止使用该表单创建文档
文本域
该域是系统域当值为”0”的时候当前表单不会创建文档,因为这里使用该表单仅仅是为了选择查询条件,不需要创建文档,所以该域的值为“0”
02
biaoti
发文标题
文本域
03
zhutici
主题词
文本域
04
laiwenhao
发文号
文本域
05
nigaoren
拟稿人
文本域
06
danwei
拟稿人单位
文本域
07
syear
文档所属年度
文本域
08
smonth
文档所属月份
文本域
在表单上按照用户要求和使用习惯利用表格布局好上述元素后,在表单上创建一个热点按钮“现在查找“,执行@Command([ToolsRunMacro];"(wFaWenSearch)") 的公式命令,其中wFaWenSearch 是一个共享代理,代码如下:Sub Initialize ‘//定义变量 Dim session As New NotesSession Dim cDoc As NotesDocument Dim db As NotesDatabase Dim sResult , Set sResultemp As NotesDocumentCollection Dim sql As String Set db=session.currentDatabase ‘//获得当前数据库 Set cDoc=session.DocumentContext() ‘//获得当前文档,即用户打开的选择条件的表单Fsearch Set view=db.getView("($UNID)") ‘//获得($UNID)视图,该视图里现实所有文件 ‘//============获取查询条件=========// sYear=cDoc.syear(0) sMonth=cDoc.smonth(0) biaoti=cDoc.biaoti(0) zhutici=cDoc.zhutici(0) laiwenhao=cDoc.laiwenhao(0) danwei=cDoc.danwei(0) nigaoren=cDoc.nigaoren(0) ‘//================END================//‘//=====组合查询条件======//sql="form=""fwmain"""+"&(@Contains(biaoti;"""+biaoti+""")"+"|@Contains(zhutici;"""+zhutici''>|@Contains(zhutici;"""+zhutici+""")"+_"|@Contains(t1+""[""+@text(t2)+""]""+@text(t3''>|@Contains(t1+""[""+@text(t2)+""]""+@text(t3)+ ""号""+;"""+laiwenhao+""")"+"|@contains(danwei">|@contains(danwei; """+danwei+""")"+_"|@Contains(nigaoren;"""+nigaoren+""")"+"|@Contains(sYear;"""+sYear''>|@Contains(nigaoren;"""+nigaoren+""")"+"|@Contains(sYear;"""+sYear+""")"+"| @Contains(sMonth;"""+sMonth+"""))"Set sResultemp= db.search(sql,Nothing,0) ‘//在数据库中搜索满足上述条件的所有文档,获得该文档集;但是由于使用search语法会把当前操’//作者没有阅读权限的文档也搜索到,所以先把搜索到的文档集赋予临时变量sResultemp 再进行处理 Set sResult=db.search("@Contains(sYear;''1'')",Nothing,0) ‘//初始化一个文档集sResul,这文档集中没有文件的‘//========下面这循环主要是利用视图对文档读者权限的限制功能把sResultemp====//‘//========这个文档集中当前用户有阅读权限的文档添加到文档集sResul中去=====// For i=1 To sResultemp.count Set sDoc=sResultemp.getNthDocument(i) key=sDoc.bh(0) Set Sview=db.getView("default") Set sDoc=Sview.Getdocumentbykey(key,True) If Not sDoc Is Nothing Then Set sDoctmp=sResult.Getdocument(sDoc) If sDoctmp Is Nothing Then Call sResult.Adddocument(sDoc) End If End If Next If sResult.count=0 Then Print "没有找到您要查找的文件" Exit Sub End If ''//=========创建网页来显示查询结果=======// Print "<html>" Print "<head>" Print "<link rel=stylesheet type=text/css href=ViewCss.css>" Print "</script>" Print "</head>"Print "<body>" Print "<table width=100%>" Print "<tr>" Print "<td colspan=6 align=right style=border-style:solid;border-width:0 0 2px;border-color:#669933>查找到 "+Cstr(jjj)+" 份文件 <br>" Print "</td>" Print "</tr>" Print "<tr>" Print "<td width=5% class=td1></td>" Print "<td width=10% class=td1>年度</td>" Print "<td width=10% class=td1>月份</td>" Print "<td width=40% class=td1>标题</td>" Print "<td width=20% class=td1>主办部门</td>" Print "<td width=15% class=td1>拟稿人</td>" Print "</tr>" For i=1 To sResult.count Set sDoc=sResult.getNthDocument(i) Set sDoc=view.getDocumentByKey(sDoc.bh(0),True) If Not sDoc Is Nothing Then Print "<tr>" Print "<td class=tdx><a href=/"+sDoc.DBPath(0)+"/merit_gwgl.nsf/($UNID)/"+sDoc.UniversalID+"?opendocument target=_blank><img src=01.gif border=0 ></a></td>" Print "<td class=tdx>"+sDoc.sYear(0)+"</td>" Print "<td class=tdx>"+sDoc.sMonth(0)+"</td>" Print "<td class=tdx>"+sDoc.biaoti(0)+"</td>" Print "<td class=tdx>"+sDoc.danwei(0)+"</td>" Print "<td class=tdx>"+sDoc.nigaoren(0)+"</td>" Print "</tr>" End If Next Print "</table>" Print "</body>" Print "</html>" End Sub
<input type="checkbox" name="%%Detach" value="IBM咨询.txt"><a href="附件路径">IBM咨询.txt</a></td></tr>
选中以后,保存文档,附件就会被系统自动删除
江川之子 22:04:47 使用什么方法定位嵌入的embeddedobject呢 ,嵌入到文档还是rtf域
CoolStar~_~ 22:04:55 文档
江川之子 22:05:24 只能用getembedobject
江川之子 22:05:44 如果是rtf中的就可以用ref。emdedobjects
主业务数据表组,日志数据表组,组织结构权限组表,辅助数据表组,业务控制数据表组,
尤其对于oa,组织结构最重要。对于一般的业务,业务控制数据最重要,这样可以让你的业务变的很灵活。