[Cppcms-users] template plugins
Brought to you by:
artyom-beilis
From: augustin <aug...@ov...> - 2012-01-03 03:28:49
|
Artyom, In reply both to your December 18th email regarding documentation requests, and to yesterday's email regarding the looming code freeze, I'd like to bring up an issue that has been discussed several times on this list. I know that a plugin framework is planned for CPPCMS 1.1. Can you guesstimate when such a release would take place? One year from now? Two years from now...? Maybe more? There seems to be a fairly large demand for a plugin framework. Several people have already mentioned it on this list. Fortunately, we can roll out our own without waiting for CPPCMS 1.1. However, I counted at least three different people, maybe four, who brought the same issue over the last 12~18 months, and I would be the fifth person to do so. It seems that independently from each other, we all were confronted with the same issue, namely: how does a plugin register a single part of a larger template which is implemented by the core application? Let's say we have a core application which implements a common template (skin). And we have several plugins, each implementing a functionality, e.g. a block of content with its own specific HTML markup (sub-template). The core of the application does not know in advance what additional sub-templates the plugins will implement, and plugins do not know what other plugins need. Basically, what each of us were trying to do is to 'attach' a sub-template to the core main template. And we all hit the problem that you don't offer an API to do so. We can manually create a header file for the sub .tmpl file (part of the plugin), so that the template at least compiles, but then the core application is not aware of it and doesn't use it. I didn't fully understand all of your answers, though I tried and read them many times. From what I understood, your answer was two-fold: 1) On one hand you say that the plugin can recompile the whole skin and load it at run time. Maybe there is a need to properly document this because I didn't fully understand how to do so, and how a plugin would be aware of all the other sub-templates implemented by the other plugins. 2) On the other hand, you seemed to say that it was not possible, because it was difficult to do it right, especially considering race conditions in a multi- threaded web server, leading to a crash when one thread is trying to render a sub-template from a plugin that was just disabled in another thread. So, my request is thus: a) If what we are trying to implement is fully possible today, can the proper solution be documented? b) If not, some projects will not be able to wait until the release of CPPCMS 1.1 (see questions at the top). Could you at least implement in 1.0 some stop- gap measure that would be usable for our purposes, even if not completely ideal? Let me know if you want me to dig up the discussion threads where those topics have already been raised. Thanks, Augustin. -- Friends: http://www.reuniting.info/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |