Updated cms library with comments, and removed a few JSON obsolete calls.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ note
|
|||||||
class
|
class
|
||||||
CMS_JSON_CONFIGURATION
|
CMS_JSON_CONFIGURATION
|
||||||
|
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
|
|
||||||
JSON_CONFIGURATION
|
JSON_CONFIGURATION
|
||||||
@@ -19,29 +18,36 @@ feature -- Access
|
|||||||
l_parser: JSON_PARSER
|
l_parser: JSON_PARSER
|
||||||
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
|
||||||
Result := l_mode.item.is_case_insensitive_equal_general ("html")
|
attached l_parser.parsed_json_object as jo and then l_parser.is_parsed and then
|
||||||
end
|
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
|
||||||
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
|
||||||
l_parser: JSON_PARSER
|
l_parser: JSON_PARSER
|
||||||
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
|
||||||
Result := l_mode.item.is_case_insensitive_equal_general ("web")
|
attached l_parser.parsed_json_object as jo and then l_parser.is_parsed and then
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user