Commit Graph

63 Commits

Author SHA1 Message Date
Tomasz Sowa d5ebb7ca12 changed the way how the request's answer is created,
now winix can return json, xml, csv from out_main_stream or from frames and json from models

removed from Request:
  bool send_bin_stream
  bool return_json
  bool return_info_only
  pt::Space info
  bool page_generated
  bool out_main_stream_use_html_filter
  bool out_streams_use_html_filter

added to Request:
  enum AnswerSource
  enum AnswerContainer
  AnswerSource answer_source
  AnswerContainer answer_container
  bool use_ezc_engine
  std::wstring frame
  bool send_all_frames
  bool use_html_filter

added to Config:
 // the name of the url parameter for returning all frames, e.g. https://domain.tld/mydir/myfunction/allframes
 // default: allframes
 std::wstring request_all_frames_parameter;

 // the name of the root element when serializing request answer to xml
 // default: winix
 std::wstring xml_root;

algorithm (the whole algorithm is described in core/request.h):
at the beginning of a request winix sets
   answer_source to models
   answer_container to text
   use_ezc_engine to true

next answer_container and use_ezc_engine can be changed in the following way:

1. winix will look for 'Accept' http header and depending on the header winix will set:
   (not implemented yet)

             Accept | answer_container | use_ezc_engine
	     ------------------------------------|-----------------
	     application/json | json             | false
	      application/xml | xml              | false
	              text/csv | csv              | false

2. next answer_container is set depending on 'container' url parameter
       container | answer_container
 ---------------------------------------------------------
     not present | don't change the value
            text | text
            json | json
             xml | xml
             csv | csv

use_ezc_engine is set depending on 'answer' url parameter:
          answer | use_ezc_engine
 ---------------------------------
     not present | don't change the value
            html | true
            data | false

if 'answer' is html then we take into account two more parameters:
 frame: frame_name (empty default) - if set then winix returns this specific frame
 allframes: (if present then winix returns all frames)
2021-10-13 01:27:14 +02:00
Tomasz Sowa 9c5c74ba84 added: setting a correct mime type for static files - using magic library
added: std::wstring file_mime_type to ItemContent - a mime type for static file
added: Header (core/header.h) - there will be header names defined, at the moment only content_type
added: FuncionsBase::Finish() - it is called at the end when the winix finishes
2021-09-22 00:23:25 +02:00
Tomasz Sowa b424988d1b updated to the new pikotools api (api2021): HTMLFilter renamed to HTMLParser
added to config: int html_filter_white_char_mode;
  how white characters between html tags are treated
  0 - WHITE_MODE_ORIGIN - they are copied from input to output
  1 - WHITE_MODE_SINGLE_LINE - new line characters are removed
  2 - WHITE_MODE_TREE - try to create a tree (some kind of pretty printing)
  default: 2
2021-08-07 02:16:48 +02:00
Tomasz Sowa f861c0761e make depend 2021-07-17 13:57:39 +02:00
Tomasz Sowa c5c02d7f44 HtmlTextStream has now pt::Stream as a based class and uses pt::WTextStream as a buffer 2021-07-16 18:17:57 +02:00
Tomasz Sowa 746aa41111 renamed: ItemContent::meta_admin -> ItemContent::admin_meta 2021-07-03 01:18:28 +02:00
Tomasz Sowa 619936c12e make depend 2021-07-01 23:35:08 +02:00
Tomasz Sowa 0f78968579 updated ticket plugin to the new ezc api (child spaces were removed) 2021-06-29 23:42:57 +02:00
Tomasz Sowa 66173c7a31 removed old meta ezc functions from gallery plugin 2021-06-28 21:34:41 +02:00
Tomasz Sowa 3f934d9aec removed old meta ezc functions from menu plugin 2021-06-28 21:34:22 +02:00
Tomasz Sowa df0cc131fe fixed in thread winix function: answers were not sorted correctly 2021-06-28 21:33:33 +02:00
Tomasz Sowa ba60f9da8a updated group plugin to the new pikotools api (child spaces were removed) 2021-06-28 20:58:39 +02:00
Tomasz Sowa ccbbb59af7 make depend 2021-06-27 23:34:06 +02:00
Tomasz Sowa 1d18b7fa12 - updated to the new pikotools api (child spaces were removed)
some plugins need to be fixed yet: ticket, gallery, group, menu
- added current user to default models as "user"
- renamed in User: super_user -> is_super_user, env -> admin_env, pass_hash_salted -> is_pass_hash_salted
- now Users class has a WinixModel as a base class
  some plugin calls have to be fixed yet
