2022-01-07 16:36:39 +01:00
|
|
|
#ifndef WEB_NODE_H
|
|
|
|
#define WEB_NODE_H
|
|
|
|
|
2022-01-07 16:57:13 +01:00
|
|
|
#include "core/nodes/node.h"
|
2022-01-07 17:16:24 +01:00
|
|
|
#include "core/reference.h"
|
2022-01-07 16:36:39 +01:00
|
|
|
|
|
|
|
class Request;
|
2022-01-07 17:16:24 +01:00
|
|
|
class Settings;
|
|
|
|
|
|
|
|
#ifdef DATABASES_ENABLED
|
|
|
|
class DataBase;
|
|
|
|
class TableBuilder;
|
|
|
|
class QueryBuilder;
|
|
|
|
#endif
|
2022-01-07 16:36:39 +01:00
|
|
|
|
2022-01-07 16:57:13 +01:00
|
|
|
class WebNode : public Node {
|
2022-01-08 10:04:12 +01:00
|
|
|
RCPP_OBJECT(WebNode, Node);
|
|
|
|
|
2022-01-07 16:36:39 +01:00
|
|
|
public:
|
2022-01-08 10:50:07 +01:00
|
|
|
String get_uri_segment();
|
|
|
|
void set_uri_segment(const String &val);
|
|
|
|
|
2022-01-07 17:16:24 +01:00
|
|
|
Settings *get_settings();
|
|
|
|
void set_settings(Settings *settings);
|
|
|
|
|
|
|
|
#ifdef DATABASES_ENABLED
|
|
|
|
Database *get_database();
|
|
|
|
Ref<TableBuilder> get_table_builder();
|
|
|
|
Ref<QueryBuilder> get_query_builder();
|
|
|
|
void set_database(Database *db);
|
|
|
|
#endif
|
|
|
|
|
2022-01-07 16:36:39 +01:00
|
|
|
virtual void handle_request_main(Request *request);
|
|
|
|
virtual void create_validators();
|
|
|
|
|
|
|
|
virtual void create_table();
|
|
|
|
virtual void drop_table();
|
|
|
|
virtual void migrate();
|
2022-01-07 17:02:47 +01:00
|
|
|
virtual void create_default_entries();
|
2022-01-07 16:36:39 +01:00
|
|
|
|
|
|
|
WebNode();
|
|
|
|
~WebNode();
|
|
|
|
|
|
|
|
protected:
|
2022-01-08 10:50:07 +01:00
|
|
|
String _uri_segment;
|
|
|
|
|
2022-01-07 17:16:24 +01:00
|
|
|
Settings *_settings;
|
|
|
|
|
|
|
|
#ifdef DATABASES_ENABLED
|
|
|
|
Database *_database;
|
|
|
|
#endif
|
2022-01-07 16:36:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|