Method and system for exporting WPS (Windows presentation System) based on domestic CPU (Central processing Unit) and operating system

文档序号:1964125 发布日期:2021-12-14 浏览:19次 中文

阅读说明:本技术 基于国产cpu和操作系统的导出wps的方法及系统 (Method and system for exporting WPS (Windows presentation System) based on domestic CPU (Central processing Unit) and operating system ) 是由 梁振棋 李利民 于 2021-08-10 设计创作,主要内容包括:本发明公开了基于国产CPU和操作系统的导出WPS的方法及系统,属于模板引擎技术领域,本发明要解决的技术问题为在国产CPU和操作系统下,如何使用户能够直接将浏览器显示的页面下载到WPS文档进行保存,提高兼容性,采用的技术方案为:该方法具体如下:新建WPS文档,设置该WPS文档的格式,并将其中需要填写或替换的数据内容部分作为FreeMarker模板引擎变量;将含有FreeMarker模板引擎变量的WPS文档另存为XML格式的文档;在国产CPU和操作系统中新建导出模板,将XML格式的文档上传到导出模板,并设置导出模板的元数据;通过页面触发,发出导出指令;FreeMarker模板引擎渲染数据模型;FreeMarker模板引擎生成数据并下载WPS文档至用户计算机。(The invention discloses a method and a system for exporting WPS (Windows presentation System) based on a domestic CPU (Central processing Unit) and an operating system, belonging to the technical field of template engines, aiming at solving the technical problem of how to enable a user to directly download a page displayed by a browser to a WPS (Windows presentation System) document for storage under the domestic CPU and the operating system and improving the compatibility, and adopting the technical scheme that: the method comprises the following specific steps: establishing a WPS document, setting the format of the WPS document, and taking a data content part needing to be filled or replaced as a Freemarker template engine variable; storing the WPS document containing the Freemarker template engine variable as a document in an XML format; a exporting template is newly built in a domestic CPU and an operating system, a document in an XML format is uploaded to the exporting template, and metadata of the exporting template is set; sending out an export instruction through page triggering; rendering a data model by a Freemarker template engine; the FreeMarker template engine generates data and downloads the WPS document to the user computer.)

1. A WPS exporting method based on a domestic CPU and an operating system is characterized by comprising the following steps:

establishing a WPS document, setting the format of the WPS document, and taking a data content part needing to be filled or replaced as a Freemarker template engine variable;

storing the WPS document containing the Freemarker template engine variable as a document in an XML format;

a exporting template is newly built in a domestic CPU and an operating system, a document in an XML format is uploaded to the exporting template, and metadata of the exporting template is set;

sending out an export instruction through page triggering;

rendering a data model by a Freemarker template engine;

the Freemarker template engine generates data and downloads the WPS document to the user computer, and the variable content of the corresponding Freemarker template engine in the downloaded page is automatically replaced or filled in the downloaded WPS document.

2. The domestic CPU and operating system based WPS exporting method according to claim 1, wherein the WPS document format is a WPS document title, a WPS document paragraph, a WPS document table, and a WPS document line.

3. The domestic CPU and operating system based WPS export method of claim 1, wherein the metadata of the export template refers to a file suffix name of the export template, a name of the export template and a code of the export template.

4. The method for deriving WPS based on domestic CPU and operating system of claim 1, wherein font format, content, typeset and template engine variables are modified for XML formatted document under domestic CPU and operating system.

5. The method for exporting the WPS based on the domestic CPU and the operating system according to claim 1, wherein the template engine variable edits the value of the XML node according to the requirement of the user to manage the export template, the export template becomes effective immediately after the management, and the exported document is rendered with the new export template to generate the downloaded document.

6. The method for exporting the WPS based on the domestic CPU and the operating system according to any one of claims 1 to 5, wherein a button or a hyperlink for triggering export is configured on an export page of the WPS document, the button or the hyperlink is clicked to send an export download instruction, the operating system finds a path where an export template is located according to a Freemarker template engine, a data model is transmitted to the Freemarker template engine, the data model is rendered by the Freemarker template engine to generate data and downloaded to the WPS document to a user computer, and the user locally opens the downloaded WPS document to display the same data and format as those on the webpage.

7. A WPS exporting system based on a domestic CPU and an operating system is characterized by comprising,

the system comprises a new building module, a search module and a search module, wherein the new building module is used for building a WPS document and taking a data content part needing to be filled or replaced as a Freemarker template engine variable;

the additional storage module is used for additionally storing the WPS document containing the Freemarker template engine variable into a document in an XML format;

the uploading module is used for newly building a exporting template in a domestic CPU and an operating system, uploading the XML format document to the exporting template and setting metadata of the exporting template;

the trigger module is used for sending out a lead-out instruction through page triggering;

the rendering module is used for rendering the data model by a Freemarker template engine;

and the downloading module is used for generating data by the Freemarker template engine, downloading the WPS document to the user computer, and automatically replacing or filling variable contents of the Freemarker template engine corresponding to the downloaded page into the downloaded WPS document.

8. The system for exporting the WPS based on the domestic CPU and the operating system according to claim 7, wherein the triggering module is configured with a button or a hyperlink for triggering the export, the button or the hyperlink is clicked to issue an export download instruction, the operating system finds a path where the export template is located according to the freemaker template engine, the data model is transmitted to the freemaker template engine, the data model is rendered by the freemaker template engine to generate data and download the data as the WPS document to the user computer, and the user locally opens the downloaded WPS document to display the same data and format as those on the webpage.

9. The domestic CPU and operating system based WPS exporting system according to claim 7, wherein the WPS document format is a WPS document title, a WPS document paragraph, a WPS document table, and a WPS document line;

the metadata of the export template refers to a file suffix name of the export template, a name of the export template and a code of the export template;

under the domestic CPU and operating system, modifying the font format, content, typesetting and template engine variables for the document in the XML format;

and editing the value of the XML node according to the requirement of the user by the template engine variable to manage the export template, immediately taking effect after management, and rendering the exported document by using the new export template to generate a downloaded document.

10. A computer-readable storage medium, in which a computer program is stored, the computer program being executable by a processor to implement the method of deriving a WPS based on a domestic CPU and an operating system according to any one of claims 1 to 6.

Technical Field

The invention relates to the technical field of template engines, in particular to a method and a system for exporting WPS based on a domestic CPU and an operating system.

Background

At present, domestic software and hardware with independent intellectual property rights have relatively rapid development, and especially in recent years, a plurality of basic software and hardware products with independent intellectual property rights emerge, and high-end universal chips with independent intellectual property rights, such as dragon cores, Feiteng, Shenwei and the like, are developed vigorously, and the technical level reaches the world advanced level of similar products.

Meanwhile, the development of domestic basic software products is also flourishing, and domestic basic software products such as a standard-winning kylin operating system, a Shentong database, a Jincang database, a Dameng database, an eastern-style middleware, a golden butterfly middleware, a standard-winning Puhua office software, a Jinshan office software, a FuXin format office suite, a digital format office suite, a ZhongAnyuan electronic signature, a Xinan electronic signature and the like are continuously emerging, and the basic software products reach or approach the world advanced level in the aspects of performance, usability and the like.

With the trend of office automation, more and more data need to be displayed on a page, a user also needs to download the data to a local storage frequently, and in order to enable the displayed data to generate a download file through a template, a template engine technology is adopted. FreeMarker is a very good template engine that can be used in any scenario and is responsible for merging data in a data model into templates to generate a standard output. The interface developer only needs to be responsible for the development of the interface, namely the template file, and the business logic developer only needs to be responsible for filling data to be displayed into a data model, and finally Freemarker is responsible for combining the data model and the template, so that standard output is generated.

