Removed shared_error from CMS_API
Added Missing theme and Missing tempalte classes. Updated CMS_RESPONSE to handle missing template and send a 503 status code with a raw response.
This commit is contained in:
42
library/src/theme/missing_theme/missing_cms_template.e
Normal file
42
library/src/theme/missing_theme/missing_cms_template.e
Normal file
@@ -0,0 +1,42 @@
|
||||
note
|
||||
description: "Summary description for {MISSING_CMS_TEMPLATE}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
MISSING_CMS_TEMPLATE
|
||||
|
||||
inherit
|
||||
|
||||
CMS_TEMPLATE
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
make ( a_theme: MISSING_CMS_THEME)
|
||||
do
|
||||
theme := a_theme
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
theme: MISSING_CMS_THEME
|
||||
|
||||
variables: STRING_TABLE [detachable ANY]
|
||||
do
|
||||
create Result.make (0)
|
||||
end
|
||||
|
||||
prepare (page: CMS_HTML_PAGE)
|
||||
do
|
||||
end
|
||||
|
||||
to_html (page: CMS_HTML_PAGE): STRING
|
||||
do
|
||||
Result := " "
|
||||
end
|
||||
|
||||
end
|
||||
45
library/src/theme/missing_theme/missing_cms_theme.e
Normal file
45
library/src/theme/missing_theme/missing_cms_theme.e
Normal file
@@ -0,0 +1,45 @@
|
||||
note
|
||||
description: "Describe a missing theme."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
MISSING_CMS_THEME
|
||||
|
||||
inherit
|
||||
|
||||
CMS_THEME
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_setup: like setup)
|
||||
do
|
||||
setup := a_setup
|
||||
ensure
|
||||
setup_set: setup = a_setup
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
name: STRING = "missing theme"
|
||||
|
||||
regions: ARRAY [STRING]
|
||||
do
|
||||
create Result.make_empty
|
||||
end
|
||||
|
||||
page_template: CMS_TEMPLATE
|
||||
-- theme template page.
|
||||
do
|
||||
create {MISSING_CMS_TEMPLATE} Result.make (Current)
|
||||
end
|
||||
|
||||
page_html (page: CMS_HTML_PAGE): STRING_8
|
||||
do
|
||||
to_implement ("Add a better response message, maybe using smarty template")
|
||||
Result := "Service Unavailable"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user