diff --git a/cms/src/modules/basic_auth/basic_auth_module.e b/cms/src/modules/basic_auth/basic_auth_module.e index f669a6d..855c4e3 100644 --- a/cms/src/modules/basic_auth/basic_auth_module.e +++ b/cms/src/modules/basic_auth/basic_auth_module.e @@ -62,7 +62,7 @@ feature -- Configure Node Resources Routes create l_bal_handler.make (config) create l_methods l_methods.enable_get - router.handle_with_request_methods ("/basic_auth/login", l_bal_handler, l_methods) + router.handle_with_request_methods ("/basic_auth_login", l_bal_handler, l_methods) end configure_api_logoff @@ -73,7 +73,7 @@ feature -- Configure Node Resources Routes create l_bal_handler.make (config) create l_methods l_methods.enable_get - router.handle_with_request_methods ("/basic_auth/logoff", l_bal_handler, l_methods) + router.handle_with_request_methods ("/basic_auth_logoff", l_bal_handler, l_methods) end end diff --git a/cms/src/modules/basic_auth/handler/basic_auth_login_handler.e b/cms/src/modules/basic_auth/handler/basic_auth_login_handler.e index 8f27b2f..a0e6df8 100644 --- a/cms/src/modules/basic_auth/handler/basic_auth_login_handler.e +++ b/cms/src/modules/basic_auth/handler/basic_auth_login_handler.e @@ -52,7 +52,7 @@ feature -- HTTP Methods do log.write_information(generator + ".do_get Processing basic auth login") if attached {STRING_32} current_user_name (req) as l_user then - (create {CMS_GENERIC_RESPONSE}).new_response_redirect (req, res, req.absolute_script_url("")) + (create {CMS_GENERIC_RESPONSE}).new_response_redirect (req, res, req.absolute_script_url("/")) else (create {CMS_GENERIC_RESPONSE}).new_response_authenticate (req, res) end diff --git a/cms/src/modules/node/handler/node_content_handler.e b/cms/src/modules/node/handler/node_content_handler.e index a15bf8a..a7113b7 100644 --- a/cms/src/modules/node/handler/node_content_handler.e +++ b/cms/src/modules/node/handler/node_content_handler.e @@ -71,7 +71,7 @@ feature -- HTTP Methods if attached {WSF_STRING} req.path_parameter ("id") as l_id then if l_id.is_integer and then attached {CMS_NODE} api_service.node (l_id.integer_value) as l_node then create {GENERIC_VIEW_CMS_RESPONSE} l_page.make (req, res, setup, "modules/node_content") - l_page.add_variable (l_node.content, "content") + l_page.add_variable (l_node.content, "node_content") l_page.add_variable (l_id.value, "id") l_page.execute else diff --git a/cms/src/modules/node/handler/node_summary_handler.e b/cms/src/modules/node/handler/node_summary_handler.e index 8e24af2..d3ec258 100644 --- a/cms/src/modules/node/handler/node_summary_handler.e +++ b/cms/src/modules/node/handler/node_summary_handler.e @@ -70,8 +70,8 @@ feature -- HTTP Methods if attached {WSF_STRING} req.path_parameter ("id") as l_id then if l_id.is_integer and then attached {CMS_NODE} api_service.node (l_id.integer_value) as l_node then create {GENERIC_VIEW_CMS_RESPONSE} l_page.make (req, res, setup, "modules/node_summary") - l_page.add_variable (l_node.summary, "summary") l_page.add_variable (l_id.value, "id") + l_page.add_variable (l_node.summary, "node_summary") l_page.execute else do_error (req, res, l_id) diff --git a/cms/src/modules/node/handler/node_title_handler.e b/cms/src/modules/node/handler/node_title_handler.e index e13dca7..570b155 100644 --- a/cms/src/modules/node/handler/node_title_handler.e +++ b/cms/src/modules/node/handler/node_title_handler.e @@ -70,20 +70,14 @@ feature -- HTTP Methods if attached {WSF_STRING} req.path_parameter ("id") as l_id then if l_id.is_integer and then attached {CMS_NODE} api_service.node (l_id.integer_value) as l_node then create {GENERIC_VIEW_CMS_RESPONSE} l_page.make (req, res, setup, "modules/node_title") - l_page.add_variable (setup.is_html, "html") - l_page.add_variable (setup.is_web, "web") - l_page.add_variable (l_node.title, "title") + l_page.add_variable (l_node.title, "node_title") l_page.add_variable (l_id.value, "id") l_page.execute else do_error (req, res, l_id) end else - to_implement ("Check how to implement API error") --- create l_page.make (req, "master2/error") --- l_page.set_value ("500", "code") --- l_page.set_value (req.absolute_script_url (req.path_info), "request") --- l_page.send_to (res) + (create {ERROR_500_CMS_RESPONSE}.make (req, res, setup, "master2/error")).execute end else (create {CMS_GENERIC_RESPONSE}).new_response_unauthorized (req, res) diff --git a/cms/src/service/cms_service.e b/cms/src/service/cms_service.e index f786a83..b2089c1 100644 --- a/cms/src/service/cms_service.e +++ b/cms/src/service/cms_service.e @@ -19,6 +19,7 @@ inherit execute_default end + WSF_FILTERED_SERVICE WSF_FILTER @@ -120,23 +121,6 @@ feature {NONE} -- Initialization router.handle_with_request_methods ("/", fhdl, router.methods_GET) end - -feature -- Access - - setup: CMS_SETUP - -- CMS setup. - - configuration: CMS_CONFIGURATION - -- CMS configuration. - -- | Maybe we can compute it (using `setup') instead of using memory. - - modules: LIST [CMS_MODULE] - -- List of possible modules. - -- | Maybe we can compute it (using `setup') instead of using memory. - - filters: LIST[WSF_FILTER] - -- List of possible filters. - feature -- Execute Filter execute_filter (req: WSF_REQUEST; res: WSF_RESPONSE) @@ -186,6 +170,23 @@ feature -- Filters f.set_next (Current) end + +feature -- Access + + setup: CMS_SETUP + -- CMS setup. + + configuration: CMS_CONFIGURATION + -- CMS configuration. + -- | Maybe we can compute it (using `setup') instead of using memory. + + modules: LIST [CMS_MODULE] + -- List of possible modules. + -- | Maybe we can compute it (using `setup') instead of using memory. + + filters: LIST[WSF_FILTER] + -- List of possible filters. + feature -- Execution execute_default (req: WSF_REQUEST; res: WSF_RESPONSE) diff --git a/cms/src/service/handler/cms_handler.e b/cms/src/service/handler/cms_handler.e index ebe75b7..c6d2902 100644 --- a/cms/src/service/handler/cms_handler.e +++ b/cms/src/service/handler/cms_handler.e @@ -9,6 +9,8 @@ deferred class inherit + WSF_HANDLER + CMS_REQUEST_UTIL SHARED_LOGGER diff --git a/cms/src/service/response/cms_response.e b/cms/src/service/response/cms_response.e index 3dd6f57..671c031 100644 --- a/cms/src/service/response/cms_response.e +++ b/cms/src/service/response/cms_response.e @@ -178,6 +178,8 @@ feature {NONE} -- Execution prepare (cms_page) create page.make (theme.page_html (cms_page)) page.set_status_code (status_code) + page.header.put_content_length (page.html.count) + page.header.put_current_date response.send (page) on_terminated end diff --git a/cms/src/service/response/generic_view_cms_response.e b/cms/src/service/response/generic_view_cms_response.e index 28d01bc..80ce094 100644 --- a/cms/src/service/response/generic_view_cms_response.e +++ b/cms/src/service/response/generic_view_cms_response.e @@ -30,8 +30,8 @@ feature -- Execution process -- Computed response message. do - set_title ("CMS") - set_page_title (Void) +-- set_title ("CMS") +-- set_page_title (Void) end end diff --git a/cms/src/theme/smarty_theme/smarty_cms_page_template.e b/cms/src/theme/smarty_theme/smarty_cms_page_template.e index 427c186..b02fe15 100644 --- a/cms/src/theme/smarty_theme/smarty_cms_page_template.e +++ b/cms/src/theme/smarty_theme/smarty_cms_page_template.e @@ -42,10 +42,10 @@ feature -- Access end if attached page.title as l_title then - variables.force (l_title, "title") + variables.force (l_title, "page_title") variables.force (l_title, "head_title") else - variables.force ("", "title") + variables.force ("", "page_title") variables.force ("", "head_title") end diff --git a/examples/roc_api/roc.ini b/examples/roc_api/roc.ini index 17eb967..f51fcfd 100644 --- a/examples/roc_api/roc.ini +++ b/examples/roc_api/roc.ini @@ -1,2 +1,2 @@ -port=8088 +port=8099 #verbose=true \ No newline at end of file diff --git a/examples/roc_api/site/www/themes/api/master2/site_navigation.tpl b/examples/roc_api/site/www/themes/api/master2/site_navigation.tpl index d37ce73..081d0f4 100644 --- a/examples/roc_api/site/www/themes/api/master2/site_navigation.tpl +++ b/examples/roc_api/site/www/themes/api/master2/site_navigation.tpl @@ -12,10 +12,10 @@ {if isset="$user"}