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

@@ -31,7 +31,7 @@ feature {NONE} -- Initialization
feature -- Access
headers: EWF_HEADER
headers: WSF_HEADER
feature -- Recycle
@@ -155,7 +155,7 @@ feature -- Output
Result := o
end
send (buf: WGI_RESPONSE_BUFFER)
send (buf: WSF_RESPONSE)
do
buf.set_status_code (200)
buf.write_headers_string (header_string)

View File

@@ -30,13 +30,13 @@ feature {NONE} -- Access: Implementation
feature -- Access
authentication_required (req: WGI_REQUEST): BOOLEAN
authentication_required (req: WSF_REQUEST): BOOLEAN
do
end
feature -- Execution
execute_application (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
execute_application (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
local
rep: like new_html_page
s: STRING
@@ -50,7 +50,7 @@ feature -- Execution
create s.make_empty
if
attached {WGI_STRING_VALUE} ctx.path_parameter ("resource") as l_resource_value and then
attached {WSF_STRING_VALUE} ctx.path_parameter ("resource") as l_resource_value and then
attached l_resource_value.string as l_resource
then
from
@@ -114,7 +114,7 @@ feature -- Execution
rep.recycle
end
process_request_handler_doc (rq: REST_REQUEST_HANDLER [C]; a_resource: STRING; buf: STRING; ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER; a_dft_format: detachable STRING)
process_request_handler_doc (rq: REST_REQUEST_HANDLER [C]; a_resource: STRING; buf: STRING; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE; a_dft_format: detachable STRING)
local
l_dft_format_name: detachable STRING
s: STRING

View File

@@ -32,7 +32,7 @@ feature -- Recycle
feature -- Access
headers: EWF_HEADER
headers: WSF_HEADER
api: STRING
-- Associated api query string.
@@ -129,7 +129,7 @@ feature -- Output
Result := o
end
send (res: WGI_RESPONSE_BUFFER)
send (res: WSF_RESPONSE)
do
compute
res.set_status_code (200)

View File

@@ -23,7 +23,7 @@ create
feature -- status
authentication_required (req: WGI_REQUEST): BOOLEAN
authentication_required (req: WSF_REQUEST): BOOLEAN
do
Result := internal_authentication_required
end

View File

@@ -15,7 +15,7 @@ inherit
feature -- Access
authentication_required (req: WGI_REQUEST): BOOLEAN
authentication_required (req: WSF_REQUEST): BOOLEAN
-- Is authentication required
-- might depend on the request environment
-- or the associated resources
@@ -35,7 +35,7 @@ feature -- Element change
feature -- Execution
execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
-- Execute request handler
local
rescued: BOOLEAN
@@ -60,24 +60,24 @@ feature -- Execution
retry
end
execute_application (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
execute_application (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
deferred
end
pre_execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
pre_execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
do
end
post_execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
post_execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
do
end
rescue_execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
rescue_execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
do
post_execute (ctx, req, res)
end
execute_unauthorized (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
execute_unauthorized (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
do
res.set_status_code ({HTTP_STATUS_CODE}.unauthorized)
res.write_header ({HTTP_STATUS_CODE}.unauthorized, Void)

View File

@@ -18,7 +18,7 @@ create
feature -- Mapping
map_agent_with_request_methods (a_id: READABLE_STRING_8; a_action: PROCEDURE [ANY, TUPLE [ctx: REST_REQUEST_URI_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER]];
map_agent_with_request_methods (a_id: READABLE_STRING_8; a_action: PROCEDURE [ANY, TUPLE [ctx: REST_REQUEST_URI_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE]];
rqst_methods: detachable ARRAY [READABLE_STRING_8])
local
h: REST_REQUEST_AGENT_HANDLER [REST_REQUEST_URI_HANDLER_CONTEXT]

View File

@@ -25,7 +25,7 @@ create
feature -- Status report
authentication_required (req: WGI_REQUEST): BOOLEAN
authentication_required (req: WSF_REQUEST): BOOLEAN
do
Result := internal_authentication_required
end
@@ -36,12 +36,12 @@ feature {NONE} -- Implementation
feature -- Execution
execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
do
Precursor {REQUEST_URI_ROUTING_HANDLER_I} (ctx, req, res)
end
execute_application (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
execute_application (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
do
check should_not_occur: False end
end

View File

@@ -18,7 +18,7 @@ create
feature -- Mapping
map_agent_with_request_methods (a_id: READABLE_STRING_8; a_action: PROCEDURE [ANY, TUPLE [ctx: REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER]];
map_agent_with_request_methods (a_id: READABLE_STRING_8; a_action: PROCEDURE [ANY, TUPLE [ctx: REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE]];
rqst_methods: detachable ARRAY [READABLE_STRING_8])
local
h: REST_REQUEST_AGENT_HANDLER [REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT]

View File

@@ -25,7 +25,7 @@ create
feature -- Status report
authentication_required (req: WGI_REQUEST): BOOLEAN
authentication_required (req: WSF_REQUEST): BOOLEAN
do
Result := internal_authentication_required
end
@@ -36,14 +36,14 @@ feature {NONE} -- Implementation
feature -- Execution
execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
do
pre_execute (ctx, req, res)
Precursor {REQUEST_URI_TEMPLATE_ROUTING_HANDLER_I} (ctx, req, res)
post_execute (ctx, req, res)
end
execute_application (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
execute_application (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
do
check should_not_occur: False end
end