Lotus Domino Release 5.0 A Developer’s Handbook phần 6

Hãy xem xét Ghi chú mô hình lập trình hiện tại Khách hàng. Object Model (DOM) Domino được truy cập bởi LotusScript trong xử lý sự kiện. Trên web, các ngôn ngữ kịch bản JavaScript, không có giao diện Domino Object Model (DOM). Java có một giao diện DOM, nhưng các API được từ xa. Đây là nơi bạn có thể sử dụng một applet CORBA. | On accessing the applet JavaScript can also access the Java public methods properties of the applet Obvious advantages include repainting applets with new data at runtime without roundtrips to the server via submits. Accessing Java CORBA Applets via LiveConnect Consider the current Notes Client Programmability model. The Domino Object Model DOM is accessed by LotusScript in the event handlers. On the Web the scripting language is JavaScript which has no interface to the Domino Object Model DOM . Java has an interface to the DOM but the API s are remote. This is where you can utilize a CORBA applet. A CORBA-enabled applet can access a remote Domino Session object and in combination with LiveConnect make this property available to JavaScript via a public property or method. An HTML page can now have a persistent session with the Domino server via JavaScript and utilize the DOM without the need to submit the page to the server for each transaction. Example The following example illustrates how LiveConnect can be used in the Notes client. It has been taken from the Lotus Domino Toolkit for Java CORBA . 338 Lotus Domino Release A Developer s Handbook The Rich Text field on the document contains a 1 pixel square embedded applet. The applet code is minimal as you can see below import . public class PinpointApplet extends public void notesAppletInit setLayout null setSize 1 1 The important thing here is that the applet extends the AppletBase class. This class implements the method which we will use to get a Domino session object. The Rich Text field on the document in the figure also has a button that when clicked locates the applet passes the openSession method to it and then accesses the Domino Object Model through JavaScript. You can see all the JavaScript code for that button. Sample JavaScript code accessing back-end data via Java Retrieves the

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
211    106    6    02-07-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.