Several small problems in NOTES development and their solution

xiaoxiao2021-03-06  18

1) Database corruption error, prompt Corrupt Data Error A: During the database structure of a good database, the existing database reconstruction process cannot solve the problem, because if all data is copied to a new database Time, it is to make the existing database's agent failure

2) User authority problem

How to get the user's digital ID file A: Re-add a user

How to change existing users to superuser permissions A: Modify in Names.nsf

How to add existing users to the Manager group

A: Copy the database to the local, open according to the local mode, modify the permissions

3) Can't run JavaAgent, prompting users without permission

Not as long as you set the system's permissions, and you want to save the Script to the user or all users in the security of the server at the same time.

4) Multi-database query Domino supports JDK 1.3 Unfortunately, it is now not possible to support JDK 1.4 Many functions.

Import lotus.domino. *; import java.util.arrays; import java.util. *; import java.io.printwriter; import java.lang. *;

Public Class JavaAgent Extends AgentBase {

Public void notesmain () {// Database initial, list the library to query String nsf_file [] = {database name};

Try {session session = getsession (); agentContext agentContext = session.getagentContext ();

// (Your Code Goes Here) PrintWriter PW = getAgentOutput (); string a_creator []; int a [];

Agent agent = agentContext.getCurrentAgent (); DbDirectory dir = session.getDbDirectory (null); String html_head = ""; html_head = "< Script language = javascript src = / "/ cngone / onesrc.nsf / noborder.js /"> "; PW.Println (HTML_HEAD);

String head_line = "

Query results "; head_line = "

Align = center border = 1> "; Head_Line ="

sequence number "; head_line ="

process name "; head_line ="

file

Title (* Click the title to see the details) "; head_line ="

Lang = zh-cn> From "; Head_Line ="

Lang = zh-cn> Differenfill "; Head_Line ="

LANG = zh-cn> Submit time "; Head_Line ="

Lang = zh-cn> Drafting time "; PW.Println (Head_Line); // define var string Temp_processLog =" "; string temp_submitdate =" "; string Temp_submitman = ""; // end define int s_count = 1; for (int i = 0; i <5; i ) {//system.out.println (title); //system.out.println ("test " ); Database db = dir.opendatabase ("cngone //" nsf_file [i]); //system.out.println ("testdir" db.gettitle ()); // DocumentCollection DC = db.search (" Station = / "2 /" "); DocumentCollection DC = db.search (" curuser = / "Xue Dongmei /" & station = / "2 /"); Document Doc = dc.getFirstDocument (); string temptitle = db.gettitle (); While (doc! = Null) {//pw.println ("test "); //nsf_file[1]=doc.getitemvalueString ("creat"); //a_fileos[]=doc.getitemvalueString ("fileos " "); // Test //system.out.println ("test=creat"); // test string tr_start = ""; PW.Println (TR_S tart); String td_line = ""; Item item = doc.getFirstItem ( "FileSendDate"); Item item2 = doc.getFirstItem ( "FileDraftDate"); Item item3 = doc.getFirstItem ( "ProcessLog"); Enumeration values ​​= item3. GetValues ​​(). Elements (); while (Values.hasMoreElements ()) {temp_processLog = VALUES.NEXTELEMENT (). Tostring ();} temp_submitdate = temp_processLog.substring (0, 10);

TEMP_SUBMITMAN = TEMP_PROCESSLOG.SUBSTRING (17, 21); // Test System.out.Println (TEMP_PROCESSLOG); //pw.print (Doc.getItemValueString ("CREATOR")); // String Tempstr = item3.get (); String tempstr = ""; //tempstr=tempstr.replacefirst ("00", ""); string tempurl = "/ cngone /" nsf_file [i] "/ 0 /" Doc.getItemValueString ("FileIDOS" ); //System.out.println; td_line = "

" s_count ""; td_line = "" temptitle ""; td_line = " " " "; TD_LINE =" " TEMP_SUBMITMAN " ";

TD_LINE = "

" Doc.getItemValueString ("Creat") ""; TD_LINE = "" TEMP_SUBMITDATE ""; TD_LINE = "" ITEM2. getDateTimeValue () ""; //pw.println (Doc.getItemValueString ("Fileos ")); //pw.println (Doc.getItemValueString ("FileIDOS")); //pw.println (DOC .GetItemValueString ("CURACTIVITYOS")); //pw.println ("
"); //pw.println (Doc.getItemValueString ("Process ")); //pw.println ("
") ///Pw.println (Doc.getItemValueString); //pw.println (item.getdatetimevalue ()); PW.Println (TD_LINE); String Tr_end = ""; PW.Println (TR_END); // s_count ; doc = dc.getnextdocument ();} //pw.print ("test ");} // print end string tail_line =" "; // int match = DC .getcount (); PW.Print (Tail_Line); //system.out.println // ("Search of /" Title "/" Found " Matches " Document (s) with curuser = / "admin /"); // Println ("test");} catch (exception e) {E.PrintStackTrace ();}} 5) How to replace all libraries by command

Load convert cngone / k * .nsf * a.ntf

OnSubmit

转载请注明原文地址:https://www.9cbs.com/read-42729.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.042, SQL: 9