Java Remote Operations Domino Objects

Source: Internet
Author: User

I. Description

Java uses the web to remotely access and manipulate Lotus Domino Objects, andJava programs use CORBA (Common Object request Broker Architecture) to request the services provided by the Domino server. The remote class uses CORBA to access the server over a TCP/IP network. Remote access consists of the following two parts:

1. The client obtains the initial object of the server through the HTTP protocol as the IOR (interoperable object Reference).
2. The client further obtains other objects through the IIOP connection.

Java remote access via HTTP and IIOP

To compile a Java program that uses the Lotus.domino package, the classpath must contain Ncso.jar.
Where Notes.jar can be found in any Notes/domino installed program directory. Ncso.jar can be found in the Domino\java directory under the Domino Designer or Domino server data directory (this package version of the Domino system is compatible with the lower version).

Second, remote call

  1. Domino Server Document settings:

The configuration page for the Server documentation for Domino Directory (NAMES.NSF) is configured as follows
(1) Open the HTTP tab of the Internet Protocol tab, set "Allow HTTP client to browse the database: yes"
(2) Open the Security tab and set the java/com limit.
Run a restricted java/javascript/com:*
Run an unrestricted java/javascript/com:*
(3) Open the Iiop tab of the Internet tab of the Port tab, the Web tab

  

(4) to start HTTP and DIIOP tasks on the server, you need to ensure that these tasks are in the task List of the Notes.ini file ServerTasks variable, and if the server document is configured correctly, these tasks should be included in the task list. The Notes.ini file should contain a line similar to the following: Servertasks=update,replica,router,amgr, Adminp,calconn,sched,diiop,http,ldap
From the running server, you can load the task by entering the following command in the console:
> Load http > Load DIIOP
You can stop a task with the Tell command at the console:
> Tell http quit > tell Diiop quit
You can refresh the DIIOP task:
> Tell Diiop Refresh
You can restart the HTTP task:
> Tell http restart

(5) Get the IOR. If you use Createsessionwithior to create a connection. You need to copy the Diiop_ior.txt file from the server computer to the client computer. The file is under the \domino\data\domino\html of the server's installation directory.

  2. Connect to the Domino server:

To create a Domino session link, you can access Domino Objects, which is an example of a new document operation:

ImportLotus.domino.*; Public classmyclass{ Public Static voidMain (String argv[]) {Try{String host= "192.168.128.2";//Note: Sometimes a port number is requiredSession s =notesfactory.createsession (host); String UserName= "Admin"; String userpwd= "Pass"; //Domino session (get session)Session session =notesfactory.createsession (Host, Notesfactory.createorb (), username,userpwd); //Domino DatabaseDatabase Database = Session.getdatabase (Session.getservername (), "Mail\\admin.nsf",false); //Create a documentDocument NDoc =database.createdocument (); //Set ThemeNdoc.appenditemvalue ("Subject", DOC.G ("Subject")); //Specify a formNdoc.appenditemvalue ("form", "Memo"); //Add AttachmentsRichtextitem RTI = (richtextitem) ndoc.createrichtextitem ("Name4"); String Attachfilepath= "E:\\test.txt"; Rti.embedobject (Embeddedobject.embed_attachment,NULL, Attachfilepath, Attachfilepath); //Save DocumentNdoc.save (); } Catch(Exception e) {e.printstacktrace (); }    } }

The program demonstrates how to access the Domino library, how to add documents, and other actions such as modifying, deleting, querying, and so on, directly referencing the Help API in administer Designner.

Java Remote Operations Domino Objects

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.