Thread: [Cppcms-users] View skin
Brought to you by:
artyom-beilis
From: Jan V. <jan...@ap...> - 2012-03-20 07:52:09
|
Hi, I would like to ask whether there is a way of specifying only one skin for all views. I found an example in the message_board but these views are dynamically linked and I need them static. When I try and remove the config section "views" and run the application, it does not produce any output (blank page). The specific view is rendered by: render("view_name", model) The view looks like this: <% c++ #include "model.h" %> <% xhtml %> <% skin %> <% view view_name uses Model %> <% template render() %> ......... <% end template %> <% end view %> <% end skin %> Thank you Jan Vlasak |
From: Marcel H. <ke...@co...> - 2012-03-20 08:43:16
|
Am 20.03.2012 08:51, schrieb Jan Vlasak: > Hi, > > I would like to ask whether there is a way of specifying only one skin > for all views. I found an example in the message_board but these views > are dynamically linked and I need them static. > When I try and remove the config section "views" and run the > application, it does not produce any output (blank page). I hope you included them in the make /CMake file (whatever) Look at this http://cppcms.com/wikipp/en/page/cppcms_1x_tut_hello_templates#Linking.Statically > The specific view is rendered by: render("view_name", model) > The view looks like this: > <% c++ #include "model.h" %> > <% xhtml %> > <% skin %> > <% view view_name uses Model %> > <% template render() %> > ......... > <% end template %> > <% end view %> > <% end skin %> > What's wrong about this? Afaik you do not must name your skin, but I really would prefer it? Why don't you name it and then stay with that name all the time? This is how I do it often, with little projects. > Thank you > > Jan Vlasak Marcel |
From: Jan V. <jan...@gm...> - 2012-03-21 07:01:22
|
Hi Marcel, Thanks for response. I have tried it with the same skin name across all views, but It just does not produce anything. As soon as I supply different name for each view, it works fine. Should I include the skin name in the config.js or ... ? I cannot really see what is wrong as the views are working fine with distinct skin names. Any suggestions. Thanks, Jan On Tue, Mar 20, 2012 at 8:42 AM, Marcel Hellwig <ke...@co...> wrote: > Am 20.03.2012 08:51, schrieb Jan Vlasak: > > Hi, > > > > I would like to ask whether there is a way of specifying only one skin > > for all views. I found an example in the message_board but these views > > are dynamically linked and I need them static. > > When I try and remove the config section "views" and run the > > application, it does not produce any output (blank page). > I hope you included them in the make /CMake file (whatever) Look at this > > http://cppcms.com/wikipp/en/page/cppcms_1x_tut_hello_templates#Linking.Statically > > The specific view is rendered by: render("view_name", model) > > The view looks like this: > > <% c++ #include "model.h" %> > > <% xhtml %> > > <% skin %> > > <% view view_name uses Model %> > > <% template render() %> > > ......... > > <% end template %> > > <% end view %> > > <% end skin %> > > > What's wrong about this? Afaik you do not must name your skin, but I > really would prefer it? Why don't you name it and then stay with that > name all the time? This is how I do it often, with little projects. > > Thank you > > > > Jan Vlasak > Marcel > > > ------------------------------------------------------------------------------ > This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2d-msazure > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > -- Jan Vlasak Flat 2 39 Hurst Lane Birmingham B34 7HS ph.:+44 754 6124920 |
From: Artyom B. <art...@ya...> - 2012-03-21 08:13:20
|
> Thanks for response. > I have tried it with the same skin name across all views, > but It just does not produce anything. Each cppcms template compilation unit should have its own skin name. It is actually namespace - the module. You should for course have different view names (classes) withing the same skin but view names can be shared between different skins (namespaces) You can define skin name by two methods: - using <% skin NAME %> - using -s NAME flag for cppcms_tmpl_cc > > As soon as I supply different name for each view, it works fine. Can you show the code - the pattern you use > Should I include the skin name in the config.js or ... ? If you create **dynamically loadable** view than yes, if it is statically linked then: If you have multiple skins you man need to define only the default one > I cannot really see what is wrong as the views are > working fine with distinct skin names. > Each compilation unit created by cppcms_tmpl_cc should have distinct skin names > >Any suggestions. >Thanks, > > More pointers: http://cppcms.com/wikipp/en/page/cppcms_1x_tut_hello_templates http://cppcms.com/wikipp/en/page/cppcms_1x_tut_templates_inheritance http://cppcms.com/wikipp/en/page/cppcms_1x_templates_gen http://cppcms.com/wikipp/en/page/cppcms_1x_config#views Artyom Beilis |
From: Jan V. <jan...@gm...> - 2012-03-22 14:17:43
|
Thanks for the reply, What I am trying to do is group view into one namespace (skin). My code is: view 1 --------------------------------------------------- <% c++ #include "model1.h" %> <% xhtml %> <% skin skinName %> <% view viewName1 uses Model1 %> <% template render() %> ......... <% end template %> <% end view %> <% end skin %> view 2 ----------------------------------------------------- <% c++ #include "model2.h" %> <% xhtml %> <% skin skinName %> <% view viewName2 uses Model2 %> <% template render() %> ......... <% end template %> <% end view %> <% end skin %> rendering / invocation --------------------------------------------------------------- Model1 model1; render("skinName", "viewName1", model1); and Model2 mode2l; render("skinName", "viewName2", model2); each of those are invoked at different point of execution path not in the same function. This implementation produces empty screen and as soon as I change the skin name to be different for each view, it is fine. Any suggestions? Thanks, guys. Jan On Wed, Mar 21, 2012 at 8:13 AM, Artyom Beilis <art...@ya...> wrote: > > > > > Thanks for response. > > I have tried it with the same skin name across all views, > > but It just does not produce anything. > > Each cppcms template compilation unit should have its own skin name. It is > actually > namespace - the module. > > You should for course have different view names (classes) withing the same > skin but > view names can be shared between different skins (namespaces) > > You can define skin name by two methods: > > - using <% skin NAME %> > - using -s NAME flag for cppcms_tmpl_cc > > > > > > > As soon as I supply different name for each view, it works fine. > > Can you show the code - the pattern you use > > > > Should I include the skin name in the config.js or ... ? > > If you create **dynamically loadable** view than yes, if > > it is statically linked then: > > If you have multiple skins you man need to define only > the default one > > > > I cannot really see what is wrong as the views are > > working fine with distinct skin names. > > > > Each compilation unit created by cppcms_tmpl_cc should have distinct skin > names > > > > > >Any suggestions. > >Thanks, > > > > > > More pointers: > > > http://cppcms.com/wikipp/en/page/cppcms_1x_tut_hello_templates > http://cppcms.com/wikipp/en/page/cppcms_1x_tut_templates_inheritance > http://cppcms.com/wikipp/en/page/cppcms_1x_templates_gen > http://cppcms.com/wikipp/en/page/cppcms_1x_config#views > Artyom Beilis > > > ------------------------------------------------------------------------------ > This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2d-msazure > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > -- Jan Vlasak Flat 2 39 Hurst Lane Birmingham B34 7HS ph.:+44 754 6124920 |
From: Jan V. <jan...@gm...> - 2012-03-24 10:35:48
|
Hi, I have checked the error logs for apache and the error from the rendering is cppcms, error: Caught exception [cppcms::views::pool: no such view viewName1 in the skin skinName] I have even put config value for default skin into config.js like this. "views" : { "default_skin" : "skinName" } But still nothing. the same error is produced... Any idea. Thanks, Jan On Thu, Mar 22, 2012 at 2:17 PM, Jan Vlasak <jan...@gm...> wrote: > Thanks for the reply, > > What I am trying to do is group view into one namespace (skin). > My code is: > > view 1 > --------------------------------------------------- > <% c++ #include "model1.h" %> > <% xhtml %> > <% skin skinName %> > <% view viewName1 uses Model1 %> > <% template render() %> > ......... > <% end template %> > <% end view %> > <% end skin %> > > > view 2 > ----------------------------------------------------- > <% c++ #include "model2.h" %> > <% xhtml %> > <% skin skinName %> > <% view viewName2 uses Model2 %> > <% template render() %> > ......... > <% end template %> > <% end view %> > <% end skin %> > > > rendering / invocation > --------------------------------------------------------------- > > Model1 model1; > render("skinName", "viewName1", model1); > > and > > Model2 mode2l; > render("skinName", "viewName2", model2); > > each of those are invoked at different point of execution path not in the > same function. > > This implementation produces empty screen and as soon as I change the skin > name to be different for each view, it is fine. > > Any suggestions? > > Thanks, guys. > > Jan > > > On Wed, Mar 21, 2012 at 8:13 AM, Artyom Beilis <art...@ya...>wrote: > >> >> >> >> > Thanks for response. >> > I have tried it with the same skin name across all views, >> > but It just does not produce anything. >> >> Each cppcms template compilation unit should have its own skin name. It >> is actually >> namespace - the module. >> >> You should for course have different view names (classes) withing the >> same skin but >> view names can be shared between different skins (namespaces) >> >> You can define skin name by two methods: >> >> - using <% skin NAME %> >> - using -s NAME flag for cppcms_tmpl_cc >> >> >> > >> >> > As soon as I supply different name for each view, it works fine. >> >> Can you show the code - the pattern you use >> >> >> > Should I include the skin name in the config.js or ... ? >> >> If you create **dynamically loadable** view than yes, if >> >> it is statically linked then: >> >> If you have multiple skins you man need to define only >> the default one >> >> >> > I cannot really see what is wrong as the views are >> > working fine with distinct skin names. >> > >> >> Each compilation unit created by cppcms_tmpl_cc should have distinct skin >> names >> >> >> > >> >Any suggestions. >> >Thanks, >> > >> > >> >> More pointers: >> >> >> http://cppcms.com/wikipp/en/page/cppcms_1x_tut_hello_templates >> http://cppcms.com/wikipp/en/page/cppcms_1x_tut_templates_inheritance >> http://cppcms.com/wikipp/en/page/cppcms_1x_templates_gen >> http://cppcms.com/wikipp/en/page/cppcms_1x_config#views >> Artyom Beilis >> >> >> ------------------------------------------------------------------------------ >> This SF email is sponsosred by: >> Try Windows Azure free for 90 days Click Here >> http://p.sf.net/sfu/sfd2d-msazure >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > > > > -- > Jan Vlasak > > Flat 2 > 39 Hurst Lane > Birmingham > B34 7HS > ph.:+44 754 6124920 > -- Jan Vlasak Flat 2 39 Hurst Lane Birmingham B34 7HS ph.:+44 754 6124920 |
From: Jan V. <jan...@ap...> - 2012-03-24 10:37:21
|
---------- Forwarded message ---------- From: Jan Vlasak <jan...@gm...> Date: Sat, Mar 24, 2012 at 10:35 AM Subject: Re: [Cppcms-users] View skin To: Artyom Beilis <art...@ya...>, cpp...@li... Hi, I have checked the error logs for apache and the error from the rendering is cppcms, error: Caught exception [cppcms::views::pool: no such view viewName1 in the skin skinName] I have even put config value for default skin into config.js like this. "views" : { "default_skin" : "skinName" } But still nothing. the same error is produced... Any idea. Thanks, Jan On Thu, Mar 22, 2012 at 2:17 PM, Jan Vlasak <jan...@gm...> wrote: > Thanks for the reply, > > What I am trying to do is group view into one namespace (skin). > My code is: > > view 1 > --------------------------------------------------- > <% c++ #include "model1.h" %> > <% xhtml %> > <% skin skinName %> > <% view viewName1 uses Model1 %> > <% template render() %> > ......... > <% end template %> > <% end view %> > <% end skin %> > > > view 2 > ----------------------------------------------------- > <% c++ #include "model2.h" %> > <% xhtml %> > <% skin skinName %> > <% view viewName2 uses Model2 %> > <% template render() %> > ......... > <% end template %> > <% end view %> > <% end skin %> > > > rendering / invocation > --------------------------------------------------------------- > > Model1 model1; > render("skinName", "viewName1", model1); > > and > > Model2 mode2l; > render("skinName", "viewName2", model2); > > each of those are invoked at different point of execution path not in the > same function. > > This implementation produces empty screen and as soon as I change the skin > name to be different for each view, it is fine. > > Any suggestions? > > Thanks, guys. > > Jan > > > On Wed, Mar 21, 2012 at 8:13 AM, Artyom Beilis <art...@ya...>wrote: > >> >> >> >> > Thanks for response. >> > I have tried it with the same skin name across all views, >> > but It just does not produce anything. >> >> Each cppcms template compilation unit should have its own skin name. It >> is actually >> namespace - the module. >> >> You should for course have different view names (classes) withing the >> same skin but >> view names can be shared between different skins (namespaces) >> >> You can define skin name by two methods: >> >> - using <% skin NAME %> >> - using -s NAME flag for cppcms_tmpl_cc >> >> >> > >> >> > As soon as I supply different name for each view, it works fine. >> >> Can you show the code - the pattern you use >> >> >> > Should I include the skin name in the config.js or ... ? >> >> If you create **dynamically loadable** view than yes, if >> >> it is statically linked then: >> >> If you have multiple skins you man need to define only >> the default one >> >> >> > I cannot really see what is wrong as the views are >> > working fine with distinct skin names. >> > >> >> Each compilation unit created by cppcms_tmpl_cc should have distinct skin >> names >> >> >> > >> >Any suggestions. >> >Thanks, >> > >> > >> >> More pointers: >> >> >> http://cppcms.com/wikipp/en/page/cppcms_1x_tut_hello_templates >> http://cppcms.com/wikipp/en/page/cppcms_1x_tut_templates_inheritance >> http://cppcms.com/wikipp/en/page/cppcms_1x_templates_gen >> http://cppcms.com/wikipp/en/page/cppcms_1x_config#views >> Artyom Beilis >> >> >> ------------------------------------------------------------------------------ >> This SF email is sponsosred by: >> Try Windows Azure free for 90 days Click Here >> http://p.sf.net/sfu/sfd2d-msazure >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > > > > -- > Jan Vlasak > > Flat 2 > 39 Hurst Lane > Birmingham > B34 7HS > ph.:+44 754 6124920 > -- Jan Vlasak Flat 2 39 Hurst Lane Birmingham B34 7HS ph.:+44 754 6124920 |
From: Artyom B. <art...@ya...> - 2012-03-25 15:06:26
|
Please show how do you build the skin? i.e. cppcms_tmp_cc command and link command how do you link the compiled object. Artyom >________________________________ > From: Jan Vlasak <jan...@gm...> >To: Artyom Beilis <art...@ya...>; cpp...@li... >Sent: Saturday, March 24, 2012 12:35 PM >Subject: Re: [Cppcms-users] View skin > > >Hi, > > >I have checked the error logs for apache and the error from the rendering is cppcms, error: Caught exception [cppcms::views::pool: no such view viewName1 in the skin skinName] > > >I have even put config value for default skin into config.js like this. > > > "views" : { > "default_skin" : "skinName" > } > > >But still nothing. the same error is produced... > > >Any idea. > > >Thanks, > > >Jan > >On Thu, Mar 22, 2012 at 2:17 PM, Jan Vlasak <jan...@gm...> wrote: > >Thanks for the reply, >> >> >>What I am trying to do is group view into one namespace (skin). >>My code is: >> >> >>view 1 >>--------------------------------------------------- >><% c++ #include "model1.h" %> >><% xhtml %> >><% skin skinName %> >><% view viewName1 uses Model1 %> >><% template render() %> >>......... >><% end template %> >><% end view %> >><% end skin %> >> >> >> >> >>view 2 >>----------------------------------------------------- >><% c++ #include "model2.h" %> >><% xhtml %> >><% skin skinName %> >><% view viewName2 uses Model2 %> >><% template render() %> >>......... >><% end template %> >><% end view %> >><% end skin %> >> >> >> >> >>rendering / invocation >>--------------------------------------------------------------- >> >> >>Model1 model1; >>render("skinName", "viewName1", model1); >> >> >>and >> >> >>Model2 mode2l; >>render("skinName", "viewName2", model2); >> >> >>each of those are invoked at different point of execution path not in the same function. >> >> >>This implementation produces empty screen and as soon as I change the skin name to be different for each view, it is fine. >> >> >>Any suggestions? >> >> >>Thanks, guys. >> >>Jan >> >> >> >> >>On Wed, Mar 21, 2012 at 8:13 AM, Artyom Beilis <art...@ya...> wrote: >> >> >>> >>> >>>> Thanks for response. >>>> I have tried it with the same skin name across all views, >>>> but It just does not produce anything. >>> >>>Each cppcms template compilation unit should have its own skin name. It is actually >>>namespace - the module. >>> >>>You should for course have different view names (classes) withing the same skin but >>>view names can be shared between different skins (namespaces) >>> >>>You can define skin name by two methods: >>> >>>- using <% skin NAME %> >>>- using -s NAME flag for cppcms_tmpl_cc >>> >>> >>> >>>> >>> >>>> As soon as I supply different name for each view, it works fine. >>> >>>Can you show the code - the pattern you use >>> >>> >>> >>>> Should I include the skin name in the config.js or ... ? >>> >>>If you create **dynamically loadable** view than yes, if >>> >>>it is statically linked then: >>> >>>If you have multiple skins you man need to define only >>> the default one >>> >>> >>> >>>> I cannot really see what is wrong as the views are >>>> working fine with distinct skin names. >>>> >>> >>>Each compilation unit created by cppcms_tmpl_cc should have distinct skin names >>> >>> >>>> >>>>Any suggestions. >>>>Thanks, >>>> >>>> >>> >>>More pointers: >>> >>> >>>http://cppcms.com/wikipp/en/page/cppcms_1x_tut_hello_templates >>>http://cppcms.com/wikipp/en/page/cppcms_1x_tut_templates_inheritance >>>http://cppcms.com/wikipp/en/page/cppcms_1x_templates_gen >>>http://cppcms.com/wikipp/en/page/cppcms_1x_config#views >>>Artyom Beilis >>> >>> >>>------------------------------------------------------------------------------ >>>This SF email is sponsosred by: >>>Try Windows Azure free for 90 days Click Here >>>http://p.sf.net/sfu/sfd2d-msazure >>>_______________________________________________ >>>Cppcms-users mailing list >>>Cpp...@li... >>>https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >> >> >> >> >>-- >>Jan Vlasak >> >>Flat 2 >>39 Hurst Lane >>Birmingham >>B34 7HS >>ph.:+44 754 6124920 >> > > > >-- >Jan Vlasak > >Flat 2 >39 Hurst Lane >Birmingham >B34 7HS >ph.:+44 754 6124920 > >------------------------------------------------------------------------------ >This SF email is sponsosred by: >Try Windows Azure free for 90 days Click Here >http://p.sf.net/sfu/sfd2d-msazure >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
From: Artyom B. <art...@ya...> - 2012-03-25 19:15:21
|
> >viewName1.cpp: viewName1.tmpl model1.h >cppcms_tmpl_cc $< -o $@ > You compile only viewName1.tmpl to the view. It should be cppcms_tmpl_cc view_a.tmpl view_b.tmpl view_c.tmpl -o someskin.cpp So you actually do not get the viewName2.tmpl compiled in :-) Artyom |