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

@@ -36,9 +36,13 @@ feature -- Hook
if attached {CMS_HOOK_RESPONSE_ALTER} Current as h_resp then
a_hooks.subscribe_to_response_alter_hook (h_resp)
end
if attached {CMS_HOOK_WEBAPI_RESPONSE_ALTER} Current as h_resp then
a_hooks.subscribe_to_webapi_response_alter_hook (h_resp)
end
end
note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end

View File

@@ -60,6 +60,28 @@ feature -- Hook: response
end
end
feature -- Hook: webapi response
subscribe_to_webapi_response_alter_hook (h: CMS_HOOK_WEBAPI_RESPONSE_ALTER)
-- Add `h' as subscriber of response alter hooks CMS_HOOK_WEBAPI_RESPONSE_ALTER.
do
subscribe_to_hook (h, {CMS_HOOK_WEBAPI_RESPONSE_ALTER})
end
invoke_webapi_response_alter (a_response: WEBAPI_RESPONSE)
-- Invoke response alter hook for response `a_response'.
do
if attached subscribers ({CMS_HOOK_WEBAPI_RESPONSE_ALTER}) as lst then
across
lst as ic
loop
if attached {CMS_HOOK_WEBAPI_RESPONSE_ALTER} ic.item as h then
h.webapi_response_alter (a_response)
end
end
end
end
feature -- Hook: menu_system_alter
subscribe_to_menu_system_alter_hook (h: CMS_HOOK_MENU_SYSTEM_ALTER)
@@ -110,7 +132,7 @@ feature -- Hook: form_alter
-- Add `h' as subscriber of form alter hooks CMS_HOOK_FORM_ALTER,
-- and response `a_response'.
do
subscribe_to_hook (h, {CMS_HOOK_MENU_ALTER})
subscribe_to_hook (h, {CMS_HOOK_FORM_ALTER})
end
invoke_form_alter (a_form: CMS_FORM; a_form_data: detachable WSF_FORM_DATA; a_response: CMS_RESPONSE)

View File

@@ -0,0 +1,30 @@
note
description: "[
Hook providing a way to alter a webapi response.
]"
date: "$Date$"
revision: "$Revision$"
deferred class
CMS_HOOK_WEBAPI_RESPONSE_ALTER
inherit
CMS_HOOK
feature -- Hook
webapi_response_alter (a_response: WEBAPI_RESPONSE)
deferred
end
note
copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
5949 Hollister Ave., Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end