cppcms-users Mailing List for CppCMS C++ Web Framework (Page 133)
Brought to you by:
artyom-beilis
You can subscribe to this list here.
2009 |
Jan
|
Feb
(22) |
Mar
|
Apr
(3) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(4) |
Feb
|
Mar
(8) |
Apr
(8) |
May
(8) |
Jun
(36) |
Jul
(63) |
Aug
(126) |
Sep
(47) |
Oct
(66) |
Nov
(46) |
Dec
(42) |
2011 |
Jan
(87) |
Feb
(24) |
Mar
(54) |
Apr
(21) |
May
(22) |
Jun
(18) |
Jul
(22) |
Aug
(101) |
Sep
(57) |
Oct
(33) |
Nov
(34) |
Dec
(66) |
2012 |
Jan
(64) |
Feb
(76) |
Mar
(73) |
Apr
(105) |
May
(93) |
Jun
(83) |
Jul
(84) |
Aug
(88) |
Sep
(57) |
Oct
(59) |
Nov
(35) |
Dec
(49) |
2013 |
Jan
(67) |
Feb
(17) |
Mar
(49) |
Apr
(64) |
May
(87) |
Jun
(64) |
Jul
(93) |
Aug
(23) |
Sep
(15) |
Oct
(16) |
Nov
(62) |
Dec
(73) |
2014 |
Jan
(5) |
Feb
(23) |
Mar
(21) |
Apr
(11) |
May
(1) |
Jun
(19) |
Jul
(27) |
Aug
(16) |
Sep
(5) |
Oct
(37) |
Nov
(12) |
Dec
(9) |
2015 |
Jan
(7) |
Feb
(7) |
Mar
(44) |
Apr
(28) |
May
(5) |
Jun
(12) |
Jul
(8) |
Aug
|
Sep
(39) |
Oct
(34) |
Nov
(30) |
Dec
(34) |
2016 |
Jan
(66) |
Feb
(23) |
Mar
(33) |
Apr
(15) |
May
(11) |
Jun
(15) |
Jul
(26) |
Aug
(4) |
Sep
(1) |
Oct
(30) |
Nov
(10) |
Dec
|
2017 |
Jan
(52) |
Feb
(9) |
Mar
(24) |
Apr
(16) |
May
(9) |
Jun
(12) |
Jul
(33) |
Aug
(8) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(6) |
2018 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(14) |
Jun
(1) |
Jul
(9) |
Aug
(1) |
Sep
(13) |
Oct
(8) |
Nov
(2) |
Dec
(2) |
2019 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(9) |
Jul
(6) |
Aug
(25) |
Sep
(10) |
Oct
(10) |
Nov
(6) |
Dec
|
2021 |
Jan
|
Feb
|
Mar
(7) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(9) |
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Artyom <art...@ya...> - 2010-08-19 10:36:46
|
> $ svn update > U src/form.cpp > > > Updated to revision 1375. > $ cd build/ > $ make > $ sudo make install > > As before I added the following line to your form example: > name.size(20); > The code compiles, now, but the application crashes when I browse it: > > cppcms/examples/forms$ ./hello -c config.js > ./hello: symbol lookup error: ./hello: undefined symbol: > _ZN6cppcms7widgets4text4sizeEi > Are you sure you installed this correctly? Because it seems that hello loads an old shared object instead of new one, othewise you would get a error on linking stage. Artyom |
From: Artyom <art...@ya...> - 2010-08-19 10:35:16
|
> class IPlugin { > public: > virtual content::master handleRequest() const = 0; > }; > class HelloPlugin: public IPlugin { > public: > virtual content::master handleRequest() { > content::hello_plugin hp; > hp.title = "Hello"; > hp.message = "World"; > return hp; > } > } ---------------------------------------------------- In C++, objects are not references! They are values. ---------------------------------------------------- What happens there that content::master is copties from content::hello_plugin and this forgets all about hello_plugin. For handling polymorphic classes you need to use pointers or references. > > // This is the function that dispatches to plugin > void myapp::dispatcher(std::string module) { > IPlugin p = plugcontainer.getPluginByModule(module); > content::master m = p.handleRequest(); > render("hello_plugin",m); > } And in this point m is type of content::master so when in plugin it tryes to cast to the content::hello_pluging it fails for very good reason :-) What you need is something like this with smart pointers: class IPlugin { public: virtual booster::shared_ptr<content::master> handleRequest() const = 0; }; class HelloPlugin: public IPlugin { public: virtual booster::shared_ptr<content::master> handleRequest() { booster::shared_ptr<content::hello_plugin> hp(new content::hello_plugin); hp->title = "Hello"; hp->message = "World"; return hp; } } void myapp::dispatcher(std::string module) { IPlugin p = plugcontainer.getPluginByModule(module); booster::shared_ptr<content::master> m = p.handleRequest(); render("hello_plugin",*m); } This should work Best, Artyom |
From: augustin <aug...@ov...> - 2010-08-19 09:54:10
|
On Thursday 19 August 2010 04:46:19 pm Artyom wrote: > Thanks for the report. > Fixed in changeset 1374, > I had added an implementation of the missing function Hello Arytom, Thanks for the quick fix. However, I did: $ svn update U src/form.cpp Updated to revision 1375. $ cd build/ $ make $ sudo make install As before I added the following line to your form example: name.size(20); The code compiles, now, but the application crashes when I browse it: cppcms/examples/forms$ ./hello -c config.js ./hello: symbol lookup error: ./hello: undefined symbol: _ZN6cppcms7widgets4text4sizeEi Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ 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/ . |
From: Artyom <art...@ya...> - 2010-08-19 08:46:26
|
Hello, Thanks for the report. Fixed in changeset 1374, I had added an implementation of the missing function Artyom > In the example: > cppcms/examples/forms/ > in info_form::info_form(), calling name.size(int n); does not work. > I get the compile error: > undefined reference to `cppcms::widgets::text::size(int)' > > yet the function is defined here: > > http://art-blog.no- >ip.info/cppcms_ref_v0_99/classcppcms_1_1widgets_1_1text.html#cdd6d081d3f17291ba374e75cf812e7b >b > void cppcms::widgets::text::size ( int n ) > Set html attribute size of the widget > |
From: Artyom <art...@ya...> - 2010-08-19 07:28:36
|
> Just another question: > The plugins currently return their own content class derived from a > master class containing common properties such as a page title. > Because C++ doesn't allow to redefine return types when overloading > virtual methods, I use a booster::shared_ptr<content::master> for > passing the content class. Actually you can redefine. But not for shared pointer but rather for ordinary pointers and references. i.e. class A{}; class B: public A{} class foo { public: virtual A &get(); }; class bar { public: virtual B &get(); }; Is legal as B derived from A. This is what is called co-variant types. So you may do this. > Example: > Plugin HelloWorld has a content class content::hello_world derived from > content::master which is returned on calling handleRequest() wrapped in > a booster::shared_ptr<content::master>. This content class now has to be > rendered by the main application which does not now which content > subclass is wrapped in the pointer / knows it at runtime only, so that a > hard-compiled conversion via > booster::dynamic_pointer_cast<content::hello_world,content::master> is > not possible, because there could be other plugins returning different > subclasses of the master than hello_world. > The plugin tells the main application to use the view 'hello_world' for > rendering. This view uses content::hello_world, because it needs access > to some fields defined only in the subclass. > > Now, if I call > > render("hello_world", *c.get()); > > where c is the returned shared_ptr, cppcms catches a std::bad_cast > exception occuring in http_context.c, line 132. First of all `render` function always receives `content::master` and dynamic casts after-wards in views to correct content. If cast fails it throws bad_cast. > If I use booster::dynamic_pointer_cast beforehand and pass the casted > shared_ptr, everything works. What do you cast? Do you mean that you cast to `content::hello_world` ? It seems to me this is more shared object issues. Do you compile your application with -rdynamic or --export-dynamic. see: <http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_templates_bld#Dynamic+Loading+of+Views> Because use it looks like this issue. If you don't compile your applications with -rdynamic, dynamic cast between shared object boundaries may fail. This is very important to remember. Artyom |
From: Artyom <art...@ya...> - 2010-08-19 07:10:39
|
Hello, > 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. Yes I think this is the way. I would suggest following. 1. Compile entry skin for each plugin, acutally this what I'm doing for each skin/view. For example if I need two skins I do something like: master_foo.tmpl master_bar.tmpl shared1.tmpl, shared2.tmpl Then I compile all of them into two skins: cppcms_tmpl_cc master_foo.tmpl shared1.tmpl shared1.tmpl -s "foo" ... cppcms_tmpl_cc master_bar.tmpl shared1.tmpl shared1.tmpl -s "bar" ... In your case it would be: master.tmpl plugin_foo.tmpl plugin_bar.tmpl cppcms_tmpl_cc master.tmpl plugin_foo.tmpl -s "plugins_skin_foo" ... cppcms_tmpl_cc master.tmpl plugin_bar.tmpl -s "plugins_skin_bar" ... It duplicates the code but makes the life much easier as you don't need to deal with classes. And you may add some query to pluging to get its skin name. 2. Another option is to use separate skin for what plugin need to render. For example if the pluging need to create a one or two pice of HTML you may create small skinks that render only these parts for them and each one of them has its own skins. I hope I understand your question correctly. Artyom |
From: Artyom <art...@ya...> - 2010-08-19 06:48:00
|
Hello, > > Hello, > > What is the proper way to set up cppcms to run with fastcgi? > Every CGI/FastCGI/SCGI application regardless if they are CppCMS based or not are run by web server and defined by special "script" path. For example for PHP it may be /foo/bar.php for binary cgi scripts it would be /cgi-bin/bar.cgi So you need to provide a web server a path to run CGI application from. Recommendation choose something like /your_app_name Next step is to decide whether web server is responsible on starting your CppCMS application or you start your CppCMS application on your own and just tell web server how to connect (apache, lighttpd support both first and second case, nginx just second case). If you want to know how to configure a web server in second case the simplest way - use cppcms_run utility, it creates a configuration file you should be based on. It is very useful tool to run CppCMS applications against web server for debugging. For example in case of apache external start you may need something like that: FastCgiIpcDir some/ipc/directory/generally/given/in/your/fastcgi/mod FastCgiExternalServer /path/to/your/myapp.fcgi -socket /tmp/cppcms_socket ScriptAliasMatch ^/your_app_name(.*)$ /path/to/your/myapp.fcgi\$1 AddHandler fastcgi-script .fcgi And then pass: "api" : "fastcgi" , "socket" : "/tmp/cppcms_socket" For case of apache staring the service you need to use FastCgiServer instead of external one and set server.socket = "stdin" see to take the socket from web server: <http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_config#service.socket> (Actually I had forgot to add the stdin option to documentation) See also reference: <http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html> This reminds me that I need a section in wiki on how to configure CppCMS with various web servers. > I have libapache2-mod-fastcgi installed. > > > The problem with "api":"http" is that I have not found a way to configure it >so > > that: > > 1- we can serve file (file_server = true, to serve .css files, etc). > 2- there is no prefix (from the script) at the beginning of the URL. > > In the 'mb' example, all the url's are prefixed like this: > url = request().script_name()+"/tree/"+lexical_cast<string>(id); > where my code simply does the equivalent of: > url = "/tree/"+lexical_cast<string>(id); > > http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_config > I tried several combinations of: > service.api > http.script > file_server.enable > file_server.document_root > but the only way I managed to make it work is when all the URL are prefixed > with the script name. > Yes, fastcgi applications require some script name. And this is what you will have with every web server. You may probably use some URL rewriting or use several script names to get different behavior. In any case iternal server supports only this kind of behavior. Regards, Artyom |
From: augustin <aug...@ov...> - 2010-08-19 06:03:26
|
Hello, In the example: cppcms/examples/forms/ in info_form::info_form(), calling name.size(int n); does not work. I get the compile error: undefined reference to `cppcms::widgets::text::size(int)' yet the function is defined here: http://art-blog.no- ip.info/cppcms_ref_v0_99/classcppcms_1_1widgets_1_1text.html#cdd6d081d3f17291ba374e75cf812e7b void cppcms::widgets::text::size ( int n ) Set html attribute size of the widget The following works, however: name.attributes_string("size='20'") See the attached patch. I am not sure if it's a bug in cppcms, or me who does things wrong. Cheers, Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ 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/ . |
From: Julian P. <ju...@wh...> - 2010-08-19 01:23:25
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Just another question: The plugins currently return their own content class derived from a master class containing common properties such as a page title. Because C++ doesn't allow to redefine return types when overloading virtual methods, I use a booster::shared_ptr<content::master> for passing the content class. The problem that occurs is the following: Example: Plugin HelloWorld has a content class content::hello_world derived from content::master which is returned on calling handleRequest() wrapped in a booster::shared_ptr<content::master>. This content class now has to be rendered by the main application which does not now which content subclass is wrapped in the pointer / knows it at runtime only, so that a hard-compiled conversion via booster::dynamic_pointer_cast<content::hello_world,content::master> is not possible, because there could be other plugins returning different subclasses of the master than hello_world. The plugin tells the main application to use the view 'hello_world' for rendering. This view uses content::hello_world, because it needs access to some fields defined only in the subclass. Now, if I call render("hello_world", *c.get()); where c is the returned shared_ptr, cppcms catches a std::bad_cast exception occuring in http_context.c, line 132. If I use booster::dynamic_pointer_cast beforehand and pass the casted shared_ptr, everything works. So what I need is basically the following: 1. A way to use something like dynamic_pointer_cast with a type that is known only at runtime (could be queried from the plugin) 2. Or: The template compiler should not write a constructor expecting content::hello_world but instead from a booster::shared_ptr<content::master> which is then dynamic_pointer_cast'ed to the required pointer to a content::hello_world. Assumption for the compiler would be, that the base class is always content::master, so that the information from <% view uses content::hello_world %> would be used to construct this: content::hello_world &content; hello_world(booster::shared_ptr<content::master> ptr) { booster::shared_ptr<content::hello_world> hptr = booster::dynamic_pointer_cast<content::hello_world,content::master> (ptr); content = *hptr.get(); } Any ideas on that matter? Thank you, Julian -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJMbIeDAAoJENidYKvYQHlQqLMQAMXLquJctetMqg47huo+4D8l Z1a70oCfCwtQjL0DYdV7o8zMBZL4CKjC3H7i0XsCVcR3TokFl+EjBCQtJEQK+JQE ZWQ2SwhY3HwKELaNSF2wXt0H+iZgwjLDc2UUvx9t0hEpdesoL0LG2Nl0FgBUvGX7 BxUDmspjiWBsFTfSBHB9sVy4Iq7RXD5HLvnIJEaYN8KnZ8NmllLIl+VX/N3ECrgW GNxD057MRih2eMn999GWEoRJPOytMWwgq0F2IQRdzRPKIi+BQbFWXwQRQ7i0mbUX Lmm6WRbqGjt+eeEZWz6QkAsvX52xgJWGLPJw+PQmXADpd2O0PV2WS9uqtVxdeSrP fatJwAl/2+9uj5uIXKhkiHhkqW9AmmNIXGDgeo9F17RsryCgsWqlVlpSQoZBXSA0 g6PpIm2iDGBVue1+5X9LMxUbVLv7m1rJNaXJIsHg9yN/ebBK9li23zXFffQ2I1uj z2o4O+WoyOD6vCUbYa38M2kJU+Iuwwt4fjvZVmbr0wezeLUPtsXp2Zw5DLZNWUC1 gEhmCrDFvgQXcUvlQwYzmDYLPrNq7y5ovkgRccNt/kY0kxLJouahNtFfv7GLnVIl BWjef8qQ4vS+l9h6e5g5R+Et50DSSDKqpdoWGSr4YvaG5cCjEpfI9doISC05QTSv o84I1M1kAcEpUQGu9Q23 =hpb4 -----END PGP SIGNATURE----- |
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----- |
From: augustin <aug...@ov...> - 2010-08-18 07:56:23
|
Hello, What is the proper way to set up cppcms to run with fastcgi? I have libapache2-mod-fastcgi installed. When I run the hello_world example, I change the config.js file: "service" : { "api" : "fastcgi", but the browser just hangs in there, and never returns anything. I searched the web but I couldn't find a proper documentation (at least not one I understood). The problem with "api":"http" is that I have not found a way to configure it so that: 1- we can serve file (file_server = true, to serve .css files, etc). 2- there is no prefix (from the script) at the beginning of the URL. In the 'mb' example, all the url's are prefixed like this: url = request().script_name()+"/tree/"+lexical_cast<string>(id); where my code simply does the equivalent of: url = "/tree/"+lexical_cast<string>(id); http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_config I tried several combinations of: service.api http.script file_server.enable file_server.document_root but the only way I managed to make it work is when all the URL are prefixed with the script name. Thanks, Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ 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/ . |
From: augustin <aug...@ov...> - 2010-08-18 07:47:10
|
On Wednesday 18 August 2010 02:54:43 pm Artyom wrote: > Actually there is a special filter called > "raw" filter build for this purpose Yes, I saw that. Thanks :) Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ 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/ . |
From: Artyom <art...@ya...> - 2010-08-18 06:54:50
|
Actually there is a special filter called "raw" filter build for this purpose - it transfers everything without change and thus HTML goes directly to stream without escaping. ----- Original Message ---- > From: augustin <aug...@ov...> > To: cpp...@li... > Sent: Wed, August 18, 2010 6:51:50 AM > Subject: Re: [Cppcms-users] templates and HTML escaping and raw output > > > > Ooops! I wrote too quickly. I hadn't read the full page. > http://art-blog.no- > ip.info/wikipp/en/page/ref_templates_comm#Variable+with+filters > > " > If no filters, are given the variable is automatically escaped, but if you > provide any filter they are used instead of escaping." > > Sorry for the noise. I'll test this all and I'll write again later if I still > have problems. > > Thank you for the nice documentation :) > > Augustin. > > > -- > Friends: http://www.reuniting.info/ http://activistsolutions.org/ > 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/ > > > > > > > > > > > > > . > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: augustin <aug...@ov...> - 2010-08-18 03:55:20
|
Ooops! I wrote too quickly. I hadn't read the full page. http://art-blog.no- ip.info/wikipp/en/page/ref_templates_comm#Variable+with+filters " If no filters, are given the variable is automatically escaped, but if you provide any filter they are used instead of escaping." Sorry for the noise. I'll test this all and I'll write again later if I still have problems. Thank you for the nice documentation :) Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ 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/ . |
From: augustin <aug...@ov...> - 2010-08-18 03:50:58
|
Hello, http://art-blog.no-ip.info/wikipp/en/page/ref_templates_comm#Variable It is stated above that the template system performs HTML escaping on every string. In all the examples, it appears that links and anything containing HTML is using sub-templates. Isn't it possible to have a raw output (i.e. without HTML escaping. Imagine a webmaster writing a blog post with HTML. How can the HTML be output as is? I am not too sure how to use std::ostringstream to that effect. Thanks, Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ 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/ . |
From: Artyom <art...@ya...> - 2010-08-10 12:26:42
|
See: <http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_config#file\_server> > The configuration didn't make clear how to tell cppcms where to mount > the fileserver. You don't mount it, you just define it. You mount your application to specific points. > /path/to/webroot/static/* accessible under /static/*? You define file_server.document_root to /path/to/webroot Note: when using HTTP web server you should specify script_name for the location of your web application, anything that does not much script_name would be served by file server. See: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_config#http Artyom |
From: Julian P. <ju...@wh...> - 2010-08-10 11:53:53
|
Hallo, how is the built-in fileserver to be configured, if I want to have /path/to/webroot/static/* accessible under /static/*? The configuration didn't make clear how to tell cppcms where to mount the fileserver. Thanks, Julian |
From: Artyom <art...@ya...> - 2010-08-10 11:43:08
|
> > Just another question: Are there any possibilities to gain information > about the current upload progress to display it in browser via ajax or > so in current SVN? > Not yet, for such information take a look on following discussion http://comments.gmane.org/gmane.comp.lib.cppcms.user/143 Artyom |
From: Julian P. <ju...@wh...> - 2010-08-10 11:38:01
|
Ok, excuse the noise, it was a layer 8 problem here. Because I created the image file as root (permissions are 700), I couldn't read it as the user which run the browser I tried to upload with. Should have stumbled upon the fact, that the image had been transferred unbelievable fast via the 100Mbits network connection ^^. Just another question: Are there any possibilities to gain information about the current upload progress to display it in browser via ajax or so in current SVN? Thanks, Julian |
From: Artyom <art...@ya...> - 2010-08-10 11:29:43
|
> > Currently, I'm using 0.99.2.1, now compiling latest SVN revision just to > check whether it works there. There is no difference in file handling between svn and beta 0.99.2 so don't need to do. > In my code, I did not invoke the file widget's limits() method to set > limits, now I did this and set them to 0 for min and -1 for max, and > validate now returns true, but the file is zero bytes long (if I set min > to 1, validate returns false again). Before you use widget validation, just for debugging: Print what you are actually uploaded without relation to specific widget: cppcms::http::request::files_type files=request().files(); std::cout << "Got files" << std::endl; for(unsigned i=0;i<files.size();i++) { std::cout << files[i]->name() << " " << files[i]->filename() << " " << files[i]->size() << std::endl; } std::cout << "Done" << std::endl; And see if you get anything uploaded. Once you got continue to widget itself to check validation procedure. |
From: Artyom <art...@ya...> - 2010-08-10 11:21:14
|
Hello, I've tryed uploading 150Mb files with this setting, no problems. If you are using 0.99.2.1 Then: 1. Make sure /mnt/root.parent is accessible directory. 2. Make sure that uploaded files has both file name and mime types provided, otherwise they would be treated as ordinary form fields. 3. Take a look in this directory if temporary files like /mnt/root.parent/cppcms_uploads_60ddf620746d2b8832c5028bb03a2671.tmp Are created during upload process. > > This is my config.js which should contain the required settings for > uploads of this size: > > { > "service" : { > "api" : "http", > "ip" : "0.0.0.0", > "port": 4444 > }, > "security" : { > "multipart_form_data_limit" : 3000000, > "uploads_path": "/mnt/root.parent" > }, > "logging" : { > "level": "debug" > } > } > > Because of memory constraints, the uploads_path is set to another than > the default location. Does this work in the current beta release > (0.99.2.1) or do I have to use SVN? > > As you see, there is no other webserver which could put constraints on > upload file size, currently the HTTP implementation of CPPCMS is used. > > There are no error outputs on stderr concerning a too big POST size, > only logs of the HTTP requests. > > Help is greatly appreciated, > Julian > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Julian P. <ju...@wh...> - 2010-08-10 11:11:29
|
Am 10.08.2010 12:58, schrieb Artyom: >> >> Because of memory constraints, the uploads_path is set to another than >> the default location. Does this work in the current beta release >> (0.99.2.1) or do I have to use SVN? >> > > Just to make clear what version of CppCMS are you using? If you are using 0.99.1 > then upgrade to 0.99.2.1 where lots of file handing fixes where done, it it does > not work on 0.99.2.1 then I'll try to figure out what happens. > Currently, I'm using 0.99.2.1, now compiling latest SVN revision just to check whether it works there. In my code, I did not invoke the file widget's limits() method to set limits, now I did this and set them to 0 for min and -1 for max, and validate now returns true, but the file is zero bytes long (if I set min to 1, validate returns false again). Later in the code, I'm using save_to to store the uploaded file to another file on the same filesystem, this file is only zero bytes in size (checked with ls -l). I don't know whether cppcms respects my upload_files setting, because in /mnt/root.parent I don't see any temporary file, and under /tmp is not enough space to store the entire file. |
From: Artyom <art...@ya...> - 2010-08-10 10:58:39
|
> > Because of memory constraints, the uploads_path is set to another than > the default location. Does this work in the current beta release > (0.99.2.1) or do I have to use SVN? > Just to make clear what version of CppCMS are you using? If you are using 0.99.1 then upgrade to 0.99.2.1 where lots of file handing fixes where done, it it does not work on 0.99.2.1 then I'll try to figure out what happens. Artyom |
From: Julian P. <ju...@wh...> - 2010-08-10 10:46:35
|
Hallo, I'm currently implementing an application which requires that files of approx. 130 MB can be uploaded via multipart/form-data-POST. While files of smaller sizes (tested with up to 10MB) work, the file of 130 MB does not. As it seems, the file is simply missing (my script gives error output to user if the file has not been uploaded, and when the big file is uploaded it indicates that the file is missing). On the page with the upload form, two file fields are specified: a checksum file (32 Bytes) and the image file. The checksum file is uploaded correctly everytime, but the image file only if its not too big. This is my config.js which should contain the required settings for uploads of this size: { "service" : { "api" : "http", "ip" : "0.0.0.0", "port": 4444 }, "security" : { "multipart_form_data_limit" : 3000000, "uploads_path": "/mnt/root.parent" }, "logging" : { "level": "debug" } } Because of memory constraints, the uploads_path is set to another than the default location. Does this work in the current beta release (0.99.2.1) or do I have to use SVN? As you see, there is no other webserver which could put constraints on upload file size, currently the HTTP implementation of CPPCMS is used. There are no error outputs on stderr concerning a too big POST size, only logs of the HTTP requests. Help is greatly appreciated, Julian |
From: augustin <aug...@ov...> - 2010-08-08 12:58:54
|
Thank you very much Artyom for this new release. Thanks also for the added examples. It's looking good. Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ 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/ . |