BS mode-based non-embedded Office using method in OA system

文档序号:189899 发布日期:2021-11-02 浏览:25次 中文

阅读说明:本技术 一种在OA系统中基于BS模式非嵌入式使用Office的方法 (BS mode-based non-embedded Office using method in OA system ) 是由 刘绍军 姜新华 于 2021-08-05 设计创作,主要内容包括:本发明公开了一种在OA系统中基于BS模式非嵌入式使用Office的方法,其特征在于:所述方法包括以下步骤:S10:开启本地HTTP服务器程序,S20:使用浏览器网页的JS脚本通过AJAX模块实现与所述本地HTTP服务器程序的通信;S30:所述AJAX模块访问本地HTTP服务器程序的StartBrowser接口启动CefBrowser程序,S40:由CefBrowser程序打开指定的浏览器网页的URL链接,本发明的优点在于消除了由于浏览器版本的类型不同和版本更新等因素造成的Office程序在打开和保存等环节存在的各种错误的可能性;以BS模式设计整个OA系统,使系统的灵活性和可维护性大大提高。(The invention discloses a BS mode-based non-embedded Office using method in an OA system, which is characterized by comprising the following steps: s10: starting a local HTTP server program, S20: using a JS script of a browser webpage to realize communication with the local HTTP server program through an AJAX module; s30: the AJAX module accesses the StartBrowser interface of the local HTTP server program to start the CefBrowser program, S40: the method has the advantages that the method eliminates the possibility of various errors in the links of opening, saving and the like of Office programs caused by different types of browser versions, version updating and other factors; the entire OA system is designed in the BS mode, so that the flexibility and maintainability of the system are greatly improved.)

1. A method for using Office in an OA system based on BS mode non-embedded mode is characterized by comprising the following steps:

s10: the local HTTP server program is turned on and,

s20: using a JS script of a browser webpage to realize communication with the local HTTP server program through an AJAX module;

s30: the AJAX module accesses the startbolt interface of the local HTTP server program to start the CefBrowser program,

s40: the URL link of the specified browser page is opened by the CefBrowser program,

the URL webpage link is embedded into the Office webpage middleware through a PPAPPI plug-in to realize the embedding of the Office application program, and the JS module of the URL webpage link is communicated with the Office document middleware through a scriptable object interface of a PPAPPI host module of a CEF kernel to further control and use the function of the Office program;

the HTTP server program is used for receiving a browser webpage AJAX module command and calling the CefBrowser program;

the CefBrowser program is a Windows application program of a CEF kernel, and realizes opening of a browser webpage embedded with an Office program.

2. The method for using Office in OA system based on BS mode non-embedded mode as claimed in claim 1, wherein said OA system designs application system in BS mode, said browser webpage containing Office program can only be loaded and opened by CefBrower, JS script in said webpage uses Office object in mode of processing common webpage element DOM object by using PPAPI plug-in, Office document middleware as proxy.

Technical Field

The invention relates to Office automation technology of an OA system based on WEB, in particular to a BS mode-based non-embedded Office using method in the OA system.

Background

OA: office Automation (OA) is a new Office method combining modern Office work and computer technology. Office automation has no unified definition, and all the office businesses adopting various new technologies, new machines and new equipment in the traditional office belong to the field of office automation. WEB-based collaborative office automation software is specified herein.

Microsoft Office files: microsoft Office (hereinafter, Office) is a suite of Office software developed by Microsoft corporation based on Windows operating system. Common components are Word, Excel, PowerPoint, etc. The Microsoft Office file refers to a file stored after software editing such as Word, Excel, PowerPoint and the like.

CEF, namely, Chromium Embedded Framework (CEF) is an open-source Web browser control based on a Google Chromium project and supports Windows, Linux and Mac platforms. Besides providing a C/C + + interface, there are also port-fixes for other languages. Because of the Chrome-based, CEF supports the characteristics of HTML5 implemented in Webkit & Chrome, and also is closer to Chrome in terms of performance.

AJAX refers to a web page development technology for creating interactive web page applications. By exchanging a small amount of data with the server in the background, Ajax can enable the webpage to be updated asynchronously. This means that certain parts of the web page can be updated without reloading the entire web page.

Native HTTP server program: refers to a program that listens to a certain port of the local IP and processes a request of the HTTP protocol.

The PPAPPI plug-in unit: for the sake of security, in 2010, Chrome developed a new ppapi (peer plug api) interface on the basis of the original netscape NPAPI, and stopped the support of the NPAPI interface at Chrome45 and later versions. The PPAPI plug-in is particularly used for creating Office document middleware on the basis of realizing a basic PPAPI interface, realizing the attribute and method that a Chrome calls the Office document middleware by using a JavaScript code, and realizing an event that the Chrome responds to the Office document middleware by using the JavaScript code.

Office automation programming interface, namely an automation (IDispatch) interface provided by Office programs, and a user can use the functions provided by the interface in a programming mode to meet the requirements of various actual functions.

