diff --git a/core/http/controller.cpp b/core/http/controller.cpp deleted file mode 100644 index b79bdb5..0000000 --- a/core/http/controller.cpp +++ /dev/null @@ -1,18 +0,0 @@ - -#include "controller.h" - -#include "request.h" - -void Controller::handle_request_main(Request *request) { -} - -void Controller::create_validators() { -} - - -Controller::Controller() { - create_validators(); -} - -Controller::~Controller() { -} \ No newline at end of file diff --git a/core/http/controller.h b/core/http/controller.h deleted file mode 100644 index 3e7e6f9..0000000 --- a/core/http/controller.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef HTTP_CONTROLLER_H -#define HTTP_CONTROLLER_H - -#include "core/object.h" - -class Request; - -class Controller : public Object { -public: - virtual void handle_request_main(Request *request); - virtual void create_validators(); - - Controller(); - ~Controller(); - -protected: -}; - -#endif \ No newline at end of file diff --git a/core/http/model.cpp b/core/http/model.cpp deleted file mode 100644 index 02f2ec5..0000000 --- a/core/http/model.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "model.h" - -void Model::create_table() { - -} - -void Model::drop_table() { - -} - -void Model::migrate() { - -} - -Model::Model() { -} - -Model::~Model() { -} \ No newline at end of file diff --git a/core/http/model.h b/core/http/model.h deleted file mode 100644 index 7622cd0..0000000 --- a/core/http/model.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef HTTP_MODEL_H -#define HTTP_MODEL_H - -#include "core/object.h" - -class Model : public Object { -public: - virtual void create_table(); - virtual void drop_table(); - virtual void migrate(); - - Model(); - ~Model(); - -protected: -}; - -#endif \ No newline at end of file diff --git a/core/http/web_node.cpp b/core/http/web_node.cpp new file mode 100644 index 0000000..7897741 --- /dev/null +++ b/core/http/web_node.cpp @@ -0,0 +1,29 @@ + +#include "web_node.h" + +#include "request.h" + +void WebNode::handle_request_main(Request *request) { +} + +void WebNode::create_validators() { +} + +void WebNode::create_table() { + +} + +void WebNode::drop_table() { + +} + +void WebNode::migrate() { + +} + +WebNode::WebNode() { + create_validators(); +} + +WebNode::~WebNode() { +} \ No newline at end of file diff --git a/core/http/web_node.h b/core/http/web_node.h new file mode 100644 index 0000000..e5a3fa8 --- /dev/null +++ b/core/http/web_node.h @@ -0,0 +1,23 @@ +#ifndef WEB_NODE_H +#define WEB_NODE_H + +#include "core/object.h" + +class Request; + +class WebNode : public Object { +public: + virtual void handle_request_main(Request *request); + virtual void create_validators(); + + virtual void create_table(); + virtual void drop_table(); + virtual void migrate(); + + WebNode(); + ~WebNode(); + +protected: +}; + +#endif \ No newline at end of file diff --git a/modules/admin_panel/admin_controller.cpp b/modules/admin_panel/admin_controller.cpp deleted file mode 100644 index 468e410..0000000 --- a/modules/admin_panel/admin_controller.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "admin_controller.h" - -#include "core/html/form_validator.h" -#include "core/html/html_builder.h" -#include "core/http/cookie.h" -#include "core/http/http_session.h" -#include "core/http/request.h" -#include "core/http/session_manager.h" - -void AdminController::admin_handle_request_main(Request *request) { - -} - -String AdminController::admin_get_section_name() { - return ""; -} - -void AdminController::admin_add_section_links(Vector *links) { - -} - -bool AdminController::admin_full_render() { - return false; -} - -AdminController::AdminController() : - Controller() { - -} - -AdminController::~AdminController() { -} diff --git a/modules/admin_panel/admin_node.cpp b/modules/admin_panel/admin_node.cpp new file mode 100644 index 0000000..8bfd727 --- /dev/null +++ b/modules/admin_panel/admin_node.cpp @@ -0,0 +1,32 @@ +#include "admin_node.h" + +#include "core/html/form_validator.h" +#include "core/html/html_builder.h" +#include "core/http/cookie.h" +#include "core/http/http_session.h" +#include "core/http/request.h" +#include "core/http/session_manager.h" + +void AdminNode::admin_handle_request_main(Request *request) { + +} + +String AdminNode::admin_get_section_name() { + return ""; +} + +void AdminNode::admin_add_section_links(Vector *links) { + +} + +bool AdminNode::admin_full_render() { + return false; +} + +AdminNode::AdminNode() : + WebNode() { + +} + +AdminNode::~AdminNode() { +} diff --git a/modules/admin_panel/admin_controller.h b/modules/admin_panel/admin_node.h similarity index 71% rename from modules/admin_panel/admin_controller.h rename to modules/admin_panel/admin_node.h index 4a3a18d..d4fa0b6 100644 --- a/modules/admin_panel/admin_controller.h +++ b/modules/admin_panel/admin_node.h @@ -1,7 +1,7 @@ -#ifndef ADMIN_CONTROLLER_H -#define ADMIN_CONTROLLER_H +#ifndef ADMIN_NODE_H +#define ADMIN_NODE_H -#include "core/http/controller.h" +#include "core/http/web_node.h" #include "core/containers/vector.h" #include "core/string.h" @@ -22,8 +22,8 @@ struct AdminSectionLinkInfo { } }; -class AdminController : public Controller { - RCPP_OBJECT(AdminController, Controller); +class AdminNode : public WebNode { + RCPP_OBJECT(AdminNode, WebNode); public: virtual void admin_handle_request_main(Request *request); @@ -31,8 +31,8 @@ public: virtual void admin_add_section_links(Vector *links); virtual bool admin_full_render(); - AdminController(); - ~AdminController(); + AdminNode(); + ~AdminNode(); protected: }; diff --git a/modules/admin_panel/admin_panel.cpp b/modules/admin_panel/admin_panel.cpp index 9ed054a..4c874da 100644 --- a/modules/admin_panel/admin_panel.cpp +++ b/modules/admin_panel/admin_panel.cpp @@ -7,7 +7,7 @@ #include "core/http/request.h" #include "core/http/session_manager.h" -#include "admin_controller.h" +#include "admin_node.h" void AdminPanel::handle_request_main(Request *request) { //todo check permissions @@ -23,7 +23,7 @@ void AdminPanel::handle_request_main(Request *request) { AdminPanelSection &s = _controllers[i]; if (s.section_url == seg) { - AdminController *c = s.controller; + AdminNode *c = s.controller; request->push_path(); @@ -92,14 +92,14 @@ void AdminPanel::render_admin_panel_list(Request *request) { request->compile_and_send_body(); } -void AdminPanel::render_controller_panel(Request *request, AdminController *controller) { +void AdminPanel::render_controller_panel(Request *request, AdminNode *controller) { //set up headers controller->admin_handle_request_main(request); //set up footers request->compile_and_send_body(); } -void AdminPanel::register_admin_controller(const String §ion, AdminController *controller) { +void AdminPanel::register_admin_controller(const String §ion, AdminNode *controller) { AdminPanelSection sec; sec.section_url = section; @@ -147,7 +147,7 @@ AdminPanel *AdminPanel::get_singleton() { } AdminPanel::AdminPanel() : - Controller() { + WebNode() { if (_self) { printf("AdminPanel::AdminPanel(): Error! self is not null!/n"); diff --git a/modules/admin_panel/admin_panel.h b/modules/admin_panel/admin_panel.h index 6fba4d8..4fcf351 100644 --- a/modules/admin_panel/admin_panel.h +++ b/modules/admin_panel/admin_panel.h @@ -1,25 +1,25 @@ #ifndef ADMIN_PANEL_H #define ADMIN_PANEL_H -#include "core/http/controller.h" +#include "core/http/web_node.h" #include "core/string.h" #include "core/containers/vector.h" class Request; class FormValidator; -class AdminController; +class AdminNode; -class AdminPanel : public Controller { - RCPP_OBJECT(AdminPanel, Controller); +class AdminPanel : public WebNode { + RCPP_OBJECT(AdminPanel, WebNode); public: void handle_request_main(Request *request); virtual void render_admin_panel_list(Request *request); - virtual void render_controller_panel(Request *request, AdminController *controller); + virtual void render_controller_panel(Request *request, AdminNode *controller); - void register_admin_controller(const String §ion, AdminController *controller); + void register_admin_controller(const String §ion, AdminNode *controller); void clear(); virtual void render_headers(Request *request); @@ -41,7 +41,7 @@ protected: struct AdminPanelSection { String section_url; String name; - AdminController *controller; + AdminNode *controller; }; static AdminPanel *_self; diff --git a/modules/rbac/rbac_controller.cpp b/modules/rbac/rbac_controller.cpp index e2f3394..ba663ae 100644 --- a/modules/rbac/rbac_controller.cpp +++ b/modules/rbac/rbac_controller.cpp @@ -617,7 +617,7 @@ RBACController *RBACController::get_singleton() { } RBACController::RBACController() : - AdminController() { + AdminNode() { if (_self) { printf("RBACController::RBACController(): Error! self is not null!/n"); diff --git a/modules/rbac/rbac_controller.h b/modules/rbac/rbac_controller.h index e348ff9..aec7d55 100644 --- a/modules/rbac/rbac_controller.h +++ b/modules/rbac/rbac_controller.h @@ -3,7 +3,7 @@ #include -#include "modules/admin_panel/admin_controller.h" +#include "modules/admin_panel/admin_node.h" #include "core/containers/vector.h" #include "core/string.h" @@ -14,8 +14,8 @@ class Request; class FormValidator; -class RBACController : public AdminController { - RCPP_OBJECT(RBACController, AdminController); +class RBACController : public AdminNode { + RCPP_OBJECT(RBACController, AdminNode); public: void handle_request_main(Request *request); diff --git a/modules/rbac/rbac_model.cpp b/modules/rbac/rbac_model.cpp index f1f1525..5cfa220 100644 --- a/modules/rbac/rbac_model.cpp +++ b/modules/rbac/rbac_model.cpp @@ -242,7 +242,7 @@ RBACModel *RBACModel::get_singleton() { } RBACModel::RBACModel() : - Model() { + WebNode() { if (_self) { printf("RBACModel::RBACModel(): Error! self is not null!/n"); diff --git a/modules/rbac/rbac_model.h b/modules/rbac/rbac_model.h index dc7b8d0..69d1a65 100644 --- a/modules/rbac/rbac_model.h +++ b/modules/rbac/rbac_model.h @@ -1,7 +1,7 @@ #ifndef RBAC_MODEL_H #define RBAC_MODEL_H -#include "core/http/model.h" +#include "core/http/web_node.h" #include #include "core/containers/vector.h" @@ -10,8 +10,8 @@ #include "rbac_permission.h" #include "rbac_rank.h" -class RBACModel : public Model { - RCPP_OBJECT(RBACModel, Model); +class RBACModel : public WebNode { + RCPP_OBJECT(RBACModel, WebNode); public: virtual std::map > load_ranks();