cppcms-users Mailing List for CppCMS C++ Web Framework (Page 37)
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
|
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
|
From: Artyom B. <art...@ya...> - 2014-07-20 19:07:46
|
1st of all threads_no() returns the SIZE of the thread pool and not the "specific thread ID". So you'll see the same number. Where do you think you are blocked? What is the output? Are you sure the loop completes? Print something before you "post -back" to the event loop. I don't see any specific problem why wouldn't it work. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ -------------------------------------------- On Wed, 7/16/14, DieterM75 . <die...@gm...> wrote: Subject: Re: [Cppcms-users] Asynchronous app calls thread_pool.post() and blocks current thread To: "Artyom Beilis" <art...@ya...>, cpp...@li... Date: Wednesday, July 16, 2014, 10:18 PM Sure, I want an asynchronous application to handle some requests assigned to the dispatcher. Then for each request, a long running task is to be created. Therefore I want it to be executed not in the event loop and block the complete process. What I thought would happen was the jop posted via thread_pool().post would have been executed in a thread from the pool, not blocking the event loop nor the request handling. What I encounter is that the asynchronous application is not able to handle further requests while the first job is running, but rather enques them and processes them one after another. However, a timer I implemented with boosters deadline_timer is continuously triggering (not included in the code). So I guess the event loop is not blocked, but the application is. On Wed, Jul 16, 2014 at 9:34 AM, Artyom Beilis <art...@ya...> wrote: Can you please send the code via attachment/inline and not "pastie" and explain in more details what happens? Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ From: dieterm57 <die...@gm...> To: cpp...@li... Sent: Monday, July 14, 2014 10:34 PM Subject: [Cppcms-users] Asynchronous app calls thread_pool.post() and blocks current thread Hey all, I try to run an eventhandler inside of an asynchronous application, using the following code: http://pastie.org/private/9kuhjwvrzswmnpoczvvqw This seems to not block the eventloop, but the eventhandler gets called in the same thread the application runs in, resulting in the application not responding to new incoming requests. Is this the way it is designed or am I screwing up again :-[ ? What would be the correct application design to execute a 'background' job in the thread_pool, while not blocking the incoming requests? Sincerely Dieter ------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck® Code Sight™ - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users ------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |
|
From: Abhishek K. <abh...@gm...> - 2014-07-18 14:38:59
|
Hi,
Please ignore,
I could make it working by simply mapping it with url along with other
sub-applications. like:
attach( new app_user::User_controller(s),
"user","/user{1}","/user(/(.*))?",1);
attach( new app_user::User_json_service(s),
"rpc","/rpc{1}","/rpc(/(.*))?",1);
Thanks for such a great framework Artyom. Its love developing with it.
Regards,
Abhishek
|
|
From: Abhishek K. <abh...@gm...> - 2014-07-17 17:15:23
|
Hello Artyom, CPPCMS Developers,
I have a main function defined as follows:
int main(int argc,char **argv)
{
try {
cppcms::service srv(argc,argv);
srv.applications_pool()
.mount(cppcms::applications_factory<app_common::Main_controller>());
srv.applications_pool()
.mount(cppcms::applications_factory<app_user::User_json_service>());
srv.run();
}
catch(std::exception const &e) {
std::cerr << "Failed: " << e.what() << std::endl;
std::cerr << booster::trace(e) << std::endl;
return 1;
}
return 0;
}
app_common::Main_controller : is the normal application, which contains url
dispatcher bound to their relevant methods.
app_user::User_json_service : is an RPC application.
However, when I run the method, I see that app_common::Main_controller works
as usual, however, I don't see app_user::User_json_service responding to any
url calls.
In config.js, I have added
"http" : {
"script_names" : ["/lb","/rpc"] ,
"rewrite" : [
{ "regex" : "/media(/.*)?", "pattern" : "$0" },
{ "regex" : "/rpc(/.*)?", "pattern" : "/rpc$0" },
{ "regex" : ".*" , "pattern" : "/lb$0" }
But the RPC never works here. Can you tell me a proper way to do it? is it
possible to added multiple application in the pool and get working? Or do I
require have a different server dedicated for doing RPC work only?
Please let me know.
Regards,
Abhishek
|
|
From: DieterM75 . <die...@gm...> - 2014-07-16 19:18:11
|
Sure, I want an asynchronous application to handle some requests assigned to the dispatcher. Then for each request, a long running task is to be created. Therefore I want it to be executed not in the event loop and block the complete process. What I thought would happen was the jop posted via thread_pool().post would have been executed in a thread from the pool, not blocking the event loop nor the request handling. What I encounter is that the asynchronous application is not able to handle further requests while the first job is running, but rather enques them and processes them one after another. However, a timer I implemented with boosters deadline_timer is continuously triggering (not included in the code). So I guess the event loop is not blocked, but the application is. On Wed, Jul 16, 2014 at 9:34 AM, Artyom Beilis <art...@ya...> wrote: > Can you please send the code via attachment/inline and not "pastie" and > explain in more details what happens? > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > ------------------------------ > *From:* dieterm57 <die...@gm...> > *To:* cpp...@li... > *Sent:* Monday, July 14, 2014 10:34 PM > *Subject:* [Cppcms-users] Asynchronous app calls thread_pool.post() and > blocks current thread > > Hey all, > I try to run an eventhandler inside of an asynchronous application, > using the following code: > http://pastie.org/private/9kuhjwvrzswmnpoczvvqw > > This seems to not block the eventloop, but the eventhandler gets called > in the same thread the application runs in, resulting in the application > not responding to new incoming requests. > > Is this the way it is designed or am I screwing up again :-[ ? > What would be the correct application design to execute a 'background' > job in the thread_pool, while not blocking the incoming requests? > > Sincerely > Dieter > > > ------------------------------------------------------------------------------ > Want fast and easy access to all the code in your enterprise? Index and > search up to 200,000 lines of code with a free copy of Black Duck® > Code Sight™ - the same software that powers the world's largest code > search on Ohloh, the Black Duck Open Hub! Try it now. > http://p.sf.net/sfu/bds > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > Want fast and easy access to all the code in your enterprise? Index and > search up to 200,000 lines of code with a free copy of Black Duck > Code Sight - the same software that powers the world's largest code > search on Ohloh, the Black Duck Open Hub! Try it now. > http://p.sf.net/sfu/bds > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
|
From: Abhishek K. <abh...@gm...> - 2014-07-16 17:21:02
|
> Hi Artyom, Thanks for your reply. I have discovered the use of content varaible in template code using <% c++ .... %> and have solved my problem. I was about to post this, just to save your time in answering me. > if you want to access the object itself. What do you expect to do with it? If you access an object you access its members. We can have this case: <% form as_p form %> Rather than passing an object which wraps a form, we could have passed the form object directly to the render function. However, I don't think that would be possible, since form isn't inheriting from base_content (and doing multi-inheritance may be bad.) However, even without this, development is still going at our end smoothly. And this was just a design opinion that popped (due to habits of using Spring MVC, etc.). However, I don't think, cppcms template design is any less in any way. Regards, Abhishek |
|
From: Artyom B. <art...@ya...> - 2014-07-16 07:35:05
|
Can you please send the code via attachment/inline and not "pastie" and explain in more details what happens? Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: dieterm57 <die...@gm...> >To: cpp...@li... >Sent: Monday, July 14, 2014 10:34 PM >Subject: [Cppcms-users] Asynchronous app calls thread_pool.post() and blocks current thread > > >Hey all, >I try to run an eventhandler inside of an asynchronous application, >using the following code: >http://pastie.org/private/9kuhjwvrzswmnpoczvvqw > >This seems to not block the eventloop, but the eventhandler gets called >in the same thread the application runs in, resulting in the application >not responding to new incoming requests. > >Is this the way it is designed or am I screwing up again :-[ ? >What would be the correct application design to execute a 'background' >job in the thread_pool, while not blocking the incoming requests? > >Sincerely >Dieter > >------------------------------------------------------------------------------ >Want fast and easy access to all the code in your enterprise? Index and >search up to 200,000 lines of code with a free copy of Black Duck® >Code Sight™ - the same software that powers the world's largest code >search on Ohloh, the Black Duck Open Hub! Try it now. >http://p.sf.net/sfu/bds >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Artyom B. <art...@ya...> - 2014-07-16 07:33:47
|
I'm not 100% sure I understood your question. If you need to pass a complex structures you can part them as a member of "content::message" if you want to access the object itself. What do you expect to do with it? If you access an object you access its members. Now technically <% = text %> is converted to C++ code like: out() << content.text; (not exactly as there are filtering and some more stuff) so if you embed C++ to the code you can actually access c as "content" variable. Now one important restriction is that "c" is actually derived from cppcms::base_content http://cppcms.com/cppcms_ref/latest/classcppcms_1_1base__content.html Which is polymorphic class and safe dynamic casting can be done to ensure you actually use right object withing the template. Note templates may be loaded dynamically and compiled independently. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Abhishek Kaushik <abh...@gm...> >To: cpp...@li... >Sent: Monday, July 14, 2014 7:16 PM >Subject: [Cppcms-users] Template rendering. Access the actual class, rather then members? > > >Greetings, > >I have been following the CPPCMS tutorials regarding view rendering. > >What I see mostly is that when you render your data (let's use the example >of content::message) > >so we have: > > content::message c; > c.text=">>>Hello<<<"; > render("message",c); > >and then in the templates, we use this data as: > ><% view message uses content::message %> ><% template render() %> ><html> > <body> > <h1><%= text %> World!</h1> <-- this is a part of message. > </body> ></html> ><% end template %> ><% end view %> > >========================== > >What I wanted to know, is there a way to access "message" object in the >template, directly? Like instead of doing: > ><%= text %>, is there any way where I can refer the actual parent object: >like <%= message.text %> ? > >The advantage I will have is, that while calling the render method (as in >render("message",c);), I would be able to pass my data directly. > >Let's say in the Message Board's Example. If you see the passing of >data::forum to templates, you were required to construct a parent kind of >object, which would contained vectors to topics, etc. But if you see from >the usage or design point of view, it would be great if I were able to pass >the topics directly, without making it require a parent kind of wrapper. > >Let me know, if there exists any way to achieve it. > >Regards, >Abhishek > > >------------------------------------------------------------------------------ >Want fast and easy access to all the code in your enterprise? Index and >search up to 200,000 lines of code with a free copy of Black Duck® >Code Sight™ - the same software that powers the world's largest code >search on Ohloh, the Black Duck Open Hub! Try it now. >http://p.sf.net/sfu/bds >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: dieterm57 <die...@gm...> - 2014-07-14 19:34:59
|
Hey all, I try to run an eventhandler inside of an asynchronous application, using the following code: http://pastie.org/private/9kuhjwvrzswmnpoczvvqw This seems to not block the eventloop, but the eventhandler gets called in the same thread the application runs in, resulting in the application not responding to new incoming requests. Is this the way it is designed or am I screwing up again :-[ ? What would be the correct application design to execute a 'background' job in the thread_pool, while not blocking the incoming requests? Sincerely Dieter |
|
From: Abhishek K. <abh...@gm...> - 2014-07-14 16:17:13
|
Greetings,
I have been following the CPPCMS tutorials regarding view rendering.
What I see mostly is that when you render your data (let's use the example
of content::message)
so we have:
content::message c;
c.text=">>>Hello<<<";
render("message",c);
and then in the templates, we use this data as:
<% view message uses content::message %>
<% template render() %>
<html>
<body>
<h1><%= text %> World!</h1> <-- this is a part of message.
</body>
</html>
<% end template %>
<% end view %>
==========================
What I wanted to know, is there a way to access "message" object in the
template, directly? Like instead of doing:
<%= text %>, is there any way where I can refer the actual parent object:
like <%= message.text %> ?
The advantage I will have is, that while calling the render method (as in
render("message",c);), I would be able to pass my data directly.
Let's say in the Message Board's Example. If you see the passing of
data::forum to templates, you were required to construct a parent kind of
object, which would contained vectors to topics, etc. But if you see from
the usage or design point of view, it would be great if I were able to pass
the topics directly, without making it require a parent kind of wrapper.
Let me know, if there exists any way to achieve it.
Regards,
Abhishek
|
|
From: Abhishek K. <abh...@gm...> - 2014-07-10 14:52:44
|
Thanks, That did work! |
|
From: Lee E. <le...@el...> - 2014-07-10 12:13:32
|
Override application::main in your base app. Everything goes throu it
בתאריך 10 ביול 2014 13:45, "Abhishek Kaushik" <abh...@gm...> כתב:
> Hi,
>
> I am working on an application and have a very simple requirement.
>
> Its just that I want all the requests being made to the server should pass
> an authentication criteria.
>
> If the requests are valid (based on session checks), let them continue or
> else redirect them to a login page.
>
> I have created one such implementation as shown here:
>
> void main_controller::manage_default(std::string page) {
> if(page == "/login") {
> if(session().is_set("username")) {
> response().status(cppcms::http::response::found,url(""));
> }
> } else {
> if(!session().is_set("username")) {
> response().status(cppcms::http::response::found,url("/login"));
> }
> }
> }
>
> but this function (manage_default) is mapped to default url (i.e. ""). So
> it
> won't be called if user calls some other pages like /view_bills (without
> touching the base url).
>
> So is there a way where I can capture all such requests at a single place
> and then allow such requests to continue further?
>
> Regards,
> Abhishek
>
>
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
|
|
From: Abhishek K. <abh...@gm...> - 2014-07-10 10:45:32
|
Hi,
I am working on an application and have a very simple requirement.
Its just that I want all the requests being made to the server should pass
an authentication criteria.
If the requests are valid (based on session checks), let them continue or
else redirect them to a login page.
I have created one such implementation as shown here:
void main_controller::manage_default(std::string page) {
if(page == "/login") {
if(session().is_set("username")) {
response().status(cppcms::http::response::found,url(""));
}
} else {
if(!session().is_set("username")) {
response().status(cppcms::http::response::found,url("/login"));
}
}
}
but this function (manage_default) is mapped to default url (i.e. ""). So it
won't be called if user calls some other pages like /view_bills (without
touching the base url).
So is there a way where I can capture all such requests at a single place
and then allow such requests to continue further?
Regards,
Abhishek
|
|
From: Artyom B. <art...@ya...> - 2014-06-28 15:50:48
|
Because std::string isn't Plain Old Object - it has constructor/destructor etc. You can't serialize it as POD you need to serialize all its members independently Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: CN <cn...@fa...> >To: cpp...@li... >Sent: Friday, June 27, 2014 1:03 PM >Subject: [Cppcms-users] Serialization usage > > >I feel this code has little difference from the bundled example, but it >yields garbage. Any idea why? >---------------------- >#include <cppcms/serialization.h> >#include <cppcms/application.h> >#include <cppcms/cache_interface.h> >#include <cppcms/session_interface.h> >#include <iostream> >struct person >{ > std::string id; > std::string name; > std::string address; >}; > >struct serializable_person : public cppcms::serializable >{ > person p; > void serialize(cppcms::archive &a){ > a & cppcms::as_pod(p); > } >}; > >struct serializable_v : public cppcms::serializable >{ > std::vector<serializable_person> many; > void serialize(cppcms::archive &a){ > a & many; > } >}; > >int main(int argc,char **argv) >{ > serializable_v obj; > > obj.many.push_back(serializable_person()); > person &p=obj.many.back().p; > p.id="1"; p.name="John"; p.address="here"; > > obj.many.push_back(serializable_person()); > person &p1=obj.many.back().p; > p1.id="1"; p1.name="John"; p1.address="here"; > > cppcms::archive a; > obj.save(a); > std::cout << a.str(); //garbage > return 0; >} > >-- >http://www.fastmail.fm - IMAP accessible web-mail > > >------------------------------------------------------------------------------ >Open source business process management suite built on Java and Eclipse >Turn processes into business applications with Bonita BPM Community Edition >Quickly connect people, data, and systems into organized workflows >Winner of BOSSIE, CODIE, OW2 and Gartner awards >http://p.sf.net/sfu/Bonitasoft >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: CN <cn...@fa...> - 2014-06-27 10:03:25
|
I feel this code has little difference from the bundled example, but it
yields garbage. Any idea why?
----------------------
#include <cppcms/serialization.h>
#include <cppcms/application.h>
#include <cppcms/cache_interface.h>
#include <cppcms/session_interface.h>
#include <iostream>
struct person
{
std::string id;
std::string name;
std::string address;
};
struct serializable_person : public cppcms::serializable
{
person p;
void serialize(cppcms::archive &a){
a & cppcms::as_pod(p);
}
};
struct serializable_v : public cppcms::serializable
{
std::vector<serializable_person> many;
void serialize(cppcms::archive &a){
a & many;
}
};
int main(int argc,char **argv)
{
serializable_v obj;
obj.many.push_back(serializable_person());
person &p=obj.many.back().p;
p.id="1"; p.name="John"; p.address="here";
obj.many.push_back(serializable_person());
person &p1=obj.many.back().p;
p1.id="1"; p1.name="John"; p1.address="here";
cppcms::archive a;
obj.save(a);
std::cout << a.str(); //garbage
return 0;
}
--
http://www.fastmail.fm - IMAP accessible web-mail
|
|
From: Lucile Q. <luc...@sa...> - 2014-06-20 13:47:20
|
On 06/11/2014 06:37 AM, Artyom Beilis wrote: > There are several important bugs I need to fix so it should be > ready withing a week or two. Hello, Since a new release is planned, would you consider the patch I submitted for the following feature request "#17 make the skin generation order independent" ? http://sourceforge.net/p/cppcms/feature-requests/17/ Thanks, |
|
From: sergey l. <ccp...@gm...> - 2014-06-20 13:28:22
|
Dear Stanimir! Thank you for your help! It is not 100% solution for my problem, but it will simplify my life. Also I will create feature request in sf project. Maybe Artyom could add requested functionality. On Fri, Jun 20, 2014 at 1:01 PM, Stanimir Mladenov < sta...@zo...> wrote: > On Fri, Jun 20, 2014 at 10:22 AM, sergey lavrov <ccp...@gm...> > wrote: > >> Dear Stanimir! Dear All! >> >> function request().get() doesn't return >> std::multimap<std::string,std::string>. >> > > There is two "get" member funtions. > One with string param that is handy to get the parameter by name directly. > The other is get() without params. Look at the link to the documentation. > http://cppcms.com/cppcms_ref/latest/classcppcms_1_1http_1_1request.html#a36d72816584f61d3c5b7e510d61a5f58 > > The former returns form_type which is > typedef std::multimap<std::string,std::string> > cppcms::http::request::form_type > <http://cppcms.com/cppcms_ref/latest/classcppcms_1_1http_1_1request.html#af80022c2dddaf68330eb7f3f23ec84fc> > > >> probably you meant about request::getenv() function, that return >> std::map<std::string,std::string>, but this function returns all CGI >> variables. >> >> http://cppcms.com/cppcms_ref/latest/classcppcms_1_1http_1_1request.html#a92bc86f75e4e1f9480967ce3fd1e4f65 >> >> when using request::getenv() function all variables of requested URL and >> it's values are all in one QUERY_STRING key. >> so parsing QUERY_STRING with such complex associative array notations is >> not trivial task. >> for example for one of the request QUERY_STRING looks like, and its >> nightmare to parse variable unknown length and unknown of numbers of >> variables string: >> >> >> draw=1&columns[0][data]=0&columns[0][name]=&columns[0][searchable]=false&columns[0][orderable]=false&columns[0][search][value]=&columns[0][search][regex]=false&columns[1][data]=1&columns[1][name]=&columns[1][searchable]=true&columns[1][orderable]=true&columns[1][search][value]=&columns[1][search][regex]=false&columns[2][data]=2&columns[2][name]=&columns[2][searchable]=true&columns[2][orderable]=true&columns[2][search][value]=&columns[2][search][regex]=false&columns[3][data]=3&columns[3][name]=&columns[3][searchable]=true&columns[3][orderable]=true&columns[3][search][value]=&columns[3][search][regex]=false&columns[4][data]=4&columns[4][name]=&columns[4][searchable]=true&columns[4][orderable]=true&columns[4][search][value]=&columns[4][search][regex]=false&order[0][column]=1&order[0][dir]=asc&start=0&length=10&search[value]=&search[regex]=false&_=1403203600182 >> >> So I still looking for solution. Or should I create feature request? >> >> Thanks in advance! >> >> >> On Fri, Jun 20, 2014 at 9:13 AM, Stanimir Mladenov < >> sta...@zo...> wrote: >> >>> You have request().get() -> >>> http://cppcms.com/cppcms_ref/latest/classcppcms_1_1http_1_1request.html#a36d72816584f61d3c5b7e510d61a5f58 >>> >>> which returns std::multimap<std::string,std::string> >>> >>> The first is your parameter name and the second its value. >>> Note that a parameter could be any type serialized as string. Like an >>> ISO Date (2014-05-24). >>> It is you responsibility to parse those values and convert them to your >>> appropriate c++ representation, since CppCms can't know every type you need. >>> >>> Stanimir >>> >>> >>> On Thu, Jun 19, 2014 at 10:12 PM, sergey lavrov < >>> ccp...@gm...> wrote: >>> >>>> Dear All! >>>> >>>> I need to parsing complex variables and its values in URL which have >>>> the form like: >>>> variable[index1][index2]...[indexN]=X, where index1-N,X could be >>>> integer, string, boolean. >>>> For example, such notation have new version of jquery DataTables 1.10.0. >>>> http://datatables.net/manual/server-side >>>> Also such associative array notations using in variables in forms. >>>> >>>> What is the best way to parse such complex variables and its values? >>>> >>>> The best option for me is packing variables and it's values from URL to >>>> c++ structures as is done in php and other languages. >>>> Unfortunately cppcms::http::request or other classes haven't such >>>> functionality. >>>> >>>> Thanks in advance! >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> HPCC Systems Open Source Big Data Platform from LexisNexis Risk >>>> Solutions >>>> Find What Matters Most in Your Big Data with HPCC Systems >>>> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. >>>> Leverages Graph Analysis for Fast Processing & Easy Data Exploration >>>> http://p.sf.net/sfu/hpccsystems >>>> _______________________________________________ >>>> Cppcms-users mailing list >>>> Cpp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>> >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions >>> Find What Matters Most in Your Big Data with HPCC Systems >>> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. >>> Leverages Graph Analysis for Fast Processing & Easy Data Exploration >>> http://p.sf.net/sfu/hpccsystems >>> _______________________________________________ >>> Cppcms-users mailing list >>> Cpp...@li... >>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >>> >> >> >> ------------------------------------------------------------------------------ >> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions >> Find What Matters Most in Your Big Data with HPCC Systems >> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. >> Leverages Graph Analysis for Fast Processing & Easy Data Exploration >> http://p.sf.net/sfu/hpccsystems >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> > > > ------------------------------------------------------------------------------ > HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions > Find What Matters Most in Your Big Data with HPCC Systems > Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. > Leverages Graph Analysis for Fast Processing & Easy Data Exploration > http://p.sf.net/sfu/hpccsystems > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
|
From: Stanimir M. <sta...@zo...> - 2014-06-20 09:01:35
|
On Fri, Jun 20, 2014 at 10:22 AM, sergey lavrov <ccp...@gm...> wrote: > Dear Stanimir! Dear All! > > function request().get() doesn't return > std::multimap<std::string,std::string>. > There is two "get" member funtions. One with string param that is handy to get the parameter by name directly. The other is get() without params. Look at the link to the documentation. http://cppcms.com/cppcms_ref/latest/classcppcms_1_1http_1_1request.html#a36d72816584f61d3c5b7e510d61a5f58 The former returns form_type which is typedef std::multimap<std::string,std::string> cppcms::http::request::form_type <http://cppcms.com/cppcms_ref/latest/classcppcms_1_1http_1_1request.html#af80022c2dddaf68330eb7f3f23ec84fc> > probably you meant about request::getenv() function, that return > std::map<std::string,std::string>, but this function returns all CGI > variables. > > http://cppcms.com/cppcms_ref/latest/classcppcms_1_1http_1_1request.html#a92bc86f75e4e1f9480967ce3fd1e4f65 > > when using request::getenv() function all variables of requested URL and > it's values are all in one QUERY_STRING key. > so parsing QUERY_STRING with such complex associative array notations is > not trivial task. > for example for one of the request QUERY_STRING looks like, and its > nightmare to parse variable unknown length and unknown of numbers of > variables string: > > > draw=1&columns[0][data]=0&columns[0][name]=&columns[0][searchable]=false&columns[0][orderable]=false&columns[0][search][value]=&columns[0][search][regex]=false&columns[1][data]=1&columns[1][name]=&columns[1][searchable]=true&columns[1][orderable]=true&columns[1][search][value]=&columns[1][search][regex]=false&columns[2][data]=2&columns[2][name]=&columns[2][searchable]=true&columns[2][orderable]=true&columns[2][search][value]=&columns[2][search][regex]=false&columns[3][data]=3&columns[3][name]=&columns[3][searchable]=true&columns[3][orderable]=true&columns[3][search][value]=&columns[3][search][regex]=false&columns[4][data]=4&columns[4][name]=&columns[4][searchable]=true&columns[4][orderable]=true&columns[4][search][value]=&columns[4][search][regex]=false&order[0][column]=1&order[0][dir]=asc&start=0&length=10&search[value]=&search[regex]=false&_=1403203600182 > > So I still looking for solution. Or should I create feature request? > > Thanks in advance! > > > On Fri, Jun 20, 2014 at 9:13 AM, Stanimir Mladenov < > sta...@zo...> wrote: > >> You have request().get() -> >> http://cppcms.com/cppcms_ref/latest/classcppcms_1_1http_1_1request.html#a36d72816584f61d3c5b7e510d61a5f58 >> >> which returns std::multimap<std::string,std::string> >> >> The first is your parameter name and the second its value. >> Note that a parameter could be any type serialized as string. Like an ISO >> Date (2014-05-24). >> It is you responsibility to parse those values and convert them to your >> appropriate c++ representation, since CppCms can't know every type you need. >> >> Stanimir >> >> >> On Thu, Jun 19, 2014 at 10:12 PM, sergey lavrov <ccp...@gm... >> > wrote: >> >>> Dear All! >>> >>> I need to parsing complex variables and its values in URL which have the >>> form like: >>> variable[index1][index2]...[indexN]=X, where index1-N,X could be >>> integer, string, boolean. >>> For example, such notation have new version of jquery DataTables 1.10.0. >>> http://datatables.net/manual/server-side >>> Also such associative array notations using in variables in forms. >>> >>> What is the best way to parse such complex variables and its values? >>> >>> The best option for me is packing variables and it's values from URL to >>> c++ structures as is done in php and other languages. >>> Unfortunately cppcms::http::request or other classes haven't such >>> functionality. >>> >>> Thanks in advance! >>> >>> >>> ------------------------------------------------------------------------------ >>> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions >>> Find What Matters Most in Your Big Data with HPCC Systems >>> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. >>> Leverages Graph Analysis for Fast Processing & Easy Data Exploration >>> http://p.sf.net/sfu/hpccsystems >>> _______________________________________________ >>> Cppcms-users mailing list >>> Cpp...@li... >>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >>> >> >> >> ------------------------------------------------------------------------------ >> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions >> Find What Matters Most in Your Big Data with HPCC Systems >> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. >> Leverages Graph Analysis for Fast Processing & Easy Data Exploration >> http://p.sf.net/sfu/hpccsystems >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> > > > ------------------------------------------------------------------------------ > HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions > Find What Matters Most in Your Big Data with HPCC Systems > Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. > Leverages Graph Analysis for Fast Processing & Easy Data Exploration > http://p.sf.net/sfu/hpccsystems > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
|
From: sergey l. <ccp...@gm...> - 2014-06-20 07:22:33
|
Dear Stanimir! Dear All! function request().get() doesn't return std::multimap<std::string,std::string>. probably you meant about request::getenv() function, that return std::map<std::string,std::string>, but this function returns all CGI variables. http://cppcms.com/cppcms_ref/latest/classcppcms_1_1http_1_1request.html#a92bc86f75e4e1f9480967ce3fd1e4f65 when using request::getenv() function all variables of requested URL and it's values are all in one QUERY_STRING key. so parsing QUERY_STRING with such complex associative array notations is not trivial task. for example for one of the request QUERY_STRING looks like, and its nightmare to parse variable unknown length and unknown of numbers of variables string: draw=1&columns[0][data]=0&columns[0][name]=&columns[0][searchable]=false&columns[0][orderable]=false&columns[0][search][value]=&columns[0][search][regex]=false&columns[1][data]=1&columns[1][name]=&columns[1][searchable]=true&columns[1][orderable]=true&columns[1][search][value]=&columns[1][search][regex]=false&columns[2][data]=2&columns[2][name]=&columns[2][searchable]=true&columns[2][orderable]=true&columns[2][search][value]=&columns[2][search][regex]=false&columns[3][data]=3&columns[3][name]=&columns[3][searchable]=true&columns[3][orderable]=true&columns[3][search][value]=&columns[3][search][regex]=false&columns[4][data]=4&columns[4][name]=&columns[4][searchable]=true&columns[4][orderable]=true&columns[4][search][value]=&columns[4][search][regex]=false&order[0][column]=1&order[0][dir]=asc&start=0&length=10&search[value]=&search[regex]=false&_=1403203600182 So I still looking for solution. Or should I create feature request? Thanks in advance! On Fri, Jun 20, 2014 at 9:13 AM, Stanimir Mladenov < sta...@zo...> wrote: > You have request().get() -> > http://cppcms.com/cppcms_ref/latest/classcppcms_1_1http_1_1request.html#a36d72816584f61d3c5b7e510d61a5f58 > > which returns std::multimap<std::string,std::string> > > The first is your parameter name and the second its value. > Note that a parameter could be any type serialized as string. Like an ISO > Date (2014-05-24). > It is you responsibility to parse those values and convert them to your > appropriate c++ representation, since CppCms can't know every type you need. > > Stanimir > > > On Thu, Jun 19, 2014 at 10:12 PM, sergey lavrov <ccp...@gm...> > wrote: > >> Dear All! >> >> I need to parsing complex variables and its values in URL which have the >> form like: >> variable[index1][index2]...[indexN]=X, where index1-N,X could be integer, >> string, boolean. >> For example, such notation have new version of jquery DataTables 1.10.0. >> http://datatables.net/manual/server-side >> Also such associative array notations using in variables in forms. >> >> What is the best way to parse such complex variables and its values? >> >> The best option for me is packing variables and it's values from URL to >> c++ structures as is done in php and other languages. >> Unfortunately cppcms::http::request or other classes haven't such >> functionality. >> >> Thanks in advance! >> >> >> ------------------------------------------------------------------------------ >> HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions >> Find What Matters Most in Your Big Data with HPCC Systems >> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. >> Leverages Graph Analysis for Fast Processing & Easy Data Exploration >> http://p.sf.net/sfu/hpccsystems >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> > > > ------------------------------------------------------------------------------ > HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions > Find What Matters Most in Your Big Data with HPCC Systems > Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. > Leverages Graph Analysis for Fast Processing & Easy Data Exploration > http://p.sf.net/sfu/hpccsystems > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
|
From: Stanimir M. <sta...@zo...> - 2014-06-20 05:36:06
|
You have request().get() -> http://cppcms.com/cppcms_ref/latest/classcppcms_1_1http_1_1request.html#a36d72816584f61d3c5b7e510d61a5f58 which returns std::multimap<std::string,std::string> The first is your parameter name and the second its value. Note that a parameter could be any type serialized as string. Like an ISO Date (2014-05-24). It is you responsibility to parse those values and convert them to your appropriate c++ representation, since CppCms can't know every type you need. Stanimir On Thu, Jun 19, 2014 at 10:12 PM, sergey lavrov <ccp...@gm...> wrote: > Dear All! > > I need to parsing complex variables and its values in URL which have the > form like: > variable[index1][index2]...[indexN]=X, where index1-N,X could be integer, > string, boolean. > For example, such notation have new version of jquery DataTables 1.10.0. > http://datatables.net/manual/server-side > Also such associative array notations using in variables in forms. > > What is the best way to parse such complex variables and its values? > > The best option for me is packing variables and it's values from URL to > c++ structures as is done in php and other languages. > Unfortunately cppcms::http::request or other classes haven't such > functionality. > > Thanks in advance! > > > ------------------------------------------------------------------------------ > HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions > Find What Matters Most in Your Big Data with HPCC Systems > Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. > Leverages Graph Analysis for Fast Processing & Easy Data Exploration > http://p.sf.net/sfu/hpccsystems > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
|
From: sergey l. <ccp...@gm...> - 2014-06-19 19:12:11
|
Dear All! I need to parsing complex variables and its values in URL which have the form like: variable[index1][index2]...[indexN]=X, where index1-N,X could be integer, string, boolean. For example, such notation have new version of jquery DataTables 1.10.0. http://datatables.net/manual/server-side Also such associative array notations using in variables in forms. What is the best way to parse such complex variables and its values? The best option for me is packing variables and it's values from URL to c++ structures as is done in php and other languages. Unfortunately cppcms::http::request or other classes haven't such functionality. Thanks in advance! |
|
From: Artyom B. <art...@ya...> - 2014-06-12 07:49:25
|
ignore it - mailing list testing Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |
|
From: Artyom B. <art...@ya...> - 2014-06-11 10:37:34
|
> > >I have seen you did some commits and would like to know if you are >planing to release a new version soon? There are several important bugs I need to fix so it should be ready withing a week or two. Currently I have following problems (before a release): (a) A newly booster.thread test fails on FreeBSD I need to find why it may be a serious bug (a) The ICU test fails with ICU version >= 50. It is either ICU bug or just a change that I need to ignore in the test so I'm waiting for a answer from ICU team. > Would it be possible to merge the following commit > from trunk into v1.0_fixes branch? > >r2231: Read only attribute support, closing #13 It changes the ABI in "forward compatible way" only - it adds a new API. It should be done for major versions only. If I add more API changes I need to consider more stuff that is even more important - like for example accessing cache outside the application to fire triggers and some other things. > > > >>>If I read http://cppcms.com/wikipp/en/page/cppcms_1x_tasks it looks >>>like that there >>>are quite a few (open?) tasks. Would it make more sense to strip down the number >>>of planed features and release more often a new version? >> >> >> The most important task I really need to implement is >> >> http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#Add.Support.of.multiple.event.loops >> >> >> Because it is critical for scalability >> >> Also this one: http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#Provide.Plugin.Framework >> >> probably would be postponed - mostly because it requires some design and there is already some basic support of it + support in cppcms_tmp_cc that is ready. >> >> And several other small tasks that would not take much time: >> >> http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#Improve.Support.of.RESTful.services >> >> http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#Improve.file.serving.performance >> >> Also I'm planning to publish some notes about the project state. > >Do you have an update on this one? > > > > > >> >>>Btw did you see http://sourceforge.net/p/cppcms/bugs/104/ ? >> >> Yes. See it is a bug in CMake. You can extract tar.bz2 using 7zip without problems. >> >> The problem is that zip can't contain symlinks - and some people would try to download >> it anyway even on Linux and will get failed tests. >> >> So I'd rather prefer not to provide zip. >> > >greets >-- >Christian Gmeiner, MSc > >https://soundcloud.com/christian-gmeiner > > > > |
|
From: Christian G. <chr...@gm...> - 2014-06-11 06:47:18
|
Hi Artyom 2013-09-09 9:25 GMT+02:00 Artyom Beilis <art...@ya...>: >> >>Hi Artyom >> >>It looks like you are quite a busy man but what are the plans for a new cppcms >>release? >> I have seen you did some commits and would like to know if you are planing to release a new version soon? Would it be possible to merge the following commit from trunk into v1.0_fixes branch? r2231: Read only attribute support, closing #13 >>If I read http://cppcms.com/wikipp/en/page/cppcms_1x_tasks it looks >>like that there >>are quite a few (open?) tasks. Would it make more sense to strip down the number >>of planed features and release more often a new version? > > > The most important task I really need to implement is > > http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#Add.Support.of.multiple.event.loops > > > Because it is critical for scalability > > Also this one: http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#Provide.Plugin.Framework > > probably would be postponed - mostly because it requires some design and there is already some basic support of it + support in cppcms_tmp_cc that is ready. > > And several other small tasks that would not take much time: > > http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#Improve.Support.of.RESTful.services > > http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#Improve.file.serving.performance > > Also I'm planning to publish some notes about the project state. Do you have an update on this one? > >>Btw did you see http://sourceforge.net/p/cppcms/bugs/104/ ? > > Yes. See it is a bug in CMake. You can extract tar.bz2 using 7zip without problems. > > The problem is that zip can't contain symlinks - and some people would try to download > it anyway even on Linux and will get failed tests. > > So I'd rather prefer not to provide zip. > greets -- Christian Gmeiner, MSc https://soundcloud.com/christian-gmeiner |
|
From: Artyom B. <art...@ya...> - 2014-06-09 20:41:39
|
Yes there is a reason behind that. The policy is if set() is false that accessing value() would throw an exception. Blank text is still a valid text the empty string is still a text - i.e. you take value() and it is valid, on the other hand if there is no number or there is no uploaded file, than there is no reasonable value() and than you must check the set() properly. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ -------------------------------------------- On Mon, 6/9/14, CN <cn...@fa...> wrote: Subject: [Cppcms-users] cppcms::widgets::text::set() always returns true To: cpp...@li... Date: Monday, June 9, 2014, 2:49 PM This make sense to me: cppcms::widgets::numeric::set() returns false if users leave it bank. However, cppcms::widgets::text::set() always returns true regardless of users leaving it blank or entering characters in that widget. Is there any special reason why cppcms::widgets::text::set() behave so? Why is cppcms::widgets::text::set() not designed to return false instead if users leave it blank? -- http://www.fastmail.fm - Or how I learned to stop worrying and love email again ------------------------------------------------------------------------------ HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration http://www.hpccsystems.com _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |
|
From: CN <cn...@fa...> - 2014-06-09 11:49:33
|
This make sense to me: cppcms::widgets::numeric::set() returns false if users leave it bank. However, cppcms::widgets::text::set() always returns true regardless of users leaving it blank or entering characters in that widget. Is there any special reason why cppcms::widgets::text::set() behave so? Why is cppcms::widgets::text::set() not designed to return false instead if users leave it blank? -- http://www.fastmail.fm - Or how I learned to stop worrying and love email again |