Simplify CMS_SERVICE initialization, and CMS server (launcher).

Renamed "layout" lib as "app_env" with APPLICATION_ENVIRONMENT interface.
  applied changed to callers.
Added CMS_THEME.has_region (a_name): BOOLEAN to know if a region is declared in a defined theme.
This commit is contained in:
2015-04-29 23:01:42 +02:00
parent 0eb2b70d0f
commit 6ff7a6493c
34 changed files with 214 additions and 154 deletions

View File

@@ -246,7 +246,7 @@ feature {NONE}-- Implemenation
internal_user_api: detachable like user_api
-- Cached value for `user_api'.
feature -- Layout
feature -- Environment
module_configuration (a_module_name: READABLE_STRING_GENERAL; a_name: detachable READABLE_STRING_GENERAL): detachable CONFIG_READER
-- Configuration reader for `a_module', and if `a_name' is set, using name `a_name'.
@@ -254,7 +254,7 @@ feature -- Layout
p, l_path: PATH
ut: FILE_UTILITIES
do
p := setup.layout.config_path.extended ("modules").extended (a_module_name)
p := setup.environment.config_path.extended ("modules").extended (a_module_name)
if a_name = Void then
p := p.extended (a_module_name)
else

View File

@@ -41,13 +41,11 @@ create
feature {NONE} -- Initialization
make (a_api: CMS_API)
make (a_setup: CMS_SETUP)
-- Build a CMS service with `a_api'
do
api := a_api
create api.make (a_setup)
initialize
ensure
api_set: api = a_api
end
initialize
@@ -138,7 +136,7 @@ feature -- Settings: router
a_router.handle_with_request_methods ("/theme/", fhdl, router.methods_GET)
create fhdl.make_hidden_with_path (setup.layout.www_path)
create fhdl.make_hidden_with_path (setup.environment.www_path)
fhdl.disable_index
fhdl.set_not_found_handler (agent (ia_uri: READABLE_STRING_8; ia_req: WSF_REQUEST; ia_res: WSF_RESPONSE)
do

View File

@@ -107,7 +107,7 @@ feature -- Module
module_assets_location (a_module: CMS_MODULE): PATH
-- Location for the assets associated with `a_module'.
do
Result := setup.layout.path.extended ("modules").extended (a_module.name)
Result := setup.environment.path.extended ("modules").extended (a_module.name)
end
module_assets_theme_location (a_module: CMS_MODULE): PATH