incubator-lokahi-dev mailing list archives

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: 'lokahi-dev@incubator.apache.org'
>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.
------------------------------------------------------------------------------