CN106453517A - Configuration file generation method based on freemarker - Google Patents
Configuration file generation method based on freemarker Download PDFInfo
- Publication number
- CN106453517A CN106453517A CN201610834333.3A CN201610834333A CN106453517A CN 106453517 A CN106453517 A CN 106453517A CN 201610834333 A CN201610834333 A CN 201610834333A CN 106453517 A CN106453517 A CN 106453517A
- Authority
- CN
- China
- Prior art keywords
- configuration
- freemarker
- file
- template
- configuration file
- 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/2866—Architectures; Arrangements
- H04L67/30—Profiles
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention belongs to the field of file configuration, and specifically provides a configuration file generation method based on freemarker. The method comprises the following steps: a, establishing a configuration attribute table, and recording configuration information needing to be modified and used in services and applications; and b, configuring a file freemarker template, generating a configuration file via assembled data and the freemarker template, and directly using the configuration file in deployment. Compared with the prior art, by adoption the method provided the invention, the problems of large modification amount and large difficulty of the configuration file during the deployment of various services and applications are solved initiatively, and the configuration difficulty is simplified.
Description
Technical field
The present invention relates to file configuration field, specifically provide a kind of configuration file generation method based on freemarker.
Background technology
In very widely used today private clound and public cloud, dispose various services (Oracle, MySQL, Hadoop,
Tomcat etc.) when, need the configuration file that configuration service uses one by one, quantity is many and numerous and diverse, modification configuration file workload is big,
Error-prone problem.The using method of some of which configuration, mode are not that most of deployer knows, and further increase portion
The difficulty of administration, simultaneously during the service of deployment different performance demand, configuration is also required to be adjusted.
Content of the invention
The technical assignment of the present invention is for above-mentioned the deficiencies in the prior art, provides a kind of configuration based on freemarker
Document generating method.The method can automatically generate the configuration file needing during deployment by freemarker, directly uses, greatly
Amplitude simplifies deploying step.
The technical assignment of the present invention is realized in the following manner:
A kind of configuration file generation method based on freemarker, is characterized in comprising the following steps:
A, set up configuration attribute table, in record service and application, need the configuration information changed and use;
B, configuration file freemarker template, are configured by the configuration data and freemarker template generation assembling
File, directly uses in deployment.
In order to reduce deployment difficulty further, the inventive method is further comprising the steps of:
C, set up common configuration template, define the proposed arrangement under conventional application deployment scenario in advance, direct during use
Choose template.
As preferred:
Described in step a, configuration information includes:ISN, parameter name, parameter coding, parameter value, affiliated service and application, mould
Plate id and description.
The concrete grammar of step b is:
The configuration file of service or application is transformed it would be desirable to be used by the parameter tags that parameter configuration writes
Freemarker template instruction is marked, and forms several freemarker template files;When using with configuration parameter number
According to for data model, add that template file can generate specific configuration file content.
Described template file is preferably preserved by file directory, and the configuration template file of different services and application is stored in phase
In the file answered, directly whole file is carried out conversion during use and generate destination file.
The concrete grammar of step c is:
Set up configuration template table, preserve a certain deployment scenario information in table, and safeguard the generic configuration value under this scene;
When creating service and applying, corresponding configuration template is selected according to current deployment scenario, using customized good configuration.
Compared with prior art, the present invention had based on the configuration file generation method of freemarker following outstanding
Beneficial effect:
(1) the inventive method can generate corresponding configuration file content, solve allocation position bad search it is not required that
Go again to change configuration file by hand.
(2) provide the detailed description of each configuration of configuration file, solution configuration concrete meaning is indefinite, the bad confirmation of function
Problem, help to service and apply unfamiliar user complete to map out the work.
(3) pass through to provide configuration template, customize out the proposed arrangement under service and application deployment scenario in advance, when using
Directly select template and can generate corresponding proposed arrangement file, also can modify on the basis of proposed arrangement.
Brief description
Fig. 1 is embodiment of the present invention data model schematic diagram;
Fig. 2 is embodiment of the present invention configuration file product process figure.
Specific embodiment
Below in conjunction with Figure of description and embodiment, to the configuration file generation side based on freemarker for the present invention
Method is described in further detail.
As shown in Figure 1, being comprised the following steps based on the configuration file generation method of freemarker of the present invention:
(1) configuration definition
Configuration definition, sets up the configuration parameter table shown in table one, needs to use and change in record service and application
The ISN of configuration, parameter name, parameter coding, parameter value, affiliated service and the information such as application, template id and description.Using
When, by page presentation configuration parameter list, and the detailed description of configuration parameter, help user to understand and change configuration ginseng
Number.
Table one:
(2) profile template
The configuration file of service or application is transformed it would be desirable to be used by the parameter tags that parameter configuration writes
Freemarker template instruction is marked, and forms several freemarker template files.When using with configuration parameter number
According to for data model, add that template file just can generate specific configuration file content (as shown in Figure 2).Template file can
To be preserved by file directory, the configuration template file of different services and application is stored in various files, straight during use
Connect and whole file is carried out conversion generation destination file.
(3) configuration template
In deployment services or application, find that it has the demand of different size, the such as MySQL of deployment cluster mode, list
The MySQL of node, it is deployed in the high machine of cpu internal memory, is deployed under the machine of the low internal memory of low cpu etc. scene, the joining of needs
It is distinguishing for putting, and is also rule simultaneously.
Therefore, the inventive method can also set up configuration template table, preserve a certain deployment scenario information in table, and safeguard
Generic configuration value under this scene.When creating service and applying, corresponding configuration can be selected according to current deployment scenario
Template, using customized good configuration.
Claims (6)
1. a kind of configuration file generation method based on freemarker is it is characterised in that comprise the following steps:
A, set up configuration attribute table, in record service and application, need the configuration information changed and use;
B, configuration file freemarker template, configure literary composition by the configuration data and freemarker template generation assembling
Part, directly uses in deployment.
2. the configuration file generation method based on freemarker according to claim 1 it is characterised in that also include with
Lower step:C, set up common configuration template, define the proposed arrangement under conventional application deployment scenario in advance, directly select during use
Delivery plate.
3. the configuration file generation method based on freemarker according to claim 1 and 2 it is characterised in that:Step a
Described configuration information includes:ISN, parameter name, parameter coding, parameter value, affiliated service and application, template id and description.
4. the configuration file generation method based on freemarker according to claim 1 and 2 is it is characterised in that step b
Concrete grammar be:Parameter mark it would be desirable to be write by parameter configuration is transformed to the configuration file of service or application
Note is marked using freemarker template instruction, forms several freemarker template files;Using when configure
Supplemental characteristic is data model, adds that template file can generate specific configuration file content.
5. the configuration file generation method based on freemarker according to claim 4 it is characterised in that:Template file
Preserved by file directory, the configuration template file of different services and application is stored in corresponding file, direct during use
Whole file is carried out conversion and generates destination file.
6. the configuration file generation method based on freemarker according to claim 2 is it is characterised in that the tool of step c
Body method is:Set up configuration template table, preserve a certain deployment scenario information in table, and safeguard the generic configuration under this scene
Value;When creating service and applying, corresponding configuration template is selected according to current deployment scenario, using customized good joining
Put.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610834333.3A CN106453517A (en) | 2016-09-20 | 2016-09-20 | Configuration file generation method based on freemarker |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610834333.3A CN106453517A (en) | 2016-09-20 | 2016-09-20 | Configuration file generation method based on freemarker |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106453517A true CN106453517A (en) | 2017-02-22 |
Family
ID=58166219
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610834333.3A Pending CN106453517A (en) | 2016-09-20 | 2016-09-20 | Configuration file generation method based on freemarker |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106453517A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107092502A (en) * | 2017-03-20 | 2017-08-25 | 国家电网公司 | A kind of application method of automatic configuration and device based on cloud operating system |
CN107547263A (en) * | 2017-07-26 | 2018-01-05 | 南京邮电大学 | A kind of method realized network element device automation and search template configuration |
CN107908425A (en) * | 2017-11-16 | 2018-04-13 | 中国银行股份有限公司 | A kind of generation method and system of configurationization file |
WO2020119037A1 (en) * | 2018-12-12 | 2020-06-18 | 平安科技(深圳)有限公司 | Identity authentication configuration method and device and computer readable storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103246516A (en) * | 2013-05-16 | 2013-08-14 | 中国科学院计算机网络信息中心 | Internet-based remote sensing data analysis tool packaging service method |
CN103500087A (en) * | 2013-09-17 | 2014-01-08 | 福建亿榕信息技术有限公司 | Code generation method and device based on maven plug-in and freemarker template |
US20140310591A1 (en) * | 2013-03-13 | 2014-10-16 | Thong Nguyen | Presentation layer software development kit for creation of dynamic webpages |
CN104750796A (en) * | 2014-11-13 | 2015-07-01 | 安徽四创电子股份有限公司 | Method for leading out Word under BS system |
CN104965714A (en) * | 2015-07-27 | 2015-10-07 | 广州杰赛科技股份有限公司 | Code generation method and system of application software |
CN105138448A (en) * | 2014-06-05 | 2015-12-09 | 北京畅游天下网络技术有限公司 | Method and device for page test at front end |
-
2016
- 2016-09-20 CN CN201610834333.3A patent/CN106453517A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140310591A1 (en) * | 2013-03-13 | 2014-10-16 | Thong Nguyen | Presentation layer software development kit for creation of dynamic webpages |
CN103246516A (en) * | 2013-05-16 | 2013-08-14 | 中国科学院计算机网络信息中心 | Internet-based remote sensing data analysis tool packaging service method |
CN103500087A (en) * | 2013-09-17 | 2014-01-08 | 福建亿榕信息技术有限公司 | Code generation method and device based on maven plug-in and freemarker template |
CN105138448A (en) * | 2014-06-05 | 2015-12-09 | 北京畅游天下网络技术有限公司 | Method and device for page test at front end |
CN104750796A (en) * | 2014-11-13 | 2015-07-01 | 安徽四创电子股份有限公司 | Method for leading out Word under BS system |
CN104965714A (en) * | 2015-07-27 | 2015-10-07 | 广州杰赛科技股份有限公司 | Code generation method and system of application software |
Non-Patent Citations (2)
Title |
---|
孙聚: ""基于FreeMarker引擎的代码生成工具的设计与实现"", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
学步园: ""FreeMarker使用小结"", 《学步园》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107092502A (en) * | 2017-03-20 | 2017-08-25 | 国家电网公司 | A kind of application method of automatic configuration and device based on cloud operating system |
CN107092502B (en) * | 2017-03-20 | 2020-06-16 | 国家电网有限公司 | Automatic application configuration method and device based on cloud operating system |
CN107547263A (en) * | 2017-07-26 | 2018-01-05 | 南京邮电大学 | A kind of method realized network element device automation and search template configuration |
CN107908425A (en) * | 2017-11-16 | 2018-04-13 | 中国银行股份有限公司 | A kind of generation method and system of configurationization file |
WO2020119037A1 (en) * | 2018-12-12 | 2020-06-18 | 平安科技(深圳)有限公司 | Identity authentication configuration method and device and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI663553B (en) | Method and device for generating contract | |
CN106453517A (en) | Configuration file generation method based on freemarker | |
CN101676910B (en) | A page generation method facing to Web application system | |
RU2536390C2 (en) | Automated report generation method | |
CN105487864A (en) | Method and device for automatically generating code | |
CN105631738A (en) | Standard inputting and storing system for accountant document template | |
CN103176802B (en) | Realize the method that the user interface UI of system separates with widget library by control pond | |
CN101840334A (en) | Software component service packaging method | |
CN102665231B (en) | Method of automatically generating parameter configuration file for LTE (Long Term Evolution) system | |
CN106487912A (en) | The management being served by and dissemination method and device more | |
CN106294299A (en) | A kind of report form generation method and device | |
CN103823793A (en) | Realizing method for dynamic report based on Excel template | |
CN103020137A (en) | System and method for expanding self-defining item for data receipt | |
CN105743946A (en) | Template disposition method and apparatus | |
CN109660372A (en) | A kind of method and device of the business configuration of SDN | |
CN105068812A (en) | Form generation method and device | |
CN106843871B (en) | A kind of design system and design method of domain model frame | |
CN103634177A (en) | Method and system for implementing configuration on basis of network services | |
CN104899826A (en) | Method of manufacturing mobile phone theme based on PSD analytic technique | |
CN108959230B (en) | Method and device for generating report template | |
CN106161498A (en) | The multi-platform dissemination method of a kind of contribution and system | |
CN105786925A (en) | Reference model based dynamic data modeling method and apparatus | |
CN110489728A (en) | Legal documents automatic composing method and device | |
CN104407893B (en) | Show the method and device of animation | |
CN109213478A (en) | A method of the self-defined template based on cloudy platform creates application |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170222 |
|
RJ01 | Rejection of invention patent application after publication |