Office document middleware: an OLE container loads an Office program in an OLE embedding mode, commonly encapsulates common Office functions and provides an automatic programmable interface of Office to the outside.

BS architecture: the BS architecture is known as Browser/Server, i.e., Browser/Server architecture. Browser refers to a Web Browser, few business logic is implemented in the front end, but the main business logic is implemented in the server end, Browser client. The BS architecture has the advantages of being distributed, convenient to expand service, simple and convenient to maintain, simple to develop, strong in sharing performance, low in cost and the like.

With the continuous development of communication technology, single personal office software cannot meet the modern office requirements of increasingly frequent information communication, and the WEB technology and the office software technology are organically combined, so that the office software for realizing resource sharing and cooperative work can be developed. Since the OA system based on WEB (OA system for short) operates in the WEB browser, how to combine Office software technology with various browser technologies is an important technical problem faced by the OA system. The main browsers in the current environment are IE, firefox, google and many browsers based on google kernel, and in the OA system, the following methods are generally used:

1. and embedding an Office program mode in the browser, namely embedding ActiveX middleware in the browser and embedding Office in the ActiveX middleware. The advantage of this mode (browser version is not controllable) is that the software interface is friendly, but because of the close coupling of the browser, the stability of the software is not only relevant to Office software, but also relevant to the browser, often causing new problems due to the change of browser version.

2. The independent window containing the Office program is started from the browser, namely the Office program is not embedded in the browser any more, the mode has the advantages that the software is decoupled from the browser, the operation effect is stable, the stability of the Office program is irrelevant to the browser, but the mode is similar to a traditional CS mode, compared with a BS mode of the browser, a client of the software is too bulky, and the cost of later-stage upgrading and maintenance is higher.

3. The Office program is started by the browser through the plug-in, and the Office program is used in a non-embedded mode. However, the system can only use the visual function interface provided by the Office editor to edit the file, and cannot use the programmable interface of Office to realize more complex service functions in the system. Another disadvantage is that a corresponding plug-in needs to be developed for each browser, which is also a significant effort.

Disclosure of Invention

The invention aims to provide a BS mode-based non-embedded Office using method in an OA system, which avoids embedding an Office program in a browser webpage, can use an Office programming interface through webpage JavaScript to realize a BS operation mode, and meets the requirements of the OA system on software stability and operation maintenance efficiency.

A method for non-embedded use of Office based on a BS mode in an OA system, the method comprising the steps of:

s10: the local HTTP server program is turned on and,

s20: using a JS script of a browser webpage to realize communication with the local HTTP server program through an AJAX module;

s30: the AJAX module accesses the startbolt interface of the local HTTP server program to start the CefBrowser program,

s40: the URL link of the specified browser page is opened by the CefBrowser program,

the URL webpage link is embedded into the Office webpage middleware through a PPAPPI plug-in to realize the embedding of the Office application program, and the JS module of the URL webpage link is communicated with the Office document middleware through a scriptable object interface of a PPAPPI host module of a CEF kernel to further control and use the function of the Office program;

the HTTP server program is used for receiving a browser webpage AJAX module command and calling the CefBrowser program;

the CefBrowser program is a Windows application program of a CEF kernel, and the browser webpage embedded with the Office program is opened;

the OA system designs an application system in a BS mode, the browser webpage containing the Office program can only be loaded and opened by CefBrower, the JS script in the webpage is used as a proxy through a PPAPPI plug-in and Office document middleware, and the Office object is used in a mode of processing a common webpage element DOM object.

Compared with the mode that the browser is embedded into the Office, the method has the advantages that by decoupling the Office and the browser program, the possibility of various errors in links of opening, storing and the like of the Office program caused by different browser versions and version updating and other factors is eliminated; the CefBrowser program comprises a CEF kernel, can open a webpage embedded with an Office program, and can finish organization and control of specific service functions by using a programmable interface of the Office program through a webpage Javascript; because only the plug-in is written aiming at the CEF kernel, the writing of a plurality of plug-ins for adapting a plurality of browsers is avoided; because the service function can be written in the webpage Javascript and the whole OA system is designed in the BS mode, the flexibility and maintainability of the system are greatly improved.

Drawings

FIG. 1 is a block diagram of the system architecture of the present invention;

FIG. 2 is a diagram of the relationship of the browser, local HTTP server and CefBrowser program of the present invention;

FIG. 3 is a relational diagram of a CefBrowser program, a PPAPPI plug-in, Office document middleware and an Office program in the invention;

fig. 4 is a flow chart of the system operation of the present invention.

Detailed Description

The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.

Example (b):

referring to the system structure block diagram of fig. 1, the access of the Office file by the browser webpage of the OA system passes through a local service process group consisting of a local HTTP server and a CefBrowser program, and a plug-in module consisting of a PPAPI plug-in and Office document middleware.

