AppNodeStar::AppNodeStar( const Wt::WEnvironment& env ): Wt::WApplication( env ), m_pServer( 0 ) { m_pServer = dynamic_cast<Server*>( env.server() ); //m_pUserAuth.reset( new UserAuth( m_pServer->GetConnectionPool() ) ); //useStyleSheet(Wt::WLink("/css/nodestar.css")); //useStyleSheet("css/nodestar.css"); useStyleSheet("style/nodestar.css"); m_Session.setConnectionPool( m_pServer->GetConnectionPool() ); m_Session.mapClass<DbRecOrganization>( "organization" ); m_Session.mapClass<DbRecIpAddress>( "ipaddress" ); internalPathChanged().connect( this, &AppNodeStar::HandleInternalPathChanged ); internalPathInvalid().connect( this, &AppNodeStar::HandleInternalPathInvalid ); // Wt::WLink link( Wt::WLink::InternalPath, "/link1" ); // Wt::WAnchor* pAnchor = new Wt::WAnchor( link, "Test Link" ); // root()->addWidget( pAnchor ); //auto pTest = new Wt::WText( "<p>this is test</p>", root() ); //auto pTest = new Wt::WText( "this is test", root() ); //pTest->setStyleClass( "test" ); // make use of the authEvent to change state (show login, or show logout) via Auth.h) m_pAuth.reset( new Auth( m_pServer->GetConnectionPool() ) ); m_connectionLoginChanged = m_pAuth->RegisterLoginChanged( this, &AppNodeStar::HandleAuthLoginChangedStep1 ); namespace args = boost::phoenix::arg_names; RegisterPath( "/", boost::phoenix::bind( &AppNodeStar::HomeRoot, this, args::arg1 ) ); RegisterPath( "/home", boost::phoenix::bind( &AppNodeStar::Home, this, args::arg1 ) ); RegisterPath( "/auth/signin", boost::phoenix::bind( &AppNodeStar::AuthSignIn, this, args::arg1 ) ); RegisterPath( "/auth/expired", boost::phoenix::bind( &AppNodeStar::AuthExpired, this, args::arg1 ) ); RegisterPath( "/auth/signout", boost::phoenix::bind( &AppNodeStar::AuthSignOut, this, args::arg1 ) ); RegisterPath( "/goodbye", boost::phoenix::bind( &AppNodeStar::GoodBye, this, args::arg1 ) ); RegisterPath( "/member/home", boost::phoenix::bind( &AppNodeStar::MemberHome, this, args::arg1 ) ); RegisterPath( "/member/show/addresses", boost::phoenix::bind( &AppNodeStar::MemberShowAddresses, this, args::arg1 ) ); RegisterPath( "/member/upload/tables", boost::phoenix::bind( &AppNodeStar::MemberUploadTables, this, args::arg1 ) ); struct callback { void operator()( Wt::WContainerWidget* pcw ) { } }; TemplatePage( root(), callback() ); }
int PathArray::RegisterMultiPath(const void *_multi_path, const void *separator) { void *multi_path = strdupV(_multi_path); void *tok, *p; int cnt = 0; BOOL is_remove_quote = (flags & NO_REMOVE_QUOTE) == 0 ? TRUE : FALSE; for (tok = strtok_pathV(multi_path, separator, &p, is_remove_quote); tok; tok = strtok_pathV(NULL, separator, &p, is_remove_quote)) { if (RegisterPath(tok)) cnt++; } free(multi_path); return cnt; }