Added basic webapi system to ROC CMS system.

Added sql_delete routine to replace sql_modify with "DELETE FROM .." sql statement.
Fixed filter setup when a module has more than one filter.
Fixed filter setup for site,admin and webapi modes.
Added CMS_AUTH_FILTER, and check if user is already authenticated, then skip following auth filters.
Added specific webapi handler classes for root, user, access token, ...
Added user profile system to the core module.
Moved /user/{uid} from auth module to core module.
Added possibility to add html before and after a cms form. (useful to add a form before or after, as nested form are forbidden).
Now theme can be installed using roc install command.
This commit is contained in:
Jocelyn Fiat
2017-09-05 15:54:40 +02:00
parent 34f0aa5844
commit ac9d29b971
88 changed files with 3552 additions and 553 deletions

View File

@@ -103,6 +103,24 @@ feature {NONE} -- Initialization
site_theme_name := text_item_or_default ("site.theme", "default")
set_theme (site_theme_name)
-- Webapi
webapi_enabled := string_8_item_or_default ("webapi.mode", "off").is_case_insensitive_equal_general ("on")
l_url := string_8_item ("webapi.base_path")
if l_url /= Void and then not l_url.is_empty then
if l_url [l_url.count] = '/' then
l_url := l_url.substring (1, l_url.count - 1)
end
if l_url [1] /= '/' then
l_url := "/" + l_url
end
create webapi_base_path.make_from_string (l_url)
else
create webapi_base_path.make_from_string (default_webapi_base_path)
end
-- Administration
l_url := string_8_item ("administration.base_path")
if l_url /= Void and then not l_url.is_empty then
@@ -117,6 +135,7 @@ feature {NONE} -- Initialization
create administration_base_path.make_from_string (default_administration_base_path)
end
administration_theme_name := text_item_or_default ("administration.theme", theme_name) -- TODO: Default to builtin theme?
end
feature -- Access
@@ -314,11 +333,19 @@ feature -- Access: Site
-- Optional path defining the front page.
-- By default "" or "/".
webapi_enabled: BOOLEAN
-- Is WebAPI enabled?
webapi_base_path: IMMUTABLE_STRING_8
-- Web API base url, default=`default_webapi_base_path`.
administration_base_path: IMMUTABLE_STRING_8
-- Administration base url, default=`default_administration_base_path`.
feature {NONE} -- Constants
default_webapi_base_path: STRING = "/api"
default_administration_base_path: STRING = "/admin"
feature -- Settings
@@ -338,6 +365,12 @@ feature -- Settings
end
end
set_webapi_mode
-- Switch to webapi mode.
do
set_site_mode
end
set_administration_mode
-- Switch to administration mode.
--| - Change theme