CN108614692A - Edit model method, apparatus, server and medium - Google Patents
Edit model method, apparatus, server and medium Download PDFInfo
- Publication number
- CN108614692A CN108614692A CN201710608083.6A CN201710608083A CN108614692A CN 108614692 A CN108614692 A CN 108614692A CN 201710608083 A CN201710608083 A CN 201710608083A CN 108614692 A CN108614692 A CN 108614692A
- Authority
- CN
- China
- Prior art keywords
- variable element
- template
- change
- variable
- instruction
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Stored Programmes (AREA)
Abstract
The present invention relates to a kind of edit model method, apparatus, server and medium, methods to include:Template file is obtained, template file is parsed, obtains template elements;The variable element in extraction template elements is instructed according to extraction;Changeable identity is added to variable element according to mark instruction;Template file, the corresponding editing interface of indicating template file in editing machine are loaded by editing machine;Changeable identity is identified by editing machine, and variable element is shown in editing interface according to changeable identity;Variable element is changed according to edit instruction;According to the variable element and other template elements after change, web page files are generated.By being extracted to the variable element in template file, and changeable identity is added to variable element, so that immutable template elements are distinguished with variable element, without re-creating pattern rule, make it possible to the editors such as change for variable element, effectively increases the editorial efficiency to template file.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of edit model method, apparatus, server and Jie
Matter.
Background technology
It will be used during webpage development and arrive web page template, web page template is developed according to demand, different webpage moulds
Plate is suitable for the page of different webpages.Web page template is opened on editing platform, and a visual interface can be provided, this
Sample, the developer of webpage can in the visualization interface to web page template into edlin, and then generate web page files.
The definition rule of existing web page template is complex, and different page needs is needed individually to develop not
With web page template, be difficult to realize between web page template general, the recycling rate of waterused of web page template is low, causes opening for web page template
It is higher to send out cost, webpage development inefficiency.
Invention content
Based on this, it is necessary in view of the above technical problems, provide a kind of applicability higher, can reduce webpage development at
This, improves edit model method, apparatus, server and the medium of webpage development efficiency.
A kind of edit model method, the method includes:
Template file is obtained, the template file is parsed, obtains the template elements in the template file;
Extraction instruction is obtained, the variable element in the template elements is extracted according to the extraction instruction;
Mark instruction is obtained, changeable identity is added to the variable element according to mark instruction;
The template file is loaded by editing machine, corresponding editor circle of the template file is shown in the editing machine
Face;
The changeable identity is identified by the editing machine, and is shown in the editing interface according to the changeable identity
The variable element;
The edit instruction to the variable element is obtained, the variable element is changed according to the edit instruction;
According to the variable element and other described template elements after change, web page files are generated.
The variable element and other described template elements according to after change in one of the embodiments,
Generate web page files the step of include:
It receives and generates instruction, according to the changeable identity for generating the variable element that instruction is deleted after change;
According to other described templates in the variable element and the template file for deleting the changeable identity
Element generates more new template;
According to web page files described in the update template generation.
The edit instruction obtained to the variable element in one of the embodiments, according to the edit instruction
The step of being changed to the variable element include:
The edit instruction to the variable element is obtained, selects can be changed from the editing interface according to the edit instruction
Element;
Obtain the element property of the selected variable element;
Change element is obtained in predicted elemental library according to the edit instruction, obtains the element category of the change element
Property;
Whether the element property for detecting the variable element is consistent with the element property of the change element, when described variable
When the element property of element is consistent with the change element property of element, the variable element is changed to the change member
Element;
The step of variable element and other described template elements according to after change, generation web page files
For:
According to the change element and other described template elements, web page files are generated.
The variable element and other described template elements according to after change in one of the embodiments,
Generate web page files the step of include:
Obtain the variable element after change and other template elements in the template file;
According to the correspondence of template elements and the variable element and code snippet, obtaining can with described after change
Become the corresponding code snippet of other described template elements in element and the template file;
According to preset rules, each code snippet is compiled, generates and executes code;
According to web page files described in the execution code building.
It is described in one of the embodiments, that each code snippet is compiled according to preset rules, it generates and executes
The step of code includes:
Obtain the Logic Priority grade of multiple code snippets;
According to logic of propositions sequence and the Logic Priority grade of multiple code snippets, to multiple code snippets into
Row compiling, and generate the execution code.
A kind of edit model device, described device include:
Block elements acquisition module parses the template file, obtains in the template file for obtaining template file
Template elements;
Variable element extraction module is extracted according to extraction instruction in the template elements for obtaining extraction instruction
Variable element;
Changeable identity add module adds the variable element according to mark instruction for obtaining mark instruction
Changeable identity;
Editing interface display module loads the template file for passing through editing machine, institute is shown in the editing machine
State the corresponding editing interface of template file;
Variable element display module, for identifying the changeable identity by the editing machine, and according to the variable mark
Knowledge shows the variable element in the editing interface;
Module is changed, for obtaining the edit instruction to the variable element, according to the edit instruction to described variable
Element changes;
Web page files generation module, for according to the variable element and other described template elements after change, life
At web page files.
The web page files generation module includes in one of the embodiments,:
Changeable identity deleting unit, for receive generate instruction, according to generations instruction delete change after described in can
Become the changeable identity of element;
Update module generation unit deletes the variable element of the changeable identity and the template for basis
Other described template elements in file generate more new template;
Web page files generation unit, for according to web page files described in the update template generation.
The change module includes in one of the embodiments,:
Variable element selecting unit, for obtaining edit instruction to the variable element, according to the edit instruction from
Variable element is selected in the editing interface;
First element property acquiring unit, the element property for obtaining the selected variable element;
Second element attribute acquiring unit, for change element to be obtained in predicted elemental library according to the edit instruction,
Obtain the element property of the change element;
Changing unit, for detect the element property of the variable element and the change element element property whether one
It causes, when the element property of the variable element is consistent with the change element property of element, the variable element is changed
For the change element;
The web page files generation module is additionally operable to, according to the change element and other described template elements, generate net
Page file.
A kind of server, including memory, processor and storage are on a memory and the calculating that can run on a processor
The step of machine program, the processor realizes method described in any of the above-described embodiment when executing described program.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor
The step of method described in any of the above-described embodiment is realized when row.
Above-mentioned edit model method, apparatus, server and medium, by being carried to the variable element in template file
It takes, and changeable identity is added to variable element so that immutable template elements are distinguished with variable element, without again
Drawing template establishment rule, enabling the editors such as change for variable element, effectively increase editor's effect to template file
Rate.
Description of the drawings
Fig. 1 is the applied environment figure of edit model method in one embodiment;
Fig. 2 is the flow chart of edit model method in one embodiment;
Fig. 3 is the structural schematic diagram of edit model device in one embodiment;
Fig. 4 is the structural schematic diagram of server in one embodiment.
Specific implementation mode
In order to make the purpose , technical scheme and advantage of the present invention be clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the present invention, not
For limiting the present invention.
Edit model method provided in the embodiment of the present invention can be applied in application environment as shown in Figure 1.Its
In, multiple terminals 102 are attached with server 104 respectively by network.Template file is uploaded to by multiple terminals 102 respectively
Server 104.After server 104 receives template file, template file is parsed, the template elements in template file are obtained, eventually
End 102 receives extraction instruction and mark instruction input by user, and is sent to server, and server 104 is carried according to extraction instruction
Variable element in modulus plate element adds changeable identity according to mark instruction to variable element.Server 104 passes through editing machine
Load template file, and in editing machine indicating template file editing interface, and in editing interface distinguish show variable elements
Plain and immutable template elements, server 104 change variable element the edit instruction of variable element according to user,
Then according to the variable element and other described template elements after change, web page files are generated.
In one embodiment, as shown in Fig. 2, providing a kind of edit model method, it is applied in Fig. 1 in this way
It is illustrated for server, specifically includes following steps:
Step 202, template file is obtained, template file is parsed, obtains the template elements in template file.
Specifically, which is the template file of Webpage, which can be web page, can also
It is the template file of the display page of application program in terminal, which can be regarded as template, the net of different display styles
The page page or the display page of application program have different template files.
The template file contains several template elements, and template elements are to form the most basic element of template file.Tool
Body, which can be a pattern, picture or character string in template file, can also be to build the template
The a certain generic attribute of file, for example, template elements are the display size or template of the color template of template
The display mode of transparency or template.
In this step, by being parsed to template file, all template elements in template file is got, that is, are obtained
It forms the whole elements of the template file and builds the attribute of the template file.
Step 204, extraction instruction is obtained, the variable element in extraction template elements is instructed according to extraction.
Specifically, variable element is the template elements that can be replaced or can change in template file,
That is variable element is one kind of template elements, in other words, variable element belongs to template elements, is obtained in above-mentioned steps
After all template elements in template file, this step extracts variable element according to extraction instruction from multiple template element.
Obtain extraction instruction after, extract variable element, can be considered selected from multiple template element one of those or
Multiple person is variable element, or determines that one or more of which is variable element from multiple template element.
It is noted that extraction instruction can be obtained according to user input instruction, extraction instruction can also be
It is obtained according to default extracting rule.
Step 206, mark instruction is obtained, changeable identity is added to variable element according to mark instruction.
Specifically, changeable identity is for identifying the variable element, for distinguishing variable element and other template elements.It can
To be interpreted as, be added to changeable identity is variable element, and is not added with other template elements of changeable identity, then for can not
The template elements of change, immutable template elements are not available for replacing or be not available for change.
In this step, after variable element is determined, changeable identity is added to variable element according to mark instruction so that can
It is associated with changeable identity to become element, a variable element corresponds to a changeable identity.
The changeable identity can be the value of a preset field in template elements, in one embodiment, changeable identity
For the value of a preset identification field of template elements, for example, the data type of the changeable identity is character string, to variable elements
The value of the identification field is namely revised as preset value by element addition changeable identity, for example, each template elements includes
The value range of one preset identification field, the identification field is " 0 " and " 1 ", when the identification field value is " 1 ", then
The template elements are variable element, and when identification field value is " 0 ", then the template elements are immutable template elements.This
In embodiment, the original value of the identification field of each template elements is " 0 ", variable when being added to variable element according to mark instruction
After mark, the value of the identification field of variable element is revised as " 1 " in this way, the value of identification field is the template elements of " 1 " by " 0 "
As variable element, and the template elements that the value of identification field is " 0 " are immutable template elements.
In a further embodiment, it is that identification field is added to variable element to variable element addition changeable identity.Pass through
The identification field can distinguish variable element and immutable template elements.
In one embodiment, the changeable identity of each variable element is unified mark, that is, indicates the character of changeable identity
String is identical value, and the changeable identity of each template elements is identical, is only used for marking the template elements replaceable or modifiable;Another
In outer embodiment, the changeable identity of each template elements is different, that is, indicates that the character string of changeable identity is variant, but with same
One attribute is exactly " template elements are variable ", in this way, the changeable identity can also be used to the attribute of label template elements, template member
The information that element is operated.
Step 208, template file, the corresponding editing interface of indicating template file in editing machine are loaded by editing machine.
Specifically, the editing machine is for loading template file, and template file is shown, the mould is shown by the editing machine
The corresponding editing interface of plate file, it is graphical to obtain the template file, so that the template file can be edited.
Step 210, changeable identity is identified by editing machine, and variable elements is shown in editing interface according to changeable identity
Element.
In this step, after editing machine loads template file, the template elements in template file are read, and then obtain variable elements
The changeable identity of element, by identifying changeable identity, and then the immutable template elements of Division identification and variable element, according to this
Changeable identity shows variable element, so that the display mode of variable element and immutable other template elements
Display mode is different.
In one embodiment, the template elements that acquisition template file after template file is loaded by editing machine, read mould
The value of the identification field of plate element identifies changeable identity, according to changeable identity in editing interface according to the value of identification field
It shows variable element, i.e., is distinguished according to the value of the identification field and show variable element and other immutable template elements, in turn
So that variable element and other immutable template elements are distinguished.
In one embodiment, variable element is shown in editing interface according to changeable identity, and shows variable element pair
The changeable identity answered, for example, show changeable identity while showing variable element, and to variable element and changeable identity into
Row association is shown, in the present embodiment, changeable identity is visual mark, and changeable identity is visual in editing interface, changeable identity
For a pattern, which may be a pictorial symbolization, and variable element and changeable identity are shown by association, each
Variable element is associated with display with a changeable identity so that variable element can be distinguished with other immutable template elements.
Step 212, the edit instruction to variable element is obtained, variable element is changed according to edit instruction.
Specifically, edit instruction is used for variable element into edlin so that variable element realizes change, to variable element
It changes and can be understood as being replaced variable element, for example, being replaced variable element with a replacement element so that
Variable element realizes change, and the variable element after change all has changeable identity with variable element before changing, in other words, change
Variable element afterwards also has a preset identification field, and the value of the identification field of the variable element after change is variable with before changing
The value of the identification field of element is identical.That is, the variable element after change is still variable.
Step 214, according to the variable element and other template elements after change, web page files are generated.
In this step, the other template elements not changed in the variable element and template file after change constitute most
Whole template file, the template file is for generating web page files.
In above-described embodiment, by being extracted to the variable element in template file, and variable element is added variable
Mark so that immutable template elements are distinguished with variable element, without re-creating pattern rule, enabling needle
Editors are changed etc. to variable element, effectively increase the editorial efficiency to template file.
In one embodiment, according to the variable element and other template elements after change, the step of web page files is generated
Suddenly include:It receives and generates instruction, the changeable identity of the variable element after deleting change is instructed according to generation;It is variable according to deleting
The variable element of mark and other template elements in template file generate more new template;According to update template generation webpage
File.
In the present embodiment, more new template is updated template file, which instructs for being carried out to template file
Compiling generates web page files.Specifically, after receiving generation instruction, then mean template file it has been determined that without to mould
Plate file is changed into edlin without to the variable element in template file, then by the corresponding variable mark of variable element
To know and deletes so that all template elements in template file do not include changeable identity, or do not include identification field, in this way,
Make template file data volume smaller, and so that generating web page files does not include changeable identity yet so that web page files are more simple
It is clean.And after web page files are opened, changeable identity will not be shown on the display page of web page files, so that webpage is literary
The display page of part is more succinct.
The step of one embodiment is, the changeable identity of variable element is deleted further includes by the identification field of variable element
It deletes, and also deletes the identification field of immutable template elements so that do not include identification field in template file.
In one embodiment, the edit instruction to variable element is obtained, variable element is become according to edit instruction
More the step of includes:The edit instruction to variable element is obtained, variable element is selected from editing interface according to edit instruction;It obtains
Take the element property of selected variable element;Change element is obtained in predicted elemental library according to edit instruction, obtains change
The element property of element;Whether the element property for detecting variable element is consistent with the element property of change element, works as variable element
Element property with change the element property of element it is consistent when, by variable element be changed to change element;According to after change can
The step of becoming element and other template elements, generating web page files be:According to change element and other template elements, generate
Web page files.
Specifically, element property is a field of variable element, for example, element property is the attribute word of variable element
Section, the element property are used to indicate the attribute of variable element, which can be understood as classification, for example, the variable elements of graphics class
The element property of element is identical, and the element property of the variable element of character string class is identical, is used for the display styles of definition template file
Variable element element property it is identical.The value of the variable element of same alike result, attribute field is identical.
It is the change element to prestore to change element, includes multiple changes for replacing variable element, in the predicted elemental library
Element, different change elements have different element properties.In the present embodiment, the change element of identical element property just may be used
Variable element is replaced.
Specifically, edit instruction is additionally operable to carry out selection determination to the change element in predicted elemental library, when selection determines
After variable element and change element, the element property of variable element is obtained respectively and changes the element property of element, it is right
The element property of the two carries out contrasting detection, when the element property of the two is identical, then by the variable element in template file
Change element is replaced with, after the completion of change operation, template file is updated to more new template.
And updated more new template includes other in change element and template file in template file does not change
Template elements, then according to updated update template generation web page files.
In one embodiment, according to the variable element and other template elements after change, the step of web page files is generated
Suddenly include:Obtain the variable element after change and other template elements in template file;According to template elements and can be changed
The correspondence of element and code snippet obtains and the variable element after change and other template elements pair in template file
The code snippet answered;According to preset rules, each code snippet is compiled, generates and executes code;According to execution code building
Web page files.
Specifically, each template elements correspond to a code snippet, which is in the execution code of web page files
A part, since variable element is one kind of template elements, each variable element also corresponds to a code snippet, and the generation
Do not include changeable identity in chip segment, in other words, identification field corresponding with changeable identity is not included in code snippet.Template member
The correspondence of element and code snippet is preset in the server, and code snippet is also to be pre-stored in server.
In the present embodiment, the corresponding code snippet of template elements all in template file is obtained, that is, it includes change to obtain
The code snippet of the code snippet of variable element afterwards and other template elements not changed, and according to preset rules to all
Code snippet be compiled, generate execute code, pass through the corresponding web page files of execution code building.
In one embodiment, according to preset rules, each code snippet is compiled, the step of executing code is generated and wraps
It includes:Obtain the Logic Priority grade of multiple code snippets;According to logic of propositions sequence and the Logic Priority grade of multiple code snippets,
Multiple code snippets are compiled, and generate execution code.
It should be understood that there is nested or call relation between template elements, for example, each template elements corresponds to
The execution of one service logic, partial service logic need to execute on the basis of other service logics, the nesting of the service logic
Or call relation is then embodied by Logic Priority grade, the first code snippet of Logic Priority grade needs to run first, and logic
The posterior code snippet of priority is then run after the first code snippet operation of Logic Priority grade, logic of propositions journal
Logic Priority grade executes sequence, therefore, execution code is sequentially generated according to logic of propositions, enables to the execution generation generated
Code service logic is more accurate, avoids the occurrence of compile error.
In one embodiment, as shown in figure 3, providing a kind of edit model device, including:Block elements acquisition module
302, variable element extraction module 304, changeable identity add module 306, editing interface display module 308, variable element are shown
Module 310, change module 312 and web page files generation module 314, wherein:
Block elements acquisition module 302 parses template file, obtains the template in template file for obtaining template file
Element.
Variable element extraction module 304 instructs variable in extraction template elements for obtaining extraction instruction according to extraction
Element.
Changeable identity add module 306 adds variable mark for obtaining mark instruction, according to mark instruction to variable element
Know.
Editing interface display module 308 is used to load template file, the indicating template file in editing machine by editing machine
Corresponding editing interface.
Variable element display module 310 is used for by editing machine identification changeable identity, and according to changeable identity in editor circle
Variable element is shown in face.
Change module 312 is used to obtain the edit instruction to variable element, is become to variable element according to edit instruction
More.
Web page files generation module 314 is used to, according to the variable element and other template elements after change, generate webpage
File.
In one embodiment, web page files generation module 314 includes:
Changeable identity deleting unit, instruction is generated for receiving, and the variable element after deleting change is instructed according to generating
Changeable identity.
Update module generation unit, for according to delete changeable identity variable element and template file in other
Template elements generate more new template.
Web page files generation unit, for according to update template generation web page files.
In one embodiment, change module 312 includes:
Variable element selecting unit, for obtaining edit instruction to variable element, according to edit instruction from editing interface
Middle selection variable element.
First element property acquiring unit, the element property for obtaining selected variable element.
Second element attribute acquiring unit is obtained for obtaining change element in predicted elemental library according to edit instruction
Change the element property of element.
Changing unit, whether element property for detecting variable element and the element property for changing element are consistent, when can
When the element property of change element is consistent with the change element property of element, variable element is changed to change element.
Web page files generation module 314 is additionally operable to, according to change element and other template elements, generate web page files.
In one embodiment, web page files generation module 314 includes:
Block elements acquiring unit, other templates member for obtaining the variable element after changing and in template file
Element.
Code snippet acquiring unit is obtained for the correspondence according to template elements and variable element and code snippet
Take code snippet corresponding with the variable element after change and other template elements in template file.
Code generating unit is executed, for according to preset rules, being compiled to each code snippet, generates and executes code.
Web page files generation unit, for according to execution code building web page files.
In one embodiment, executing code generating unit includes:
Logic Priority grade obtains subelement, the Logic Priority grade for obtaining multiple code snippets.
Code building subelement is executed, the Logic Priority grade according to logic of propositions sequence and multiple code snippets is used for,
Multiple code snippets are compiled, and generate execution code.
In one embodiment, a kind of server is provided, as shown in figure 4, the server includes connecting by system bus
The processor that connects, memory, storage are on a memory and the computer program that can be run on a processor and network interface etc..
Wherein, processor is for providing calculating and control ability.Memory provides environment for the operation of computer program.Memory includes
Built-in storage and non-volatile memory medium.Network interface is used to communicate by network connection with external computer equipment.Place
Reason device realizes following steps when executing computer program:
Template file is obtained, template file is parsed, obtains the template elements in template file.
Extraction instruction is obtained, the variable element in extraction template elements is instructed according to extraction.
Mark instruction is obtained, changeable identity is added to variable element according to mark instruction.
Template file, the corresponding editing interface of indicating template file in editing machine are loaded by editing machine.
Changeable identity is identified by editing machine, and variable element is shown in editing interface according to changeable identity.
The edit instruction to variable element is obtained, variable element is changed according to edit instruction.
According to the variable element and other template elements after change, web page files are generated.
The server can be realized with the server cluster of the either multiple server compositions of independent server.Ability
Field technique personnel are appreciated that structure shown in Fig. 4, only with the block diagram of the relevant part-structure of application scheme, and
The restriction for the server being applied thereon to application scheme is not constituted, specific server may include than as shown in the figure more
More or less component either combines certain components or is arranged with different components.
In one embodiment, following steps are also realized when processor executes computer program:
It receives and generates instruction, the changeable identity of the variable element after deleting change is instructed according to generation.
According to other template elements in the variable element and template file for deleting changeable identity, update mould is generated
Plate.
According to update template generation web page files.
In one embodiment, following steps are also realized when processor executes computer program:It obtains to variable element
Edit instruction selects variable element according to edit instruction from editing interface.
Obtain the element property of selected variable element.
Change element is obtained in predicted elemental library according to edit instruction, obtains the element property of change element.
Whether the element property for detecting variable element is consistent with the element property of change element, when the element category of variable element
Property with change the element property of element it is consistent when, by variable element be changed to change element.
According to the variable element and other template elements after change, the step of generating web page files, is:
According to change element and other template elements, web page files are generated.
In one embodiment, following steps are also realized when processor executes computer program:
Obtain the variable element after change and other template elements in template file.
According to the correspondence of template elements and variable element and code snippet, obtain with the variable element after change with
And the corresponding code snippet of other template elements in template file.
According to preset rules, each code snippet is compiled, generates and executes code.
According to execution code building web page files.
In one embodiment, following steps are also realized when processor executes computer program:
Obtain the Logic Priority grade of multiple code snippets.
According to logic of propositions sequence and the Logic Priority grade of multiple code snippets, multiple code snippets are compiled,
And generate execution code.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated
Machine program realizes following steps when being executed by processor:
Template file is obtained, template file is parsed, obtains the template elements in template file.
Extraction instruction is obtained, the variable element in extraction template elements is instructed according to extraction.
Mark instruction is obtained, changeable identity is added to variable element according to mark instruction.
Template file, the corresponding editing interface of indicating template file in editing machine are loaded by editing machine.
Changeable identity is identified by editing machine, and variable element is shown in editing interface according to changeable identity.
The edit instruction to variable element is obtained, variable element is changed according to edit instruction.
According to the variable element and other template elements after change, web page files are generated.
In one embodiment, following steps are also realized when computer program is executed by processor:
It receives and generates instruction, the changeable identity of the variable element after deleting change is instructed according to generation.
According to other template elements in the variable element and template file for deleting changeable identity, update mould is generated
Plate.
According to update template generation web page files.
In one embodiment, following steps are also realized when computer program is executed by processor:
The edit instruction to variable element is obtained, variable element is selected from editing interface according to edit instruction.
Obtain the element property of selected variable element.
Change element is obtained in predicted elemental library according to edit instruction, obtains the element property of change element.
Whether the element property for detecting variable element is consistent with the element property of change element, when the element category of variable element
Property with change the element property of element it is consistent when, by variable element be changed to change element.
According to the variable element and other template elements after change, the step of generating web page files, is:
According to change element and other template elements, web page files are generated.
In one embodiment, following steps are also realized when computer program is executed by processor:
Obtain the variable element after change and other template elements in template file.
According to the correspondence of template elements and variable element and code snippet, obtain with the variable element after change with
And the corresponding code snippet of other template elements in template file.
According to preset rules, each code snippet is compiled, generates and executes code.
According to execution code building web page files.
In one embodiment, following steps are also realized when computer program is executed by processor:
Obtain the Logic Priority grade of multiple code snippets.
According to logic of propositions sequence and the Logic Priority grade of multiple code snippets, multiple code snippets are compiled,
And generate execution code.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a non-volatile computer and can be read
In storage medium, the program is when being executed, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, the storage is situated between
Matter can be magnetic disc, CD, read-only memory (Read-Only Memory, ROM) etc..
Each technical characteristic of embodiment described above can be combined arbitrarily, to keep description succinct, not to above-mentioned reality
It applies all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited
In contradiction, it is all considered to be the range of this specification record.
Several embodiments of the invention above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously
It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art
It says, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the protection of the present invention
Range.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.
Claims (10)
1. a kind of edit model method, the method includes:
Template file is obtained, the template file is parsed, obtains the template elements in the template file;
Extraction instruction is obtained, the variable element in the template elements is extracted according to the extraction instruction;
Mark instruction is obtained, changeable identity is added to the variable element according to mark instruction;
The template file is loaded by editing machine, the corresponding editing interface of the template file is shown in the editing machine;
The changeable identity is identified by the editing machine, and described in showing in the editing interface according to the changeable identity
Variable element;
The edit instruction to the variable element is obtained, the variable element is changed according to the edit instruction;
According to the variable element and other described template elements after change, web page files are generated.
2. according to the method described in claim 1, it is characterized in that, the variable element according to after change and other
The template elements, generate web page files the step of include:
It receives and generates instruction, according to the changeable identity for generating the variable element that instruction is deleted after change;
According to other described template elements in the variable element and the template file for deleting the changeable identity,
Generate more new template;
According to web page files described in the update template generation.
3. according to the method described in claim 1, it is characterized in that, the edit instruction obtained to the variable element, root
The step of being changed to the variable element according to the edit instruction include:
The edit instruction to the variable element is obtained, variable elements are selected from the editing interface according to the edit instruction
Element;
Obtain the element property of the selected variable element;
Change element is obtained in predicted elemental library according to the edit instruction, obtains the element property of the change element;
Whether the element property for detecting the variable element is consistent with the element property of the change element, when the variable element
Element property it is consistent with the change element property of element when, the variable element is changed to the change element;
The variable element and other described template elements according to after change, generate web page files the step of be:
According to the change element and other described template elements, web page files are generated.
4. according to the method described in claim 1, it is characterized in that, the variable element according to after change and other
The template elements, generate web page files the step of include:
Obtain the variable element after change and other template elements in the template file;
According to the correspondence of template elements and the variable element and code snippet, obtain and the variable elements after change
The corresponding code snippet of other described template elements in the plain and described template file;
According to preset rules, each code snippet is compiled, generates and executes code;
According to web page files described in the execution code building.
5. according to the method described in claim 4, it is characterized in that, described according to preset rules, to each code snippet into
Row compiling, generating the step of executing code includes:
Obtain the Logic Priority grade of multiple code snippets;
According to logic of propositions sequence and the Logic Priority grade of multiple code snippets, multiple code snippets are compiled
It translates, and generates the execution code.
6. a kind of edit model device, which is characterized in that described device includes:
Block elements acquisition module parses the template file, obtains the mould in the template file for obtaining template file
Plate element;
Variable element extraction module, for obtaining extraction instruction, according to the extraction instruction extract in the template elements can
Become element;
Changeable identity add module adds the variable element according to mark instruction variable for obtaining mark instruction
Mark;
Editing interface display module loads the template file for passing through editing machine, the mould is shown in the editing machine
The corresponding editing interface of plate file;
Variable element display module for identifying the changeable identity by the editing machine, and exists according to the changeable identity
The display variable element in the editing interface;
Module is changed, for obtaining the edit instruction to the variable element, according to the edit instruction to the variable element
It changes;
Web page files generation module, for according to the variable element and other described template elements after change, generating net
Page file.
7. device according to claim 6, which is characterized in that the web page files generation module includes:
Changeable identity deleting unit generates instruction for receiving, and the variable elements after change is deleted in instruction are generated according to described
The changeable identity of element;
Update module generation unit deletes the variable element of the changeable identity and the template file for basis
In other described template elements, generate more new template;
Web page files generation unit, for according to web page files described in the update template generation.
8. device according to claim 6, which is characterized in that the change module includes:
Variable element selecting unit, for obtaining edit instruction to the variable element, according to the edit instruction from described
Variable element is selected in editing interface;
First element property acquiring unit, the element property for obtaining the selected variable element;
Second element attribute acquiring unit is obtained for obtaining change element in predicted elemental library according to the edit instruction
The element property of the change element;
Changing unit, whether the element property for detecting the variable element is consistent with the element property of the change element,
When the element property of the variable element is consistent with the change element property of element, the variable element is changed to institute
State change element;
The web page files generation module is additionally operable to, according to the change element and other described template elements, generate webpage text
Part.
9. a kind of server, including memory, processor and storage are on a memory and the computer that can run on a processor
Program, which is characterized in that the processor realizes the step of any one of claim 1-5 the methods when executing described program
Suddenly.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program
The step of any one of claim 1-5 the methods are realized when being executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710608083.6A CN108614692A (en) | 2017-07-24 | 2017-07-24 | Edit model method, apparatus, server and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710608083.6A CN108614692A (en) | 2017-07-24 | 2017-07-24 | Edit model method, apparatus, server and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108614692A true CN108614692A (en) | 2018-10-02 |
Family
ID=63658778
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710608083.6A Pending CN108614692A (en) | 2017-07-24 | 2017-07-24 | Edit model method, apparatus, server and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108614692A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109358848A (en) * | 2018-10-17 | 2019-02-19 | 杨易超 | Custom instruction edit methods, device and computer equipment |
CN109933322A (en) * | 2019-01-28 | 2019-06-25 | 平安科技(深圳)有限公司 | A kind of page editing method, apparatus and computer readable storage medium |
CN112632437A (en) * | 2020-11-27 | 2021-04-09 | 中国银联股份有限公司 | Webpage generating method and device and computer readable storage medium |
CN113033171A (en) * | 2019-12-09 | 2021-06-25 | 阿里巴巴集团控股有限公司 | Template creating method, file generating method, device and computer equipment |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040268303A1 (en) * | 2003-06-11 | 2004-12-30 | Mari Abe | System, method, and computer program product for generating a web application with dynamic content |
CN102637188A (en) * | 2010-12-15 | 2012-08-15 | 微软公司 | Extensible template pipeline for web applications |
CN104375812A (en) * | 2013-08-13 | 2015-02-25 | 腾讯科技(深圳)有限公司 | Webpage content modifying template construction method and webpage content modifying method and system |
CN104461484A (en) * | 2013-09-16 | 2015-03-25 | 腾讯科技(深圳)有限公司 | Front-end template implementation method and device |
CN104636400A (en) * | 2013-11-15 | 2015-05-20 | 腾讯科技(深圳)有限公司 | Browser webpage generating method, browser and system |
CN105447096A (en) * | 2015-11-09 | 2016-03-30 | 百度在线网络技术(北京)有限公司 | Web page generation method and apparatus |
CN105446726A (en) * | 2014-09-25 | 2016-03-30 | 腾讯科技(深圳)有限公司 | Method and device for generating webpage |
CN105912613A (en) * | 2016-04-06 | 2016-08-31 | 江苏中威科技软件系统有限公司 | Website template quick migration method |
CN106201642A (en) * | 2016-06-29 | 2016-12-07 | 微梦创科网络科技(中国)有限公司 | A kind of template automatization based on NODEJS compiling loading method and system |
CN106528578A (en) * | 2015-09-15 | 2017-03-22 | 阿里巴巴集团控股有限公司 | An information display method and device |
CN106557329A (en) * | 2016-11-30 | 2017-04-05 | 安徽金曦网络科技股份有限公司 | Web page editing system |
-
2017
- 2017-07-24 CN CN201710608083.6A patent/CN108614692A/en active Pending
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040268303A1 (en) * | 2003-06-11 | 2004-12-30 | Mari Abe | System, method, and computer program product for generating a web application with dynamic content |
CN102637188A (en) * | 2010-12-15 | 2012-08-15 | 微软公司 | Extensible template pipeline for web applications |
CN104375812A (en) * | 2013-08-13 | 2015-02-25 | 腾讯科技(深圳)有限公司 | Webpage content modifying template construction method and webpage content modifying method and system |
CN104461484A (en) * | 2013-09-16 | 2015-03-25 | 腾讯科技(深圳)有限公司 | Front-end template implementation method and device |
CN104636400A (en) * | 2013-11-15 | 2015-05-20 | 腾讯科技(深圳)有限公司 | Browser webpage generating method, browser and system |
CN105446726A (en) * | 2014-09-25 | 2016-03-30 | 腾讯科技(深圳)有限公司 | Method and device for generating webpage |
CN106528578A (en) * | 2015-09-15 | 2017-03-22 | 阿里巴巴集团控股有限公司 | An information display method and device |
CN105447096A (en) * | 2015-11-09 | 2016-03-30 | 百度在线网络技术(北京)有限公司 | Web page generation method and apparatus |
CN105912613A (en) * | 2016-04-06 | 2016-08-31 | 江苏中威科技软件系统有限公司 | Website template quick migration method |
CN106201642A (en) * | 2016-06-29 | 2016-12-07 | 微梦创科网络科技(中国)有限公司 | A kind of template automatization based on NODEJS compiling loading method and system |
CN106557329A (en) * | 2016-11-30 | 2017-04-05 | 安徽金曦网络科技股份有限公司 | Web page editing system |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109358848A (en) * | 2018-10-17 | 2019-02-19 | 杨易超 | Custom instruction edit methods, device and computer equipment |
CN109933322A (en) * | 2019-01-28 | 2019-06-25 | 平安科技(深圳)有限公司 | A kind of page editing method, apparatus and computer readable storage medium |
CN109933322B (en) * | 2019-01-28 | 2024-05-24 | 平安科技(深圳)有限公司 | Page editing method and device and computer readable storage medium |
CN113033171A (en) * | 2019-12-09 | 2021-06-25 | 阿里巴巴集团控股有限公司 | Template creating method, file generating method, device and computer equipment |
CN112632437A (en) * | 2020-11-27 | 2021-04-09 | 中国银联股份有限公司 | Webpage generating method and device and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105446723B (en) | Method and apparatus for identifying the semantic differential between source code version | |
US8370808B2 (en) | Apparatus and a method for generating a test case | |
CN106062711A (en) | Compound controls | |
CN108614692A (en) | Edit model method, apparatus, server and medium | |
CN103109264A (en) | Creating a configuration file template | |
CN107608951A (en) | Report form generation method and system | |
US10884711B2 (en) | Code management system and code management method using a visual programming tool | |
CN113268227A (en) | Zero-code visualization software development platform and development method | |
CN109491884A (en) | Code method for testing performance, device, computer equipment and medium | |
CN109634569A (en) | Process implementation method, device, equipment and readable storage medium storing program for executing based on note | |
JP6486574B2 (en) | Program code generating apparatus, program code generating method, and program code generating program | |
CN102214142A (en) | Instrumentation method for traceless manageable source code manually-defined mark | |
CN105446952A (en) | Method and system for processing semantic fragments | |
CN116301774A (en) | Code generation method and device, electronic equipment and medium | |
CN109766343A (en) | The method and apparatus of different flowline numberings is generated based on WBS instantiated nodes | |
CN101710275B (en) | Gui tool is utilized to carry out the method and system of editing stream logic and screens | |
CN107741905B (en) | Test case, analytic model thereof, execution method, storage medium and processor | |
CN103226475B (en) | Method and the device of control replacement is realized during transcoding | |
US9645798B1 (en) | Using program code to generate help information, and using help information to generate program code | |
CN112597023A (en) | Case management method and device based on guide picture, computer equipment and storage medium | |
US8479152B2 (en) | Representing non-functional requirements (NFRS) in unified modeling language (UML) | |
CN113805861B (en) | Code generation method based on machine learning, code editing system and storage medium | |
KR100907709B1 (en) | Information extraction apparatus and method using block grouping | |
CN113238748B (en) | Direct current control and protection program page modification and verification method, device, terminal and medium | |
JP7073431B2 (en) | Source code analysis system and source code analysis method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181002 |