[Cppcms-users] Plugins, Localization, script_names, url mapper
Brought to you by:
artyom-beilis
|
From: Raab M. <Mar...@ka...> - 2012-03-02 10:11:16
|
Hi Artyom!
In the first example of the plugin interface you pass
the application pointer to the plugin. I think it
would be more decoupled if the plugin could create
its own stripped down application just for rendering.
Btw. the functions rendering to a stream should be
const, or do they modify the application? That change
would however break the API..
Is there any approach how to get booster::locale working
Inside own plugins?
Is it possible with the integrated webserver to
have the script at /? If "script_names" is set to "/",
the url is localhost//name. If it is not given or "",
I always get 404 for every url.
Is it possible to reconfigure the internal file server
to be at another root?
I am afraid I do not fully understand the url mapper.
E.g. I have:
27 attach (new Base_gui(srv),
28 "gui", "/gui{1}",
29 "/gui(/(.*))?", 1);
30
31 attach (new Base_rpc(srv),
32 "rpc", "/rpc{1}",
33 "/rpc(/(.*))?", 1);
For any reason
52 << "<a href='" << url("gui")<< "'>GUI</a><br>"
53 << "<a href='" << url("rpc")<< "'>RPC</a><br>
works for gui, but not for rpc? See following error for rpc:
2012-03-01 15:46:48; cppcms, error: url_mapper: key `' not found for url `gui'
0x4056a414: booster::stack_trace::trace(void**, int) + 0x24 in /usr/lib/libbooster.so.0
0x400ef4b9: cppcms::cppcms_error::cppcms_error(std::string const&) + 0x89 in /usr/lib/libcppcms.so.1
0x4012c007: cppcms::url_mapper::data::get_entry(cppcms::string_key const&, unsigned int, cppcms::string_key const&) const + 0x277 in /usr/lib/libcppcms.so.1
0x4012d587: cppcms::url_mapper::data::map(cppcms::string_key const&, cppcms::string_key const&, cppcms::filters::streamable const* const*, unsigned int, std::map<cppcms::string_key, std::string, std::less<cppcms::string_key>, std::allocator<std::pair<cppcms::string_key const, std::string> > > const&, std::map<cppcms::string_key, std::string, std::less<cppcms::string_key>, std::allocator<std::pair<cppcms::string_key const, std::string> > > const&, std::ostream&) const + 0x37 in /usr/lib/libcppcms.so.1
0x4012a02c: cppcms::url_mapper::real_map(char const*, cppcms::filters::streamable const* const*, unsigned int, std::ostream&) + 0x7dc in /usr/lib/libcppcms.so.1
0x4012ab6b: cppcms::url_mapper::map(std::ostream&, char const*) + 0x3b in /usr/lib/libcppcms.so.1
0x4012abad: cppcms::url_mapper::map(std::ostream&, std::string const&) + 0x2d in /usr/lib/libcppcms.so.1
0x40122384: cppcms::application::url(std::string const&) + 0x1f4 in /usr/lib/libcppcms.so.1
0x80506c3: AMT::Base::describe() + 0x243 in /home/markus/CVP/svn/cvp/trunk/software/cpu/build/bin/webserver
0x8051f7d: booster::function<void ()()>::callable_impl<void, cppcms::url_dispatcher::binder0<AMT::Base> >::call() + 0x2d in /home/markus/CVP/svn/cvp/trunk/software/cpu/build/bin/webserver
0x40123a2c: ??? + 0x40123a2c in /usr/lib/libcppcms.so.1
0x401238c0: cppcms::url_dispatcher::dispatch(std::string) + 0x90 in /usr/lib/libcppcms.so.1
0x4011eb43: cppcms::application::main(std::string) + 0x43 in /usr/lib/libcppcms.so.1
0x401175aa: cppcms::http::context::dispatch(booster::intrusive_ptr<cppcms::application>, std::string, bool) + 0x7a in /usr/lib/libcppcms.so.1
0x40119238: booster::function<void ()()>::callable_impl<void, cppcms_boost::_bi::bind_t<void, void (*)(booster::intrusive_ptr<cppcms::application>, std::string, bool), cppcms_boost::_bi::list3<cppcms_boost::_bi::value<booster::intrusive_ptr<cppcms::application> >, cppcms_boost::_bi::value<std::string>, cppcms_boost::_bi::value<bool> > > >::call() + 0x68 in /usr/lib/libcppcms.so.1
0x4011b027: cppcms::impl::thread_pool::worker() + 0xa7 in /usr/lib/libcppcms.so.1
0x4011ad5e: booster::function<void ()()>::callable_impl<void, cppcms_boost::_bi::bind_t<void, cppcms_boost::_mfi::mf0<void, cppcms::impl::thread_pool>, cppcms_boost::_bi::list1<cppcms_boost::_bi::value<cppcms::impl::thread_pool*> > > >::call() + 0x1e in /usr/lib/libcppcms.so.1
0x405bd41a: booster_thread_func + 0x2a in /usr/lib/libbooster.so.0
0x405e6955: ??? + 0x405e6955 in /lib/i686/cmov/libpthread.so.0
0x4049f5ee: clone + 0x5e in /lib/i686/cmov/libc.so.6
Sorry for all topics in one mail.
Best regards
Markus Raab
The information contained in this e-mail message is privileged and
confidential and is for the exclusive use of the addressee. The person
who receives this message and who is not the addressee, one of his
employees or an agent entitled to hand it over to the addressee, is
informed that he may not use, disclose or reproduce the contents
thereof, and is kindly asked to notify the sender and delete the e-mail
immediately.
|