Updated CMS_SERVICE to make the cms library complete void-safe.

Reviewed configuration related feature.
Renamed JSON_CONFIGURATION as APPLICATION_JSON_CONFIGURATION_HELPER to avoid confusion.
Updated CMS_DEFAULT_SETUP to use configuration from cms configuration library.
Added {CMS_API}.module_configuration (a_module_name: READABLE_STRING_GENERAL; a_name: detachable READABLE_STRING_GENERAL): detachable CONFIG_READER  to help getting access to configuration of a module (for now, only json and ini are supported, but in the future, this could support database layer directly)
Added CMS_HOOK_BLOCK_HELPER to reuse the template_block (..): ... function.
Cosmetic
Removed CMS_SETUP.smtp_server since for now, there is no need for such general setting.
Add header line "X-ServerEWF-App: CMS" as a simple way to know if request is processed by the CMS.
This commit is contained in:
2015-01-14 18:25:26 +01:00
parent 792880aa7a
commit db9e40cec4
31 changed files with 234 additions and 93 deletions

View File

@@ -2,8 +2,8 @@ note
description: "[
Abstract interface for a CMS Template, as part of the theme design.
]"
date: "$Date$"
revision: "$Revision$"
date: "$Date: 2014-11-20 15:03:29 +0100 (jeu., 20 nov. 2014) $"
revision: "$Revision: 96138 $"
deferred class
CMS_TEMPLATE

View File

@@ -9,6 +9,7 @@ class
MISSING_CMS_TEMPLATE
inherit
CMS_TEMPLATE
create

View File

@@ -1,7 +1,7 @@
note
description: "Summary description for {CMS_PAGE_TEMPLATE}."
date: "$Date$"
revision: "$Revision$"
date: "$Date: 2015-01-14 16:13:47 +0100 (mer., 14 janv. 2015) $"
revision: "$Revision: 96454 $"
class
SMARTY_CMS_PAGE_TEMPLATE
@@ -75,26 +75,29 @@ feature -- Access
debug ("smarty")
template_context.enable_verbose
end
p := template_context.template_folder
if p = Void then
create p.make_current
end
if attached page.type as l_page_type then
create n.make_from_string_general (l_page_type)
n.append_character ('-')
n.append_string_general (template_name)
n.append_string_general (".tpl")
if ut.file_path_exists (p.extended (n)) then
p := template_context.template_file (n)
if ut.file_path_exists (p) then
create tpl.make_from_file (n)
end
end
if tpl = Void then
create n.make_from_string_general (template_name)
n.append_string_general (".tpl")
if ut.file_path_exists (p.extended (n)) then
p := template_context.template_file (n)
if ut.file_path_exists (p) then
create tpl.make_from_file (n)
end
end
if tpl /= Void then
across
variables as ic

View File

@@ -1,7 +1,7 @@
note
description: "Smarty template CMS theme."
date: "$Date$"
revision: "$Revision$"
date: "$Date: 2014-12-05 22:39:27 +0100 (ven., 05 déc. 2014) $"
revision: "$Revision: 96260 $"
class
SMARTY_CMS_THEME
@@ -101,7 +101,11 @@ feature -- Conversion
end
end
create l_table_inspector.register (({detachable STRING_TABLE [STRING]}).name)
create l_table_inspector.register (({detachable STRING_TABLE [STRING_8]}).name)
create l_table_inspector.register (({detachable STRING_TABLE [STRING_32]}).name)
create l_table_inspector.register (({detachable STRING_TABLE [READABLE_STRING_8]}).name)
create l_table_inspector.register (({detachable STRING_TABLE [READABLE_STRING_32]}).name)
page_template.prepare (page)
Result := page_template.to_html (page)

View File

@@ -1,8 +1,8 @@
note
description: "Summary description for {STRING_TABLE_OF_STRING_INSPECTOR}."
author: ""
date: "$Date: 2014-11-06 17:59:12 -0300 (ju. 06 de nov. de 2014) $"
revision: "$Revision: 96040 $"
date: "$Date: 2014-12-05 22:39:27 +0100 (ven., 05 déc. 2014) $"
revision: "$Revision: 96260 $"
class
STRING_TABLE_OF_STRING_INSPECTOR
@@ -23,13 +23,22 @@ feature {TEMPLATE_ROUTINES}
-- If not handled by this inspector, return Void
local
l_fn: STRING
utf: UTF_CONVERTER
do
if attached {STRING_TABLE [STRING]} obj as l_regions then
if attached {STRING_TABLE [detachable READABLE_STRING_GENERAL]} obj as l_regions then
l_fn := field_name.as_lower
if l_fn.is_case_insensitive_equal ("count") then
Result := cell_of (l_regions.count)
elseif attached l_regions.item (l_fn) as v then
Result := cell_of (v)
if attached {READABLE_STRING_32} v as v32 then
if attached v32.is_valid_as_string_8 then
Result := cell_of (v.to_string_8)
else
Result := cell_of (utf.escaped_utf_32_string_to_utf_8_string_8 (v32))
end
else
Result := cell_of (v.to_string_8)
end
end
end
end