2020-12-28 23:17:30 +01:00
|
|
|
#ifndef PAGED_ARTICLE_H
|
|
|
|
#define PAGED_ARTICLE_H
|
|
|
|
|
|
|
|
#include <map>
|
2021-11-01 19:53:35 +01:00
|
|
|
#include "core/containers/vector.h"
|
|
|
|
#include "core/string.h"
|
2020-12-28 23:17:30 +01:00
|
|
|
|
2021-01-06 03:57:18 +01:00
|
|
|
#include "core/file_cache.h"
|
2022-01-08 12:53:50 +01:00
|
|
|
#include "core/http/web_node.h"
|
2020-12-28 23:17:30 +01:00
|
|
|
|
2021-05-27 17:37:23 +02:00
|
|
|
#include "core/http/request.h"
|
2020-12-28 23:17:30 +01:00
|
|
|
|
2022-01-08 12:53:50 +01:00
|
|
|
class PagedArticle : public WebNode {
|
|
|
|
RCPP_OBJECT(PagedArticle, WebNode);
|
2020-12-28 23:17:30 +01:00
|
|
|
|
|
|
|
public:
|
2022-01-08 12:53:50 +01:00
|
|
|
void handle_request_main(Request *request);
|
2020-12-28 23:17:30 +01:00
|
|
|
|
|
|
|
void load();
|
2022-02-04 22:05:51 +01:00
|
|
|
void load_folder(const String &folder, const String &path);
|
|
|
|
void generate_summary();
|
2020-12-28 23:17:30 +01:00
|
|
|
|
|
|
|
PagedArticle();
|
|
|
|
~PagedArticle();
|
|
|
|
|
2022-02-04 22:05:51 +01:00
|
|
|
String articles_folder;
|
2022-02-04 22:11:50 +01:00
|
|
|
//todo make this somehow articles_folder + "/files" by default
|
2022-02-04 22:05:51 +01:00
|
|
|
String serve_folder;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
String summary_page;
|
|
|
|
std::map<String, String *> pages;
|
|
|
|
FileCache *file_cache;
|
2020-12-28 23:17:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|