CN101976255B - 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
CN101976255B
CN101976255B CN2010105261635A CN201010526163A CN101976255B CN 101976255 B CN101976255 B CN 101976255B CN 2010105261635 A CN2010105261635 A CN 2010105261635A CN 201010526163 A CN201010526163 A CN 201010526163A CN 101976255 B CN101976255 B CN 101976255B
Authority
CN
China
Prior art keywords
word document
control layer
logic control
request
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.)
Expired - Fee Related
Application number
CN2010105261635A
Other languages
Chinese (zh)
Other versions
CN101976255A (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

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

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 in the java program, calls MS Office Word document.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 is used tags and the scriptlets of JAVA programming language type of writing 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 through tags and scriptlets visit.JSP supports reusable design based on assembly with webpage logical and webpage design and display separation, make exploitation based on the application program of Web become rapidly with 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 that Hibernate can replace CMP in the J2EE framework of using EJB, accomplish the important task of data persistence.
To sum up can know, above several kinds of technology all be independent technology, wherein the java2word compatibility relatively poor, report an error easily, poor stability.And this assembly occurs easily wrong and does not have special article or technology that these several kinds of technology are carried out the integration and development utilization in use, is used for the various information encapsulation back that inquires derived in batches generating the WORD document.
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, and the logic control layer receives the request that send, that will in the WORD document, show particular content of the JSP page; Described request is handled, result is returned the said JSP page; Confirm step, according to the said result of returning the JSP page, confirm in the WORD document, to show the solicited message of particular content, and this solicited message is sent to said logic control layer; Query steps, said logic control layer is inquired about in database according to the said solicited message of particular content that in the WORD document, shows, and with passing to java2word after the Query Result encapsulation; Write step, the represented information of Query Result after will encapsulating automatically through 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, saidly is treated to described request: said logic control layer processes said request, carry out data manipulation through Hibernate, and accomplish mutual with database; And pass to the said JSP page after the data encapsulation that Hibernate is returned it is shown.
The method of above-mentioned generation WORD document; In the preferred said query steps; According to the said solicited message that in the WORD document, shows particular content; In database, inquire about and be specially: the logic control layer utilizes Hibernate from database, to inquire about to obtain the data that will derive, again with passing to java2word after its data encapsulation of returning.
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 WORD particular content that document shows; Described request is handled, result is returned the said JSP page; Determination module is used for confirming in the WORD document, to show the solicited message of particular content according to the said result of returning the JSP page, and this solicited message is sent to said logic control layer; Enquiry module is used for said logic control layer to be inquired about in database according to said solicited message at WORD particular content that document shows, and with passing to java2word after the Query Result encapsulation; The represented information of Query Result after writing module is used for will encapsulating automatically through 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, saidly is treated to described request: said logic control layer processes said request, carry out data manipulation through Hibernate, and accomplish mutual with database; And pass to the said JSP page after the data encapsulation that Hibernate is returned it is shown.
The device of above-mentioned generation WORD document; In the preferred said enquiry module; According to the said solicited message that in the WORD document, shows particular content, in database, inquire about being specially: the logic control layer utilizes Hibernate from database, to inquire about to obtain the data that will derive.
In terms of existing technologies, the present invention integrates, develops and utilize prior art, to lay in, handle, to encapsulate mass data, can the various information encapsulation back batch that inquire be derived generation 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 for a kind of info web of the present invention in the method that generates the WORD document in batches, 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 make above-mentioned purpose of the present invention, feature and advantage can be more obviously understandable, below in conjunction with accompanying drawing and embodiment the present invention done further detailed explanation.
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, the logic control layer receives the request that send, that will in the WORD document, show particular content of the JSP page; Described request is handled, result is returned the said JSP page; Confirm step S120, according to the said result of returning the JSP page, confirm in the WORD document, to show the solicited message of particular content, and this solicited message is sent to said logic control layer; Query steps S130, said logic control layer is inquired about in database according to the said solicited message of particular content that in the WORD document, shows, and with passing to java2word after the Query Result encapsulation; Write step S140, the represented information of Query Result after will encapsulating automatically through java2word is write the WORD document of access customer assigned catalogue.
Through Fig. 2 and practical implementation instance, technical scheme of the present invention is done further explain below.
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 through 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 through clicking.
Step 002: the logic control layer is handled after receiving 001 request of data sent.The logic control layer receives in the request of solicited message post analysis process user needs information inquiring, and it is interactive to call Hibernate and database.
Step 003: carry out data manipulation through Hibernate, completion is mutual with database, returns 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 through its inner class libraries and method sessionFactory, openSession, beginTransaction, createQuery etc.; Accomplish 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; Like 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. it is showed user's selection of reading with methods such as circulations through minority JSP logic control code.
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.In the JSP page, the user selects the JSP page through clicking to data in 005 with presented such as tabulation, drop-down menus.
Step 007: the logic control layer is handled after receiving the request of sending in 006, utilizes Hibernate from database, to inquire about to obtain the data that will derive.The logic control layer utilizes class libraries and the method mentioned in 003 mutual in database, from database, inquires about obtaining the data corresponding with it 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 accomplished 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 through among the com.heavenlake.wordapi.* among the java2word type of Document 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, when writing, can data encapsulation be become data acquisition, 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 be with writing 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: like Fig. 2; The user sends the request that will show particular content through the operation JSP page to the logic control layer; Carry out data manipulation through Hibernate after the request that the logic control layer sends, completion is 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, with passing to java2word after its data encapsulation of returning, automatically these data are write in the WORD document in the access customer assigned catalogue again through java2word.
With reference to Fig. 3, Fig. 3 derives for a kind of info web of the present invention in the method that generates the WORD document in batches, 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 through instantiation Configeration object, and according to relevant demand build up table or and table set up mapping relations (* * * .hbm.xml).
3. just the sessionFactory instance can be set up through the Configeration object of instantiation, further, the session object can be created through the sessionFactory instance.
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 that the Query (result set) as inquiry is returned can change or be packaged into corresponding data types again with Query through the packaged session built-in method of hibernate.
5. through 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 through the operation JSP page; Confirm module 42, carry out data manipulation through Hibernate after the request that the logic control layer sends, completion is 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, again with passing to java2word after its data encapsulation of returning; Writing module 46 is used for automatically these data being write in the WORD document of access customer assigned catalogue through 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 through logic control layer processing page transmission user; Mutual through 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, and the derivation button of clicking in the page can export to information 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 through the logic control layer; Mutual through Hibernate and database, the information that inquiry obtains will needing to derive exports to its encapsulation back in the WORD document in user's designated directory or the catalogue through java2word.
Need to prove that here the principle of device embodiment is identical with method embodiment, relevant part repeats no more at this 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:
Request step, the logic control layer receives the request that send, that will in the WORD document, show particular content of the JSP page; Described request is handled, result is returned the said JSP page;
Confirm step, according to the said result of returning the JSP page, confirm in the WORD document, to show the solicited message of particular content, and this solicited message is sent to said logic control layer;
Query steps, said logic control layer is inquired about in database according to the said solicited message of particular content that in the WORD document, shows, and with passing to java2word after the Query Result encapsulation;
Write step, the represented information of Query Result after will encapsulating automatically through 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, said described request is treated to:
Said logic control layer processes said request carried out data manipulation through Hibernate, and completion is mutual with database; And pass to the said JSP page after the data encapsulation that Hibernate is returned it is shown.
3. the method for generation WORD document according to claim 2 is characterized in that, in the said query steps, according to the said solicited message that in the WORD document, shows particular content, in database, inquires about being specially:
The logic control layer utilizes Hibernate from database, to inquire about to obtain the data that will derive, again with passing to java2word after its data encapsulation of returning.
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 WORD particular content that document shows; Described request is handled, result is returned the said JSP page;
Determination module is used for confirming in the WORD document, to show the solicited message of particular content according to the said result of returning the JSP page, and this solicited message is sent to said logic control layer;
Enquiry module is used for said logic control layer and inquires about in database according to said solicited message at WORD particular content that document shows, and with passing to java2word after the Query Result encapsulation;
Writing module, the represented information of Query Result after being used for will encapsulating automatically through 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, said described request is treated to:
Said logic control layer processes said request carried out data manipulation through Hibernate, and completion is mutual with database; And pass to the said JSP page after the data encapsulation that Hibernate is returned it is shown.
6. the device of generation WORD document according to claim 5 is characterized in that, in the said enquiry module, according to the said solicited message that in the WORD document, shows particular content, in database, inquires about being specially:
The logic control layer utilizes Hibernate from database, to inquire about to obtain the data that will derive.
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 CN101976255A (en) 2011-02-16
CN101976255B true 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)

