diff --git a/draft/library/server/request/rest/rest-safe.ecf b/draft/library/server/request/rest/rest-safe.ecf
index 9d0055a8..1db36b15 100644
--- a/draft/library/server/request/rest/rest-safe.ecf
+++ b/draft/library/server/request/rest/rest-safe.ecf
@@ -11,7 +11,7 @@
-
+
diff --git a/draft/library/server/request/rest/rest.ecf b/draft/library/server/request/rest/rest.ecf
index 5f74326c..7b6563ee 100644
--- a/draft/library/server/request/rest/rest.ecf
+++ b/draft/library/server/request/rest/rest.ecf
@@ -10,7 +10,7 @@
-
+
diff --git a/draft/library/server/request/rest/src/rest_request_agent_handler.e b/draft/library/server/request/rest/src/rest_request_agent_handler.e
index eb0c3ffb..bb5bf129 100644
--- a/draft/library/server/request/rest/src/rest_request_agent_handler.e
+++ b/draft/library/server/request/rest/src/rest_request_agent_handler.e
@@ -1,8 +1,8 @@
class
- REST_REQUEST_AGENT_HANDLER
+ REST_REQUEST_AGENT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
inherit
- WSF_URI_TEMPLATE_AGENT_HANDLER
+ WSF_URI_TEMPLATE_AGENT_CONTEXT_HANDLER [C]
create
make
diff --git a/draft/library/server/request/rest/src/rest_request_handler.e b/draft/library/server/request/rest/src/rest_request_handler.e
index c61a980d..7503d844 100644
--- a/draft/library/server/request/rest/src/rest_request_handler.e
+++ b/draft/library/server/request/rest/src/rest_request_handler.e
@@ -5,10 +5,10 @@ note
revision: "$Revision$"
deferred class
- REST_REQUEST_HANDLER
+ REST_REQUEST_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
inherit
- WSF_URI_TEMPLATE_CONTEXT_HANDLER [WSF_HANDLER_CONTEXT]
+ WSF_URI_TEMPLATE_CONTEXT_HANDLER [C]
WSF_HANDLER_HELPER
@@ -34,7 +34,7 @@ feature -- Element change
feature -- Execution
- execute (ctx: REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)
+ execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
-- Execute request handler
do
if request_method_name_supported (req.request_method) then
@@ -52,26 +52,26 @@ feature -- Execution
execute_rescue (ctx, req, res)
end
- execute_application (ctx: REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)
+ execute_application (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
deferred
end
- pre_execute (ctx: REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)
+ pre_execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
do
end
- post_execute (ctx: REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)
+ post_execute (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
do
end
- execute_rescue (ctx: REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)
+ execute_rescue (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
do
post_execute (ctx, req, res)
rescue
--| Just in case, the rescue is raising other exceptions ...
end
- execute_unauthorized (ctx: REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)
+ execute_unauthorized (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
do
res.put_header ({HTTP_STATUS_CODE}.unauthorized, Void)
res.put_string ("Unauthorized")
@@ -79,7 +79,7 @@ feature -- Execution
feature -- Auth
- authenticated (ctx: REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT): BOOLEAN
+ authenticated (ctx: C): BOOLEAN
-- Is authenticated?
do
--| To redefine if needed
diff --git a/draft/library/server/request/rest/src/rest_service.e b/draft/library/server/request/rest/src/rest_service.e
index 419f25f3..ca694d3f 100644
--- a/draft/library/server/request/rest/src/rest_service.e
+++ b/draft/library/server/request/rest/src/rest_service.e
@@ -5,10 +5,10 @@ note
revision: "$Revision$"
deferred class
- REST_SERVICE
+ REST_SERVICE [C -> WSF_HANDLER_CONTEXT create make end]
inherit
- REST_SERVICE_I
+ REST_SERVICE_I [C]
note
copyright: "Copyright (c) 1984-2012, Eiffel Software and others"
diff --git a/draft/library/server/request/rest/src/rest_service_i.e b/draft/library/server/request/rest/src/rest_service_i.e
index dac1cf91..ad6dfa89 100644
--- a/draft/library/server/request/rest/src/rest_service_i.e
+++ b/draft/library/server/request/rest/src/rest_service_i.e
@@ -5,10 +5,10 @@ note
revision: "$Revision$"
deferred class
- REST_SERVICE_I
+ REST_SERVICE_I [C -> WSF_HANDLER_CONTEXT create make end]
inherit
- WSF_URI_TEMPLATE_ROUTED_SERVICE
+ WSF_URI_TEMPLATE_CONTEXT_ROUTED_SERVICE [C]
;note
copyright: "Copyright (c) 1984-2012, Eiffel Software and others"
diff --git a/draft/library/server/request/rest/src/uri_template/rest_request_uri_template_handler.e b/draft/library/server/request/rest/src/uri_template/rest_request_uri_template_handler.e
index fd4bdbcb..ff307d74 100644
--- a/draft/library/server/request/rest/src/uri_template/rest_request_uri_template_handler.e
+++ b/draft/library/server/request/rest/src/uri_template/rest_request_uri_template_handler.e
@@ -5,10 +5,10 @@ note
revision: "$Revision$"
deferred class
- REST_REQUEST_URI_TEMPLATE_HANDLER
+ REST_REQUEST_URI_TEMPLATE_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
inherit
- REST_REQUEST_HANDLER
+ REST_REQUEST_HANDLER [C]
;note
diff --git a/draft/library/server/request/rest/src/uri_template/rest_uri_template_service.e b/draft/library/server/request/rest/src/uri_template/rest_uri_template_service.e
index d77e2ff7..e295faad 100644
--- a/draft/library/server/request/rest/src/uri_template/rest_uri_template_service.e
+++ b/draft/library/server/request/rest/src/uri_template/rest_uri_template_service.e
@@ -5,10 +5,10 @@ note
revision: "$Revision$"
deferred class
- REST_URI_TEMPLATE_SERVICE
+ REST_URI_TEMPLATE_SERVICE [C -> WSF_HANDLER_CONTEXT create make end]
inherit
- REST_SERVICE_I
+ REST_SERVICE_I [C]
;note
copyright: "Copyright (c) 1984-2012, Eiffel Software and others"
diff --git a/draft/library/server/request/rest/tests/sample.ecf b/draft/library/server/request/rest/tests/sample.ecf
index 04b6e489..268c4245 100644
--- a/draft/library/server/request/rest/tests/sample.ecf
+++ b/draft/library/server/request/rest/tests/sample.ecf
@@ -13,6 +13,7 @@
+
diff --git a/draft/library/server/request/rest/tests/src/app/app_account_verify_credential.e b/draft/library/server/request/rest/tests/src/app/app_account_verify_credential.e
index d87b6683..01b82e59 100644
--- a/draft/library/server/request/rest/tests/src/app/app_account_verify_credential.e
+++ b/draft/library/server/request/rest/tests/src/app/app_account_verify_credential.e
@@ -64,7 +64,7 @@ feature -- Execution
content_type_supported := <<{HTTP_CONSTANTS}.application_json, {HTTP_CONSTANTS}.text_xml, {HTTP_CONSTANTS}.text_plain>>
l_format_id := ctx.request_accepted_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")
+ l_full := attached req.query_parameter ("details") as v and then v.is_case_insensitive_equal ("true")
if attached authenticated_identifier (ctx) as log then
l_login := log.as_string_8
@@ -92,10 +92,10 @@ feature -- Execution
res.put_string (s)
end
else
- send_error (ctx.path, 0, "User/password unknown", Void, ctx, req, res)
+ send_error (req.path_info, 0, "User/password unknown", Void, ctx, req, res)
end
else
- send_error (ctx.path, 0, "Authentication rejected", Void, ctx, req, res)
+ send_error (req.path_info, 0, "Authentication rejected", Void, ctx, req, res)
end
end
diff --git a/draft/library/server/request/rest/tests/src/app/app_test.e b/draft/library/server/request/rest/tests/src/app/app_test.e
index e5d48765..205d72c3 100644
--- a/draft/library/server/request/rest/tests/src/app/app_test.e
+++ b/draft/library/server/request/rest/tests/src/app/app_test.e
@@ -59,14 +59,14 @@ feature -- Execution
s.append_string (" format=" + l_format + "%N")
end
- if attached ctx.string_item ("op") as l_op then
+ if attached ctx.string_item (req, "op") as l_op then
s.append_string (" op=" + l_op)
if l_op.same_string ("crash") then
(create {DEVELOPER_EXCEPTION}).raise
elseif l_op.starts_with ("env") then
s.append_string ("%N%NAll variables:")
s.append (wgi_value_iteration_to_string (req.items, False))
- s.append_string ("
script_url(%"" + req.path_info + "%")=" + ctx.script_url (req.path_info) + "%N")
+ s.append_string ("
script_url(%"" + req.path_info + "%")=" + req.script_url (req.path_info) + "%N")
-- if attached ctx.http_authorization_login_password as t then
-- s.append_string ("Check login=" + t.login + "
%N")
-- end
@@ -75,8 +75,8 @@ feature -- Execution
end
end
else
- s.append ("%N Try " + ctx.script_absolute_url (req.path_info + "?op=env") + " to display all variables%N")
- s.append ("%N Try " + ctx.script_absolute_url (req.path_info + "?op=crash") + " to demonstrate exception trace%N")
+ s.append ("%N Try " + ctx.script_absolute_url (req, req.path_info + "?op=env") + " to display all variables%N")
+ s.append ("%N Try " + ctx.script_absolute_url (req, req.path_info + "?op=crash") + " to demonstrate exception trace%N")
end
res.set_status_code (200)
diff --git a/draft/library/server/request/rest/tests/src/app_server.e b/draft/library/server/request/rest/tests/src/app_server.e
index ad86985b..9baaf7e0 100644
--- a/draft/library/server/request/rest/tests/src/app_server.e
+++ b/draft/library/server/request/rest/tests/src/app_server.e
@@ -10,10 +10,12 @@ class
inherit
APP_SERVICE
redefine
+ create_router,
execute
end
REST_SERVICE_GATEWAY
+ WSF_REQUEST_UTILITY
create
make
@@ -42,18 +44,17 @@ feature {NONE} -- Handlers
gh: APP_REQUEST_ROUTING_HANDLER
do
create {APP_ACCOUNT_VERIFY_CREDENTIAL} h.make
- router.map ("/account/verify_credentials", h)
- router.map ("/account/verify_credentials.{format}", h)
+ router.handle ("/account/verify_credentials.{format}", h)
create {APP_TEST} h.make
create gh.make (4)
- router.map ("/test", gh)
+ router.handle ("/test", gh)
-- gh.map ("/test", h)
- gh.map ("/test/{op}", h)
- gh.map ("/test.{format}", h)
- gh.map ("/test.{format}/{op}", h)
+ gh.router.handle ("/test/{op}", h)
+ gh.router.handle ("/test.{format}", h)
+ gh.router.handle ("/test.{format}/{op}", h)
create rah.make (agent execute_exit_application)
@@ -61,8 +62,8 @@ feature {NONE} -- Handlers
h.set_description ("tell the REST server to exit (in FCGI context, this is used to reload the FCGI server)")
h.enable_request_method_get
h.enable_format_text
- router.map ("/debug/exit", h)
- router.map ("/debug/exit.{format}", h)
+ router.handle ("/debug/exit", h)
+ router.handle ("/debug/exit.{format}", h)
end
feature -- Execution
@@ -131,7 +132,7 @@ feature -- Implementation
create s.make_empty
s.append_string ("Exited")
- s.append_string (" start again%N")
+ s.append_string (" start again%N")
res.put_string (s)
exit_with_code (0)
end
diff --git a/draft/library/server/request/rest/tests/src/handler/app_request_agent_handler.e b/draft/library/server/request/rest/tests/src/handler/app_request_agent_handler.e
index 49551d2a..c7aa847b 100644
--- a/draft/library/server/request/rest/tests/src/handler/app_request_agent_handler.e
+++ b/draft/library/server/request/rest/tests/src/handler/app_request_agent_handler.e
@@ -9,18 +9,34 @@ class
inherit
APP_REQUEST_HANDLER
- undefine
- execute, pre_execute, post_execute
- end
+-- undefine
+-- execute, pre_execute, post_execute
+-- end
REST_REQUEST_AGENT_HANDLER [APP_REQUEST_HANDLER_CONTEXT]
undefine
- authenticated
+ execute
+-- authenticated
end
create
make
+feature -- Access
+
+ execute_application (ctx: APP_REQUEST_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)
+ do
+ execute (ctx, req, res)
+ end
+
+ authentication_required (req: WSF_REQUEST): BOOLEAN
+ -- Is authentication required
+ -- might depend on the request environment
+ -- or the associated resources
+ do
+ Result := False
+ end
+
note
copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
diff --git a/draft/library/server/request/rest/tests/src/handler/app_request_router.e b/draft/library/server/request/rest/tests/src/handler/app_request_router.e
deleted file mode 100644
index 4caaacbe..00000000
--- a/draft/library/server/request/rest/tests/src/handler/app_request_router.e
+++ /dev/null
@@ -1,27 +0,0 @@
-note
- description: "Summary description for {REST_REQUEST_URI_TEMPLATE_ROUTER}."
- author: ""
- date: "$Date$"
- revision: "$Revision$"
-
-class
- APP_REQUEST_ROUTER
-
-inherit
- REST_REQUEST_URI_TEMPLATE_ROUTER_I [APP_REQUEST_HANDLER, APP_REQUEST_HANDLER_CONTEXT]
-
-create
- make,
- make_with_base_url
-
-note
- copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
- license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
- source: "[
- Eiffel Software
- 5949 Hollister Ave., Goleta, CA 93117 USA
- Telephone 805-685-1006, Fax 805-685-6869
- Website http://www.eiffel.com
- Customer support http://support.eiffel.com
- ]"
-end
diff --git a/draft/library/server/request/rest/tests/src/handler/app_request_routing_handler.e b/draft/library/server/request/rest/tests/src/handler/app_request_routing_handler.e
index f6db6ec1..48077c49 100644
--- a/draft/library/server/request/rest/tests/src/handler/app_request_routing_handler.e
+++ b/draft/library/server/request/rest/tests/src/handler/app_request_routing_handler.e
@@ -9,25 +9,32 @@ class
inherit
APP_REQUEST_HANDLER
+ rename
+ execute as uri_template_execute
undefine
- execute
+ uri_template_execute
end
- REST_REQUEST_URI_TEMPLATE_ROUTING_HANDLER_I [APP_REQUEST_HANDLER, APP_REQUEST_HANDLER_CONTEXT]
- undefine
- authenticated,
- pre_execute,
- post_execute
- redefine
- router
- end
+ WSF_URI_TEMPLATE_ROUTING_CONTEXT_HANDLER [APP_REQUEST_HANDLER_CONTEXT]
create
make
-feature {NONE} -- Routing
+feature -- Access
- router: APP_REQUEST_ROUTER
+ authentication_required (req: WSF_REQUEST): BOOLEAN
+ -- Is authentication required
+ -- might depend on the request environment
+ -- or the associated resources
+ do
+ end
+
+feature -- Execution
+
+ execute_application (ctx: APP_REQUEST_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)
+ do
+ uri_template_execute (ctx, req, res)
+ end
;note
copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
diff --git a/draft/library/server/request/rest/tests/src/handler/app_service.e b/draft/library/server/request/rest/tests/src/handler/app_service.e
index d1ed763a..f77177b9 100644
--- a/draft/library/server/request/rest/tests/src/handler/app_service.e
+++ b/draft/library/server/request/rest/tests/src/handler/app_service.e
@@ -8,14 +8,8 @@ deferred class
APP_SERVICE
inherit
- REST_SERVICE_I [APP_REQUEST_HANDLER, APP_REQUEST_HANDLER_CONTEXT]
- redefine
- router
- end
+ REST_SERVICE_I [APP_REQUEST_HANDLER_CONTEXT]
-feature {NONE} -- Router
-
- router: APP_REQUEST_ROUTER
;note
copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
diff --git a/library/server/wsf/router/context/wsf_context_handler.e b/library/server/wsf/router/context/wsf_context_handler.e
index fcc117fb..f684f7a5 100644
--- a/library/server/wsf/router/context/wsf_context_handler.e
+++ b/library/server/wsf/router/context/wsf_context_handler.e
@@ -18,7 +18,7 @@ feature -- Execution
feature {WSF_ROUTER} -- Mapping
- new_mapping (a_resource: READABLE_STRING_8): WSF_ROUTER_CONTEXT_MAPPING [C]
+ new_mapping (a_resource: READABLE_STRING_8): WSF_ROUTER_MAPPING
-- New mapping built with Current as handler
deferred
end
diff --git a/library/server/wsf/wsf_extension-safe.ecf b/library/server/wsf/wsf_extension-safe.ecf
index ab34a5f3..bd44ce84 100644
--- a/library/server/wsf/wsf_extension-safe.ecf
+++ b/library/server/wsf/wsf_extension-safe.ecf
@@ -13,6 +13,6 @@
-
+
diff --git a/library/text/parser/uri_template/uri_template.ecf b/library/text/parser/uri_template/uri_template.ecf
index 25c069a5..a35782c9 100644
--- a/library/text/parser/uri_template/uri_template.ecf
+++ b/library/text/parser/uri_template/uri_template.ecf
@@ -7,9 +7,6 @@
/EIFGENs$
/.svn$
-