Added support for base_url (i.e the CMS can be hosted on the root, or sub folder).

Local paths are relative to cms site url (i.e no starting slash).
Favor CMS_RESPONSE.absolute_url and url .. instead of using directly WSF_REQUEST.absolute_script_url and script_url.
Handled unicode truncation issue for logger.
Code cleaning.
This commit is contained in:
2015-05-19 13:44:08 +02:00
parent 51699f3bd3
commit 91457080fd
31 changed files with 237 additions and 94 deletions

View File

@@ -39,17 +39,21 @@ feature {NONE} -- Initialization
end
configure
local
l_url: like site_url
do
--| Site id, used to identified a site, this could be set to a uuid, or else
site_id := text_item_or_default ("site.id", "_EWF_CMS_NO_ID_")
-- Site url: optional, but ending with a slash
site_url := string_8_item ("site_url")
if attached site_url as l_url and then not l_url.is_empty then
if l_url[l_url.count] /= '/' then
site_url := l_url + "/"
l_url := string_8_item ("site_url")
if l_url /= Void and then not l_url.is_empty then
if l_url [l_url.count] /= '/' then
l_url := l_url + "/"
end
end
site_url := l_url
-- Site name
site_name := text_item_or_default ("site.name", "EWF::CMS")

View File

@@ -62,7 +62,7 @@ feature -- Access: Site
-- Mainly used for internal notification.
site_url: detachable READABLE_STRING_8
-- Optional base url of the site.
-- Optional url of current CMS site.
front_page_path: detachable READABLE_STRING_8
-- Optional path defining the front page.