Added {CMS_RESPONSE}.formats: CMS_FORMATS

This commit is contained in:
2015-04-30 09:50:47 +02:00
parent dd3688fab8
commit 17fe37aedd
4 changed files with 23 additions and 13 deletions

View File

@@ -87,7 +87,7 @@ feature -- Forms ...
elseif a_node /= Void and then attached a_node.format as s_format and then attached response.api.format (s_format) as f_format then
f := f_format
else
f := response.api.formats.default_format
f := response.formats.default_format
end
if b /= Void then
a_node.set_content (b, Void, f.name) -- FIXME: summary
@@ -139,7 +139,7 @@ feature -- Forms ...
elseif a_node /= Void and then attached a_node.format as s_format and then attached response.api.format (s_format) as f_format then
f := f_format
else
f := response.api.formats.default_format
f := response.formats.default_format
end
if b /= Void then
l_node.set_content (b, Void, f.name)
@@ -185,7 +185,7 @@ feature -- Output
if attached node_api.cms_api.format (a_node.format) as f then
s.append (f.formatted_output (l_content))
else
s.append (node_api.cms_api.formats.default_format.formatted_output (l_content))
s.append (a_response.formats.default_format.formatted_output (l_content))
end
s.append ("</p>")

View File

@@ -69,7 +69,7 @@ feature -- Hooks
create dbg.make
create s.make_empty
dbg.append_information_to (a_response.request, a_response.response, s)
create b.make ("debug-info", "Debug", s, a_response.api.formats.plain_text)
create b.make ("debug-info", "Debug", s, a_response.formats.plain_text)
a_response.add_block (b, "footer")
end
end

View File

@@ -71,11 +71,13 @@ feature -- Access
feature -- Formats
formats: CMS_FORMATS
-- Available content formats.
once
create Result
end
format (a_format_name: detachable READABLE_STRING_GENERAL): detachable CONTENT_FORMAT
-- Content format name `a_format_name' if any.
do
Result := formats.item (a_format_name)
end

View File

@@ -59,15 +59,6 @@ feature -- Access
response: WSF_RESPONSE
api: CMS_API
-- Current CMS API.
setup: CMS_SETUP
-- Current setup
do
Result := api.setup
end
status_code: INTEGER
header: WSF_HEADER
@@ -85,6 +76,23 @@ feature -- Access
redirection: detachable READABLE_STRING_8
-- Location for eventual redirection.
feature -- API
api: CMS_API
-- Current CMS API.
setup: CMS_SETUP
-- Current setup
do
Result := api.setup
end
formats: CMS_FORMATS
-- Available content formats.
do
Result := api.formats
end
feature -- Module
module_resource_path (a_module: CMS_MODULE; a_resource: PATH): detachable PATH