[Cppcms-users] Plugins and templates
Brought to you by:
artyom-beilis
From: Julian P. <ju...@wh...> - 2010-08-18 20:43:09
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hallo, for one of my applications I'm currently developing a plugin system. The plugin is deployed as shared object and contains some methods that work with a content class that is derived from cppcms::base_content. Now I'm looking for a way to deliver the required cppcms template alongside the plugin (e.g., for a way to plug the required view into cppcms for rendering the plugin's content). To achieve this, I first wrote a template file for the common layout that the output of all plugins share and compiled it into the main application. Now each plugin has an own template file which derives from the master view and overrides some template functions to customise output. The template file is compiled as shared object after parsing it with cppcms_tmpl_cc. What I want to do now is to load the shared object and use the views contained in it. The problem I stumbled upon is, that cppcms complains that the named skin already exists when I try to load the so file as described in the online documentation via the config.js file, and of course it does, because the master view compiled in the main binary shares the skin with the view in the shared object, because this view only extends the master template. One solution that came to my mind is to not specify a skin in the master template and instead passing one with -s to cppcms_tmpl_cc to create shared objects that contain the whole stuff but all have another skin to be able to load a shared object file for each plugin and use them side by side and specifying the skin for the plugin in the render method. Is there another, perhaps more elegant method to achieve the behaviour I need? Thanks, Julian -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJMbEXUAAoJENidYKvYQHlQnz4QAMg6PTq1qPWp8qUxzQi+BZ4O 5iKR4jRBmu2K6DG+2gJjggd01c7loGvXKUxQwaBHHg7ew4UCN6VlWVU1pXdcnaUb APiGCAeYgMjMsrw/1sAbNnkJlq3FyjPA+8s92CP3gWG1syamTVWnFDeCnInZJB3V /8JWTAHPnYwSPYWCTQe5HkopEubaRsDsBvCgEBOT/vqzDKP6wHKmBMS4O/qNq1Xi V6997ZkLTzuj1O/GPwJGKHPdj4mhfl5RmMMSckrKLmuaHNM85dz1VXSwY/quzrna sVghuOq5sVeXmLDFAxNshtVBUJm2iVU919mISN3U+ko1dDtByWLw+1V34ZkYknSb /WL8EWQWEowoRh7t8i85D4erA7xT59u/mXquVGumv2qbFOex799wvS0Qv9uCwjqu AUJR8d1JxC/csuYARvcu+U1tKicFlNsD5P3NHq9mWljYRdEfk+Lo3WI9k/ze5D/6 Y5I/xrzdovdoqkzt/eIuQ/Iw/xnD4rq5hyZc6Srp74UoquvlPmYKtyGKapnqxkec VDEDGLEfSt+LiEo5w85Lk8IjlXDSaI7dX9CwdEBWVEEffCA2gxnYtQ7kQVIthgSu D2btah6zBLDT7C0bjqK095DbziyvpJVmyjoT2rC27yEfr1vmqs43CUssji/k06sT +PC9qwdDTD3uORLuGwQT =rLhn -----END PGP SIGNATURE----- |