At present, a WPS document is exported under a domestic operating system, only HTML codes on a browser page are copied and pasted into a file and then stored into a WPS format, and finally, a user opens the file after downloading the file to see the same format as that on a webpage.

Therefore, under a domestic CPU and an operating system, how to enable a user to directly download a page displayed by a browser to a WPS document for storage is a technical problem to be urgently solved at present.

Disclosure of Invention

The technical task of the invention is to provide a method and a system for exporting a WPS (Windows presentation System) based on a domestic CPU (Central processing Unit) and an operating system, so as to solve the problem of how to enable a user to directly download a page displayed by a browser into a WPS (Windows presentation System) document for storage and improve the compatibility under the domestic CPU and the operating system.

The technical task of the invention is realized in the following way, a method for exporting WPS based on domestic CPU and operating system, which comprises the following steps:

establishing a WPS document, setting the format of the WPS document, and taking a data content part needing to be filled or replaced as a Freemarker template engine variable;

storing the WPS document containing the Freemarker template engine variable as a document in an XML format;

a exporting template is newly built in a domestic CPU and an operating system, a document in an XML format is uploaded to the exporting template, and metadata of the exporting template is set;

sending out an export instruction through page triggering;

rendering a data model by a Freemarker template engine;

the Freemarker template engine generates data and downloads the WPS document to the user computer, and the variable content of the corresponding Freemarker template engine in the downloaded page is automatically replaced or filled in the downloaded WPS document.

Preferably, the format of the WPS document refers to a title of the WPS document, a paragraph of the WPS document, a table of the WPS document, and a line of the WPS document.

Preferably, the metadata of the export template refers to a file suffix name of the export template, a name of the export template, and a code of the export template.

Preferably, font format, content, layout and template engine variables are modified for XML formatted documents under a domestic CPU and operating system.

Preferably, the template engine variable edits the value of the XML node according to the requirement of the user to manage the export template, the export template takes effect immediately after management, and the exported document is rendered by the new export template to generate the downloaded document.

Preferably, a button or hyperlink used for triggering export is configured on an export page of the WPS document, the button or hyperlink is clicked to send an export download instruction, the operating system finds a path where an export template is located according to a Freemarker template engine, a data model is transmitted to the Freemarker template engine, the data model is rendered by the Freemarker template engine, the data are generated and downloaded to a user computer through the WPS document, and the user locally opens the downloaded WPS document, so that the data and the format which are the same as those on a webpage can be displayed.

A WPS exporting system based on a domestic CPU and an operating system, the system comprising,

the system comprises a new establishing module, a processing module and a processing module, wherein the new establishing module is used for establishing a WPS document, setting the format of the WPS document and taking a data content part needing to be filled or replaced as a Freemarker template engine variable;

the additional storage module is used for additionally storing the WPS document containing the Freemarker template engine variable into a document in an XML format;

the uploading module is used for newly building a exporting template in a domestic CPU and an operating system, uploading the XML format document to the exporting template and setting metadata of the exporting template;

the trigger module is used for sending out a lead-out instruction through page triggering;

the rendering module is used for rendering the data model by a Freemarker template engine;

and the downloading module is used for generating data by the Freemarker template engine, downloading the WPS document to the user computer, and automatically replacing or filling variable contents of the Freemarker template engine corresponding to the downloaded page into the downloaded WPS document.

Preferably, the triggering module is configured with a button or hyperlink for triggering export, the button or hyperlink is clicked, an export download instruction is sent, the operating system finds a path where the export template is located according to the Freemarker template engine, the data model is transmitted to the Freemarker template engine, data is generated and downloaded to the user computer as a WPS document through rendering of the Freemarker template engine, and the user opens the downloaded WPS document locally, so that the data and the format which are the same as those on the webpage can be displayed.

Preferably, the format of the WPS document refers to a title of the WPS document, a paragraph of the WPS document, a table of the WPS document and a row and column of the WPS document;

the metadata of the export template refers to a file suffix name of the export template, a name of the export template and a code of the export template;

