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 new_json_parser (a_string: STRING): JSON_PARSER
do do
create Result.make_parser (a_string) create Result.make_with_string (a_string)
end end
note note

View File

@@ -6,7 +6,6 @@ note
class class
CMS_JSON_CONFIGURATION CMS_JSON_CONFIGURATION
inherit inherit
JSON_CONFIGURATION JSON_CONFIGURATION
@@ -20,16 +19,18 @@ feature -- Access
do do
if attached json_file_from (a_path) as json_file then if attached json_file_from (a_path) as json_file then
l_parser := new_json_parser (json_file) l_parser := new_json_parser (json_file)
if attached {JSON_OBJECT} l_parser.parse as jv and then l_parser.is_parsed and then l_parser.parse_content
attached {JSON_OBJECT} jv.item ("server") as l_server and then if
attached {JSON_STRING} l_server.item ("mode") as l_mode then 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") Result := l_mode.item.is_case_insensitive_equal_general ("html")
end end
end end
end end
is_web_mode (a_path: PATH): BOOLEAN is_web_mode (a_path: PATH): BOOLEAN
-- Is the server running on web mode? -- Is the server running on web mode?
local local
@@ -37,11 +38,16 @@ feature -- Access
do do
if attached json_file_from (a_path) as json_file then if attached json_file_from (a_path) as json_file then
l_parser := new_json_parser (json_file) l_parser := new_json_parser (json_file)
if attached {JSON_OBJECT} l_parser.parse as jv and then l_parser.is_parsed and then l_parser.parse_content
attached {JSON_OBJECT} jv.item ("server") as l_server and then if
attached {JSON_STRING} l_server.item ("mode") as l_mode then 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") Result := l_mode.item.is_case_insensitive_equal_general ("web")
end end
end end
end end
end end

View File

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