CN101788994A - Method for constructing data display model and method and device for displaying data - Google Patents
Method for constructing data display model and method and device for displaying data Download PDFInfo
- Publication number
- CN101788994A CN101788994A CN200910162784A CN200910162784A CN101788994A CN 101788994 A CN101788994 A CN 101788994A CN 200910162784 A CN200910162784 A CN 200910162784A CN 200910162784 A CN200910162784 A CN 200910162784A CN 101788994 A CN101788994 A CN 101788994A
- Authority
- CN
- China
- Prior art keywords
- data
- definition
- xml document
- data display
- display model
- 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
- 238000000034 method Methods 0.000 title claims abstract description 63
- 230000008859 change Effects 0.000 claims description 27
- 238000012986 modification Methods 0.000 claims description 14
- 230000004048 modification Effects 0.000 claims description 14
- 238000012217 deletion Methods 0.000 claims description 13
- 230000037430 deletion Effects 0.000 claims description 13
- 238000013480 data collection Methods 0.000 claims description 10
- 230000001747 exhibiting effect Effects 0.000 claims description 9
- 230000015572 biosynthetic process Effects 0.000 claims description 5
- 239000000284 extract Substances 0.000 claims description 5
- 238000000605 extraction Methods 0.000 claims description 2
- 238000013515 script Methods 0.000 description 41
- 230000006870 function Effects 0.000 description 15
- 230000008569 process Effects 0.000 description 15
- 238000011161 development Methods 0.000 description 8
- 238000007726 management method Methods 0.000 description 8
- 235000006719 Cassia obtusifolia Nutrition 0.000 description 7
- 235000014552 Cassia tora Nutrition 0.000 description 7
- 244000201986 Cassia tora Species 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 230000004044 response Effects 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 4
- 238000013461 design Methods 0.000 description 4
- 238000004321 preservation Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 238000005538 encapsulation Methods 0.000 description 3
- 230000008676 import Effects 0.000 description 3
- 239000007787 solid Substances 0.000 description 3
- 238000013459 approach Methods 0.000 description 2
- 230000001174 ascending effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000013499 data model Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000000712 assembly Effects 0.000 description 1
- 238000000429 assembly Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a method for constructing a data display model and a method and a device for displaying data. The method for constructing the data display model comprises the following steps: sending a request for displaying data to a server; receiving an XML (extensive markup language) document of a data display model from the server, wherein the XML document of the data display model comprises a data set definition and a display style definition; creating a sheet frame according to the XML document of the data display model; sending a request for retrieving data to the server, wherein the request carries the data set definition; and receiving a data XML document from the server, parsing the data XML document to acquire the display data, filling the display data in the sheet frame to form the sheet and displaying the data.
Description
Technical field
The present invention relates to technical field of computer information processing, particularly, relate to a kind of data display method for establishing model, method for exhibiting data and device.
Background technology
In the web application development process, often need on webpage, show data, and operation such as response final user's increase, deletion, change, inquiry and the data that will be required preservation are submitted in the database and preserve according to the desired list pattern of operation system.This has wherein comprised and has obtained data, creates form object, and padding data increases data, deleted data, and the change data are preserved a series of processes such as data after changing.In traditional web applicating developing technology, this process is very loaded down with trivial details, particularly develops RIA (Rich Interface Applications, rich interface application) time, client script (Script) coding work amount is big, and the script debugging difficulty comprises a large amount of duplication of labour.For example, if show a list on the web page, common way is: the list pattern according to operation system needs, directly on the web page, make up with html element element (table, div etc.), and generate the list framework.Call the data that data base administrator obtains to be needed then, the data that get access to are filled on the position corresponding in the list framework successively.Revise the list content if desired and preserve amended data, then also need on the web page, add associated script and be used to generate edit control, handle final user's input, extract amended data and preservation.Server end also needs to add corresponding code and handles related data.Therefore existing web application development process exists the development amount big, the script debugging difficulty, and problem such as make mistakes easily, and also the list on the web page do not possess encapsulation, and reusability is poor, causes the development efficiency of whole application not high.
Summary of the invention
Problem at prior art exists the invention provides a kind of data display method for establishing model, method for exhibiting data and device, to carry out the displaying of data based on reusable data display model.
To achieve these goals, the embodiment of the invention provides a kind of data display method for establishing model, and this method comprises:
Carry out the data display model definition, comprise definition of data collection and Show Styles;
Generate data display model XML (Extensible MarkupLanguage, extend markup language) document according to described data display model definition;
Described data display model XML document is stored in server.
The embodiment of the invention also provides a kind of method for exhibiting data, comprising:
Send the data display request to server;
Reception is showed the model expandable mark language XML document from data in server, and this data display model XML document comprises DSD and Show Styles definition;
Create the list framework according to described data display model XML document;
Send data retrieval request to server, carry described DSD in this request;
Reception is resolved described data XML document and is obtained to show data, and described displaying data are filled in the described list framework from the data in server XML document, and the formation list is also showed.
The embodiment of the invention also provides a kind of data display modelling device, comprising:
Definition unit is used to carry out the data display model definition, comprises definition of data collection and Show Styles;
Generation unit is used for generating data display model expandable mark language XML document according to described data display model definition;
Storage unit is used for described data display model XML document is stored in server.
The embodiment of the invention also provides a kind of data display device, comprising:
First transmitting element is used for sending the data display request to server;
First receiving element is used for receiving from data in server and shows the model expandable mark language XML document, and this data display model XML document comprises DSD and Show Styles definition;
Creating unit is used for creating the list framework according to described data display model XML document;
Second transmitting element is used for sending data retrieval request to described server, carries described DSD in this request;
Second receiving element is used for receiving from the data in server XML document, resolves described data XML document and obtains to show data, and described displaying data are filled in the described list framework, forms list;
Display unit is used to show described list.
The embodiment of the invention can be carried out the displaying of data based on reusable data display model, has reduced the workload in secondary development stage.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, the accompanying drawing of required use is done to introduce simply in will describing embodiment below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of data display method for establishing model in one embodiment of the invention;
Fig. 2 is for carrying out the schematic flow sheet of data display in client in one embodiment of the invention;
Fig. 3 is the structural representation of data display model instance object in the embodiment of the invention;
Fig. 4 is the structural representation of local data cache object in the embodiment of the invention;
Fig. 5 is for carrying out the schematic flow sheet of data display in client in another embodiment of the present invention;
Fig. 6 is the data modification operating process synoptic diagram of step S260 correspondence among Fig. 5;
Fig. 7 is the structural representation of database adapter object in the embodiment of the invention;
Fig. 8 is for to realize principle schematic of the present invention based on the Web developer component of DJFocus;
Fig. 9 is list synoptic diagram to be showed in the embodiment of the invention;
Figure 10 is for setting up the interface synoptic diagram of data display model in the embodiment of the invention;
Figure 11 is the interface synoptic diagram that passes through DJFoucs Designer designing form in the embodiment of the invention;
Figure 12 is the structured flowchart of data display modelling device in the embodiment of the invention;
Figure 13 is the structured flowchart of data display device in one embodiment of the invention;
Figure 14 is the structured flowchart of data display device in another embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The embodiment of the invention provides a kind of method of setting up reusable data display model, and solve in traditional web applicating developing technology based on the data display model of being set up, client script coding work amount is big, the script debugging difficulty, list on the web page does not possess the problem of encapsulation property and reusability difference, thereby simplifies the data display operation of the web page.
In the present embodiment, at first setting up data shows model and it is left on the server, this data display model is reusable, be encapsulated in the data model XML document, promptly this data display model leaves on the server with the XML document form, and do not rely on the concrete web page, can be called by the different web pages.On showing the web page of client of list, needs call the data display model of building up then, client can be automatically with the data display model instanceization, create the list framework, further by obtain the data XML document as form data to server, the generation list also is illustrated on the page.As long as defined the edit pattern and the data way of submission of data item in the data display model, the data of above-mentioned list just can be modified and preserve, and do not need additionally to write correlative code.When if client need be submitted the data that are modified to, only need call the commit method of data display model instance object and can finish the data submission.
In the embodiment of the invention, setting up the process of data display model can finish in client, the developer can be by the browser access data model design page of client, carry out the data display modelling, after finishing, the data display modelling submits to server, to preserve this data display model at server end by client.
As shown in Figure 1, the data display method for establishing model of the embodiment of the invention comprises:
Step S110, definition of data is showed model, generates data display model XML document.
In this step, definition of data shows that model can comprise definition of data collection and Show Styles etc.
(1) definition of data collection
Data set is used to describe current data and shows how model obtains data.If obtain data from database, then Ding Yi data set comprises the attribute definition of SQL (Structured Query Language, Structured Query Language (SQL)) query statement, correlation table (as database table) and row; If not obtaining data from database, definable growth data collection then, the growth data collection only need define the attribute of row.In the embodiment of the invention, if do not obtain data from database, this data display model can be referred to as " the data display model with external data source ".This data display model can be not mutual with database, and only as a carrier of showing data.Can write script on the page in the carrier of showing data, adding data, the data that this data display model also can be showed interpolation according to predefined pattern and style, but the data of these interpolations can not be updated in the database.
In the condition of when operation deterministic retrieval data, then definition of data shows that model also comprises the definition search argument if desired.After having defined search argument, can when operation, give the condition of data display model as retrieve data by the scripts pass parameter value.The condition of deterministic retrieval data is meant during described the operation: when design data is showed model, the developer can not determine the condition of retrieve data, need be by the final user when using the data display model, according to the needs of oneself, the condition of retrieve data is set, i.e. the value of search argument.For example, if these " age is greater than 30 " are exactly the condition of retrieve data greater than 30 people all ages of retrieval in the personal information table.Same data display model, both can retrieve the people of " age is greater than 30 ", also can retrieve the people of " age is greater than 50 ", because the developer is not the final user, so condition that can not the deterministic retrieval data, this moment, the developer can define search argument, the final user can be when using the data display model condition of deterministic retrieval data, the i.e. value of search argument.The condition of described retrieve data can pass to the data display model by the script of carrying out on the page.
(2) definition of data is showed the Show Styles of model
The Show Styles of data display model can comprise object of placing on list layout, edit pattern, display format and the data display model etc.; The object of placing on the data display model for example can be interface objects such as text box, button, computational fields, picture, file, rectangle frame, lines.After the definition of data collection, the row that data set comprised use with regard to the data item that can be used as the data display model.According to needed list layout, can specify the distributed areas and the coordinate figure of these data item, data item is placed on the suitable position.Distributed areas comprise: header area, gauge outfit district, data field, table tail region and footnote district etc.Coordinate figure is exactly the X with respect to distributed areas, the Y coordinate.Each data item can define different edit patterns and display format.Wherein, edit pattern comprises the edit pattern that defined row object has in the data display model, after being meant that specifically this row object is illustrated on the page, which kind of mode to import data in, for example comprise: manual single file input, the input of manual multirow, drop-down list selection, check box, radio box, the selection of ejection calendar, pop-up window selection etc.Display format comprises: mixed decimal word, number percent, currency, time on date, scientific notation etc.Except data item, can also add interface objects such as text box, button, computational fields, picture, file, rectangle frame, lines in the data display model, each object can be placed on the optional position (free style layout) in the data display model or be positioned over (tabulation formula layout) in the mesh lines.Wherein, the computational fields object must comprise a calculation expression, and the value of computational fields object is exactly the result who obtains after calculating by this expression formula.
In the concrete application of the present invention, alternatively, definition of data shows that the step of model can also comprise the information of being defined as follows:
(3) definition of data divides set condition.
The subtotal etc. if list need divide into groups to show, divide into groups then can divide set condition by definition of data in the data display model.The cascade grouping is supported in packet, and so-called cascade grouping just is meant grouping once more on the basis of a grouping, such as: according to the grouping of personnel affiliated function, divide into groups according to sex more earlier.Data item and computational fields can be as the packet conditions of elements, the packet condition is the calculation expression that comprises at least one above-mentioned element, such as: data are set according to the grouping of personnel's sex, represent that then the expression formula of packet condition is " sex " (field of sex is called sex).
(4) definition of data sort criteria.
The data sorting condition that defines in the data display model is used for the data that are illustrated on the customer terminal webpage are sorted.Sortord has two kinds of ascending order and descendings.Data item and computational fields can be as the data sorting conditions of elements, and the data sorting condition is the calculation expression that comprises at least one above-mentioned element.Such as, sort according to the age, then setting the ordering expression formula is " age A " (field at age is called age, and A represents ascending sort from small to large, and descending then uses D).
(5) definition of data filtercondition.
The data filter condition that defines in the data display model is used for the data that are illustrated on the customer terminal webpage are filtered, and the data line that meets filtercondition is revealed, otherwise is hidden.Data filter operates in client and finishes, can minimizing and server or the mutual number of times of database.Data item and computational fields can be as the data filter conditions of elements, the data filter condition is the calculation expression that comprises at least one above-mentioned element, such as, be provided with and filter out all ages greater than 30 record, then filter expression formula and be " age>30 " (field at age is called age).
(6) definition of data way of submission.
The data way of submission has defined after the data of showing on customer terminal webpage are changed by the final user, the key word when whether needing to submit to, submit to which data, which data item to submit to as data.
After the data display model definition is finished, can generate data and show the model XML document.In one embodiment of the invention, the form of data display model XML document can be as shown in table 1.
Table 1. data display model XML document format sample
<documentation root Jie Dianbiaoqian><dSD Biao Qian><data set SQL statement definition label/><data set table label/><data set column label/><search argument definition label/><data filter condition label/><data sorting condition label/></DSD Biao Qian><packet definition label/> |
<header area definition label/><gauge outfit area definition label/><data field definition label/><table tail region definition label/><footnote area definition label/><text object definition label/><object picture definition label/><button object definition label/><computational fields object definition label/><rectangle frame object definition label/><lines object definition label/><binary object definition label/><row object definition Biao Qian><row edit pattern definition label/></row object definition Biao Qian></documentation root Jie Dianbiaoqian> |
For data display model with external data source, the form of data display model XML document is identical with table 1 basically, just at<DSD label〉under the node, do not comprise<data set SQL statement definition label/and<the data set table label/two nodes.
Step S120 submits described data display model XML document to server.
Particularly, after the data display model definition was finished, client (as the browser page script by client) can send the request of preserving data display model XML document to server, preserves described data display model XML document with the request server end.This data display model XML document is preserved in the request of server-side processes client.If preserve failure, then server end can return error message to client.
By above-mentioned steps S110~S120, just finished the foundation of data display model.
Based on the data display model of above-mentioned foundation, in other words, based on the data display model XML document of setting up in said process, the client that is connected with server just can be showed at the enterprising line data of the web page easily arbitrarily.Carrying out data display is exactly to obtain data display model XML document and the related data that is kept on the server, with the form of list related data is illustrated on the client web page, so that the final user checks or operates.As shown in Figure 2, in one embodiment of the invention, the flow process of carrying out data display in client comprises:
Step S210, user end to server sends the data display request.
If comprised the script or the label of reference data displaying model on the customer terminal webpage, when the page is performed, will send request to server end, show the model XML document to obtain data designated.
After server end receives the request of customer terminal webpage, obtain the data display model name that customer terminal webpage is asked, be converted to the Actual path of data display model XML document, read document content then by model name.If data designated shows that the model XML document is found and can correctly read its content, then return data shows that model XML document content is to client; Otherwise return error message.
Step S220 receives from data in server and shows the model XML document.
If server end can successfully find and the content of reading of data displaying model XML document, then server end can be showed model XML document content to client by return data, and client can receive from data in server and show the model XML document this moment.
Step S230 resolves described data display model XML document, creates data display model instance object, shows the list framework of this data display model instance object and create the local data cache object on the web page.
The information that defines in the data display model XML document can not directly show on webpage, but show by data display model instance object.Client is called corresponding analytics engine by page script and is resolved described data display model XML document after receiving data display model XML document from server end, creates data display model instance object.The data display model instanceization is to liking an interface object, data display model instance object not only can be used to show defined outward appearance of data display model and attribute, can also be according to the method and the incident of data display model creation data manipulation, and response final user's various operations and incident, promptly possess the interface alternation ability.Such as: the final user wants to add delegation's new data, then calls " adding line " method of the establishment of instance object, and " adding line " method of above-mentioned instance object is responsible for realizing concrete interpolation operation; Aspect response events, on some data item, press tab key such as the user, then above-mentioned instance object jumps to input focus next data item automatically.
Fig. 3 is the structural representation of the data display model instance object of the embodiment of the invention, is described below:
Data display model instance object can comprise three subobjects: data definition object, Data View object and data manipulation object.Wherein the data definition object is responsible for resolution data displaying model XML document, the various definition in the storage data display model XML document; The Data View object is used for the various definition of reading of data definition object, and defines described style create list framework and padding data on the web page according to each; The data manipulation object does not rely on concrete data display model, the instance objects that can be any data display model is created needed method of data manipulation and incident, wherein said data manipulation can comprise: submission, increase, deletion, modification, inquiry etc., but be not limited to this.
At this data display model instance object, client is according to display style information such as the list layout that defines in the data display model XML document, interface objects, on customer terminal webpage, create corresponding web page element and its attribute (as width, highly, color, font etc.) is set, to reach the interfacial effect of expection.The interface web pages element that generate this moment does not comprise data, includes only the list framework.
The customer terminal webpage script also can be created a local data cache object automatically after creating the list framework.The local data cache object resides in the client internal memory, does not just comprise data in the local data cache object of creating.Client can be by adding data in the local data cache object, will increase data in the metadata cache object two kinds of approach are arranged: (1) is to the server retrieves data and obtain the data XML document, the resolution data XML document is added data in the local data cache object to according to ranks; (2) call correlation technique or the incident that data display model instance object increases data, data line is added in the local data cache object, and the column data value is set.It is the value that the some row that comprised in the newline of interpolation are set that the column data value is set.Data line comprises some row, and each shows a data value.
In the present embodiment, the form of local data cache object is illustrated as shown in Figure 4.The local data cache object can be by row storage data, and every row comprises " row modification state " and " data rows set ".The modification state of wherein going comprises: unmodified, increase, be modified (promptly being replaced), deleted etc. newly.The data rows set is made up of plurality of data row object.Each data rows object comprises " row modification state " and " column data value ".Row modification state comprises: unmodified, be modified.Whether the column data value comprises: original value, amended value, be empty.From said structure as can be seen, the data that no matter increase newly, delete or replace are not submitted to server end immediately and handle, but are kept in the local data cache object, just being equivalent to this locality has a data set, and any data manipulation all is to carry out on this data acquisition.After data manipulation was finished, when sending the request of submitting data to, unification was submitted these data to server again.
Local data cache is equivalent to the ephemeral data storage container an of this locality, and customer terminal webpage all carries out in this data storage container the read-write operation of data, needn't be at every turn access servers all.After client operation finished, property was submitted to server again, therefore used the local data cache object can reduce customer terminal webpage and the mutual number of times of server end.Simultaneously, because the data of each visit all are the objects in the local computer internal memory, there are not network delay and disk read-write, so can also improve page response speed.
Step S240 sends data retrieval request to server, carries the DSD of data display model in this data retrieval request.
Customer terminal webpage is retrieve data if desired, promptly carries out query manipulation, then can send the request of retrieve data by client script to server end.At this moment, client script partly sends to server end with the DSD of data display model, and DSD has comprised the rule of obtaining data.Server end response data retrieval request, and resolve the DSD receive, from database, obtain data according to the data acquisition rule in the DSD, for example in database, carry out the SQL statement in the DSD, obtain a result set, wherein can comprise the data in the described database table of DSD.If successfully get access to data (result set), then server end is the document of the synthetic XML form of the data set that obtains, i.e. data XML document, and return to customer terminal webpage; Otherwise, return error message to client.
In the time of the client retrieves data,, need client script that the value of search argument is provided if the data display model is provided with the search argument definition.At this moment, client script partly sends to server end together with the value of search argument with the DSD of data display model.
The form of described data XML document can be as shown in table 2:
Table 2. data XML document format sample
<documentation root Jie Dianbiaoqian><transaction information Biao Qian><execution result code/><execution result is described/></transaction information Biao Qian><data set Biao Qian><data line Biao Qian><lie Biaoqian>Data</Lie Biaoqian></data line Biao Qian></data set Biao Qian></documentation root Jie Dianbiaoqian> |
Step 250 receives from the data in server XML document, resolves described data XML document to obtain to show data, and described displaying data are filled in the described list framework, and the formation list is also showed.
Client receives the data XML document that server end returns, and calls the data parsing engine and resolves described data XML document, and the displaying data of resolving the back acquisition are added in the local data cache object.
Client script extracts the displaying data that current needs are illustrated on the page from the local data cache object, be filled in the list framework that creates on the customer terminal webpage, form complete list, thereby can realize the data display of customer terminal webpage by list.
Realize after the data display of customer terminal webpage, the local data cache object will be retained in the client internal memory, the user can serve as that operations such as data modification are carried out on the basis to data with the local data cache object, and the data modification operation can comprise operations such as increase, deletion, replacement again.Operating process is described in detail to data below.
As shown in Figure 5, the operation of the follow-up data in the data display flow process also comprises the steps:
Step S260 to the operation of making amendment of the data in the list, is provided with amended data and revises status indicator and to store described amended data.
The data modification operation can change the data in the above-mentioned list that creates.Particularly, as shown in Figure 6, the data modification operation types for example can be divided into: increase data, deleted data and replacement data.Wherein:
Increasing data is to add new data line according to the structure of the data line of describing in the data display model definition.After client script carry out to increase the script of data, the data line that newly adds is written in the local data cache object, and the state that this data line is set is " increasing newly ".
Deleted data is that the state of the data line that will delete in the local data cache object is set to " deletion ".If this data line is the data of showing on the current page, then delete from the page simultaneously.
To be the customer terminal webpage script be written to corresponding position in the local data cache object with new data line to replacement data, replaces original data line, and the state that this new data line is set is " replacement ".
Carry out after the retouching operations such as increase, deletion or replacement, the local data cache object also is modified, and original data and amended data all are recorded in the local data cache object.
Submit amended data to server end if desired, then the embodiment of the invention can further comprise the steps:
Step S270 extracts described amended data, generates the data change XML document.
The data of submitting to these to be changed if desired, client can be called the data commit method of data display model instance object, this method can travel through the local data cache object automatically, and the data extract of being changed is come out, and forms the data change XML document that record data are changed situation.
The form of data change XML document can be as shown in table 3.
Table 3. data change XML document form:
<documentation root Jie Dianbiaoqian><dSD Biao Qian><data set SQL statement definition label/><data set table label/><data set column label/></DSD Biao Qian><data change record set Biao Qian><data increase record set Biao Qian><the row/﹠gt that increases;</data increase record set Biao Qian><data are replaced record set Biao Qian><the row/﹠gt that replaces;</data are replaced record set Biao Qian><data deletion record set Biao Qian><the row/﹠gt of deletion; |
</data deletion record set Biao Qian></data change record set Biao Qian></documentation root Jie Dianbiaoqian> |
Step 280 is submitted Data Update request and described data change XML document to server, so that the data in the described server update database.
This data change XML document and Data Update request can be submitted to server end together, server end meeting processing said data update request, and resolve described data change XML document, utilize the data in the described data change XML document renewal current database, for example, update data set defines the data in the described database table.Can return error message if upgrade failure, if upgrades successfully the record number (this record numerical table show once add, delete or replaced how many bars and write down) that can return success information and renewal to client.
Because the data base management system (DBMS) of server end management database might be the data of different types management system, and the grammer of every kind of data base management system (DBMS) difference to some extent all, therefore the embodiment of the invention also provides a kind of database adapter object, to adapt to different data base management system (DBMS)s.Particularly, can generate the order of the batch updating database that is fit to current database and carry out described order by the database adapter object according to different data base management system (DBMS)s.If the fill order failure can be returned error message; Fill order successfully can return success the record number of information and renewal.In the embodiment of the invention, database adapter is to liking a java class object, and its structural representation can be as shown in Figure 7.Among Fig. 7, the database adapter object provides an adaptable interface for each data base management system (DBMS), and each interface is mutual with corresponding database device, and database device is provided by data base management system (DBMS) producer.Each adaptable interface is responsible for handling the grammer of certain database, for external program provides a unified data operating interface.The method of data manipulation such as data retrieval, Data Update all is based on this unified data operating interface.The database adaptive object can strengthen the database independence of external program.
In the embodiment of the invention, the method for building up of data display model and corresponding method for exhibiting data can be realized based on multiple web developer component, for example can realize based on the web developer component of DJFocus, but the present invention is not limited to this, and other assemblies that are used for the web page development at present are applicable to the present invention too.Wherein DJFocus is a web developer component based on Java, and the program development personnel can develop web fast by DJFocus and use.As shown in Figure 8, DJFocus can divide two parts to realize the present invention, and a part is server-side code (comprising TagLib, Serlvet and JavaBean etc.), and another part is the Script script that moves in customer terminal webpage.In the present embodiment, adopt the specific implementation step of DJFocus for example to can be:
The first step is created the data display model.This can design by the designer (Designer) that DJFocus provides, also can XML document of manual creation, according to the definition of the form input data display model of table 1 defined, and this XML document is kept on the server.
Second step is according to data display model creation data display model instance object.The developer can call the TagLib server by the TagLib label on customer terminal webpage, the TagLib server is by calling relevant JavaBean, and the information of server end turned back to customer terminal webpage, this part program is used for creating data display model instance object on customer terminal webpage.
The 3rd goes on foot, and calls the method and the incident of data display model instance object.By the Script script reference DJFocus client code on the customer terminal webpage, the DJFocus client code submits to client-requested to server end Servlet program by the AJAX technology.After DJFocus server end Servlet program receives the request of client, call relevant JavaBean or call database adapter by JavaBean and obtain data from database, and result turned back to customer terminal webpage, thereby realize the displaying of data.
From said process as can be seen, in the conventional art on the web page process with HTML combination list substituted by the foundation of data display model of the present invention and data display process; And the process of writing the modification of Script script deal with data in the conventional art on the web page is packaged in the data display model instance object of the present invention, does not need additionally to write code.
Below by an example of on webpage, showing form data the effect of invention is described.
Fig. 9 will show a tabulation formula form the most basic.Realize displaying as shown in Figure 9, requirement is taken out the data of 4 fields and is showed from database table person_info, these 4 fields are respectively id (sign, for example can be numbering), name (name), sex (sex) and age (age), wherein the sex field still is " woman " according to code " 1 " or " 0 " demonstration " man ".In the form shown in Figure 9, require the data of each data item to edit, and can increase, delete and preserve data.
Below respectively under the duplicate situation of based hardware and software environments, by adopting conventional art and adopting method for exhibiting data of the present invention to embody beneficial effect of the present invention.In the present embodiment, the software platform of employing is based on the Web developer component of DJFocus.
(1) adopts conventional art
Adopt conventional art, the developer need write two pages: data display page normal_showData.jsp and data are preserved page normal_saveData.jsp, and the scripted code of these two pages sees Table 4.Remove outside the necessary code of jsp and html page, the scripted code that is used for data display and operation amounts to 195 row.
The scripted code of table 4.normal_showData.jsp and normal_saveData.jsp
??????????????????????????????????????normal_showData.jsp |
<%@page contentType=" text/html; charset=UTF-8 " %><%@page import=" java.sql.* " %><html><head><title>Conventional art is showed form data</title><meta http-equiv=" Content-Type " content=" text/html; charset=UTF-8 "><script type=" text/javascript " src=" djfocus/utils.js " charset=" UTF-8 "></script></head><style>The button{font:9pt Song typeface; Width:88; Height:23; Td{border-right:1px solid black; Border-bottom:1px solid black; The table{font:14pt Song typeface; Table-layout:fixed; Line-height:30px; Border-top:1px solidblack; Border-left:1px solid black; The input{font:14pt Song typeface; Border:0; Width:100%; Select{width:100%; The font:14pt Song typeface; }</style><body><button id=btnAdd>Add line</button><button id=btnDelete>The deletion row</button><button id=btnSave>Preserve data</button><hr><table id=dataTable cellspacing=0cellpadding=0><tr style=" background-color:#F0F0F0; text-align:center; " ﹠gt<td style=" width:60; "〉sequence number</td><td style=" width:100; ">Numbering</td><td style=" width:120; ">Name</td> |
??????????????????????????????????????normal_showData.jsp |
<td style=" width:100; ">Sex</td><td style=" width:100; ">Age</td></tr><% Connection conn=null; Statement stmt=null; ResultSet rs=null; Int rowNum=0; Try{ // obtain database connects Class.forName (" oracle.jdbc.driver.OracleDriver "); Conn=DriverManager.getConnection (" jdbc:oracle:thin:@10.10.0.8:1521:demoDB ", " demoUser ", " pwd1234 "); Stmt=conn.createStatement (); // carry out SQL statement to obtain data rs=stmt.executeQuery (" select id, name, sex, age from person_info orderby id "); While (rs.next ()) // in circulation, the data in the result set are inserted respective cells rowNum++ in the list; % 〉<tr><td align=" center "><%=rowNum%></td><td><input type=text value="<%=rs.getString (1) %>" this.select (); _ curRow=this.parentElement.parentElement.rowIndex; "</td><td><input type=text value="<%=rs.getString (2) .trim () %>" this.select (); _ curRow=this.parentElement.parentElement.rowIndex; "</td><td><selectonfocus=" _ curRow=this.parentElement.parentElement.rowIndex; "><option value=" 1 "<%=rs.getString (3) .equals (" 1 ")? " selected ": " " %>The man</option><option value=" 0 "<%=rs.getString (3) .equals (" 0 ")? " selected ": " " %>The woman</option></select></td><td><input type=text value="<%=rs.getString (4) %>" this.select (); _ curRow=this.parentElement.parentElement.rowIndex; " style=" text-align:right; "</td></tr><% } |
??????????????????????????????????????normal_showData.jsp |
Catch (Exception ex) { ex.printStackTrace (); Finally{ // closing database connection rs.close (); Stmt.close (); Conn.close (); % 〉</table><iframe id=" actionFrame " src=" " style=" display:none; "></iframe></body><script language=" javascript ">Var_curRow=0; // current line var_deletedRow; // deleted row // page loaded incident function document.body.onload () { if (dataTable.rows.length〉1) { _ curRow=1; // default setting current behavior the 1st row dataTable.rows[_curRow] .cells[1] .firstChild.focus (); // cursor focus to the 1 is set go doInitStatus (); // initialization list state } // interpolation button click event function btnAdd.onclick () { var row=dataTable.insertRow (); // insertion var the cell of delegation in list, oInput, oSelect, oOption; // be provided with first to be listed as: the sequence number cell=row.insertCell () of row; Cell.align=" center "; Cell.innerHTML=row.rowIndex; // secondary series is set: number cell=row.insertCell (); OInput=cell.appendChild (document.createElement ("<input type=text>")); OInput. () { this.select (); _ curRow=row.rowIndex; ; OInput.focus (); // the 3rd row: name cell=row.insertCell () is set; OInput=cell.appendChild (document.createElement ("<input type=text>")); OInput. () { this.select (); _ curRow=row.rowIndex; |
??????????????????????????????????????normal_showData.jsp |
; // the 4th row: sex cell=row.insertCell () is set; OSelect=cell.appendChild (document.createElement ("<select〉")); OSelect. () { _ curRow=row.rowIndex; ; // the drop-down options oOption=document.createElement ("<option〉") of sex is set; OOption.value=" 1 "; OOption.text=" man "; OSelect.options.add (oOption); OOption=document.createElement ("<option〉"); OOption.value=" 0 "; OOption.text=" woman "; OSelect.options.add (oOption); // the 5th row: age cell=row.insertCell () is set; OInput=cell.appendChild (document.createElement ("<input type=text〉")); OInput.style.textAlign=" right "; OInput. () { this.select (); _ curRow=row.rowIndex; ; } // delete button click event function btnDelete.onclick () { if (_ curRow<1) return; // value of the critical field of deleted row is saved in if in the array (dataTable.rows[_curRow] .cells[1] .firstChild.DBValue) { _ deletedRow.push (dataTable.rows[_curRow] .cells[1] .firstChild.DBValue); Capable dataTable.deleteRow in the } // deletion list (_ curRow); // be provided with current line if (_ curRow==dataTable.rows.length) _ curRow--; If (dataTable.rows.length〉1) { if (_ curRow<1) CurRow=1; DataTable.rows[_curRow] .cells[1] .firstChild.focus (); // capable sequence number for (var i=1 is set; I<dataTable.rows.length; I++) dataTable.rows[i] and .cells[0] .innerHTML=i; |
??????????????????????????????????????normal_showData.jsp |
// save button click event function btnSave.onclick () { var sqlStr=" ", idStr=" ", nameStr=" ", sexStr=" ", ageStr=" ", dbValue=" "; Var sqlArr=new Array (); // in circulation according to data conditions, generate insert or update statement for (var i=1; i<dataTable.rows.length; i++) dbValue=dataTable.rows[i] and .cells[1] .firstChild.DBValue; The original value idStr=dataTable.rows[i of // major key] .cells[1] .firstChild.value; //id field value nameStr=dataTable.rows[i] .cells[2] .firstChild.value; //name field value sexStr=dataTable.rows[i] .cells[3] .firstChild.value; //sex field value ageStr=dataTable.rows[i] .cells[4] .firstChild.value; //age field value if (dbValue) sqlStr=" update person_info setid=" "+idStr+ " ', name=" '+nameStr+ " ', sex=" '+sexStr+ " ', age="+ageStr+ " where id=" '+dbValue+ " " '; Else{ sqlStr=" insert into person info (id; name; sex; age) values (" '+idStr+ " '; " '+nameStr+ " '; " '+sexStr+ " ', "+ageStr+ ") " } sqlArr.push (sqlStr); } // from array obtained deleted Major key, and generates delete statement for (var i=0; i<_ deletedRow.length; i++) sqlArr.push (" delete person_info where id=" '+_ deletedRow[i]+" " '); The sql statement of } // submit to generate to preserve page actionFrame.location.replace ("/normal_saveData.jsp? sqlList="+sqlArr.join (" $ ")); The method function doInitStatus () { document.all.actionFrame.src=" " of } // initial table forms data state; _ deletedRow=new Array (); For (var i=1; i<data Table.rows.length; i++) dataTable.rows[i] and .cells[1] .firstChild.DBValue=dataTable.rows[i] .cells[1] .firstChild.value;</script></html> |
?????????????????????????????????normal_saveData.jsp |
??<%@page?contentType=″text/html;charset=UTF-8″%>??<%@page?import=″java.sql.*″%>??<html>??<head> |
??????????????????????????????????????normal_showData.jsp |
<title>Conventional art is preserved form data</title><meta http-equiv=" Content-Type " content=" text/html; charset=UTF-8 "></head><body>The parameter S tring sqlList=request.getParameter (" sqlList ") that<% // the obtain page transmits; if (sqlList==null) return; // separate each sql statement, generate a sql statement array String[] sqlArr=new String (sqlList.getBytes (" ISO8859-1 ")) .split (" $ "); Connection conn=null; Statement stmt=null; Int retValue=0; Try{ // obtain database connects Class.forName (" oraclejdbc.driver.OracleDriver "); Conn=DriverManager.getConnection (" jdbc:oracle:thin:@10.10.0.8:1521:demoDB ", " demoUser ", " pwd1234 "); Stmt=conn.createStatement (); // execution sql statement for (int i=0; i<sqlArr.length; i++) retValue=stmt.executeUpdate (sqlArr[i]); If (retValue<0) if // make mistakes, then interrupt circulation break; catch (Exception ex) { ex.printStackTrace (); Finally{ // closing database connection stmt.close (); Conn.close (); % 〉</body><script language=" javascript ">Function document.body.onload () { var retValue=<%=retValue%>If (retValue 〉=0) { alert (" data are preserved successfully "); Parent.doInitStatus (); // preserve successfully after, the list state of initialization data displayed page } else{ alert (" data preserve failure ");</script></html> |
(2) adopt method for exhibiting data of the present invention
If adopt the present invention to realize the bandwagon effect of Fig. 9, then be to carry out visualized data with the DJFocus designer earlier to show modelling, set up the data display model.Carry out the displaying of data based on the data display model of setting up then.
Realize that based on the web developer component of DJFocus the step of displaying shown in Figure 9 is exemplified below:
The first step: the developer selects " new established model " in the DJFocus designer, in the new window that ejects, the form that represents as required and the field information of database table, determine list displaying style and SQL query statement, create the XML document of a personList.xml by name then, the XML document that created this moment is exactly a data display model XML document, and the document is kept on the server.Figure 10 is the interface synoptic diagram by the data display model of the newly-built personList.xml by name of DJfocus designer.
In the above-mentioned data display model, DSD can be as follows:
<datasource>
<sqlselect>select?id,name,sex,age?from?person_info</sqlselect>
<table?type=″table″>person_info</table>
<col?tableid=1?type=″NUMBER″precision=″6″scale=″0″>id</col>
<col?tableid=1?type=″VARCHAR″>name</col>
<col?tableid=1?type=″CHAR″>sex</col>
<col?tableid=1?type=″NUMBER″>age</col>
</datasource>
Above-mentioned DSD has comprised 4 row: id, name, sex, age.These row can be used as the data item of data display, are placed in the data display model on the appointed positions, are used for showing the data that retrieval is come out from database.
Second step: open the data display model XML document of establishment, carry out the attribute setting of model.
When first step model of creation, use all be the attribute of acquiescence basically, these attributes can not satisfy the demands usually fully, so will carry out detailed setting in second step.
Particularly, the DJFocus assembly can be opened the data display model XML document of establishment by a designer drawing board, automatically generate an initial table style, the developer further is provided with the various attributes of form on this basis, promptly carry out the editor of data display model XML document, such as: background, data item font, color of form title block or the like are set.Figure 11 is the interface synoptic diagram by DJFoucs Designer designing form.After setting is finished, preserve data display model XML document.The data display model XML document example of preserving is as shown in table 5.
Table 5. data display model XML document example
<? xml version=" 1.0 " encoding=" UTF-8 "?><dataobject version=" 1.0 " processing=" 1 " rowsperpage=" 20 "><gridlines color=" #000000 " position=" 61,162,283,384,485 "/><datasource type=" sqlselect "><sqlselect>Select ID, NAME, SEX, AGE from PERSON_INFO order byid</sqlselect><table schema=" DPSUSER " type=" TABLE " update=" yes ">Person_info</table><col coltype=" string " type=" char " nullable=" no " precision=" 3 " scale=" 0 " tableid=" 1 " update=" yes " key=" yes ">Id</col><col coltype=" string " type=" char " nullable=" no " precision=" 10 " scale=" 0 " tableid=" 1 " update=" yes " key=" no ">Name</col><col coltype=" string " type=" char " nullable=" no " precision=" 1 " scale=" 0 " tableid=" 1 " update=" yes " key=" no ">Sex</col><col coltype=" number " type=" NUMBER " nullable=" no " precision=" 5 " scale=" 0 " tableid=" 1 " update=" yes " key=" no ">Age</col><filter/><sort>IdA</sort></datasource><titlebar height=" 0 " backgroundcolor=" white "/><header height=" 30 " backgroundcolor=" white "/><detail height=" 30 " backgroundcolor=" white "/><summary height=" 0 " backgroundcolor=" white "/><footer height=" 0 " backgroundcolor=" white "/><text name=" text_1 " band=" Header " align=" center " x=" 61 " y=" 0 " width=" 100 " height=" 30 " text=" numbering " fontfamily=" Song typeface " fontsize=" 14pt " backgroundcolor=" #f0f0f0 "/><text name=" text_2 " band=" Header " align=" center " x=" 162 " y=" 0 " |
Width=" 120 " height=" 30 " text=" name " fontfamily=" Song typeface " fontsize=" 14pt " backgroundcolor=" #f0f0f0 "/〉<text name=" text_3 " band=" Header " align=" center " x=" 283 " y=" 0 " width=" 100 " height=" 30 " text=" sex " fontfamily=" Song typeface " fontsize=" 14pt " backgroundcolor=" #f0f0f0 "/><text name=" text_4 " band=" Header " align=" center " x=" 384 " y=" 0 " width=" 100 " height=" 30 " text=" age " fontfamily=" Song typeface " fontsize=" 14pt " backgroundcolor=" #f0f0f0 "/><text name=" text_5 " band=" Header " tag=" " text=" sequence number " align=" center " pointer=" default " color=" black " visible=" yes " backgroundcolor=" #f0f0f0 " href=" " x=" 0 " y=" 0 " width=" 60 " height=" 30 " fontfamily=" Song typeface " fontsize=" 14pt " fontweight=" normal " fontstyle=" normal " textdecoration=" none " border=" 0 "/><column name=" id " band=" Detail " taborder=" 10 " colid=" 1 " align=" left " x=" 61 " y=" 0 " width=" 100 " height=" 30 " formattype=" none " format=" " maxlength=" 3 " fontfamily=" Song typeface " fontsize=" 14pt "><editmode type=" text " autoselection=" yes "/></column><column name=" name " band=" Detail " taborder=" 20 " colid=" 2 " align=" left " x=" 162 " y=" 0 " width=" 120 " height=" 30 " formattype=" none " format=" " maxlength=" 10 " fontfamily=" Song typeface " fontsize=" 14pt "><editmode type=" text " autoselection=" yes "/></column><column name=" sex " band=" Detail " taborder=" 30 " colid=" 3 " align=" left " x=" 283 " y=" 0 " width=" 100 " height=" 30 " formattype=" none " format=" " maxlength=" 1 " fontfamily=" Song typeface " fontsize=" 14pt "><editmode type=" select "><item value=" 1 ">The man</item><item value=" 0 ">The woman</item></editmode></column><column name=" age " band=" Detail " taborder=" 40 " colid=" 4 " align=" right " x=" 384 " y=" 0 " width=" 100 " height=" 30 " formattype=" none " format=" " maxlength=" 5 " fontfamily=" Song typeface " fontsize=" 14pt "><editmode type=" text " autoselection=" yes "/></column><compute name=" compute_1 " band=" Detail " tag=" " expression=" RowNum () " |
Formattype=" none " format=" " align=" center " pointer=" default " color=" black " visible=" yes " backgroundcolor=" transparent " x=" 0 " y=" 0 " width=" 60 " height=" 30 " fontfamily=" Song typeface " fontsize=" 14pt " fontweight=" normal " fontstyle=" normal " textdecoration=" none " border=" 0 "/></dataobject> |
The 3rd step: use data display model XML document.The developer utilizes tag library TagLib label on customer terminal webpage, reference data is showed model, the DJFocus assembly can be created corresponding data display model instance object according to the data display model of being quoted on customer terminal webpage, and creates three subobjects simultaneously: data definition object, Data View object and data manipulation object.The data definition object is responsible for each defined node in the analyzing XML file, is responsible for displaying by the Data View object then.The data manipulation object is responsible for needed method of load operation and incident.At this moment, also can create the local data cache object, but not fill concrete data this moment.
The 4th step: retrieve data.The developer calls the method for retrieve data by client Script script, data display model instance object then sends the request of retrieve data to server end, server end Servlet program receives after the request, call corresponding JavaBean, the JavaBean program gets access to needed data by database adapter from database, and returns to customer terminal webpage by Servlet.At this moment, the data of returning are returned with the form of data XML document.The data XML document example of returning is as shown in table 6.
Table 6. data XML document format sample
<?xml?version=″1.0″?><xmldata>?<transinfo>??<code>0</code>??<dbcode>0</dbcode>??<message></message>??<retrievedrows>3</retrievedrows>?</transinfo>?<dataset>??<r> |
<c>001</c><c>Zhang San</c><c>0</c><c>36</c></r><r><c>002</c><c>Li Si</c><c>1</c><c>38</c></r><r><c>003</c><c>The king five</c><c>1</c><c>42</c></r></dataset></xmldata> |
The 5th step: show data.After data display model instance object in the customer terminal webpage receives the data XML document that server end returns, data are filled in the local data cache object, and simultaneously the current data presented that needs is filled in the list framework on the page, the list of formation is as shown in Figure 9.
The 6th step: data manipulation.Be illustrated on the page the data display model instanceization to as if one can be mutual interface object.Adjustable the ining all sorts of ways of data display model instance object (inquiry, increase, deletion, replacement, preservation etc.) realized mutual with the final user, and the result of renewable displaying after mutual.When after operation is finished, needing to submit to, will use the data change XML document.The data change XML document can gather the data change that local interaction produced according to increasing, delete, replacing to classify.Above-mentioned data change XML document adopts AJAX technology and server end Servlet interprogram communication by client Script script, submits to the data change XML document to server end.Server end is submitted to data change in the database by Servlet routine call JavaBean and database adapter.Return this by Servlet then and submit whether successful information to.After customer terminal webpage received the return message of server, whether this operation of prompting final user was successful.The example of the data change XML document that generates after the data manipulation is as shown in table 7.
Table 7. data change XML document example
<? xml version=" 1.0 "?><xmldata><datasource><sqlselect>Select ID, NAME, SEX, AGE from PERSON_INFO order by id</sqlselect><table schema=" DPSUSER " type=" TABLE " update=" yes ">Person_info</table><col coltype=" string " type=" char " nullable=" no " precision=" 3 " scale=" 0 " tableid=" 1 " update=" yes " key=" yes ">Id</col><col coltype=" string " type=" char " nullable=" no " precision=" 10 " scale=" 0 " tableid=" 1 " update=" yes " key=" no ">Name</col><col coltype=" string " type=" char " nullable=" no " precision=" 1 " scale=" 0 " tableid=" 1 " update=" yes " key=" no ">Sex</col><col coltype=" number " type=" NUMBER " nullable=" no " precision=" 5 " scale=" 0 " tableid=" 1 " update=" yes " key=" no ">Age</col></datasource><updatelist><deletedrow><r><pk>003</pk></r></deletedrow><updatedrow><r><c>002</c><cs=" 1 " o=" Li Si " n=" 0 ">Li Si 1</c><c>1</c><cs=" 1 " o=" 38 " n=" 0 ">33</c></r></updated row><insertedrow><r><cs=" 2 " n=" 0 ">005</c> |
<cs=" 2 " n=" 0 ">Zhao six</c><cs=" 2 " n=" 0 ">0</c><cs=" 2 " n=" 0 ">32</c></r></insertedrow></updatelist></xmldata> |
In the present embodiment based on DJFocus realize form that Fig. 9 shows scripted code as shown in table 8.The scripted code shown in the call list 8 on the page removes outside the necessary code of jsp and html page, and the scripted code that is used for data display and operation amounts to 18 row, and lines of code is less than 1/10th of traditional approach.
Table 8. is realized the code of the form that Fig. 9 shows based on DJFocus
????????????????????????????????djfocus_showData.jsp |
<%@page contentType=" text/html; charset=UTF-8 " %><%@taglib uri="/djfocus " prefix=" dj " %><html><head><title>DJFocus shows form data</title><meta http-equiv=" Content-Type " content=" text/html; charset=UTF-8 "></head><style>The button{font:9pt Song typeface; Width:88; Height:23; }</style><body><button id=btnAdd>Add line</button><button id=btnDelete>The deletion row</button><button id=btnSave>Preserve data</button><hr><dj:dataview id=" dvl " dataObject='/personList ' style=" width:100%; height:400; "/〉</body><script language=" javascript ">// page loaded incident function document.body.onload () { dvl.SetDBProfile (" demoDB "); // database is set connects dvl.Retrieve (); // retrieve data } // interpolation button click event |
Function btnAdd.onclick () { dvl.InsertRow (0); // interpolation data } // delete button click event function btnDelete.onclick () { dvl.DeleteRow (0); // deleted data } // save button click event function btnSave.onclick () { // preservation data if (dvl.Update ()==1) { alert (" data are preserved successfully "); Else{ alert (" data are preserved failure ");</script></html> |
Compare with conventional art more as can be seen by top, the present invention has visualized data and shows advantages such as modelling, the data display model is reusable, encapsulation property is strong, code is succinct.
In a word, the embodiment of the invention is by the reusable data display model of design, and provide the parsing of data display model, client data to show and data manipulation correlation technique and incident, and reduced the workload in secondary development stage, can improve development efficiency and reduce the probability that script is made mistakes.
The embodiment of the invention also provides a kind of data display modelling device, and as shown in figure 12, this device comprises:
In concrete the application, described definition unit 1201 also is used for definition of data and shows in the following information of model one or multinomial: packet condition, data sorting condition, data filter condition and data way of submission.
The data display modelling device that present embodiment provides can be the part of client or client, can be used for realizing aforesaid data display method for establishing model.
The embodiment of the invention also provides a kind of data display device, and as shown in figure 13, this data display device 1300 comprises:
First transmitting element 1301 is used for sending the data display request to server;
First receiving element 1302 is used for receiving from data in server and shows the model expandable mark language XML document, and this data display model XML document comprises DSD and Show Styles definition;
Creating unit 1303 is used for creating the list framework according to described data display model XML document;
In the concrete application of the present invention, this device also can comprise:
Revise unit 1307, be used for the data of list are made amendment, and amended data are provided with the modification status indicator.
Commit unit 1309 is used for submitting described data change XML document to described server, so that described server update database.
The data display device that the embodiment of the invention provides is the part of client or client, can be used for realizing the method for exhibiting data in the previous embodiment.
One of ordinary skill in the art will appreciate that all or part of step that realizes in the foregoing description method can instruct relevant hardware to finish by program, this program can be stored in the computer read/write memory medium, such as ROM/RAM, magnetic disc, CD etc.
Above-described specific embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the above only is specific embodiments of the invention; and be not intended to limit the scope of the invention; within the spirit and principles in the present invention all, any modification of being made, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.
Claims (15)
1. a method for exhibiting data is characterized in that, comprising:
Send the data display request to server;
Reception is showed the model expandable mark language XML document from data in server, and this data display model XML document comprises DSD and Show Styles definition;
Create the list framework according to described data display model XML document;
Send data retrieval request to server, carry described DSD in this request;
Reception resolves described data XML document to obtain to show data from the data in server XML document, and described displaying data are filled in the described list framework, and the formation list is also showed.
2. method according to claim 1 is characterized in that, also comprises:
Create the local data cache object, and store described data XML document to the local data cache object.
3. method according to claim 1 is characterized in that:
Described data display model also comprises in the following information one or multinomial: search argument definition, packet definition, data sorting definition, data filter definition and the definition of data way of submission.
4. method according to claim 1 is characterized in that, also comprises:
Data in the list are made amendment, amended data are provided with revise status indicator and store.
5. method according to claim 4 is characterized in that, described data in the list are made amendment comprises:
Data in increase, deletion or the replacement list.
6. according to claim 4 or 5 described methods, it is characterized in that, also comprise:
Extract described amended data, generate the data change XML document;
Submit described data change XML document to described server, so that the database table of describing in the described server update DSD.
7. method according to claim 1 is characterized in that:
Described Show Styles definition comprises as one in giving a definition or multinomial: list layout definition, edit pattern definition, display styles definition and interface object definition.
8. a data display method for establishing model is characterized in that, comprising:
Carry out the data display model definition, comprise definition of data collection and Show Styles;
Generate data display model expandable mark language XML document according to described data display model definition;
Described data display model XML document is stored in server.
9. method according to claim 8 is characterized in that, the described data display model definition that carries out also comprises:
Be defined as follows in the information one or multinomial: search argument definition, packet condition, data sorting condition, data filter condition and data way of submission.
10. method according to claim 8 is characterized in that:
Described Show Styles comprises in the following information one or multinomial: list layout, edit pattern, display styles and interface object.
11. a data display device is characterized in that, comprising:
First transmitting element is used for sending the data display request to server;
First receiving element is used for receiving from data in server and shows the model expandable mark language XML document, and this data display model XML document comprises DSD and Show Styles definition;
Creating unit is used for creating the list framework according to described data display model XML document;
Second transmitting element is used for sending data retrieval request to described server, carries described DSD in this request;
The analytics engine unit is used for receiving from the data in server XML document, resolves described data XML document and obtains to show data, and described displaying data are filled in the described list framework, forms list;
Display unit is used to show described list.
12. device according to claim 11 is characterized in that, also comprises:
Revise the unit, be used for the data of list are made amendment, and amended data are provided with the modification status indicator.
13. device according to claim 11 is characterized in that, also comprises:
Extraction unit is used to extract described amended data, generates the data change XML document;
Commit unit is used for submitting described data change XML document to described server, so that the database table of describing in the described server update DSD.
14. a data display modelling device is characterized in that, comprising:
Definition unit is used to carry out the data display model definition, comprises definition of data collection and Show Styles;
Generation unit is used for generating data display model expandable mark language XML document according to described data display model definition;
Storage unit is used for described data display model XML document is stored in server.
15. device according to claim 14 is characterized in that,
Described definition unit also is used for definition of data and shows in the following information of model one or multinomial: search argument definition, packet condition, data sorting condition, data filter condition and data way of submission.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200910162784A CN101788994A (en) | 2009-08-14 | 2009-08-14 | Method for constructing data display model and method and device for displaying data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200910162784A CN101788994A (en) | 2009-08-14 | 2009-08-14 | Method for constructing data display model and method and device for displaying data |
Publications (1)
Publication Number | Publication Date |
---|---|
CN101788994A true CN101788994A (en) | 2010-07-28 |
Family
ID=42532210
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN200910162784A Pending CN101788994A (en) | 2009-08-14 | 2009-08-14 | Method for constructing data display model and method and device for displaying data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101788994A (en) |
Cited By (32)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102053838A (en) * | 2010-12-31 | 2011-05-11 | 山东中创软件商用中间件股份有限公司 | Form building method and device in rich client platform |
CN102236709A (en) * | 2011-07-01 | 2011-11-09 | 深圳中兴力维技术有限公司 | Flex-based monitoring page display method and system |
CN102306104A (en) * | 2011-08-26 | 2012-01-04 | 深圳市万兴软件有限公司 | Method and device for automatically updating application program |
CN102567032A (en) * | 2010-12-08 | 2012-07-11 | 金蝶软件(中国)有限公司 | Common interface configuration method and computer |
CN102902692A (en) * | 2011-07-28 | 2013-01-30 | 腾讯科技(北京)有限公司 | Method and system for processing and showing network media information |
CN102955694A (en) * | 2011-08-31 | 2013-03-06 | 中国电信股份有限公司 | Client implementation method based on WebKit browser and client |
CN103064975A (en) * | 2013-01-11 | 2013-04-24 | 北京亿赞普网络技术有限公司 | Method and system for showing messages on client |
CN103136201A (en) * | 2011-11-22 | 2013-06-05 | 阿里巴巴集团控股有限公司 | Method and device for displaying page information |
CN103345522A (en) * | 2013-07-18 | 2013-10-09 | 北京润通丰华科技有限公司 | Method and device for showing and processing and showing data |
CN103607434A (en) * | 2013-11-04 | 2014-02-26 | 四川长虹电器股份有限公司 | Interaction method of network communication data |
CN103701756A (en) * | 2012-09-27 | 2014-04-02 | 中国电信股份有限公司 | Method and device for protecting web form data and web server |
CN103885780A (en) * | 2014-03-28 | 2014-06-25 | 深圳创维-Rgb电子有限公司 | Website development method and server |
CN104252440A (en) * | 2013-10-08 | 2014-12-31 | 深圳市华傲数据技术有限公司 | Method and device for processing cell fonts |
CN105260439A (en) * | 2015-09-30 | 2016-01-20 | 小米科技有限责任公司 | Data release method and apparatus and terminal |
CN105335159A (en) * | 2015-11-03 | 2016-02-17 | 浪潮软件集团有限公司 | Anychart chart display method |
WO2016095737A1 (en) * | 2014-12-18 | 2016-06-23 | 阿里巴巴集团控股有限公司 | Method for dynamically displaying client interface and system thereof |
CN105786478A (en) * | 2014-12-23 | 2016-07-20 | 阿里巴巴集团控股有限公司 | Data processing method and device |
CN105871998A (en) * | 2015-12-18 | 2016-08-17 | 乐视致新电子科技(天津)有限公司 | Data displaying method and device |
CN105989010A (en) * | 2015-01-28 | 2016-10-05 | 上海飞维信息技术有限公司 | Web page data generation method, WEBITOX server and Web application system |
CN107291940A (en) * | 2017-07-07 | 2017-10-24 | 腾讯科技(深圳)有限公司 | Content of pages management method, device and associated server |
CN107391158A (en) * | 2017-08-02 | 2017-11-24 | 郑州云海信息技术有限公司 | A kind of method and apparatus that form drafting is realized based on iDataTable encapsulation |
CN103714509B (en) * | 2013-12-20 | 2018-05-04 | 北京奇虎科技有限公司 | The method and system of data interaction are carried out between a client and a server |
CN108132945A (en) * | 2016-12-01 | 2018-06-08 | 百度在线网络技术(北京)有限公司 | For generating the method and apparatus of report |
CN108133015A (en) * | 2017-12-22 | 2018-06-08 | 东软集团股份有限公司 | Form data trace method, apparatus, storage medium and electronic equipment |
CN108563621A (en) * | 2018-04-28 | 2018-09-21 | 江苏国泰新点软件有限公司 | A kind of PDF report form generation methods, device, equipment and storage medium |
CN108614842A (en) * | 2016-12-13 | 2018-10-02 | 北京国双科技有限公司 | The method and apparatus for inquiring data |
CN109313415A (en) * | 2016-07-05 | 2019-02-05 | 株式会社安川电机 | Parameter editing device of industrial equipment control device, industrial equipment control system, manufacturing method and program of industrial equipment control system |
CN109445794A (en) * | 2018-11-12 | 2019-03-08 | 北京中电普华信息技术有限公司 | A kind of page building method and device |
CN109522139A (en) * | 2018-11-23 | 2019-03-26 | 杭州数梦工场科技有限公司 | A kind of tables of data service creation call method, device, equipment and storage medium |
CN112860254A (en) * | 2021-02-07 | 2021-05-28 | 武汉蓝星科技股份有限公司 | Method for presenting list control by using data model |
CN112862449A (en) * | 2021-03-02 | 2021-05-28 | 岭东核电有限公司 | Structural chemical industry bill generation method and device, computer equipment and storage medium |
CN114003842A (en) * | 2021-11-01 | 2022-02-01 | 北京天融信网络安全技术有限公司 | Form processing method, apparatus, electronic device, and computer-readable storage medium |
-
2009
- 2009-08-14 CN CN200910162784A patent/CN101788994A/en active Pending
Cited By (44)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102567032A (en) * | 2010-12-08 | 2012-07-11 | 金蝶软件(中国)有限公司 | Common interface configuration method and computer |
CN102567032B (en) * | 2010-12-08 | 2016-01-20 | 金蝶软件(中国)有限公司 | The collocation method of General Purpose Interface and computing machine |
CN102053838A (en) * | 2010-12-31 | 2011-05-11 | 山东中创软件商用中间件股份有限公司 | Form building method and device in rich client platform |
CN102236709A (en) * | 2011-07-01 | 2011-11-09 | 深圳中兴力维技术有限公司 | Flex-based monitoring page display method and system |
CN102902692A (en) * | 2011-07-28 | 2013-01-30 | 腾讯科技(北京)有限公司 | Method and system for processing and showing network media information |
CN102306104A (en) * | 2011-08-26 | 2012-01-04 | 深圳市万兴软件有限公司 | Method and device for automatically updating application program |
CN102955694A (en) * | 2011-08-31 | 2013-03-06 | 中国电信股份有限公司 | Client implementation method based on WebKit browser and client |
CN102955694B (en) * | 2011-08-31 | 2016-06-22 | 中国电信股份有限公司 | The client realization method of sing on web Kit browser and client |
CN103136201A (en) * | 2011-11-22 | 2013-06-05 | 阿里巴巴集团控股有限公司 | Method and device for displaying page information |
CN103701756A (en) * | 2012-09-27 | 2014-04-02 | 中国电信股份有限公司 | Method and device for protecting web form data and web server |
CN103064975A (en) * | 2013-01-11 | 2013-04-24 | 北京亿赞普网络技术有限公司 | Method and system for showing messages on client |
CN103345522A (en) * | 2013-07-18 | 2013-10-09 | 北京润通丰华科技有限公司 | Method and device for showing and processing and showing data |
CN103345522B (en) * | 2013-07-18 | 2018-10-19 | 北京润通丰华科技有限公司 | Displaying processing, methods of exhibiting and the device of data |
CN104252440A (en) * | 2013-10-08 | 2014-12-31 | 深圳市华傲数据技术有限公司 | Method and device for processing cell fonts |
CN104252440B (en) * | 2013-10-08 | 2017-05-17 | 深圳市华傲数据技术有限公司 | Method and device for processing cell fonts |
CN103607434A (en) * | 2013-11-04 | 2014-02-26 | 四川长虹电器股份有限公司 | Interaction method of network communication data |
CN103714509B (en) * | 2013-12-20 | 2018-05-04 | 北京奇虎科技有限公司 | The method and system of data interaction are carried out between a client and a server |
CN103885780A (en) * | 2014-03-28 | 2014-06-25 | 深圳创维-Rgb电子有限公司 | Website development method and server |
CN105760149A (en) * | 2014-12-18 | 2016-07-13 | 阿里巴巴集团控股有限公司 | Client-terminal-interface dynamic display method and system |
CN105760149B (en) * | 2014-12-18 | 2020-05-05 | 阿里巴巴集团控股有限公司 | Client interface dynamic display method and system |
WO2016095737A1 (en) * | 2014-12-18 | 2016-06-23 | 阿里巴巴集团控股有限公司 | Method for dynamically displaying client interface and system thereof |
CN105786478A (en) * | 2014-12-23 | 2016-07-20 | 阿里巴巴集团控股有限公司 | Data processing method and device |
CN105786478B (en) * | 2014-12-23 | 2019-07-02 | 菜鸟智能物流控股有限公司 | Method and apparatus for data processing |
CN105989010A (en) * | 2015-01-28 | 2016-10-05 | 上海飞维信息技术有限公司 | Web page data generation method, WEBITOX server and Web application system |
CN105260439A (en) * | 2015-09-30 | 2016-01-20 | 小米科技有限责任公司 | Data release method and apparatus and terminal |
CN105260439B (en) * | 2015-09-30 | 2019-02-12 | 小米科技有限责任公司 | Data publication method, apparatus and terminal |
CN105335159B (en) * | 2015-11-03 | 2018-11-02 | 浪潮软件集团有限公司 | Anychart chart display method |
CN105335159A (en) * | 2015-11-03 | 2016-02-17 | 浪潮软件集团有限公司 | Anychart chart display method |
CN105871998A (en) * | 2015-12-18 | 2016-08-17 | 乐视致新电子科技(天津)有限公司 | Data displaying method and device |
CN109313415A (en) * | 2016-07-05 | 2019-02-05 | 株式会社安川电机 | Parameter editing device of industrial equipment control device, industrial equipment control system, manufacturing method and program of industrial equipment control system |
CN109313415B (en) * | 2016-07-05 | 2022-08-09 | 株式会社安川电机 | Parameter editing device for industrial machine control device, industrial machine control system, method for manufacturing industrial machine control system, and storage medium |
CN108132945A (en) * | 2016-12-01 | 2018-06-08 | 百度在线网络技术(北京)有限公司 | For generating the method and apparatus of report |
CN108614842A (en) * | 2016-12-13 | 2018-10-02 | 北京国双科技有限公司 | The method and apparatus for inquiring data |
CN107291940A (en) * | 2017-07-07 | 2017-10-24 | 腾讯科技(深圳)有限公司 | Content of pages management method, device and associated server |
CN107391158A (en) * | 2017-08-02 | 2017-11-24 | 郑州云海信息技术有限公司 | A kind of method and apparatus that form drafting is realized based on iDataTable encapsulation |
CN108133015A (en) * | 2017-12-22 | 2018-06-08 | 东软集团股份有限公司 | Form data trace method, apparatus, storage medium and electronic equipment |
CN108563621A (en) * | 2018-04-28 | 2018-09-21 | 江苏国泰新点软件有限公司 | A kind of PDF report form generation methods, device, equipment and storage medium |
CN108563621B (en) * | 2018-04-28 | 2022-08-05 | 国泰新点软件股份有限公司 | PDF report generation method, device, equipment and storage medium |
CN109445794B (en) * | 2018-11-12 | 2022-01-28 | 北京中电普华信息技术有限公司 | Page construction method and device |
CN109445794A (en) * | 2018-11-12 | 2019-03-08 | 北京中电普华信息技术有限公司 | A kind of page building method and device |
CN109522139A (en) * | 2018-11-23 | 2019-03-26 | 杭州数梦工场科技有限公司 | A kind of tables of data service creation call method, device, equipment and storage medium |
CN112860254A (en) * | 2021-02-07 | 2021-05-28 | 武汉蓝星科技股份有限公司 | Method for presenting list control by using data model |
CN112862449A (en) * | 2021-03-02 | 2021-05-28 | 岭东核电有限公司 | Structural chemical industry bill generation method and device, computer equipment and storage medium |
CN114003842A (en) * | 2021-11-01 | 2022-02-01 | 北京天融信网络安全技术有限公司 | Form processing method, apparatus, electronic device, and computer-readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101788994A (en) | Method for constructing data display model and method and device for displaying data | |
US6651055B1 (en) | OLAP query generation engine | |
CA2669479C (en) | Generating end-user presentations from structured data | |
US5455945A (en) | System and method for dynamically displaying entering, and updating data from a database | |
US7165073B2 (en) | Dynamic, hierarchical data exchange system | |
US8756495B2 (en) | Computer-implemented system and method for tagged and rectangular data processing | |
US20110087708A1 (en) | Business object based operational reporting and analysis | |
US8341512B2 (en) | Method for capturing design-time and run-time formulas associated with a cell | |
US20030074419A1 (en) | System and method for non-programmers to dynamically manage multiple sets of XML document data | |
CA2412318A1 (en) | Method and apparatus for efficient management of xml documents | |
KR20090028758A (en) | How to reuse information, how to present it, editable documents, and document editing systems | |
US9805112B2 (en) | Method and structure for managing multiple electronic forms and their records using a static database | |
CN113177168A (en) | Positioning method based on Web element attribute characteristics | |
US20250181826A1 (en) | Displaying data dimension of a descendant worksheet and data from one or more non-direct ancestor worksheets of a client-side spreadsheet | |
US20050033725A1 (en) | System and method of data modelling | |
Zhao | The database construction of intangible cultural heritage based on artificial intelligence | |
CN101794223B (en) | Design method of WADE service message architecture | |
US20110184975A1 (en) | Incorporated web page content | |
US20070094289A1 (en) | Dynamic, hierarchical data exchange system | |
JP5056384B2 (en) | Search program, method and apparatus | |
CN117851375A (en) | Metadata model optimization method and computing device | |
WO2010147453A1 (en) | System and method for designing a gui for an application program | |
JP3842574B2 (en) | Information extraction method, structured document management apparatus and program | |
Reitsma et al. | Relational (TE 1.0) vs. NoSQL (TE 2.0) | |
Liu et al. | Automatic updating of a combine harvester knowledge-based system by webpages and user-uploaded files |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20100728 |