Summary of the invention
In view of deficiency of the prior art, the object of the invention is to provide a kind of template network station to generate improved system and method.Be intended to solve template network station in prior art and use the problems such as the fill substance existing in the data stuffing technology after template is single, calling data is dumb.
Technical scheme of the present invention is as follows:
A kind of template network station generates and improves one's methods, and wherein, said method comprising the steps of:
A, according to user instruction, from described template configuration file, obtain web page template, generate the corresponding html page;
B, obtain the coding of web page template, set up a label in described coding, described label is for accessing database view;
C, when described in html page invocation during label, according to user instruction, determine the parameter of described label, obtain the data stuffing page.
Described template network station generates and improves one's methods, and wherein, label described in described step B is provided with the input item for user's input, and described input item comprises view name, records number and querying condition.
Described template network station generates and improves one's methods, and wherein, in described step C, described in html page invocation, label adopts freemarker mechanism to call.
Generate an improved system, wherein, comprising:
Page generation unit, for obtaining web page template according to user instruction from described template configuration file, generates the corresponding html page;
Label is set up unit, for obtaining the coding of web page template, sets up a label in described coding, and described label is for accessing database view;
Data stuffing unit, for when described in html page invocation during label, determines the parameter of described label according to user instruction, obtain the data stuffing page.
Described template network station generates improved system, and wherein, described label is set up label described in unit and is provided with the input item for user's input, and described input item comprises view name, records number and querying condition.
Described template network station generates improved system, and wherein, in described data stuffing unit, described in html page invocation, label adopts freemarker mechanism to call.
Beneficial effect:
Template network station of the present invention generates improved system and method, and than prior art, tool has the following advantages:
(1) flexible, can call arbitrary data, can tackle flexible and changeable demonstration demand;
(2) simple, to label, give simple parameter and can apply, unlike other invention, to configure complicated XML file etc.
Embodiment
The invention provides a kind of board-like website and generate improved system and method, for making object of the present invention, technical scheme and effect clearer, clear and definite, below the present invention is described in more detail.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
Refer to Fig. 1, the process flow diagram that it is improved one's methods for board-like website generation of the present invention.As shown in the figure, said method comprising the steps of:
S1, according to user instruction, from described template configuration file, obtain web page template, generate the corresponding html page;
S2, obtain the coding of web page template, set up a label in described coding, described label is for accessing database view;
S3, when described in html page invocation during label, according to user instruction, determine the parameter of described label, obtain the data stuffing page.
For above-mentioned steps, be described in detail respectively below:
Described step S1, for to obtain web page template from described template configuration file according to user instruction, generates the corresponding html page.Specifically, according to user instruction, from many covers web page template that template network station generation system or instrument provide, select needed web page template, generate the corresponding html page.This technology is identical with existing template type webpage generating method, has just seldom described here.
Described step S2 is the coding that obtains web page template, sets up a label in described coding, and described label is for accessing database view.Wherein, described data base view is a kind of conversion of raw data database data, is another mode of checking data in table.View can be regarded as to the window of a movement, by it, can see interested data.View obtains from one or more actual tables, and the deposit data of these tables is in database.Those tables for generation of view are called the base table of this view.A view also can produce from another view.The object of tag access is data base view, and the data that can only show needs generate view (for example only news being generated to view), and how label is used and all cannot access the not data of configuration view like this.In addition, wherein, label described in described step S2 is provided with the input item for user input, and described input item comprises view name, recording that number and querying condition etc. are multiple can input item.
Described step S3, for when described in html page invocation during label, determines the parameter of described label according to user instruction, obtain the data stuffing page.Specifically, in label, can specify view, the Call Condition that will call, to greatest extent the self-defined data that need demonstration.
How below by a concrete example, illustrate that template network station generates to improve one's methods realizes.
Embodiment mono-
Refer to Fig. 2, the lower right corner of the html page shown in Fig. 2 shows that " contacting us " only need to, at corresponding template position use label (showing in as following table black box), can recall the data of appointment:
Embodiment bis-
If think to apply more flexibly, for example want to call " front four headline are 333 news ", can carry out as follows:
First, use news view news; Then, limit the number 4, finally set restrictive condition for " title is 333 ",
<taq.list?name="newsrows"tarqet="news"orderBy="id?desc"type
=?"${newsTypeId}"scci="1"pageMax="4">title=333</taq.list>
Can obtain corresponding display page (being the data stuffing page) as shown in Figure 4;
Further, in the present embodiment, in described step S3, described in html page invocation, label adopts freemarker mechanism to call.Wherein, FreeMarker is a template engine of writing with Java language, and it becomes text output next life based on template.FreeMarker and Web container are irrelevant, and, when Web moves, it does not also know Servlet or HTTP.It not only can be used as the technology that realizes of presentation layer, but also can be for generating XML, JSP or Java etc.
The present invention also provides a kind of template network station to generate improved system, as shown in Figure 3, comprising:
Page generation unit 100, for obtaining web page template according to user instruction from described template configuration file, generates the corresponding html page;
Label is set upunit 200, for obtaining the coding of web page template, sets up a label in described coding, and described label is for accessing database view;
Data stuffing unit 300, for when described in html page invocation during label, determines the parameter of described label according to user instruction, obtain the data stuffing page.
Further, described template network station generates in improved system, and described label is set up label described in unit and is provided with the input item for user's input, and described input item comprises view name, records number and querying condition.
Further, described template network station generates in improved system, and in described data stuffing unit, described in html page invocation, label adopts freemarker mechanism to call.
The function of above-mentioned various piece is all described in detail in said method, here superfluous having stated no longer just.
In sum, template network station of the present invention generates improved system and method, and wherein, described method comprises: first, according to user instruction, from described template configuration file, obtain web page template, generate the corresponding html page; Then, obtain the coding of web page template, set up a label in described coding, described label is for accessing database view; When described in html page invocation during label, according to user instruction, determine the parameter of described label, obtain the data stuffing page.Than prior art, there is the advantages such as flexible, simple, can call arbitrary data, can tackle flexible and changeable demonstration demand; And to label, give simple parameter and can apply, unlike other invention, will configure complicated XML file etc.
Should be understood that, application of the present invention is not limited to above-mentioned giving an example, and for those of ordinary skills, can be improved according to the above description or convert, and all these improvement and conversion all should belong to the protection domain of claims of the present invention.