Commit Graph

53 Commits

Author SHA1 Message Date
Tomasz Sowa 75daf37bbd improve AcceptBaseParser parsing algorithm
remove AcceptParser - not needed now, AcceptBaseParser can prepare a table now
2022-02-02 17:58:27 +01:00
Tomasz Sowa d0d2cfb22c move AcceptBaseParser to utils directory 2022-02-02 17:11:46 +01:00
Tomasz Sowa f7b5ac0dc8 change the way how winix answer is created
Now we can return ezc content and models serialized in the same json structure,
Xml and Csv are not implemented yet.
Ezc frames are returned in 'ezc_frames' field.
Main ezc stream is returned in 'main_stream' field.
Frame url parameter can take more than one frame (names separated by commas).
Honor Accept http header (AcceptParser).

returns html answer from the main ezc stream

returns html answer from the main ezc stream (the same as above)

returns "abc" frame as html

returns all serialized models to json and no ezc streams

returns all serialized models to xml and no ezc streams (not implemented yet)

returns all serialized models to json and two frames in 'ezc_frames' object

returns all serialized models to json and all frames in 'ezc_frames' object

returns all serialized models and the main ezc stream in 'main_stream' field

returns all serialized models to json, all frames and the main stream
2022-02-01 18:44:23 +01:00
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 7673264fe1 make depend 2021-08-12 21:57:03 +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 9d65d931d0 moved some ezc functions from templates/item.cpp to Item and ItemContent
removed: templates/item.cpp
updated: some html templates which use [item] or [item_tab]
removed some old html templates: item_info.html and itam_tab_info.html
2021-07-06 21:52:29 +02:00
Tomasz Sowa 619936c12e make depend 2021-07-01 23:35:08 +02:00
Tomasz Sowa ccbbb59af7 make depend 2021-06-27 23:34:06 +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 4db421d6c3 make depend 2021-06-16 23:43:57 +02:00
Tomasz Sowa f2f2c851df make depend 2021-06-16 18:09:01 +02:00
Tomasz Sowa 81df52f6ca make depend 2021-05-31 18:59:49 +02:00
Tomasz Sowa 06be33ba5f make depend 2021-05-21 23:06:57 +02:00
Tomasz Sowa 8c523ce8b9 make depend 2021-05-21 00:32:58 +02:00
Tomasz Sowa d66a36cf21 make depend 2021-05-14 03:32:03 +02:00
Tomasz Sowa 801c9a2cda make depend 2021-05-11 22:22:10 +02:00
Tomasz Sowa bb513b0187 make depend 2021-04-30 01:35:40 +02:00
Tomasz Sowa 00b980e74b make depend 2021-04-09 16:02:54 +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 23f1c112a4 make depend 2021-03-10 16:40:22 +01:00
Tomasz Sowa 73352e680e Make depend 2021-03-08 21:10:33 +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

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

- 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 619236329c Makefile.dep
git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-09-26 18:25:21 +00:00
Tomasz Sowa 76160a5ba6 Makefile deps
git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-09-25 16:25:44 +00:00
Tomasz Sowa be81307faa Makefiles deps
git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-08-20 12:24:22 +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:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-03-14 13:33:40 +00:00
Tomasz Sowa 5060997d2a Makefile.dep
git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-03-07 18:02:52 +00:00
Tomasz Sowa 0ac5a21a14 Makefile.dep
git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-03-06 18:19:29 +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:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-01-07 03:32:17 +00:00
Tomasz Sowa e5d7403c54 Makefile.dep
git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-01-02 09:12:42 +00:00
Tomasz Sowa b90445de4a updated to the new pikotools api - we have a logger for morm and ezc
pikotools has now Log and FileLog classes
which are base classes for winix Log and FileLog classes

git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-11-23 17:53:43 +00:00
Tomasz Sowa 491dd27ebf some work in the new api:
- log_level and save_each_line moved from Log to FileLog
- other fixes in loggers
- DirContainer from Dirs and LoadAvg had no dependencies set

git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-11-21 22:53:24 +00:00
Tomasz Sowa a2ffc1e81c start working on 0.7.x branch
- added FileLog which stores content to the file log
- now Log is only a wrapper - it puts messages to the local buffer and when logsave is used then the buffer is put to FileLog
- new base classes:
  WinixBase (Log, Config*, Synchro*)
  WinixModel : public WinixBase (morm::ModelConnector*, Plugin*)
  WinixSystem : public WinixModel (System*)
  WinixRequest : public WinixSystem (SLog, Cur*)
- singletons: log, slog, plugin are depracated - now references to them are in base classses (WinixBase, WinixModel)
- DbBase,  DbConn and Db are depracated - now we are using Morm project (in WinixModel there is a model_connector pointer)
  each thread will have its own ModelConnector

git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-11-21 11:03:53 +00:00
Tomasz Sowa 833c04776f changed Makefile.dep
git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-11-14 17:15:03 +00:00
Tomasz Sowa 919c2f62f5 using PT::IsSubString* methods from pikotools
git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-11-01 00:46:44 +00:00
Tomasz Sowa 1b8f5dc673 added to HTMLFilter:
- possibility to remove html entities
  method: SkipEntity(bool)

git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-10-24 16:31:42 +00:00
Tomasz Sowa 027a8ec428 added to HTMLFilter:
- now we can parse " and ' in html attributes
- we can skip html tags and commentaries, added method:
  void SkipAllTags(bool skip_all_tags, bool skip_commentaries);
- there is virtual method: virtual void ItemFound();
  which is called when a html tag is parsed

git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-10-23 23:28:45 +00:00
Tomasz Sowa 2d1b2e6b6e Makefile.dep
git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-07-05 11:15:42 +00:00
Tomasz Sowa 1c05c31721 added: antispam mechanism
each html form has a hidden form_id and counter_id
counter_id on the client side is generated through javascript code
on the server the form_id and counter_id is stored in the session
after sending the html form the server checks the form_id and counter_id

git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-07-02 11:16:36 +00:00
Tomasz Sowa fd421c54e3 changed: Makefile (added Logger from pikotools)
git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-23 14:29:58 +00:00
Tomasz Sowa 55992b5066 added: std::wstring * Request::ParamValuep(const wchar_t * param_name)
for taking a pointer (can be null) to a parameter value
added: bool System::IsSSLRequired(bool try_to_use_ssl)
       returns true if we should use ssl
       try_to_use_ssl is to be meant: config->use_ssl, config->use_ssl_static, config->use_ssl_common

git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-22 21:26:56 +00:00
Tomasz Sowa a5dfc9974f added: a virtual dctor() for BaseThread class
git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-16 22:44:59 +00:00
Tomasz Sowa 7b4a17c934 changed: makefile dep
git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-03-23 19:27:32 +00:00
Tomasz Sowa c2a1097dd5 added: dependency on the morm project
git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-03-13 22:34:59 +00:00
Tomasz Sowa ccf78dcb02 updated to the new Pikotools API
git-svn-id: svn:// e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-01-06 18:12:53 +00:00