Families Citing this family (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
CN104504160B (en) * 2015-01-20 2018-06-15 中国地质大学(武汉) The online batch wiring method of Excel document based on SSH frames
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

Family Cites Families (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
CN101446965B (en) * 2008-12-31 2011-11-30 中国建设银行股份有限公司 Data query method and system thereof

Also Published As

Publication number Publication date
CN101976255A (en) 2011-02-16

Similar Documents

Publication Publication Date Title
US8375354B2 (en) System and method and apparatus for using UML tools for defining web service bound component applications
CN101065947B (en) Web service registry and method of operation
CN102902733B (en) A kind of information-pushing method based on content subscription, Apparatus and system
US7080092B2 (en) Application view component for system integration
US8443374B2 (en) Business application integration adapters management system
TW576982B (en) Programmatic management of software resources in a content framework environment
CN100520718C (en) Script order registration method, method and device for calling source program code
US8806345B2 (en) Information exchange using generic data streams
CN109408746A (en) Portrait information query method, device, computer equipment and storage medium
CN101208649A (en) Recording and tracing non-trending production data and events in an industrial process control environment
US8396941B2 (en) Digital living network alliance (DLNA) server that serves contents from IVL services
WO2010008950A1 (en) Systems and methods for distributed asset management having tagging capabilities
WO2003093977A1 (en) System and method for enterprise application interactions
EP1625468A2 (en) A framework for a composite application
US20070282616A1 (en) Systems and methods for providing template based output management
CN100596139C (en) System and method for building component applications using metadata defined mapping between message and data domains
US20070156868A1 (en) Efficient dynamic discovery of web services
EP1444609A1 (en) Application view component for system integration
CN107704256A (en) The method that Python relies on system library automation installation is realized on a kind of Ubuntu
CN101968812A (en) Method and device for automatically generating cartogram by calling database data
CN101976255B (en) Method and device for large-quantity export of webpage information to generate WORD document
WO2019043462A1 (en) Systems and methods for creating automated interface transmission between heterogeneous systems in an enterprise ecosystem
CN107977419A (en) A kind of nuclear power station DCS O&Ms support file identification method and system
CN102467502A (en) Retrieval method and system
CN104053135B (en) A kind of method and device for realizing unstructured supplementary data traffic

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

Granted publication date: 20120704

Termination date: 20171025

CF01 Termination of patent right due to non-payment of annual fee