Webdar 1.0.0
Web user interface to libdar
html_archive_create.hpp
1/*********************************************************************/
2// webdar - a web server and interface program to libdar
3// Copyright (C) 2013-2025 Denis Corbin
4//
5// This file is part of Webdar
6//
7// Webdar is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// Webdar is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with Webdar. If not, see <http://www.gnu.org/licenses/>
19//
20//----
21// to contact the author: dar.linux@free.fr
22/*********************************************************************/
23
24#ifndef HTML_ARCHIVE_CREATE_HPP
25#define HTML_ARCHIVE_CREATE_HPP
26
27 // C system header files
28#include "my_config.h"
29extern "C"
30{
31
32}
33
34 // C++ system header files
35#include <libthreadar/libthreadar.hpp>
36
37 // webdar headers
38#include "html_form_input_file.hpp"
39#include "html_form_fieldset.hpp"
40#include "html_options_create.hpp"
41#include "body_builder.hpp"
42#include "html_derouleur.hpp"
43#include "actor.hpp"
44#include "html_libdar_running_popup.hpp"
45#include "guichet.hpp"
46
48
49class html_archive_create: public body_builder, public libthreadar::thread_signal, public actor
50{
51public:
53 html_archive_create(const html_archive_create & ref) = delete;
54 html_archive_create(html_archive_create && ref) noexcept = delete;
55 html_archive_create & operator = (const html_archive_create & ref) = delete;
56 html_archive_create & operator = (html_archive_create && ref) noexcept = delete;
57 ~html_archive_create() { cancel(); join(); };
58
60 void set_biblio(const std::shared_ptr<bibliotheque> & ptr);
61
62 const std::string & get_archive_path() const { return sauv_path.get_value(); };
63 const std::string & get_archive_basename() const;
64 const std::string & get_fs_root() const { return fs_root.get_value(); };
65 libdar::archive_options_create get_options_create(std::shared_ptr<html_web_user_interaction> dialog) const { return options->get_options(dialog); };
66
67 // inherited from actor
68 virtual void on_event(const std::string & event_name) override;
69
70protected:
72 virtual std::string inherited_get_body_part(const chemin & path,
73 const request & req) override;
74
75 virtual void new_css_library_available() override;
76
78 virtual void inherited_run() override;
79
81 virtual void signaled_inherited_cancel() override;
82
83private:
84 static constexpr const char* fs_root_change_event = "fs_root_changed";
85
86 html_derouleur deroule;
87 html_form form;
90 html_form_input_file sauv_path;
91 html_form_input basename;
93
94 guichet guichet_options;
95 std::shared_ptr<html_options_create> options;
96
97
99
102 bool need_entrepot_update;
103
104 void update_entrepot();
105 void update_landing_path();
106
107};
108
109#endif
class of object that are pointed/triggered to by others
Definition: actor.hpp:55
class body_builder is the root class of object generating HTML body
Definition: body_builder.hpp:99
class chemin definition
Definition: chemin.hpp:51
class guichet let one fetch config from a bibliotheque, save as or setup manually for a given compone...
Definition: guichet.hpp:92
object providing html user interface component for the user to provide options to create a new archiv...
Definition: html_archive_create.hpp:50
virtual void on_event(const std::string &event_name) override
implementation in inherited class of the action triggered by the event given in argument
Definition: html_archive_create.cpp:155
void set_biblio(const std::shared_ptr< bibliotheque > &ptr)
mandatory call to invoke ASAP after constructor
Definition: html_archive_create.cpp:118
virtual std::string inherited_get_body_part(const chemin &path, const request &req) override
inherited from body_builder
Definition: html_archive_create.cpp:184
virtual void signaled_inherited_cancel() override
inherited from libthreadar::thread
Definition: html_archive_create.cpp:210
virtual void new_css_library_available() override
Definition: html_archive_create.cpp:192
virtual void inherited_run() override
inherited from libthreadar::thread
Definition: html_archive_create.cpp:201
class html_derouleur is a pure virtual class
Definition: html_derouleur.hpp:55
class html_form_fieldset implements HTML fieldset feature
Definition: html_form_fieldset.hpp:51
class html_form_input_file provides a mean to the user to navigate in a file system to select a file ...
Definition: html_form_input_file.hpp:60
class html_form_input implements HTML input feature
Definition: html_form_input.hpp:57
class html_form implements HTML form feature
Definition: html_form.hpp:51
html_libdar_running_popup wraps up an html_web_user_interaction in a html_popup component
Definition: html_libdar_running_popup.hpp:48
class holding fields of an HTTP request (method, URI, header, cookies, and so on)
Definition: request.hpp:45