The OA system accesses a StartBrowser interface of a local HTTP server through an AJAX module in a webpage code to call out a CefBrowser program, the CefBroser opens an Office editing webpage, a CEF core of the CefBroser loads a PPAPPI plug-in which exists in a webpage element form, the PPAPPI plug-in loads Office document middleware, and the Office document middleware loads the Office program. And finally, the CefBrowser operates the Office program through JavaScript in the Office editing webpage.

Referring to fig. 2, the local HTTP server discloses a file operation command interface (startbolt), and the browser web code can access the startbolt interface through the AJAX module. The StartBorrowser starts a CEF kernel browser program CefBrowser to open an Office file operation webpage, and the specific Office file operation function is customized and realized in JavaScript of the webpage according to the requirements of the OA system, so that the system runs in a BS mode of a lightweight client.

Referring to fig. 3, after the CefBrowser is started, the CEF kernel is loaded and the Office editing web page is opened, where the PPAPI plug-in web page element exists in the page. The PPAPPI Host of the CEF kernel is used as a Host, the PPAPPI plug-in is incorporated into a webpage element Object tree DOM (document Object module), the JavaScript can create a DOM Object through an instant Private interface of a PPAPPI plug-in protocol, and the DOM Object can be operated through a scriptable Object interface, so that the PPAPPI plug-in Object is operated. On the other hand, the PPAPI plug-in is connected to the Office document middleware, the PPAPI plug-in serves as a middle agent to expose an external interface of the Office document middleware, and the JavaScript can operate a DOM object of the PPAPI plug-in, so that the interface of the Office document middleware is operated, an automatic programmable interface function of an Office program is used, and finally the purpose of using the Office function is achieved.

Referring to fig. 4, taking the most common function of opening files in the OA system as an example, a Word file on a web server is opened in a browser webpage and the content of the Word file is shown in the CefBrowser program. The method comprises the steps that AJAX calls a StartBorowser interface of a local HTTP server, the HTTP server obtains a website URL for displaying a Word file after analyzing interface parameters, a CefBrowser program opens a webpage URL for displaying the Word file, a CEF kernel module analyzes webpage elements, PPAPI plug-in webpage elements are analyzed into DOM objects, PPAPI plug-in loads Office document middleware, the middleware loads an Office program in an OLE mode to expose an automatic programmable interface of the Office program, and JavaScript of a webpage can use the Office programmable interface through a PPAPPI plug-in agent. And finally, the OA system flexibly organizes and uses Office program functions through webpage JavaScript according to the requirements of the OA system.

A method for non-embedded use of Office based on a BS mode in an OA system, the method comprising the steps of:

s10: the local HTTP server program is turned on and,

s20: using a JS script of a browser webpage to realize communication with the local HTTP server program through an AJAX module;

s30: the AJAX module accesses the startbolt interface of the local HTTP server program to start the CefBrowser program,

s40: the URL link of the specified browser page is opened by the CefBrowser program,

the URL webpage link is embedded into the Office webpage middleware through a PPAPPI plug-in to realize the embedding of the Office application program, and the JS module of the URL webpage link is communicated with the Office document middleware through a scriptable object interface of a PPAPPI host module of a CEF kernel to further control and use the function of the Office program;

the HTTP server program is used for receiving a browser webpage AJAX module command and calling the CefBrowser program;

the CefBrowser program is a Windows application program of a CEF kernel, and the browser webpage embedded with the Office program is opened;

the OA system designs an application system in a BS mode, the browser webpage containing the Office program can only be loaded and opened by CefBrower, the JS script in the webpage is used as a proxy through a PPAPPI plug-in and Office document middleware, and the Office object is used in a mode of processing a common webpage element DOM object.

The working principle is as follows:

a non-embedded Office method based on a webpage BS mode in an OA system starts a local HTTP server program, a JS script in a browser webpage is used for communicating with the local HTTP server program through an AJAX module, the AJAX accesses a StartBorrowser interface of the local HTTP server to call out a CefBroser program, and then JavaScript in an Office editing webpage of the CefBroser program completes Office file operation; the CefBrowser program consists of a CEF kernel, a PPAPPI plug-in and Office document middleware; the Office document middleware completes downloading, uploading, opening and closing of Office files and automation functions provided by all Office programs; the PPAPPI plug-in uses internal Office middleware to convert JavaScript statements in a webpage of the CefBrowser program into automatic function calls of the Office program so as to complete Office file operation. The operation of the browser webpage on the Office file calls out a CefBrowser program through a JavaScript statement of the browser webpage, an AJAX module and a local HTTP server program, the CefBroser then opens the Office editing webpage, and finally the Office editing webpage reaches the Office program by using an Office document middleware. Taking a remote file opening function as an example, the AJAX module transmits a browser webpage command to a local HTTP server program, the local HTTP server program calls CefBrower, the CefBrower transmits a file downloading command to Office document middleware through a PPPAPI plug-in, the Office document middleware downloads an Office file from a remote server, and finally the Office document middleware opens the Office program in an embedded mode through Office OLE.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于Java的echarts图表动态生成方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!