Updated cms library with comments, and removed a few JSON obsolete calls.

This commit is contained in:
2014-11-20 14:11:28 +01:00
parent d84f164dbd
commit ba58fcdf75
3 changed files with 29 additions and 17 deletions

View File

@@ -94,7 +94,7 @@ feature {NONE} -- JSON
new_json_parser (a_string: STRING): JSON_PARSER
do
create Result.make_parser (a_string)
create Result.make_with_string (a_string)
end
note

View File

@@ -6,7 +6,6 @@ note
class
CMS_JSON_CONFIGURATION
inherit
JSON_CONFIGURATION
@@ -19,29 +18,36 @@ feature -- Access
l_parser: JSON_PARSER
do
if attached json_file_from (a_path) as json_file then
l_parser := new_json_parser (json_file)
if attached {JSON_OBJECT} l_parser.parse as jv and then l_parser.is_parsed and then
attached {JSON_OBJECT} jv.item ("server") as l_server and then
attached {JSON_STRING} l_server.item ("mode") as l_mode then
Result := l_mode.item.is_case_insensitive_equal_general ("html")
end
l_parser := new_json_parser (json_file)
l_parser.parse_content
if
l_parser.is_valid and then
attached l_parser.parsed_json_object as jo and then l_parser.is_parsed and then
attached {JSON_OBJECT} jo.item ("server") as l_server and then
attached {JSON_STRING} l_server.item ("mode") as l_mode
then
Result := l_mode.item.is_case_insensitive_equal_general ("html")
end
end
end
is_web_mode (a_path: PATH): BOOLEAN
-- Is the server running on web mode?
local
l_parser: JSON_PARSER
do
if attached json_file_from (a_path) as json_file then
l_parser := new_json_parser (json_file)
if attached {JSON_OBJECT} l_parser.parse as jv and then l_parser.is_parsed and then
attached {JSON_OBJECT} jv.item ("server") as l_server and then
attached {JSON_STRING} l_server.item ("mode") as l_mode then
Result := l_mode.item.is_case_insensitive_equal_general ("web")
end
l_parser := new_json_parser (json_file)
l_parser.parse_content
if
l_parser.is_valid and then
attached l_parser.parsed_json_object as jo and then l_parser.is_parsed and then
attached {JSON_OBJECT} jo.item ("server") as l_server and then
attached {JSON_STRING} l_server.item ("mode") as l_mode
then
Result := l_mode.item.is_case_insensitive_equal_general ("web")
end
end
end
end

View File

@@ -1,5 +1,7 @@
note
description: "Summary description for {WSF_CMS_PAGE_TEMPLATE}."
description: "[
Abstract interface for a CMS Template, as part of the theme design.
]"
date: "$Date$"
revision: "$Revision$"
@@ -9,18 +11,22 @@ deferred class
feature -- Access
theme: CMS_THEME
-- Associated theme.
deferred
end
variables: STRING_TABLE [detachable ANY]
-- Variables used for Current template rendering.
deferred
end
prepare (page: CMS_HTML_PAGE)
-- Prepare `page' with current template.
deferred
end
to_html (page: CMS_HTML_PAGE): STRING
-- HTML rendering for page `page'.
deferred
end