I just uploaded another patch to the Jira issue. Below is the list that
the patch addresses.

Added patch (templateEngine.patch) for the following issues /
enhancements:
- Updated HostingPoolModel to use the new TemplateDeployer
- Added logging code to VelocityTemplateEngine. By default, velocity
will use its own logger and write to the current working directory. The
updated code used the currently running lokahi log4j logger.
- Added MathTool to the VelocityTemplateEngine
- Added a buildString() method to the Templating engines so we can now
process individual strings with the engine. This comes in handy if you
would want to template the location of a deployed file. Eg:
/etc/$worker.getPath()/conf/


-Jeff

-----Original Message-----
From: Toback, Steve 
Sent: Tuesday, February 12, 2008 11:43 AM
To: '[email protected]'
Subject: RE: Templating configuration files

Without looking at the patch - we should probably start a page on the
wiki for this documentation :) 

>-----Original Message-----
>From: Feist, Jeffrey 
>Sent: Tuesday, February 12, 2008 11:36 AM
>To: [email protected]
>Subject: RE: Templating configuration files
>
>I just committed the patches for the templating engine. 
>Currently, it included a VelocityTemplatingEngine but I 
>included instructions on how to add your own on the Jira issue 
>page: https://issues.apache.org/jira/browse/LOKAHI-4. This 
>page also includes all of the changes that were made for the 
>templating engine code.
>
>-Jeff
>
>-----Original Message-----
>From: Feist, Jeffrey 
>Sent: Monday, February 11, 2008 5:09 PM
>To: '[email protected]'
>Subject: RE: Templating configuration files
>
>With the templating code being updated, I figured it would 
>also be beneficial to include a generic config template 
>deployer. This simply takes a worker, builds the config files 
>based on its templates and deploys them to the location on the 
>server provided when it is created.
>
>This should also reduce some of the dependencies on Apache and Tomcat. 
>
>
>-----Original Message-----
>From: Feist, Jeffrey 
>Sent: Friday, February 08, 2008 4:26 PM
>To: '[email protected]'
>Subject: RE: Templating configuration files
>
>I have started working on this and found something else that 
>looked to be beneficial. Instead of Apache and Tomcat only 
>being allowed to have one file, I updated them to have a 
>Collection of Templates. This allows any Application 
>(currently only Apache and Tomcat) to have any number of 
>configuration files. This lets the user choose a template for 
>their worker.properties file along with the apache main file. 
>This required 2 database tables be updated but I will be 
>including a patch to update existing tables.
>
>-Jeff
>
>>-----Original Message-----
>>From: Feist, Jeffrey 
>>Sent: Thursday, February 07, 2008 9:38 AM
>>To: '[email protected]'
>>Subject: RE: Templating configuration files
>>
>>Glad to hear there is a lot of interest in templating. Below 
>are what I believe the changes that need to be made for the 
>first pass. I will get started on these changes and attach 
>them to the Jira ticket when they are complete. Please let me 
>know if you have any comments or suggestions.
>>
>>GUI
>>----
>>Update "Manage Files" to say "Manage Templates"
>>
>>For files/templates:
>>      Name: display name
>>      Path: path to this file on the server (is this needed anymore?)
>>      Descriptor: name of file (httpd.conf / httpsd.conf / 
>workers.properties)
>>*Put examples next to field names*
>>
>>Update Apache:
>>      - Update "Apache Main" to say "Apache Template"
>>      - Add workers.properties template (with none as a choice)
>>
>>Update Tomcat:
>>      - Add Server.xml Template drop down
>>
>>Backend
>>-----------
>>add "lokahi.template.engine=X" in lokahi.properties
>>
>>Create a new class called something like ConfTemplateBuilder
>>
>>Workers will call: public String 
>ConfTemplateBuilder.buildConf(Server worker) {
>>      - calls 
>PropertiesFile.getConstantValue("templateEngine") -> returns 
>org.apache.lokahi....VelocityTemplateEngine
>>      - calls VelocityTemplateEngine.buildConf(Server) {}
>>
>>The engine classes would be: 
>>Public abstract class TemplateEngine() 
>>VelocityTemplateEngine extends TemplateEngine( ) 
>>
>>String VelocityTemplateEngine.buildConf(Server worker) {}
>>      - would have the mapping from $apacheServer  -> 
>(ApacheWorker) Server.getApache().getServerRoot();
>>      - if Server instanceof ApacheWorker {}
>>      - else if Server instanceof TomcatWorker {}
>>      
>>
>>
>>When other Engines would be added, they would need to extend 
>class TemplateEngine() and have a buildConf function that 
>returns a string representation of the config file.
>>
>>-Jeff
>
>
>


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD
and in Japan, as Banyu - direct contact information for affiliates is 
available at http://www.merck.com/contact/contacts.html) that may be 
confidential, proprietary copyrighted and/or legally privileged. It is 
intended solely for the use of the individual or entity named on this 
message. If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then 
delete it from your system.

------------------------------------------------------------------------------

Reply via email to