CN101976255A - Method and device for large-quantity export of webpage information to generate WORD document - Google Patents

Method and device for large-quantity export of webpage information to generate WORD document Download PDF

Info

Publication number
CN101976255A
CN101976255A CN 201010526163 CN201010526163A CN101976255A CN 101976255 A CN101976255 A CN 101976255A CN 201010526163 CN201010526163 CN 201010526163 CN 201010526163 A CN201010526163 A CN 201010526163A CN 101976255 A CN101976255 A CN 101976255A
Authority
CN
China
Prior art keywords
word document
request
control layer
logic control
database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 201010526163
Other languages
Chinese (zh)
Other versions
CN101976255B (en
Inventor
高万林
张树亮
臧金玉
卢帅州
赵佳宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Agricultural University
Original Assignee
China Agricultural University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Agricultural University filed Critical China Agricultural University
Priority to CN2010105261635A priority Critical patent/CN101976255B/en
Publication of CN101976255A publication Critical patent/CN101976255A/en
Application granted granted Critical
Publication of CN101976255B publication Critical patent/CN101976255B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method and a device for the large-quantity export of webpage information to generate a WORD document. The method comprises the steps of: receiving a request of specific contents sent by a JAP page; processing the request and returning a processing result to the JSP page; determining request information of the displayed specific contents according to the processing result of the JSP page, and sending the request information to a logic control layer; according to the request information of the displayed specific contents in document, inquiring a database through the logic control layer, and encapsulating and transferring an inquiry result to java2word; and automatically writing information, represented by the encapsulated inquiry result, in a WORD document of a user-specified directory through the java2word. Based on the integration, development and utilization of the prior art, the method and the device according to the invention can store, process and encapsulate a larger quantity of information, is capable of encapsulating and exporting various inquired information in large quantity to generate the WORD document, and has good compatibility, stability and little possibility of error.

Description

Info web is derived the method and apparatus that generates the WORD document in batches
Technical field
The present invention relates to the processing data information technical field, relate in particular to a kind of info web and derive the method and apparatus that generates the WORD document in batches.
Background technology
About the read-write of WORD document, JAVA has a lot of plug-in units, comprises poi, java2Word, jacob, itext, rtf or the like at present, and wherein java2word is an assembly that calls MS Office Word document in the java program.This assembly provides one group of simple interface, so that its service operations Word document of java routine call.These services comprise: opening document, new document, search literal, Alternate text, insert literal, insert picture, insert form, insert literal at the bookmark place, insert picture, insert form, padding data in form, read list data etc.
The JSP technology uses the JAVA programming language to write tags and the scriptlets of class XML, encapsulates the processing logic that produces dynamic web page.Webpage can also be present in the applied logic of the resource of service end by tags and scriptlets visit.JSP supports reusable design based on assembly with webpage logical and webpage design and display separation, exploitation based on the application program of Web is become rapidly and easily.
Hibernate is the Object Relation Mapping framework of an open source code, and it has carried out the very object encapsulation of lightweight to JDBC, makes java applet person arbitrary use object programming thinking to come the manipulation data storehouse.Hibernate can be applied in the occasion of any use JDBC, both can use at the client-side program of Java, use in also can using at the Web of Servlet/JSP, tool revolution meaning be, Hibernate can replace CMP in the J2EE framework of using EJB, finish the important task of data persistence.
In summary, above several technology all be independent technology, wherein the java2word compatibility relatively poor, report an error easily, poor stability.And this assembly occurs mistake easily and does not have special article or technology that these several technology are carried out the integration and development utilization in use, and the various information encapsulation back that is used for inquiring is derived generation WORD document in batches.
Summary of the invention
The object of the present invention is to provide a kind of info web to derive the method and apparatus that generates the WORD document in batches.Based on the present invention, can realize that the various information encapsulation back batch derivation that will inquire generates the WORD document, and have good compatibility and poor stability.
A kind of info web of the present invention is derived the method that generates the WORD document in batches, comprises the steps: request step, that the logic control layer receives is that the JSP page sends, will be in the WORD document request of shown particular content; Described request is handled, result is returned the described JSP page; Determining step according to the described result of returning the JSP page, is determined the solicited message of shown particular content in the WORD document, and this solicited message is sent to described logic control layer; Query steps, described logic control layer according to described in the WORD document solicited message of shown particular content in database, inquire about, and will Query Result pass to java2word after the encapsulation; Write step, the represented information of Query Result after will encapsulating automatically by java2word is write the WORD document of access customer assigned catalogue.
The method of above-mentioned generation WORD document in the preferred described request step, describedly is treated to described request: described logic control layer processes said request, carry out data manipulation by Hibernate, and finish mutual with database; And pass to the described JSP page after the data encapsulation that Hibernate is returned it is shown.
The method of above-mentioned generation WORD document, in the preferred described query steps, according to described in the WORD document solicited message of shown particular content, inquire about in database and be specially: the logic control layer utilizes Hibernate to inquire about to obtain the data that will derive from database, pass to java2word after the data encapsulation that it is returned again.
On the other hand, a kind of info web of the present invention is derived the device that generates the WORD document in batches, comprising: request module, determination module, enquiry module and writing module.Request module be used for the logic control layer receive that the JSP page sends, will be in the request of the shown particular content of WORD document; Described request is handled, result is returned the described JSP page; Determination module is used for determining the solicited message of shown particular content in the WORD document according to the described result of returning the JSP page, and this solicited message is sent to described logic control layer; Enquiry module is used for described logic control layer to be inquired about in database according to described solicited message at the shown particular content of WORD document, and will pass to java2word after the Query Result encapsulation; The represented information of Query Result after writing module is used for will encapsulating automatically by java2word is write the WORD document of access customer assigned catalogue.
The device of above-mentioned generation WORD document in the preferred described request module, describedly is treated to described request: described logic control layer processes said request, carry out data manipulation by Hibernate, and finish mutual with database; And pass to the described JSP page after the data encapsulation that Hibernate is returned it is shown.
The device of above-mentioned generation WORD document, in the preferred described enquiry module, according to described in the WORD document solicited message of shown particular content, inquire about being specially in database: the logic control layer utilizes Hibernate to inquire about to obtain the data that will derive from database.
In terms of existing technologies, the present invention integrates, develops and utilize prior art, and with deposit, processing, encapsulation mass data, the various information encapsulation back that can inquire derivation in batches generates the WORD document; Compatible and good stability, be not easy to report an error.
Description of drawings
Fig. 1 derives the flow chart of steps of the method that generates the WORD document in batches for a kind of info web of the present invention;
Fig. 2 derives the method embodiment schematic diagram that generates the WORD document in batches for a kind of info web of the present invention;
Fig. 3 derives in batches for a kind of info web of the present invention in the method that generates the WORD document, the Hibernate operational flow diagram;
Fig. 4 derives the structural representation of the device embodiment that generates the WORD document in batches for a kind of info web of the present invention.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
With reference to Fig. 1, Fig. 1 derives the flow chart of steps of the method that generates the WORD document in batches for a kind of info web of the present invention; Comprise: request step S110, logic control layer receive that the JSP page sends, will be in the WORD document request of shown particular content; Described request is handled, result is returned the described JSP page; Determining step S120 according to the described result of returning the JSP page, determines the solicited message of shown particular content in the WORD document, and this solicited message is sent to described logic control layer; Query steps S130, described logic control layer according to described in the WORD document solicited message of shown particular content in database, inquire about, and will Query Result pass to java2word after the encapsulation; Write step S140, the represented information of Query Result after will encapsulating automatically by java2word is write the WORD document of access customer assigned catalogue.
Below by Fig. 2 and concrete embodiment, technical scheme of the present invention is described in further detail.
Deriving generation WORD document with certain webpage information data is example:
Fig. 2 derives the schematic flow sheet that generates WORD for enforcement of the present invention provides information, and as shown in Figure 2, the data of present embodiment derive generation WORD and may further comprise the steps:
Step 001: the user sends to the logic control layer by the page after click selecting to want content displayed in the JSP page and wants request of data.System's page shows the user with data message with multi-form, and the user selects in the JSP page to click inquire button the logic control layer is submitted in request after the information in the modules such as drop-down menu, tabulation, multiselect frame by clicking.
Step 002: the logic control layer is handled after receiving 001 request of data of sending.The logic control layer receives in the request of solicited message post analysis process user needs information inquiring, calls Hibernate and database interaction.
Step 003: carry out data manipulation by Hibernate, finish mutual with database, return and ask the information corresponding data.Fig. 3 is the Hibernate operational flow diagram, Hibernate carries out mutual with database in the back of calling that receives the logic control layer by its inner class libraries and method sessionFactory, openSession, beginTransaction, createQuery etc., finish query manipulation, thereby obtain and the solicited message information corresponding.
Step 004: pass to the JSP page after the information processing encapsulation that the logic control layer returns Hibernate in 003.When Hibernate in 003 obtain with solicited message information corresponding data after, the logic control layer with these information datas handle be encapsulated into the JSP page can data information displayed, as various header list collection or details collection, then it is passed to the JSP page.
The step 005:JSP page receives in 004 after the data of transmitting its demonstration.After the JSP page receives in 004 the information of transmitting, combine with page elements, label etc. with methods such as circulations by minority JSP logic control code it is showed user's selection of reading.
Step 006: after the user clicked in the JSP page and selects to want derived data, the JSP page sent the derived data request to the logic control layer.Data in 005 are illustrated in the JSP page with forms such as tabulation, drop-down menus, and the user selects the JSP page by clicking.
Step 007: the logic control layer is handled after receiving the request of sending in 006, utilizes Hibernate to inquire about from database to obtain the data that will derive.The logic control layer utilizes class libraries and the method mentioned in 003 mutual in database, inquires about obtaining the data corresponding with it from database according to the solicited message in 006.
Step 008: pass to java2word after the data encapsulation that Hibernate in 007 is returned.Wherein the encapsulation of data is finished at the logic control layer, and the content of encapsulation comprises message header, content etc., and the data mode after the encapsulation is set, array, character string and binary data.
Step 009:java2word writes the WORD document in access customer assigned catalogue or the catalogue with the data that pass in 008.Method by class Document among the com.heavenlake.wordapi.* among the java2word has insert, insertln, mergeCell, replace, replaceAll, newDoc, find, replaceTable, open, saveAs, setStyle, insertAtBookmark etc.Wherein insert can write data into the WORD document of appointment.The Insert method can be write information such as text, picture in the WORD document, data encapsulation can be become data acquisition when writing, and can give these data acquisitions more additional WORD patterns simultaneously; The Open method can be opened the WORD document under the assigned catalogue, and the saveAs method can will be write the WORD document storage in assigned catalogue.Additive method is responsible for searching accordingly, replacement, additional formats etc.
Data derive the cardinal principle flow process that generates the WORD system: as Fig. 2, the user sends the request that will show particular content by the operation JSP page to the logic control layer, carry out data manipulation by Hibernate after the request that the logic control layer sends, finish mutual with database.The data encapsulation that the logic control layer returns Hibernate passes to the JSP page afterwards it is shown, the user operates the JSP page and selects to want derived data to send the derived data request to the logic control layer, the logic control layer receives request aftertreatment request, utilize Hibernate from database, to inquire about to obtain the data that will derive, pass to java2word after the data encapsulation that it is returned again, automatically these data are write in the WORD document in the access customer assigned catalogue by java2word.
With reference to Fig. 3, Fig. 3 derives in batches for a kind of info web of the present invention in the method that generates the WORD document, the Hibernate operational flow diagram;
1. after configuring the configuration file and the configuration file corresponding of hibernate, start server with class.
2. server reads the deploy content of hibernate.cfg.xml file by instantiation Configeration object, and builds up table or set up mapping relations (* * * .hbm.xml) with table according to relevant demand.
3. just the sessionFactory example can be set up by the Configeration object of instantiation, further, the session object can be created by the sessionFactory example.
4. obtain after the session, just can carry out additions and deletions to database changes to look into and has operated, except the full-text search of more complicated, shirtsleeve operation can realize by the packaged session built-in method of hibernate, Query (result set) as inquiry is returned can change or be packaged into corresponding data types again with Query.
5. by Transaction deal with data and various unusual.
With reference to Fig. 4, Fig. 4 calls the structural representation that database data generates the device embodiment of statistical graph automatically for the present invention is a kind of.Comprise: request module 40, affirmation module 42, enquiry module 44 and writing module 46.
Wherein: request module 40 is used for the user and sends the request that will show particular content to the logic control layer by the operation JSP page; Confirm module 42, carry out data manipulation by Hibernate after the request that the logic control layer sends, finish mutual with database; The data encapsulation that the logic control layer returns Hibernate passes to the JSP page afterwards it is shown; Enquiry module 44, being used for the user operates the JSP page and selects to want derived data to the request of logic control layer transmission derived data, the logic control layer receives request aftertreatment request, utilize Hibernate from database, to inquire about to obtain the data that will derive, pass to java2word after the data encapsulation that it is returned again; Writing module 46 is used for these data being write in the WORD document of access customer assigned catalogue automatically by java2word.
In sum, the present invention has following characteristics:
The first, method provided by the invention can be presented at information to display in the JSP page by demand: information is shown to the JSP page asks to realize by logic control layer processing page transmission user, mutual by Hibernate and database, inquiry needing to obtain display message that it is shown in the JSP page.
The second, the user selects the information that will derive, clicks derivation button in the page and information can be exported in the WORD document in the assigned catalogue or in the catalogue.Being divided into information derivation generation WORD document is to handle the request that the JSP page transmits by the logic control layer, mutual by Hibernate and database, inquiry to need to obtain the information that derives that its encapsulation back is exported in the WORD document in user's designated directory or the catalogue by java2word.
Need to prove that here the principle of device embodiment is identical with method embodiment, relevant part does not repeat them here mutually with reference to getting final product.
More than a kind of info web provided by the present invention derived the method and apparatus that generates the WORD document in batches describe in detail, used specific embodiment herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, part in specific embodiments and applications all can change.In sum, this description should not be construed as limitation of the present invention.

Claims (6)

1. an info web is derived the method that generates the WORD document in batches, it is characterized in that, comprises the steps:
That request step, logic control layer receive is that the JSP page sends, will be in the WORD document request of shown particular content; Described request is handled, result is returned the described JSP page;
Determining step according to the described result of returning the JSP page, is determined the solicited message of shown particular content in the WORD document, and this solicited message is sent to described logic control layer;
Query steps, described logic control layer according to described in the WORD document solicited message of shown particular content in database, inquire about, and will Query Result pass to java2word after the encapsulation;
Write step, the represented information of Query Result after will encapsulating automatically by java2word is write the WORD document of access customer assigned catalogue.
2. the method for generation according to claim 1 WORD document is characterized in that, in the described request step, described described request is treated to:
Described logic control layer processes said request carried out data manipulation by Hibernate, finishes mutual with database; And pass to the described JSP page after the data encapsulation that Hibernate is returned it is shown.
3. the method for generation according to claim 2 WORD document is characterized in that, in the described query steps, according to described in the WORD document solicited message of shown particular content, in database, inquire about being specially:
The logic control layer utilizes Hibernate to inquire about to obtain the data that will derive from database, pass to java2word after the data encapsulation that it is returned again.
4. an info web is derived the device that generates the WORD document in batches, it is characterized in that, comprising:
Request module, be used for the logic control layer receive that the JSP page sends, will be in the request of the shown particular content of WORD document; Described request is handled, result is returned the described JSP page;
Determination module is used for determining the solicited message of shown particular content in the WORD document according to the described result of returning the JSP page, and this solicited message is sent to described logic control layer;
Enquiry module is used for described logic control layer and inquires about in database according to described solicited message at the shown particular content of WORD document, and will pass to java2word after the Query Result encapsulation;
Writing module, the represented information of Query Result after being used for will encapsulating automatically by java2word is write the WORD document of access customer assigned catalogue.
5. the device of generation according to claim 4 WORD document is characterized in that, in the described request module, described described request is treated to:
Described logic control layer processes said request carried out data manipulation by Hibernate, finishes mutual with database; And pass to the described JSP page after the data encapsulation that Hibernate is returned it is shown.
6. the device of generation according to claim 5 WORD document is characterized in that, in the described enquiry module, according to described in the WORD document solicited message of shown particular content, in database, inquire about being specially:
The logic control layer utilizes Hibernate to inquire about to obtain the data that will derive from database.
CN2010105261635A 2010-10-25 2010-10-25 Method and device for large-quantity export of webpage information to generate WORD document Expired - Fee Related CN101976255B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010105261635A CN101976255B (en) 2010-10-25 2010-10-25 Method and device for large-quantity export of webpage information to generate WORD document

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010105261635A CN101976255B (en) 2010-10-25 2010-10-25 Method and device for large-quantity export of webpage information to generate WORD document

Publications (2)

Publication Number Publication Date
CN101976255A true CN101976255A (en) 2011-02-16
CN101976255B CN101976255B (en) 2012-07-04

Family

ID=43576141

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010105261635A Expired - Fee Related CN101976255B (en) 2010-10-25 2010-10-25 Method and device for large-quantity export of webpage information to generate WORD document

Country Status (1)

Country Link
CN (1) CN101976255B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104504160A (en) * 2015-01-20 2015-04-08 中国地质大学(武汉) Excel document online batch write-in method based on SSH frame
CN104750796A (en) * 2014-11-13 2015-07-01 安徽四创电子股份有限公司 Method for leading out Word under BS system
CN109783480A (en) * 2018-12-19 2019-05-21 深圳供电局有限公司 It is a kind of to dispatch method and system, the electronic equipment, medium that annual report generates

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101004863A (en) * 2006-12-25 2007-07-25 杨贻方 Audio journal
CN101446965A (en) * 2008-12-31 2009-06-03 中国建设银行股份有限公司 Data query method and system thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101004863A (en) * 2006-12-25 2007-07-25 杨贻方 Audio journal
CN101446965A (en) * 2008-12-31 2009-06-03 中国建设银行股份有限公司 Data query method and system thereof

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《http://download.csdn.net/source/273152》 20071030 FAT0708 Java2Word 第1页 1-6 , 2 *
《http://ll-feng.iteye.com/blog/345873》 20090309 11_feng 利用JSP将数据导出到word文档 第1-2页 1-6 , 2 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104750796A (en) * 2014-11-13 2015-07-01 安徽四创电子股份有限公司 Method for leading out Word under BS system
CN104504160A (en) * 2015-01-20 2015-04-08 中国地质大学(武汉) Excel document online batch write-in method based on SSH frame
CN109783480A (en) * 2018-12-19 2019-05-21 深圳供电局有限公司 It is a kind of to dispatch method and system, the electronic equipment, medium that annual report generates

Also Published As

Publication number Publication date
CN101976255B (en) 2012-07-04

Similar Documents

Publication Publication Date Title
CN102902733B (en) A kind of information-pushing method based on content subscription, Apparatus and system
CN1703701B (en) Apparatus for managing a collection of portlets in a portal server
US7080092B2 (en) Application view component for system integration
US7213049B2 (en) System and method for transaction processing with transaction property feature
US20060053120A1 (en) Web service registry and method of operation
US8443374B2 (en) Business application integration adapters management system
CN100520718C (en) Script order registration method, method and device for calling source program code
US20050086360A1 (en) Methods and systems for real time integration services
US8396941B2 (en) Digital living network alliance (DLNA) server that serves contents from IVL services
CN107679071B (en) Relational database-oriented general data service customized packaging method
WO2010008950A1 (en) Systems and methods for distributed asset management having tagging capabilities
CN101208649A (en) Recording and tracing non-trending production data and events in an industrial process control environment
AU2002318249A1 (en) System and method for transaction processing with transaction property feature
CN102810057A (en) Log recording method
US7818328B2 (en) API for obtaining unambiguous representation of objects in a relational database
JP2005506618A (en) Application view components for system integration
CN101945184B (en) IVR (Interactive Voice Response) realization method and device based on NGN (Next Generation Network) network
CN101968812A (en) Method and device for automatically generating cartogram by calling database data
CN100596139C (en) System and method for building component applications using metadata defined mapping between message and data domains
CN107704256A (en) The method that Python relies on system library automation installation is realized on a kind of Ubuntu
WO2018071489A1 (en) Searching index information for application data
CN101976255B (en) Method and device for large-quantity export of webpage information to generate WORD document
CN107977419A (en) A kind of nuclear power station DCS O&Ms support file identification method and system
CN104053135B (en) A kind of method and device for realizing unstructured supplementary data traffic
CN112084247A (en) Method and device for extending application program service

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120704

Termination date: 20171025