CN103412765A - Method for realizing universality of data exporting interface - Google Patents
Method for realizing universality of data exporting interface Download PDFInfo
- Publication number
- CN103412765A CN103412765A CN2013103972693A CN201310397269A CN103412765A CN 103412765 A CN103412765 A CN 103412765A CN 2013103972693 A CN2013103972693 A CN 2013103972693A CN 201310397269 A CN201310397269 A CN 201310397269A CN 103412765 A CN103412765 A CN 103412765A
- Authority
- CN
- China
- Prior art keywords
- data
- interface
- export interface
- data export
- versatility
- 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.)
- Pending
Links
Images
Landscapes
- Stored Programmes (AREA)
Abstract
The invention discloses a method for realizing universality of a data exporting interface. According to the method, by defining a data exporting interface category, the data exporting interface is subjected to expansion, the received data current is matched with a corresponding data exporting interface, and the data current is converted into file current to be output onto the browser client end, so that the export of a file in any format can be realized. Test proves that the method is recognized to be stable and high-efficient, and the method is not limited by the problem of difference between any other browsers and clustering data, therefore the method can be used for providing convenience for carrying out the export of clustering data in a developing environment based on J2EE.
Description
Technical field
The present invention relates to man-machine switching technology field, particularly a kind of method that realizes data export interface versatility.
Background technology
Because the J2EE platform has the potential quality of the business system that builds scalability, dirigibility, ease for maintenance, it more and more is subject to enterprise customer's trust.
But existing the service of deriving does not also realize certain versatility based on the system under the J2EE development environment, when the data of different functions derive, need to write corresponding different derivation service code, causes the developer to this function waste energy and time.
In view of this, prior art awaits further improvement.
Summary of the invention
In view of above-mentioned the deficiencies in the prior art part, the object of the present invention is to provide a kind of method that realizes data export interface versatility, with data export interface in the solution prior art, can not realize the defect of versatility, a kind of method that realizes data export interface versatility is provided, realize the derivation of arbitrary format file, improved the universal performance of data export interfaces.
In order to achieve the above object, the present invention has taked following technical scheme:
A kind of method that realizes data export interface versatility wherein, said method comprising the steps of:
A, definition data export interface class; The parameter of described data export interface class comprises: be used to parameter and the output stream parameter that collective data is set;
B, growth data export interface, and receive the data stream corresponding with deriving Format Type;
C, the data stream received in step B is complementary with corresponding data export interface;
D, convert described data stream to document flow, output to browser client, user's download is provided.
The described method that realizes data export interface versatility, wherein, adopt the source code of the I/O interface of JAVA bottom to carry out the expansion of data export interface in described step B.
The described method that realizes data export interface versatility, wherein, in described step C, utilize JAVA the I/O interface convert data stream to document flow.
The described method that realizes data export interface versatility, wherein, in described step B, the mode of growth data export interface comprises: inherit base interface and additional interface.
The described method that realizes data export interface versatility, wherein, in described step C, specifically comprise: automatically according to the Format Type of derived data stream, select the data export interface be complementary with it or select according to the Format Type of user-defined derived data stream the data export interface be complementary with it.
A kind of method that realizes data export interface versatility provided by the invention, by defining the data export interface class of a versatility, then this interface class is expanded, make its data that can support different-format derive Format Type, thereby can realize the derivation of arbitrary format file, derive and to provide convenience carrying out collective data for the software based under the J2EE development environment.
The accompanying drawing explanation
Fig. 1 is a kind of flow chart of steps that realizes the method for data export interface versatility provided by the invention.
Fig. 2 is a kind of method step figure that realizes the method specific embodiment of data export interface versatility provided by the invention.
Embodiment
The invention provides a kind of method that realizes data export interface versatility.For making purpose of the present invention, technical scheme and effect clearer, clear and definite, the present invention is described in more detail referring to the accompanying drawing examples.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
As shown in Figure 1, the invention provides a kind of method that realizes data export interface versatility, said method comprising the steps of:
S1, definition data export interface class; The parameter of described data export interface class comprises: be used to parameter and the output stream parameter that collective data is set.
In order to realize the versatility of data export interface, at first select the data export interface that definition is a series of and the various type of all derivation is corresponding, be used to deriving the data stream of arbitrary format type, for following steps are prepared.
Described data export interface class has two parameters.First parameter is the general shape parameter of abstract class, and it arranges concrete collective data for the user, comprises title that export is set and the content item of export; Another parameter is output stream, for finally data stream being printed to client browser, for the user, download, this parameter is exactly the interior bank interface class of the primary bag of a foreground httpservletreponse(java web javax.servlet.ServletResponse in fact) a front-end output stream.
S2, growth data export interface, and receive the data stream corresponding with deriving Format Type.
In this step, the growth data export interface is for deriving the data stream of arbitrary format type, therefore its data export interface need to meet with the data stream of any derivation Format Type and is complementary, in embodiment, additional data export interface is carried out in its source code of inheriting base interface and the I/O interface by adopting the JAVA bottom.
S3, the data stream received in step S2 is complementary with corresponding data export interface.
Data export interface after the data stream that receives in above-mentioned steps and expansion is complementary, finds out with this data stream and derive the corresponding data export interface of Format Type.
S4, convert described data stream to document flow, output to browser client, user's download is provided.
After in above-mentioned steps, finding the data export interface corresponding with data stream derivation Format Type, corresponding different Format Type is derived this data stream.The Format Type of described data stream may be: excel, pdf, txt etc., the data export interface converts data stream to document flow, and is transferred to the client browser on foreground, downloads for the client.
Concrete, the method provided by the I/O interface that utilizes JAVA in this step converts data stream to the data stream of specified format.
As shown in Figure 2, a kind of concrete Application Example method step of method figure that realizes data export interface versatility provided by the invention, as shown in the figure:
H1, at first selected one group of collective data that the user need to derive;
H2, call the ExportService export interface, transmit data export interface parameter;
H3, the title hurdle being set with String[] array forms, and then the value of the corresponding every row of collective data is set;
The derivation form that H4, data export interface are selected according to the user derives corresponding data stream or selection is corresponding with data to be exported stream automatically, and the browser spanned file that flows to that generates different file layouts is downloaded.
Below illustrate:
Existing one group of user's collective data:
List<User> userList =new ArrayList<User>();
User user = new User();
user.addId(1);
User.addUserName (" Zhang San ");
user.addId(2);
User.addUserName (" Li Si ");
user.addId(3);
User.addUserName (" king five ");
The developer is at first by following function call data export interface provided by the invention:
.exportService.write(new AbstractDataSource<Map<String, Object>>(userlist){
Then title hurdle information first is set:
TabHead[0]=" Customs Assigned Number "
TabHead[1]=" address name "
Then every row respective value of collective data is set:
String[] dataFields=new String[getHeads().length];
dataFields[0]=item.get(“schoolName”).toString();
dataFields[1]=item.get(“className”).toString();
The data export interface can complete remaining work, according to the derived type of user's selection: excel, and txt, pdf etc. derive corresponding formatted file.
A kind of method that realizes data export interface versatility provided by the invention, by definition data export interface class, expand the data export interface, and receive the data stream corresponding with deriving Format Type; The data stream received is complementary and converts described data stream to document flow with corresponding data export interface, output to browser client, thereby can realize the derivation of arbitrary format file, described method performance provided by the invention is through test, regard as stable, efficient, therefore and be not subjected to the restriction of any other browser problem different with collective data, can derive and provide convenience carrying out collective data for the software based under the J2EE development environment.
Be understandable that, for those of ordinary skills, can be equal to replacement or change according to technical scheme of the present invention and inventive concept thereof, and all these changes or replacement all should belong to the protection domain of the appended claim of the present invention.
Claims (5)
1. a method that realizes data export interface versatility, is characterized in that, said method comprising the steps of:
A, definition data export interface class; The parameter of described data export interface class comprises: be used to parameter and the output stream parameter that collective data is set;
B, growth data export interface, and receive the data stream corresponding with deriving Format Type;
C, the data stream received in step B is complementary with corresponding data export interface;
D, convert described data stream to document flow, output to browser client, user's download is provided.
2. realize according to claim 1 the method for data export interface versatility, it is characterized in that, in described step B, adopt the source code of the I/O interface of JAVA bottom to carry out the expansion of data export interface.
3. realize according to claim 1 the method for data export interface versatility, it is characterized in that, in described step C, utilize JAVA the I/O interface convert data stream to document flow.
4. realize according to claim 1 the method for data export interface versatility, it is characterized in that, in described step B, the mode of growth data export interface comprises: inherit base interface and additional interface.
5. realize according to claim 4 the method for data export interface versatility, it is characterized in that,
In described step C, specifically comprise: automatically according to the Format Type of derived data stream, select the data export interface be complementary with it or select according to the Format Type of user-defined derived data stream the data export interface be complementary with it.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2013103972693A CN103412765A (en) | 2013-09-04 | 2013-09-04 | Method for realizing universality of data exporting interface |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2013103972693A CN103412765A (en) | 2013-09-04 | 2013-09-04 | Method for realizing universality of data exporting interface |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103412765A true CN103412765A (en) | 2013-11-27 |
Family
ID=49605778
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2013103972693A Pending CN103412765A (en) | 2013-09-04 | 2013-09-04 | Method for realizing universality of data exporting interface |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103412765A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107395784A (en) * | 2017-08-02 | 2017-11-24 | 郑州云海信息技术有限公司 | The method and apparatus that a kind of batch imports Internet protocol IP pond |
CN116821166A (en) * | 2023-08-31 | 2023-09-29 | 云筑信息科技(成都)有限公司 | Distributed data export method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6195662B1 (en) * | 1997-06-27 | 2001-02-27 | Juxtacomm Technologies Inc. | System for transforming and exchanging data between distributed heterogeneous computer systems |
US6381600B1 (en) * | 1999-09-22 | 2002-04-30 | International Business Machines Corporation | Exporting and importing of data in object-relational databases |
CN101247589A (en) * | 2007-07-04 | 2008-08-20 | 华为技术有限公司 | Mobile terminal data conversion/backup method, device and system |
CN101944128A (en) * | 2010-09-25 | 2011-01-12 | 中兴通讯股份有限公司 | Data export and import method and device |
CN103092993A (en) * | 2013-02-18 | 2013-05-08 | 五八同城信息技术有限公司 | Data exporting method and data exporting device |
-
2013
- 2013-09-04 CN CN2013103972693A patent/CN103412765A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6195662B1 (en) * | 1997-06-27 | 2001-02-27 | Juxtacomm Technologies Inc. | System for transforming and exchanging data between distributed heterogeneous computer systems |
US6381600B1 (en) * | 1999-09-22 | 2002-04-30 | International Business Machines Corporation | Exporting and importing of data in object-relational databases |
CN101247589A (en) * | 2007-07-04 | 2008-08-20 | 华为技术有限公司 | Mobile terminal data conversion/backup method, device and system |
CN101944128A (en) * | 2010-09-25 | 2011-01-12 | 中兴通讯股份有限公司 | Data export and import method and device |
CN103092993A (en) * | 2013-02-18 | 2013-05-08 | 五八同城信息技术有限公司 | Data exporting method and data exporting device |
Non-Patent Citations (3)
Title |
---|
倪一鸣: "统一数据接口", 《科技信息》, 10 January 2008 (2008-01-10) * |
刘珊: "基于.NET的数据导出和导入通用类设计", 《电脑编程技巧与维护》, 31 October 2005 (2005-10-31) * |
吴岚,江永斌: "delphi语言在SQL2000数据库开发和维护中的应用", 《武汉船舶职业技术学院学报》, 31 December 2009 (2009-12-31) * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107395784A (en) * | 2017-08-02 | 2017-11-24 | 郑州云海信息技术有限公司 | The method and apparatus that a kind of batch imports Internet protocol IP pond |
CN107395784B (en) * | 2017-08-02 | 2021-07-27 | 郑州云海信息技术有限公司 | Method and device for importing internet protocol IP pools in batches |
CN116821166A (en) * | 2023-08-31 | 2023-09-29 | 云筑信息科技(成都)有限公司 | Distributed data export method |
CN116821166B (en) * | 2023-08-31 | 2023-12-08 | 云筑信息科技(成都)有限公司 | Distributed data export method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103955364B (en) | A kind of front end assemblies method suitable for mobile phone | |
CN104133772B (en) | Automatic test data generation method | |
CA3099664C (en) | Cloud-edge topologies | |
US7720953B2 (en) | System and method of data source detection | |
US20120159468A1 (en) | Software deployment to multiple computing devices | |
US20130275958A1 (en) | Automatic identification of services | |
JP6616774B2 (en) | Anti-malware type mobile content data management apparatus and method | |
CN104346184A (en) | Application packaging device and application packaging method | |
CN104219198B (en) | A kind of tamper resistant method of WebApp | |
CN104484216A (en) | Method and device for generating service interface document and on-line test tool | |
CN103077024A (en) | Device and method for supporting customization and running of software-as-a-service (SaaS) application processes | |
CN103914290A (en) | Operating command processing method and device | |
CN104461531A (en) | Implementing method for self-defined functions of reporting system | |
US20140282394A1 (en) | Invocation of external web services using dynamically generated composite applications | |
CN100596139C (en) | System and method for building component applications using metadata defined mapping between message and data domains | |
CN107797823A (en) | Business Rule Management method, apparatus, storage medium and computer equipment | |
CN101673299B (en) | ERP system and data search method and device thereof | |
CN102156650B (en) | Method and device capable of implementing automatic analysis of patch | |
CN102999329B (en) | The Active Directory interface exploitation method of configuration is mapped based on extend markup language | |
CN103412765A (en) | Method for realizing universality of data exporting interface | |
CN102385516B (en) | Method for designing reconfigurable radio frequency identification (RFID) middleware based on cloud server | |
CN111241000B (en) | Layered automatic testing method based on cucumber testing tool | |
US20140324918A1 (en) | Database Generation System, Method For Generating A Database, Product Line Management System And Non-Transitory Data Carrier | |
US7716653B2 (en) | Configurable importers and resource writers for converting data into another format | |
CN106201744A (en) | The method realizing in componentization system calling RESTful 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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20131127 |
|
RJ01 | Rejection of invention patent application after publication |