First try to get a limited WGI_ and use WSF_ as default framework

This commit is contained in:
Jocelyn Fiat
2011-10-19 00:34:30 +02:00
parent eaa99c9c61
commit aec0136739
51 changed files with 2756 additions and 1082 deletions

View File

@@ -35,14 +35,14 @@ feature {NONE} -- Initialization
feature -- Access
authentication_required (req: WGI_REQUEST): BOOLEAN
authentication_required (req: WSF_REQUEST): BOOLEAN
do
Result := True
end
feature -- Execution
execute_unauthorized (a_hdl_context: APP_REQUEST_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
execute_unauthorized (a_hdl_context: APP_REQUEST_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)
local
s: STRING
lst: LIST [STRING]
@@ -52,16 +52,16 @@ feature -- Execution
res.write_string ("Unauthorized")
end
execute_application (ctx: APP_REQUEST_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
execute_application (ctx: APP_REQUEST_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)
local
l_full: BOOLEAN
h: EWF_HEADER
h: WSF_HEADER
l_login: STRING_8
s: STRING
content_type_supported: ARRAY [STRING]
l_format_id: INTEGER
do
content_type_supported := <<{HTTP_CONSTANTS}.json_app, {HTTP_CONSTANTS}.xml_text, {HTTP_CONSTANTS}.plain_text>>
content_type_supported := <<{HTTP_CONSTANTS}.application_json, {HTTP_CONSTANTS}.text_xml, {HTTP_CONSTANTS}.text_plain>>
l_format_id := ctx.request_format_id ("format", content_type_supported)
if authenticated (ctx) then
l_full := attached ctx.query_parameter ("details") as v and then v.is_case_insensitive_equal ("true")

View File

@@ -32,17 +32,17 @@ feature {NONE} -- Initialization
feature -- Access
authentication_required (req: WGI_REQUEST): BOOLEAN
authentication_required (req: WSF_REQUEST): BOOLEAN
do
end
feature -- Execution
execute_application (ctx: APP_REQUEST_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
execute_application (ctx: APP_REQUEST_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)
-- Execute request handler
local
s: STRING
h: EWF_HEADER
h: WSF_HEADER
do
create h.make
h.put_content_type_text_plain

View File

@@ -68,17 +68,17 @@ feature {NONE} -- Handlers
feature -- Execution
execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
do
request_count := request_count + 1
Precursor (req, res)
end
execute_default (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
execute_default (req: WSF_REQUEST; res: WSF_RESPONSE)
local
rqst_uri: detachable STRING
l_path_info: detachable STRING
h: EWF_HEADER
h: WSF_HEADER
s: STRING
l_redir_url: STRING
do
@@ -96,6 +96,8 @@ feature -- Execution
res.write_string (s)
end
request_count: INTEGER
-- execute_rescue (ctx: like new_request_context)
-- -- Execute the default rescue behavior
-- do
@@ -106,7 +108,7 @@ feature -- Implementation
-- execute_exception_trace (ctx: like new_request_context)
-- local
-- h: EWF_HEADER
-- h: WSF_HEADER
-- s: STRING
-- do
-- create h.make
@@ -121,7 +123,7 @@ feature -- Implementation
-- exit_with_code (-1)
-- end
execute_exit_application (ctx: APP_REQUEST_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
execute_exit_application (ctx: APP_REQUEST_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)
local
s: STRING
do

View File

@@ -2,7 +2,7 @@ deferred class
REST_APPLICATION_GATEWAY
inherit
WGI_APPLICATION
WSF_APPLICATION
feature -- Access

View File

@@ -2,7 +2,7 @@ deferred class
REST_APPLICATION_GATEWAY
inherit
WGI_APPLICATION
WSF_APPLICATION
feature -- Access

View File

@@ -2,7 +2,7 @@ deferred class
REST_APPLICATION_GATEWAY
inherit
WGI_APPLICATION
WSF_APPLICATION
feature -- Access

View File

@@ -23,7 +23,7 @@ feature {NONE} -- Initialization
feature {NONE} -- Implementation
wgi_value_iteration_to_string (v: ITERABLE [WGI_VALUE]; using_pre: BOOLEAN): STRING_8
wgi_value_iteration_to_string (v: ITERABLE [WSF_VALUE]; using_pre: BOOLEAN): STRING_8
do
create Result.make (100)
if using_pre then

View File

@@ -9,7 +9,7 @@ deferred class
feature -- Helpers
send_error (a_path: STRING; a_error_id: INTEGER; a_error_name: STRING; a_error_message: detachable STRING; ctx: APP_REQUEST_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
send_error (a_path: STRING; a_error_id: INTEGER; a_error_name: STRING; a_error_message: detachable STRING; ctx: APP_REQUEST_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)
local
s: STRING
i,nb: INTEGER