under the domestic CPU and operating system, modifying the font format, content, typesetting and template engine variables for the document in the XML format;

and editing the value of the XML node according to the requirement of the user by the template engine variable to manage the export template, immediately taking effect after management, and rendering the exported document by using the new export template to generate a downloaded document.

A computer readable storage medium having stored therein a computer program executable by a processor to implement a method of deriving a WPS based on a domestic CPU and an operating system as described above.

The method and the system for exporting the WPS based on the domestic CPU and the operating system have the following advantages that:

the method has strong compatibility, and meets the requirement that users download export data to local WPS documents in daily business; meanwhile, the downloaded export template can be modified in the aspects of format and content on line, so that the use by a user is facilitated, and the user experience is enhanced;

secondly, based on a domestic CPU and an operating system, a user can directly download a page displayed by a browser into a WPS document for storage, the compatibility is strong, the operation is convenient, and the WPS can be exported under the domestic CPU and the operating system which are convenient for the user to use;

the method comprises the steps that firstly, a WPS document is newly built by a user, content needing to be filled or replaced in the WPS document is used as an engine variable according to the grammatical requirement of a Freemarker template engine, then the WPS document is converted into an XML format and uploaded into a newly built export template, and finally, a final WPS export file is generated and downloaded to a user computer through user triggering, so that a browser page seen by the user can be directly converted into the WPS document for storage, the downloaded WPS document can be embedded into other formats of the WPS, the compatibility is strong, and the requirement of the user for downloading export system data to a local WPS document in daily business is met;

the invention can be applied to the single industry software system as the template management and the document export, and the management research and development idea can also be used in other similar data display and document export functions and the business scene with relatively uncomplicated business processing;

the method for exporting the WPS document under the home-made operating system is completely exported according to the style and paragraph displayed on the browser page, printing is not deformed, and control is very convenient;

and (VI) under a domestic operating system, the function of editing the export template is realized through the conversion of the XML format document, and the downloaded export template can be modified in the aspects of format and content through the management of the document template, so that the use by a user is facilitated, and the user experience is enhanced.

Drawings

The invention is further described below with reference to the accompanying drawings.

Figure 1 is a flow chart diagram of a method for exporting a WPS based on a domestic CPU and an operating system.

Detailed Description

The method and system for deriving WPS based on domestic CPU and operating system of the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.

Example 1:

as shown in fig. 1, the method for deriving WPS based on domestic CPU and os of the present invention specifically includes:

s1, creating a WPS document, setting the format of the WPS document, and taking the data content part needing to be filled or replaced as a Freemarker template engine variable; the WPS document format refers to a title of the WPS document, a paragraph of the WPS document, a table of the WPS document and a row and column of the WPS document.

S2, storing the WPS document containing the Freemarker template engine variable as a document in an XML format;

s3, newly building a exporting template in a domestic CPU and an operating system, uploading the XML-format document to the exporting template, and setting metadata of the exporting template; the metadata of the export template refers to a file suffix name of the export template, a name of the export template, and a code of the export template.

S4, sending out a lead-out instruction through page triggering;

s5, rendering the data model by a Freemarker template engine;

and S6, the Freemarker template engine generates data and downloads the WPS document to the user computer, and the variable content of the Freemarker template engine corresponding to the downloaded page is automatically replaced or filled in the downloaded WPS document.

The template is a file with a format, the format in the template is a format expected by a user, but data in the template needs to be managed by a Freemarker template engine, for example, names of students, three pages can be written in the template, on the premise that the three pages belong to variables of the Freemarker template engine, and the downloaded WPS data is the names of the students displayed on a page opened by the user instead of the three pages. If the variable of the Freemarker template engine variable about the names of the students is 'name', the 'name' needs to be written in the WPS document newly built by the user, and all the names of the students displayed on the user opening page can be automatically filled in the position corresponding to the name in the downloaded WPS data.