- added UserWrapper model with a pointer to User class
- removed from ItemContent: methods for accessing 'meta' and 'admin_meta', now ezc can iterate through Space classes
- fixed in env winix function: if there is "changeuser" parameter then we should only switch the user (not save anything)
2021-06-27 23:31:50 +02:00
Tomasz Sowa 472490c239 make depend 2021-06-24 21:17:11 +02:00
Tomasz Sowa 443c2023d9 make depend 2021-06-23 17:04:21 +02:00
Tomasz Sowa 94f96c11cb make depend 2021-06-18 19:18:46 +02:00
Tomasz Sowa f2f2c851df make depend 2021-06-16 18:09:01 +02:00
Tomasz Sowa 6dddc5e948 renamed: WinixModel -> WinixModelDeprecated (this class will be removed)
added: WinixModel (models/winixmodel.h|cpp) - a class inheriting from morm::WinixModel, we have methods such as: get_config(), get_logger(), get_request()
       and this class will be a base class for our models
added: WinixModelConnector (models/winixmodelconnector.h|cpp) - a class inheriting from morm::WinixModelConnector
       this connector we are using instead of morm::ModelConnector - there are pointers to winix objects there (config, request, log)
added to Request: Ezc::Models models
removed from TemplatesFunctions: Ezc::Models ezc_models;
changed: ImgCrop winix functions is using its own item_tab vector now (not finished yet)
added: Item::is(), Item::link(), ItemContent::print_content()
2021-06-16 18:07:44 +02:00
Tomasz Sowa 81df52f6ca make depend 2021-05-31 18:59:49 +02:00
Tomasz Sowa 22de3322ae - added to Request: is_htmx_request (bool) - true if the request is made by htmx library (ajax)
- commented out using mount_page_arg_is "subject" and "info" from fun_cat.html and fun_run.html - they will be removed soon
- some improvements in fun_reply.html, fun_showthreads.html and fun_thread.html (scrolling)
2021-05-31 10:58:34 +02:00
Tomek fc24570062 fixed compilation: pikotools is in src subdirectory now 2021-05-27 12:04:41 +02:00
Tomasz Sowa aa71abd725 some workarounds in Thread plugin (don't show stale info in html forms) 2021-05-27 10:29:26 +02:00
Tomasz Sowa 06be33ba5f make depend 2021-05-21 23:06:57 +02:00
Tomasz Sowa b2cffa39e1 added models Thread and ThreadFiles in thread plugin 2021-05-21 23:06:48 +02:00
Tomasz Sowa 86ef2529b1 fixed in some places: system->AddFile() returns bool now instead of Error 2021-05-21 17:41:16 +02:00
Tomasz Sowa f1b9d1b870 updated to the new pikotools api: changed the way how child_spaces are created in Space class 2021-05-21 17:17:17 +02:00
Tomasz Sowa fe67b5d72a updated to the new pikotools api: snake_case names of methods from SpaceParser 2021-05-21 04:51:58 +02:00
Tomasz Sowa 27720afaf2 updated to the new pikotools api: SpaceParser::SetSpace(...) methods have been removed 2021-05-21 01:37:42 +02:00
Tomasz Sowa 8bb585d97d updated to the new pikotools api: changed utf8 functions PascalCase to snake_case 2021-05-21 00:41:27 +02:00
Tomasz Sowa e48a28a5c8 namespace PT renamed to pt 2021-05-20 20:59:12 +02:00
Tomasz Sowa 4df10de6b7 methods eq() from finder can have now a table name 2021-05-13 19:33:19 +02:00
Tomasz Sowa 801c9a2cda make depend 2021-05-11 22:22:10 +02:00
Tomasz Sowa f1af7e2eeb updated to the current pikotools api from branch api2021 2021-05-11 22:20:46 +02:00
Tomasz Sowa bb513b0187 make depend 2021-04-30 01:35:40 +02:00
Tomasz Sowa 35e10ed469 updated to the new Pikotools api (new Space struct) 2021-04-09 17:50:58 +02:00
Tomasz Sowa 8d87d9a875 changed in Makefile: we have now one lib pikotools/pikotools.a
make depend
2021-03-31 20:25:09 +02:00
Tomasz Sowa bbc0a67153 added support for new morm api
- field(...) methods from Model take now FT structure instead of insertable/updatable/primary_key boolean flags
- table name is set in a prepare_table() method now
- added meta and admin_meta from ItemContent (morm has a field() method with PT::Space argument now)
2021-03-11 18:48:18 +01:00
Tomasz Sowa e8ba2a7bd1 fixed: incorrect status was set when editing a file
now System::EditFile() returns boolean
2021-03-11 18:42:26 +01:00
Tomasz Sowa 23f1c112a4 make depend 2021-03-10 16:40:22 +01:00
Tomasz Sowa 57aad8b454 removed from Item: update() and save() methods which take the 'url_was_changed' argument
and added ItemModelData (based on morm::ModelData) class which has 'prepare_unique_url' field,
an object of this class is passed to update(), insert() and save() methods

fixed: Dirs::CheckRootDir(): update should update childs too (privileges)

WIP: #4
2021-03-08 21:06:50 +01:00
Tomasz Sowa 3e84eb9dbf Makefile deps 2021-02-25 00:15:03 +01:00
Tomasz Sowa 32e93a04c5 Item class has been moved to a new directory 'models', a new class has been added: ItemContent
and same fields from Item were moved to ItemContent

Item
- id
- parent_id
- type (file, dir, symlink)
- url
- subject
- template (html template)
- sort_index
- content_id

ItemContent
- id
- ref -> references (renamed)
- user_id
- modification_user_id
- group_id
- privileges
- date_creation
- date_modification
- guest_name
- link_to
- link_redirect
- file_path
- file_fs
- file_type
- file_size
- has_thumb -> file_has_thumb (renamed)
- hash -> file_hash (renamed)
- hash_type -> file_hash_type (renamed)
- content -> content_raw (renamed)
- content_type -> content_raw_type (renamed)
- content_parsed
- content_parsed_type
- meta
- ameta -> meta_admin (renamed)
- modify_index (removed)

WIP: #4
2021-02-24 01:19:47 +01:00
Tomasz Sowa 76160a5ba6 Makefile deps
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1219 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-09-25 16:25:44 +00:00
Tomasz Sowa be81307faa Makefiles deps
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1199 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-08-20 12:24:22 +00:00
Tomasz Sowa 4c2efc08fd fixed: permissions to symlinks and directories with redirect flag were incorrectly checked
(there was no session set and the request was treated the same as from a not logged user)
fixed: in BaseThread there was used 'log' in the main thread (this logger is only for the other thread)
added: in BaseThread we have a main_log now - logger which puts to the main log buffer from the main thread




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1182 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-03-19 18:08:09 +00:00
Tomasz Sowa ae03922491 seo plugin: added calling WINIX_FILE_CHANGED
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1180 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-03-14 13:46:40 +00:00
Tomasz Sowa ab005118ba added: a new plugin: seo
new winix function: "seo", it allowes to edit subject, description and keywords for a page
description and keywords are stored in meta



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1179 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-03-14 13:33:40 +00:00
Tomasz Sowa 5060997d2a Makefile.dep
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1176 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-03-07 18:02:52 +00:00
Tomasz Sowa 4f8db81c85 added to Locale:
const std::wstring & GetReplace(const wchar_t * key, Types ... types)
key is a string pattern which has %0, %1 parameters which will be replaced with 'types'




git-svn-id: svn://ttmath.org/publicrep/winix/branches/0.7.x@1164 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-01-07 03:32:17 +00:00