The developer finds the XML nodes needing to be modified, namely the template engine variables, edits the values of the XML nodes according to the requirements of the user to manage the exported templates, the exported templates become effective immediately after management, and the exported documents are rendered by the new exported templates to generate downloaded documents. Under the domestic CPU and operating system, the document in XML format is modified in font format, content, typesetting and template engine variables.

A user needs to lead out a button or a hyperlink used for triggering the lead-out is configured on a page of the WPS document, the user clicks the button or the hyperlink to send out a lead-out downloading instruction, an operating system finds out a path where a lead-out template is located according to a Freemarker template engine, a data model is transmitted to the Freemarker template engine, the data is generated and downloaded to a user computer through the rendering of the Freemarker template engine, the user opens the downloaded WPS document locally, namely, the data and the format which are the same as those on a webpage can be displayed, the format refers to a document format but not a file format, the document format is indentation, thickening, italics and the like, and the file format is also the WPS file format of the WPS. For example, in a homemade operating system, a user clicks a download file button, and the system calls a Freemarker template engine to replace or fill in data.

Example 2:

the system for exporting the WPS based on the domestic CPU and the operating system comprises,

the system comprises a new establishing module, a processing module and a processing module, wherein the new establishing module is used for establishing a WPS document, setting the format of the WPS document and taking a data content part needing to be filled or replaced as a Freemarker template engine variable; the format of the WPS document refers to a title of the WPS document, a paragraph of the WPS document, a table of the WPS document and a row and column of the WPS document;

the additional storage module is used for additionally storing the WPS document containing the Freemarker template engine variable into a document in an XML format;

the uploading module is used for newly building a exporting template in a domestic CPU and an operating system, uploading the XML format document to the exporting template and setting metadata of the exporting template; the metadata of the export template refers to a file suffix name of the export template, a name of the export template and a code of the export template;

the trigger module is used for sending out a lead-out instruction through page triggering;

the rendering module is used for rendering the data model by a Freemarker template engine;

and the downloading module is used for generating data by the Freemarker template engine, downloading the WPS document to the user computer, and automatically replacing or filling variable contents of the Freemarker template engine corresponding to the downloaded page into the downloaded WPS document.

The trigger module in this embodiment is configured with a button or a hyperlink for triggering export, and clicks the button or the hyperlink to send an export download instruction, the operating system finds a path where the export template is located according to the Freemarker template engine, and transmits the data model to the Freemarker template engine, and through rendering by the Freemarker template engine, data is generated and downloaded as a WPS document to the user computer, and the user opens the downloaded WPS document locally, so that data and a format identical to those on the webpage can be displayed.

In the embodiment, under a domestic CPU and an operating system, the font format, the content, the typesetting and the template engine variable are modified for the document in the XML format;

the template engine variable of the embodiment edits the value of the XML node according to the requirement of the user to manage the export template, the export template takes effect immediately after management, and the document exported again is rendered by the new export template to generate the download document.

Example 3:

embodiments of the present invention further provide a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions are loaded by a processor, so that the processor executes the method for deriving the WPS based on a domestic CPU and an operating system in any embodiment of the present invention. Specifically, a system or an apparatus equipped with a storage medium on which software program codes that realize the functions of any of the above-described embodiments are stored may be provided, and a computer (or a CPU or MPU) of the system or the apparatus is caused to read out and execute the program codes stored in the storage medium.

In this case, the program code itself read from the storage medium can realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.

Examples of the storage medium for supplying the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RYM, DVD-RW, DVD + RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer via a communications network.

Further, it should be clear that the functions of any one of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform a part or all of the actual operations based on instructions of the program code.

Further, it is to be understood that the program code read out from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion unit connected to the computer, and then causes a CPU or the like mounted on the expansion board or the expansion unit to perform part or all of the actual operations based on instructions of the program code, thereby realizing the functions of any of the above-described embodiments.

Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于markdown语法扩展的文本编辑方法与系统

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!