From b1f5065e63d817467275f32a55a8be921591b859 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Wed, 14 Sep 2011 14:47:29 +0200 Subject: [PATCH 01/11] sync with nino --- ext/server/nino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/server/nino b/ext/server/nino index 9dd1439a..9fef2d71 160000 --- a/ext/server/nino +++ b/ext/server/nino @@ -1 +1 @@ -Subproject commit 9dd1439a2f6354f5f6da04fdd86fbf2e45abe978 +Subproject commit 9fef2d71f053c32c9e4c55984d53ebefe7a02c15 From 4bcea900a6e7710a290e380c3d77715793538d84 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Wed, 14 Sep 2011 14:48:08 +0200 Subject: [PATCH 02/11] better result type (using READABLE_..) --- .../protocol/uri_template/src/uri_template_match_result.e | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/protocol/uri_template/src/uri_template_match_result.e b/library/protocol/uri_template/src/uri_template_match_result.e index 92ea6681..1077444c 100644 --- a/library/protocol/uri_template/src/uri_template_match_result.e +++ b/library/protocol/uri_template/src/uri_template_match_result.e @@ -58,7 +58,7 @@ feature -- Query feature -- Query: url-decoded - url_decoded_query_variable (n: READABLE_STRING_GENERAL): detachable STRING_32 + url_decoded_query_variable (n: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 -- Unencoded value related to variable name `n' do if attached query_variable (n) as v then @@ -66,7 +66,7 @@ feature -- Query: url-decoded end end - url_decoded_path_variable (n: READABLE_STRING_GENERAL): detachable STRING_32 + url_decoded_path_variable (n: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 -- Unencoded value related to variable name `n' do if attached path_variable (n) as v then @@ -74,7 +74,7 @@ feature -- Query: url-decoded end end - url_decoded_variable (n: READABLE_STRING_GENERAL): detachable STRING_32 + url_decoded_variable (n: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 -- Unencoded value related to variable name `n' do if attached variable (n) as v then @@ -84,7 +84,7 @@ feature -- Query: url-decoded feature {NONE} -- Implementation - url_decoded_string (s: READABLE_STRING_GENERAL): STRING_32 + url_decoded_string (s: READABLE_STRING_GENERAL): READABLE_STRING_32 do Result := url_encoder.decoded_string (s.as_string_8) end From 5626e03aa82363ea8abd1ff43c8619a97db11d58 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Wed, 14 Sep 2011 14:54:06 +0200 Subject: [PATCH 03/11] - Adopted deferred WGI_VALUE design for Result type of *_parameter and similar functions - Adopted the ITERATION_CURSOR [WGI_VALUE] design for *_parameters and similar functions - renamed parameter as item - provided helper function to handle "string" value parameters Experimental for now. --- .../connectors/nino/src/ewf_nino_connector.e | 2 +- .../request/value/wgi_string_value.e | 71 +++++ .../ewsgi/specification/request/wgi_request.e | 46 ++- .../ewsgi/specification/request/wgi_value.e | 48 +++ .../src/request/wgi_request_from_table.e | 275 +++++++++++------- .../src/contrib/doc/rest_api_documentation.e | 5 +- .../src/application/routed_application.e | 19 +- .../src/context/request_handler_context.e | 34 ++- .../src/context/request_uri_handler_context.e | 6 +- .../request_uri_template_handler_context.e | 15 +- .../default_request_uri_routing_handler.e | 33 +++ 11 files changed, 402 insertions(+), 152 deletions(-) create mode 100644 library/server/ewsgi/specification/request/value/wgi_string_value.e create mode 100644 library/server/ewsgi/specification/request/wgi_value.e create mode 100644 library/server/request/router/src/default/default_request_uri_routing_handler.e diff --git a/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e b/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e index 67af8814..519a3a15 100644 --- a/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e +++ b/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e @@ -78,7 +78,7 @@ feature -- Server do create req.make (env, create {EWF_NINO_INPUT_STREAM}.make (a_input)) create res.make (create {EWF_NINO_OUTPUT_STREAM}.make (a_output)) - req.set_meta_variable ("RAW_HEADER_DATA", a_headers_text) + req.set_meta_string_variable ("RAW_HEADER_DATA", a_headers_text) application.execute (req, res) end diff --git a/library/server/ewsgi/specification/request/value/wgi_string_value.e b/library/server/ewsgi/specification/request/value/wgi_string_value.e new file mode 100644 index 00000000..c39664bc --- /dev/null +++ b/library/server/ewsgi/specification/request/value/wgi_string_value.e @@ -0,0 +1,71 @@ +note + description: "Summary description for {WGI_STRING_VALUE}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + WGI_STRING_VALUE + +inherit + WGI_VALUE + +create + make + +convert + as_string: {READABLE_STRING_32, STRING_32} + +feature {NONE} -- Initialization + + make (a_name: like name; a_value: like value) + do + name := a_name + value := a_value + end + +feature -- Access + + name: READABLE_STRING_GENERAL + + value: READABLE_STRING_32 + +feature -- Helper + + same_string (a_other: READABLE_STRING_GENERAL): BOOLEAN + -- Does `a_other' represent the same string as `Current'? + do + Result := value.same_string_general (a_other) + end + + is_case_insensitive_equal (a_other: READABLE_STRING_8): BOOLEAN + -- Does `a_other' represent the same case insensitive string as `Current'? + local + v: like value + do + v := value + if v = a_other then + Result := True + elseif v.is_valid_as_string_8 then + Result := v.is_case_insensitive_equal (a_other) + end + end + +feature -- Conversion + + as_string: STRING_32 + do + create Result.make_from_string (value) + end + +;note + copyright: "2011-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/library/server/ewsgi/specification/request/wgi_request.e b/library/server/ewsgi/specification/request/wgi_request.e index da041511..75b4d431 100644 --- a/library/server/ewsgi/specification/request/wgi_request.e +++ b/library/server/ewsgi/specification/request/wgi_request.e @@ -89,14 +89,14 @@ feature -- Access: extra values feature -- Access: CGI meta variables - meta_variable (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + meta_variable (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE -- Environment variable related to `a_name' require a_name_valid: a_name /= Void and then not a_name.is_empty deferred end - meta_variables: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL] + meta_variables: ITERATION_CURSOR [WGI_VALUE] -- These variables are specific to requests made with HTTP. -- Interpretation of these variables may depend on the value of -- SERVER_PROTOCOL. @@ -575,28 +575,14 @@ feature -- Extra CGI environment variables deferred end ---feature -- Access: execution variables - --- execution_variables: WGI_VARIABLES [STRING_32] --- -- Execution variables set by the application --- deferred --- end - --- execution_variable (a_name: STRING): detachable STRING_32 --- -- Execution variable related to `a_name' --- require --- a_name_valid: a_name /= Void and then not a_name.is_empty --- deferred --- end - feature -- Query string Parameters - query_parameters: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL] + query_parameters: ITERATION_CURSOR [WGI_VALUE] -- Variables extracted from QUERY_STRING deferred end - query_parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + query_parameter (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE -- Parameter for name `n'. require a_name_valid: a_name /= Void and then not a_name.is_empty @@ -605,12 +591,12 @@ feature -- Query string Parameters feature -- Form fields and related - form_data_parameters: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL] + form_data_parameters: ITERATION_CURSOR [WGI_VALUE] -- Variables sent by POST request deferred end - form_data_parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + form_data_parameter (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE -- Field for name `a_name'. require a_name_valid: a_name /= Void and then not a_name.is_empty @@ -630,12 +616,12 @@ feature -- Form fields and related feature -- Cookies - cookies: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL] + cookies: ITERATION_CURSOR [WGI_VALUE] -- Expanded cookies variable deferred end - cookie (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + cookie (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE -- Field for name `a_name'. require a_name_valid: a_name /= Void and then not a_name.is_empty @@ -644,14 +630,26 @@ feature -- Cookies feature -- Access: global variable - parameters: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL] + parameters: like items + obsolete "use items" + do + Result := items + end + + parameter (a_name: READABLE_STRING_GENERAL): like item + obsolete "use item" + do + Result := item (a_name) + end + + items: ITERATION_CURSOR [WGI_VALUE] -- Table containing all the various variables -- Warning: this is computed each time, if you change the content of other containers -- this won't update this Result's content, unless you query it again deferred end - parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + item (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE -- Variable named `a_name' from any of the variables container -- and following a specific order -- execution, environment, get, post, cookies diff --git a/library/server/ewsgi/specification/request/wgi_value.e b/library/server/ewsgi/specification/request/wgi_value.e new file mode 100644 index 00000000..2919df74 --- /dev/null +++ b/library/server/ewsgi/specification/request/wgi_value.e @@ -0,0 +1,48 @@ +note + description: "Summary description for {WGI_VALUE}." + author: "" + date: "$Date$" + revision: "$Revision$" + +deferred class + WGI_VALUE + +convert + as_string: {READABLE_STRING_32, STRING_32} + +feature -- Access + + name: READABLE_STRING_GENERAL + -- Parameter name + deferred + end + +feature -- Helper + + same_string (a_other: READABLE_STRING_GENERAL): BOOLEAN + -- Does `a_other' represent the same string as `Current'? + deferred + end + + is_case_insensitive_equal (a_other: READABLE_STRING_8): BOOLEAN + -- Does `a_other' represent the same case insensitive string as `Current'? + deferred + end + +feature -- Query + + as_string: STRING_32 + deferred + end + +note + copyright: "2011-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/library/server/ewsgi/src/request/wgi_request_from_table.e b/library/server/ewsgi/src/request/wgi_request_from_table.e index eeed7909..c24678f2 100644 --- a/library/server/ewsgi/src/request/wgi_request_from_table.e +++ b/library/server/ewsgi/src/request/wgi_request_from_table.e @@ -34,33 +34,33 @@ feature {NONE} -- Initialization analyze end - set_meta_parameters (a_vars: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8]) + set_meta_parameters (a_vars: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_GENERAL]) -- Fill with variable from `a_vars' local - s: like meta_variable - table: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL] + s: like meta_string_variable + table: HASH_TABLE [WGI_VALUE, READABLE_STRING_GENERAL] do create {STRING_32} empty_string.make_empty create table.make (a_vars.count) - meta_variables := table + meta_variables_table := table from a_vars.start until a_vars.after loop - table.force (a_vars.item_for_iteration, a_vars.key_for_iteration) + table.force (new_string_value (a_vars.key_for_iteration, a_vars.item_for_iteration), a_vars.key_for_iteration) a_vars.forth end --| QUERY_STRING - query_string := meta_parameter_or_default ({WGI_META_NAMES}.query_string, empty_string, False) + query_string := meta_string_variable_or_default ({WGI_META_NAMES}.query_string, empty_string, False) --| REQUEST_METHOD - request_method := meta_parameter_or_default ({WGI_META_NAMES}.request_method, empty_string, False) + request_method := meta_string_variable_or_default ({WGI_META_NAMES}.request_method, empty_string, False) --| CONTENT_TYPE - s := meta_variable ({WGI_META_NAMES}.content_type) + s := meta_string_variable ({WGI_META_NAMES}.content_type) if s /= Void and then not s.is_empty then content_type := s else @@ -68,7 +68,7 @@ feature {NONE} -- Initialization end --| CONTENT_LENGTH - s := meta_variable ({WGI_META_NAMES}.content_length) + s := meta_string_variable ({WGI_META_NAMES}.content_length) content_length := s if s /= Void and then s.is_natural_64 then content_length_value := s.to_natural_64 @@ -77,13 +77,13 @@ feature {NONE} -- Initialization end --| PATH_INFO - path_info := meta_parameter_or_default ({WGI_META_NAMES}.path_info, empty_string, False) + path_info := meta_string_variable_or_default ({WGI_META_NAMES}.path_info, empty_string, False) --| SERVER_NAME - server_name := meta_parameter_or_default ({WGI_META_NAMES}.server_name, empty_string, False) + server_name := meta_string_variable_or_default ({WGI_META_NAMES}.server_name, empty_string, False) --| SERVER_PORT - s := meta_variable ({WGI_META_NAMES}.server_port) + s := meta_string_variable ({WGI_META_NAMES}.server_port) if s /= Void and then s.is_integer then server_port := s.to_integer else @@ -91,16 +91,16 @@ feature {NONE} -- Initialization end --| SCRIPT_NAME - script_name := meta_parameter_or_default ({WGI_META_NAMES}.script_name, empty_string, False) + script_name := meta_string_variable_or_default ({WGI_META_NAMES}.script_name, empty_string, False) --| REMOTE_ADDR - remote_addr := meta_parameter_or_default ({WGI_META_NAMES}.remote_addr, empty_string, False) + remote_addr := meta_string_variable_or_default ({WGI_META_NAMES}.remote_addr, empty_string, False) --| REMOTE_HOST - remote_host := meta_parameter_or_default ({WGI_META_NAMES}.remote_host, empty_string, False) + remote_host := meta_string_variable_or_default ({WGI_META_NAMES}.remote_host, empty_string, False) --| REQUEST_URI - request_uri := meta_parameter_or_default ({WGI_META_NAMES}.request_uri, empty_string, False) + request_uri := meta_string_variable_or_default ({WGI_META_NAMES}.request_uri, empty_string, False) end initialize @@ -114,13 +114,13 @@ feature {NONE} -- Initialization if attached request_uri as rq_uri then p := rq_uri.index_of ('?', 1) if p > 0 then - set_meta_variable (rq_uri.substring (1, p-1), {WGI_META_NAMES}.self) + set_meta_string_variable (rq_uri.substring (1, p-1), {WGI_META_NAMES}.self) else - set_meta_variable (rq_uri, {WGI_META_NAMES}.self) + set_meta_string_variable (rq_uri, {WGI_META_NAMES}.self) end end if meta_variable ({WGI_META_NAMES}.request_time) = Void then - set_meta_variable (date_time_utilities.unix_time_stamp (Void).out, {WGI_META_NAMES}.request_time) + set_meta_string_variable (date_time_utilities.unix_time_stamp (Void).out, {WGI_META_NAMES}.request_time) end end @@ -160,51 +160,65 @@ feature -- Access extra information -- Request time (UTC) do if - attached meta_variable ({WGI_META_NAMES}.request_time) as t and then - t.is_integer_64 + attached {WGI_STRING_VALUE} meta_variable ({WGI_META_NAMES}.request_time) as t and then + t.value.is_integer_64 then - Result := date_time_utilities.unix_time_stamp_to_date_time (t.to_integer_64) + Result := date_time_utilities.unix_time_stamp_to_date_time (t.value.to_integer_64) end end -feature -- Access: CGI meta parameters +feature {NONE} -- Access: CGI meta parameters - meta_variables: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL] + meta_variables_table: HASH_TABLE [WGI_VALUE, READABLE_STRING_GENERAL] -- CGI Environment parameters - meta_variable (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 - -- CGI meta variable related to `a_name' +feature -- Access: CGI meta parameters + + meta_variables: ITERATION_CURSOR [WGI_VALUE] do - Result := meta_variables.item (a_name) + Result := meta_variables_table.new_cursor end - meta_parameter_or_default (a_name: READABLE_STRING_GENERAL; a_default: READABLE_STRING_32; use_default_when_empty: BOOLEAN): READABLE_STRING_32 + meta_variable (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE + -- CGI meta variable related to `a_name' + do + Result := meta_variables_table.item (a_name) + end + + meta_string_variable (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + -- CGI meta variable related to `a_name' + do + if attached meta_variables_table.item (a_name) as val then + Result := val.as_string + end + end + + meta_string_variable_or_default (a_name: READABLE_STRING_GENERAL; a_default: READABLE_STRING_32; use_default_when_empty: BOOLEAN): READABLE_STRING_32 -- Value for meta parameter `a_name' -- If not found, return `a_default' require a_name_not_empty: a_name /= Void and then not a_name.is_empty do - if attached meta_variable (a_name) as s then - if use_default_when_empty and then s.is_empty then + if attached meta_variable (a_name) as val then + Result := val.as_string + if use_default_when_empty and then Result.is_empty then Result := a_default - else - Result := s end else Result := a_default end end - set_meta_variable (a_name: READABLE_STRING_GENERAL; a_value: READABLE_STRING_32) + set_meta_string_variable (a_name: READABLE_STRING_GENERAL; a_value: READABLE_STRING_32) do - meta_variables.force (a_value, a_name) + meta_variables_table.force (new_string_value (a_name, a_value), a_name) ensure - param_set: meta_variable (a_name) ~ a_value + param_set: attached {WGI_STRING_VALUE} meta_variable (a_name) as val and then val ~ a_value end unset_meta_variable (a_name: READABLE_STRING_GENERAL) do - meta_variables.remove (a_name) + meta_variables_table.remove (a_name) ensure param_unset: meta_variable (a_name) = Void end @@ -221,7 +235,7 @@ feature -- Access: CGI meta parameters - 1.1 gateway_interface: READABLE_STRING_32 do - Result := meta_parameter_or_default ({WGI_META_NAMES}.gateway_interface, "", False) + Result := meta_string_variable_or_default ({WGI_META_NAMES}.gateway_interface, "", False) end path_info: READABLE_STRING_32 @@ -234,7 +248,7 @@ feature -- Access: CGI meta parameters - 1.1 path_translated: detachable READABLE_STRING_32 do - Result := meta_variable ({WGI_META_NAMES}.path_translated) + Result := meta_string_variable ({WGI_META_NAMES}.path_translated) end query_string: READABLE_STRING_32 @@ -245,12 +259,12 @@ feature -- Access: CGI meta parameters - 1.1 remote_ident: detachable READABLE_STRING_32 do - Result := meta_variable ({WGI_META_NAMES}.remote_ident) + Result := meta_string_variable ({WGI_META_NAMES}.remote_ident) end remote_user: detachable READABLE_STRING_32 do - Result := meta_variable ({WGI_META_NAMES}.remote_user) + Result := meta_string_variable ({WGI_META_NAMES}.remote_user) end request_method: READABLE_STRING_32 @@ -263,12 +277,12 @@ feature -- Access: CGI meta parameters - 1.1 server_protocol: READABLE_STRING_32 do - Result := meta_parameter_or_default ({WGI_META_NAMES}.server_protocol, "HTTP/1.0", True) + Result := meta_string_variable_or_default ({WGI_META_NAMES}.server_protocol, "HTTP/1.0", True) end server_software: READABLE_STRING_32 do - Result := meta_parameter_or_default ({WGI_META_NAMES}.server_software, "Unknown Server", True) + Result := meta_string_variable_or_default ({WGI_META_NAMES}.server_software, "Unknown Server", True) end feature -- Access: HTTP_* CGI meta parameters - 1.1 @@ -276,41 +290,41 @@ feature -- Access: HTTP_* CGI meta parameters - 1.1 http_accept: detachable READABLE_STRING_32 -- Contents of the Accept: header from the current request, if there is one. do - Result := meta_variable ({WGI_META_NAMES}.http_accept) + Result := meta_string_variable ({WGI_META_NAMES}.http_accept) end http_accept_charset: detachable READABLE_STRING_32 -- Contents of the Accept-Charset: header from the current request, if there is one. -- Example: 'iso-8859-1,*,utf-8'. do - Result := meta_variable ({WGI_META_NAMES}.http_accept_charset) + Result := meta_string_variable ({WGI_META_NAMES}.http_accept_charset) end http_accept_encoding: detachable READABLE_STRING_32 -- Contents of the Accept-Encoding: header from the current request, if there is one. -- Example: 'gzip'. do - Result := meta_variable ({WGI_META_NAMES}.http_accept_encoding) + Result := meta_string_variable ({WGI_META_NAMES}.http_accept_encoding) end http_accept_language: detachable READABLE_STRING_32 -- Contents of the Accept-Language: header from the current request, if there is one. -- Example: 'en'. do - Result := meta_variable ({WGI_META_NAMES}.http_accept_language) + Result := meta_string_variable ({WGI_META_NAMES}.http_accept_language) end http_connection: detachable READABLE_STRING_32 -- Contents of the Connection: header from the current request, if there is one. -- Example: 'Keep-Alive'. do - Result := meta_variable ({WGI_META_NAMES}.http_connection) + Result := meta_string_variable ({WGI_META_NAMES}.http_connection) end http_host: detachable READABLE_STRING_32 -- Contents of the Host: header from the current request, if there is one. do - Result := meta_variable ({WGI_META_NAMES}.http_host) + Result := meta_string_variable ({WGI_META_NAMES}.http_host) end http_referer: detachable READABLE_STRING_32 @@ -319,7 +333,7 @@ feature -- Access: HTTP_* CGI meta parameters - 1.1 -- Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. -- In short, it cannot really be trusted. do - Result := meta_variable ({WGI_META_NAMES}.http_referer) + Result := meta_string_variable ({WGI_META_NAMES}.http_referer) end http_user_agent: detachable READABLE_STRING_32 @@ -329,13 +343,13 @@ feature -- Access: HTTP_* CGI meta parameters - 1.1 -- Among other things, you can use this value to tailor your page's -- output to the capabilities of the user agent. do - Result := meta_variable ({WGI_META_NAMES}.http_user_agent) + Result := meta_string_variable ({WGI_META_NAMES}.http_user_agent) end http_authorization: detachable READABLE_STRING_32 -- Contents of the Authorization: header from the current request, if there is one. do - Result := meta_variable ({WGI_META_NAMES}.http_authorization) + Result := meta_string_variable ({WGI_META_NAMES}.http_authorization) end feature -- Access: Extension to CGI meta parameters - 1.1 @@ -354,7 +368,7 @@ feature {NONE} -- Element change: CGI meta parameter related to PATH_INFO s_attached: s /= Void do orig_path_info := s - set_meta_variable ({WGI_META_NAMES}.orig_path_info, s) + set_meta_string_variable ({WGI_META_NAMES}.orig_path_info, s) end unset_orig_path_info @@ -389,17 +403,17 @@ feature {NONE} -- Element change: CGI meta parameter related to PATH_INFO end end -feature -- Query parameters +feature {NONE} -- Query parameters - query_parameters: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL] + query_parameters_table: HASH_TABLE [WGI_VALUE, READABLE_STRING_GENERAL] -- Variables extracted from QUERY_STRING local - vars: like internal_query_parameters + vars: like internal_query_parameters_table p,e: INTEGER rq_uri: like request_uri s: detachable STRING do - vars := internal_query_parameters + vars := internal_query_parameters_table if vars = Void then s := query_string if s = Void then @@ -416,20 +430,27 @@ feature -- Query parameters end end vars := urlencoded_parameters (s, True) - internal_query_parameters := vars + internal_query_parameters_table := vars end Result := vars end - query_parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 +feature -- Query parameters + + query_parameters: ITERATION_CURSOR [WGI_VALUE] + do + Result := query_parameters_table.new_cursor + end + + query_parameter (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE -- Parameter for name `n'. do - Result := query_parameters.item (a_name) + Result := query_parameters_table.item (a_name) end feature {NONE} -- Query parameters: implementation - urlencoded_parameters (a_content: detachable READABLE_STRING_8; decoding: BOOLEAN): HASH_TABLE [READABLE_STRING_32, STRING] + urlencoded_parameters (a_content: detachable READABLE_STRING_8; decoding: BOOLEAN): HASH_TABLE [WGI_VALUE, STRING] -- Import `a_content' local n, p, i, j: INTEGER @@ -466,7 +487,7 @@ feature {NONE} -- Query parameters: implementation l_name := url_encoder.decoded_string (l_name) l_value := url_encoder.decoded_string (l_value) end - Result.force (l_value, l_name) + Result.force (new_string_value (l_name, l_value), l_name) end end end @@ -474,17 +495,17 @@ feature {NONE} -- Query parameters: implementation end end -feature -- Form fields and related +feature {NONE} -- Form fields and related - form_data_parameters: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL] + form_data_parameters_table: HASH_TABLE [WGI_VALUE, READABLE_STRING_GENERAL] -- Variables sent by POST request local - vars: like internal_form_data_parameters + vars: like internal_form_data_parameters_table s: STRING n: NATURAL_64 l_type: like content_type do - vars := internal_form_data_parameters + vars := internal_form_data_parameters_table if vars = Void then n := content_length_value if n > 0 then @@ -502,20 +523,27 @@ feature -- Form fields and related vars := urlencoded_parameters (s, True) end if raw_post_data_recorded then - vars.force (s, "RAW_POST_DATA") + vars.force (new_string_value ("RAW_POST_DATA", s), "RAW_POST_DATA") end else create vars.make (0) end - internal_form_data_parameters := vars + internal_form_data_parameters_table := vars end Result := vars end - form_data_parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 +feature -- Form fields and related + + form_data_parameters: ITERATION_CURSOR [WGI_VALUE] + do + Result := form_data_parameters_table.new_cursor + end + + form_data_parameter (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE -- Field for name `a_name'. do - Result := form_data_parameters.item (a_name) + Result := form_data_parameters_table.item (a_name) end uploaded_files: HASH_TABLE [WGI_UPLOADED_FILE_DATA, STRING] @@ -527,18 +555,19 @@ feature -- Form fields and related --| error: if /= 0 , there was an error : TODO ... --| size: size of the file given by the http request -feature -- Cookies +feature {NONE} -- Cookies - cookies: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL] + cookies_table: HASH_TABLE [WGI_VALUE, READABLE_STRING_GENERAL] -- Expanded cookies variable local i,j,p,n: INTEGER - l_cookies: like internal_cookies - k,v: STRING + l_cookies: like internal_cookies_table + k,v,s: STRING do - l_cookies := internal_cookies + l_cookies := internal_cookies_table if l_cookies = Void then - if attached meta_variable ({WGI_META_NAMES}.http_cookie) as s then + if attached {WGI_STRING_VALUE} meta_variable ({WGI_META_NAMES}.http_cookie) as val then + s := val.value create l_cookies.make (5) from n := s.count @@ -561,94 +590,117 @@ feature -- Cookies v := s.substring (i + 1, j - 1) p := j + 1 end - l_cookies.force (v, k) + l_cookies.force (new_string_value (k, v), k) end end else create l_cookies.make (0) end - internal_cookies := l_cookies + internal_cookies_table := l_cookies end Result := l_cookies end - cookie (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 - -- Field for name `a_name'. +feature -- Cookies + + cookies: ITERATION_CURSOR [WGI_VALUE] do - Result := cookies.item (a_name) + Result := cookies_table.new_cursor end -feature -- Access: global variable + cookie (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE + -- Field for name `a_name'. + do + Result := cookies_table.item (a_name) + end - parameters: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL] +feature {NONE} -- Access: global variable + + items_table: HASH_TABLE [WGI_VALUE, READABLE_STRING_GENERAL] -- Table containing all the various variables -- Warning: this is computed each time, if you change the content of other containers -- this won't update this Result's content, unless you query it again local - vars: HASH_TABLE [READABLE_STRING_GENERAL, READABLE_STRING_GENERAL] + vars: ITERATION_CURSOR [WGI_VALUE] do create Result.make (100) vars := meta_variables from - vars.start +-- vars.start until vars.after loop - Result.force (vars.item_for_iteration.as_string_32, vars.key_for_iteration) + Result.force (vars.item, vars.item.name) vars.forth end vars := query_parameters from - vars.start +-- vars.start until vars.after loop - Result.force (vars.item_for_iteration.as_string_32, vars.key_for_iteration) + Result.force (vars.item, vars.item.name) vars.forth end vars := form_data_parameters from - vars.start +-- vars.start until vars.after loop - Result.force (vars.item_for_iteration.as_string_32, vars.key_for_iteration) + Result.force (vars.item, vars.item.name) vars.forth end vars := cookies from - vars.start +-- vars.start until vars.after loop - Result.force (vars.item_for_iteration.as_string_32, vars.key_for_iteration) + Result.force (vars.item, vars.item.name) vars.forth end end - parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 +feature -- Access: global variable + + items: ITERATION_CURSOR [WGI_VALUE] + do + Result := items_table.new_cursor + end + + item (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE -- Variable named `a_name' from any of the variables container -- and following a specific order -- execution, environment, get, post, cookies local - s: detachable READABLE_STRING_GENERAL + v: detachable WGI_VALUE do - s := meta_variable (a_name) - if s = Void then - s := query_parameter (a_name) - if s = Void then - s := form_data_parameter (a_name) - if s = Void then - s := cookie (a_name) + v := meta_variable (a_name) + if v = Void then + v := query_parameter (a_name) + if v = Void then + v := form_data_parameter (a_name) + if v = Void then + v := cookie (a_name) end end end - if s /= Void then - Result := s.as_string_32 +-- if s /= Void then +-- Result := s.as_string_32 +-- end + end + + string_item (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + do + if attached {WGI_STRING_VALUE} item (a_name) as val then + Result := val.value + else + check is_string_value: False end end end @@ -862,7 +914,7 @@ feature {NONE} -- Temporary File handling feature {NONE} -- Implementation: Form analyzer - analyze_multipart_form (t: STRING; s: STRING; vars: like form_data_parameters) + analyze_multipart_form (t: STRING; s: STRING; vars: like form_data_parameters_table) -- Analyze multipart form content --| FIXME[2011-06-21]: integrate eMIME parser library require @@ -928,7 +980,7 @@ feature {NONE} -- Implementation: Form analyzer end end - analyze_multipart_form_input (s: STRING; vars_post: like form_data_parameters) + analyze_multipart_form_input (s: STRING; vars_post: like form_data_parameters_table) -- Analyze multipart entry require s_not_empty: s /= Void and then not s.is_empty @@ -1035,7 +1087,7 @@ feature {NONE} -- Implementation: Form analyzer save_uploaded_file (l_content, l_up_file_info) uploaded_files.force (l_up_file_info, l_name) else - vars_post.force (l_content, l_name) + vars_post.force (new_string_value (l_name, l_content), l_name) end else error_handler.add_custom_error (0, "unamed multipart entry", Void) @@ -1075,13 +1127,13 @@ feature {NONE} -- Internal value end end - internal_query_parameters: detachable like query_parameters + internal_query_parameters_table: detachable like query_parameters_table -- cached value for `query_parameters' - internal_form_data_parameters: detachable like form_data_parameters + internal_form_data_parameters_table: detachable like form_data_parameters_table -- cached value for `form_fields' - internal_cookies: detachable like cookies + internal_cookies_table: detachable like cookies_table -- cached value for `cookies' feature {NONE} -- I/O: implementation @@ -1138,7 +1190,12 @@ feature {NONE} -- Implementation end end -feature {NONE} -- Implementation: utilities +feature {NONE} -- Implementation: utilities + + new_string_value (a_name: READABLE_STRING_GENERAL; a_value: READABLE_STRING_32): WGI_STRING_VALUE + do + create Result.make (a_name, a_value) + end empty_string: READABLE_STRING_32 -- Reusable empty string diff --git a/library/server/request/rest/src/contrib/doc/rest_api_documentation.e b/library/server/request/rest/src/contrib/doc/rest_api_documentation.e index 0d30b40e..f4364ac1 100644 --- a/library/server/request/rest/src/contrib/doc/rest_api_documentation.e +++ b/library/server/request/rest/src/contrib/doc/rest_api_documentation.e @@ -48,7 +48,10 @@ feature -- Execution rep.headers.put_content_type_text_html create s.make_empty - if attached ctx.path_parameter ("resource") as l_resource then + if + attached {WGI_STRING_VALUE} ctx.path_parameter ("resource") as l_resource_value and then + attached l_resource_value.value as l_resource + then from hdl_cursor := router.new_cursor until diff --git a/library/server/request/router/src/application/routed_application.e b/library/server/request/router/src/application/routed_application.e index 8c6d4313..848d57de 100644 --- a/library/server/request/router/src/application/routed_application.e +++ b/library/server/request/router/src/application/routed_application.e @@ -38,10 +38,15 @@ feature -- Execution execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) local l_handled: BOOLEAN + rescued: BOOLEAN do - l_handled := router.dispatch (req, res) - if not l_handled then - execute_default (req, res) + if not rescued then + l_handled := router.dispatch (req, res) + if not l_handled then + execute_default (req, res) + end + else + execute_rescue (req, res) end end @@ -49,6 +54,14 @@ feature -- Execution deferred end + execute_rescue (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) + do + if not res.header_committed then + res.write_header ({HTTP_STATUS_CODE}.internal_server_error, Void) + end + res.flush + end + note copyright: "2011-2011, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" diff --git a/library/server/request/router/src/context/request_handler_context.e b/library/server/request/router/src/context/request_handler_context.e index 92dcf745..aaa652ca 100644 --- a/library/server/request/router/src/context/request_handler_context.e +++ b/library/server/request/router/src/context/request_handler_context.e @@ -35,7 +35,7 @@ feature -- Query request_format (a_format_variable_name: detachable READABLE_STRING_GENERAL; content_type_supported: detachable ARRAY [READABLE_STRING_8]): detachable READABLE_STRING_8 -- Format id for the request based on {HTTP_FORMAT_CONSTANTS} do - if a_format_variable_name /= Void and then attached parameter (a_format_variable_name) as ctx_format then + if a_format_variable_name /= Void and then attached string_parameter (a_format_variable_name) as ctx_format then Result := ctx_format.as_string_8 else Result := content_type_to_request_format (request_content_type (content_type_supported)) @@ -107,27 +107,51 @@ feature -- Query feature -- Query - path_parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + path_parameter (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE -- Parameter value for path variable `a_name' deferred end - query_parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + query_parameter (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE -- Parameter value for query variable `a_name' --| i.e after the ? character deferred end - parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + parameter (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE -- Any parameter value for variable `a_name' -- URI template parameter and query parameters do - Result := query_parameter (a_name) + Result := query_parameter (a_name) if Result = Void then Result := path_parameter (a_name) end end +feature -- String query + + string_from (a_value: detachable WGI_VALUE): detachable READABLE_STRING_32 + do + if attached {WGI_STRING_VALUE} a_value as val then + Result := val.value + end + end + + string_path_parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + do + Result := string_from (path_parameter (a_name)) + end + + string_query_parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + do + Result := string_from (query_parameter (a_name)) + end + + string_parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + do + Result := string_from (parameter (a_name)) + end + ;note copyright: "2011-2011, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" diff --git a/library/server/request/router/src/context/request_uri_handler_context.e b/library/server/request/router/src/context/request_uri_handler_context.e index c6884918..bfb167f1 100644 --- a/library/server/request/router/src/context/request_uri_handler_context.e +++ b/library/server/request/router/src/context/request_uri_handler_context.e @@ -23,13 +23,13 @@ feature {NONE} -- Initialization feature -- Query - path_parameter (a_name: READABLE_STRING_GENERAL): detachable STRING_32 + path_parameter (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE do end - query_parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + query_parameter (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE do - Result := request.parameter (a_name) + Result := request.query_parameter (a_name) end note diff --git a/library/server/request/router/src/context/request_uri_template_handler_context.e b/library/server/request/router/src/context/request_uri_template_handler_context.e index 1d8aa5c8..5cf1c7db 100644 --- a/library/server/request/router/src/context/request_uri_template_handler_context.e +++ b/library/server/request/router/src/context/request_uri_template_handler_context.e @@ -31,16 +31,19 @@ feature -- Access feature -- Query - path_parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + path_parameter (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE do - Result := uri_template_match.url_decoded_path_variable (a_name) + if attached uri_template_match.url_decoded_path_variable (a_name) as s then + create {WGI_STRING_VALUE} Result.make (a_name, s) + end end - query_parameter (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 + query_parameter (a_name: READABLE_STRING_GENERAL): detachable WGI_VALUE do - Result := uri_template_match.url_decoded_query_variable (a_name) - if Result = Void then - Result := request.parameter (a_name) + if attached uri_template_match.url_decoded_query_variable (a_name) as s then + create {WGI_STRING_VALUE} Result.make (a_name, s) + else + Result := request.query_parameter (a_name) end end diff --git a/library/server/request/router/src/default/default_request_uri_routing_handler.e b/library/server/request/router/src/default/default_request_uri_routing_handler.e new file mode 100644 index 00000000..32f15bfa --- /dev/null +++ b/library/server/request/router/src/default/default_request_uri_routing_handler.e @@ -0,0 +1,33 @@ +note + description: "Summary description for {DEFAULT_REQUEST_URI_ROUTING_HANDLER}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + DEFAULT_REQUEST_URI_ROUTING_HANDLER + +inherit + REQUEST_URI_ROUTING_HANDLER [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT], REQUEST_URI_HANDLER_CONTEXT] + redefine + router + end + +create + make + +feature {NONE} -- Routing + + router: DEFAULT_REQUEST_URI_ROUTER + +;note + copyright: "2011-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 From 840ae1e6e4d27d4c55bfebc7060958845c22477d Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Wed, 14 Sep 2011 15:04:29 +0200 Subject: [PATCH 04/11] reorganized router library --- .../request/router/src/{utility => misc}/request_format_utility.e | 0 .../router/src/{helper => misc}/routed_application_helper.e | 0 .../request/router/src/{handler => }/request_agent_handler.e | 0 library/server/request/router/src/{handler => }/request_handler.e | 0 .../request/router/src/{context => }/request_handler_context.e | 0 library/server/request/router/src/{router => }/request_router.e | 0 .../request/router/src/{handler => }/request_routing_handler.e | 0 .../request/router/src/{application => }/routed_application.e | 0 .../router/src/{context => uri}/request_uri_handler_context.e | 0 .../request/router/src/{router => uri}/request_uri_router.e | 0 .../router/src/{handler => uri}/request_uri_routing_handler.e | 0 .../request_uri_template_handler_context.e | 0 .../src/{router => uri_template}/request_uri_template_router.e | 0 .../request_uri_template_routing_handler.e | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename library/server/request/router/src/{utility => misc}/request_format_utility.e (100%) rename library/server/request/router/src/{helper => misc}/routed_application_helper.e (100%) rename library/server/request/router/src/{handler => }/request_agent_handler.e (100%) rename library/server/request/router/src/{handler => }/request_handler.e (100%) rename library/server/request/router/src/{context => }/request_handler_context.e (100%) rename library/server/request/router/src/{router => }/request_router.e (100%) rename library/server/request/router/src/{handler => }/request_routing_handler.e (100%) rename library/server/request/router/src/{application => }/routed_application.e (100%) rename library/server/request/router/src/{context => uri}/request_uri_handler_context.e (100%) rename library/server/request/router/src/{router => uri}/request_uri_router.e (100%) rename library/server/request/router/src/{handler => uri}/request_uri_routing_handler.e (100%) rename library/server/request/router/src/{context => uri_template}/request_uri_template_handler_context.e (100%) rename library/server/request/router/src/{router => uri_template}/request_uri_template_router.e (100%) rename library/server/request/router/src/{handler => uri_template}/request_uri_template_routing_handler.e (100%) diff --git a/library/server/request/router/src/utility/request_format_utility.e b/library/server/request/router/src/misc/request_format_utility.e similarity index 100% rename from library/server/request/router/src/utility/request_format_utility.e rename to library/server/request/router/src/misc/request_format_utility.e diff --git a/library/server/request/router/src/helper/routed_application_helper.e b/library/server/request/router/src/misc/routed_application_helper.e similarity index 100% rename from library/server/request/router/src/helper/routed_application_helper.e rename to library/server/request/router/src/misc/routed_application_helper.e diff --git a/library/server/request/router/src/handler/request_agent_handler.e b/library/server/request/router/src/request_agent_handler.e similarity index 100% rename from library/server/request/router/src/handler/request_agent_handler.e rename to library/server/request/router/src/request_agent_handler.e diff --git a/library/server/request/router/src/handler/request_handler.e b/library/server/request/router/src/request_handler.e similarity index 100% rename from library/server/request/router/src/handler/request_handler.e rename to library/server/request/router/src/request_handler.e diff --git a/library/server/request/router/src/context/request_handler_context.e b/library/server/request/router/src/request_handler_context.e similarity index 100% rename from library/server/request/router/src/context/request_handler_context.e rename to library/server/request/router/src/request_handler_context.e diff --git a/library/server/request/router/src/router/request_router.e b/library/server/request/router/src/request_router.e similarity index 100% rename from library/server/request/router/src/router/request_router.e rename to library/server/request/router/src/request_router.e diff --git a/library/server/request/router/src/handler/request_routing_handler.e b/library/server/request/router/src/request_routing_handler.e similarity index 100% rename from library/server/request/router/src/handler/request_routing_handler.e rename to library/server/request/router/src/request_routing_handler.e diff --git a/library/server/request/router/src/application/routed_application.e b/library/server/request/router/src/routed_application.e similarity index 100% rename from library/server/request/router/src/application/routed_application.e rename to library/server/request/router/src/routed_application.e diff --git a/library/server/request/router/src/context/request_uri_handler_context.e b/library/server/request/router/src/uri/request_uri_handler_context.e similarity index 100% rename from library/server/request/router/src/context/request_uri_handler_context.e rename to library/server/request/router/src/uri/request_uri_handler_context.e diff --git a/library/server/request/router/src/router/request_uri_router.e b/library/server/request/router/src/uri/request_uri_router.e similarity index 100% rename from library/server/request/router/src/router/request_uri_router.e rename to library/server/request/router/src/uri/request_uri_router.e diff --git a/library/server/request/router/src/handler/request_uri_routing_handler.e b/library/server/request/router/src/uri/request_uri_routing_handler.e similarity index 100% rename from library/server/request/router/src/handler/request_uri_routing_handler.e rename to library/server/request/router/src/uri/request_uri_routing_handler.e diff --git a/library/server/request/router/src/context/request_uri_template_handler_context.e b/library/server/request/router/src/uri_template/request_uri_template_handler_context.e similarity index 100% rename from library/server/request/router/src/context/request_uri_template_handler_context.e rename to library/server/request/router/src/uri_template/request_uri_template_handler_context.e diff --git a/library/server/request/router/src/router/request_uri_template_router.e b/library/server/request/router/src/uri_template/request_uri_template_router.e similarity index 100% rename from library/server/request/router/src/router/request_uri_template_router.e rename to library/server/request/router/src/uri_template/request_uri_template_router.e diff --git a/library/server/request/router/src/handler/request_uri_template_routing_handler.e b/library/server/request/router/src/uri_template/request_uri_template_routing_handler.e similarity index 100% rename from library/server/request/router/src/handler/request_uri_template_routing_handler.e rename to library/server/request/router/src/uri_template/request_uri_template_routing_handler.e From 1e3770d72406fd93ffbf03be2006cdac30dc0f1e Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Wed, 14 Sep 2011 15:39:37 +0200 Subject: [PATCH 05/11] some renaming to use _I for the generic classes, and removed the DEFAULT_ prefix for default implementation this should makes things easier for new users --- .../{rest_application.e => rest_application_i.e} | 2 +- .../rest/src/context/rest_request_uri_handler_context.e | 4 ++-- .../context/rest_request_uri_template_handler_context.e | 4 ++-- .../request/rest/src/contrib/doc/rest_api_documentation.e | 2 +- .../{default_rest_application.e => rest_application.e} | 4 ++-- ...t_request_uri_handler.e => rest_request_uri_handler.e} | 2 +- ...est_request_uri_router.e => rest_request_uri_router.e} | 4 ++-- ...late_handler.e => rest_request_uri_template_handler.e} | 2 +- ...mplate_router.e => rest_request_uri_template_router.e} | 4 ++-- ...dler.e => rest_request_uri_template_routing_handler.e} | 6 +++--- ...ault_rest_uri_application.e => rest_uri_application.e} | 6 +++--- ...late_application.e => rest_uri_template_application.e} | 6 +++--- ...ing_handler.e => rest_request_uri_routing_handler_i.e} | 8 ++++---- ...er.e => rest_request_uri_template_routing_handler_i.e} | 8 ++++---- ...t_request_uri_router.e => rest_request_uri_router_i.e} | 4 ++-- ...late_router.e => rest_request_uri_template_router_i.e} | 4 ++-- ...{default_request_uri_router.e => request_uri_router.e} | 8 ++++---- ...ri_routing_handler.e => request_uri_routing_handler.e} | 6 +++--- ...ri_template_router.e => request_uri_template_router.e} | 8 ++++---- ...g_handler.e => request_uri_template_routing_handler.e} | 6 +++--- ..._uri_routed_application.e => uri_routed_application.e} | 6 +++--- ...ed_application.e => uri_template_routed_application.e} | 6 +++--- ..._handler_context.e => request_uri_handler_context_i.e} | 2 +- .../uri/{request_uri_router.e => request_uri_router_i.e} | 2 +- ..._routing_handler.e => request_uri_routing_handler_i.e} | 6 +++--- ...context.e => request_uri_template_handler_context_i.e} | 2 +- ..._template_router.e => request_uri_template_router_i.e} | 2 +- ...handler.e => request_uri_template_routing_handler_i.e} | 6 +++--- 28 files changed, 65 insertions(+), 65 deletions(-) rename library/server/request/rest/src/application/{rest_application.e => rest_application_i.e} (88%) rename library/server/request/rest/src/default/{default_rest_application.e => rest_application.e} (80%) rename library/server/request/rest/src/default/{default_rest_request_uri_handler.e => rest_request_uri_handler.e} (94%) rename library/server/request/rest/src/default/{default_rest_request_uri_router.e => rest_request_uri_router.e} (86%) rename library/server/request/rest/src/default/{default_rest_request_uri_template_handler.e => rest_request_uri_template_handler.e} (93%) rename library/server/request/rest/src/default/{default_rest_request_uri_template_router.e => rest_request_uri_template_router.e} (84%) rename library/server/request/rest/src/default/{default_rest_request_uri_template_routing_handler.e => rest_request_uri_template_routing_handler.e} (70%) rename library/server/request/rest/src/default/{default_rest_uri_application.e => rest_uri_application.e} (75%) rename library/server/request/rest/src/default/{default_rest_uri_template_application.e => rest_uri_template_application.e} (72%) rename library/server/request/rest/src/handler/{rest_request_uri_routing_handler.e => rest_request_uri_routing_handler_i.e} (86%) rename library/server/request/rest/src/handler/{rest_request_uri_template_routing_handler.e => rest_request_uri_template_routing_handler_i.e} (84%) rename library/server/request/rest/src/router/{rest_request_uri_router.e => rest_request_uri_router_i.e} (84%) rename library/server/request/rest/src/router/{rest_request_uri_template_router.e => rest_request_uri_template_router_i.e} (76%) rename library/server/request/router/src/default/{default_request_uri_router.e => request_uri_router.e} (73%) rename library/server/request/router/src/default/{default_request_uri_routing_handler.e => request_uri_routing_handler.e} (76%) rename library/server/request/router/src/default/{default_request_uri_template_router.e => request_uri_template_router.e} (81%) rename library/server/request/router/src/default/{default_request_uri_template_routing_handler.e => request_uri_template_routing_handler.e} (72%) rename library/server/request/router/src/default/{default_uri_routed_application.e => uri_routed_application.e} (85%) rename library/server/request/router/src/default/{default_uri_template_routed_application.e => uri_template_routed_application.e} (82%) rename library/server/request/router/src/uri/{request_uri_handler_context.e => request_uri_handler_context_i.e} (96%) rename library/server/request/router/src/uri/{request_uri_router.e => request_uri_router_i.e} (97%) rename library/server/request/router/src/uri/{request_uri_routing_handler.e => request_uri_routing_handler_i.e} (80%) rename library/server/request/router/src/uri_template/{request_uri_template_handler_context.e => request_uri_template_handler_context_i.e} (97%) rename library/server/request/router/src/uri_template/{request_uri_template_router.e => request_uri_template_router_i.e} (97%) rename library/server/request/router/src/uri_template/{request_uri_template_routing_handler.e => request_uri_template_routing_handler_i.e} (78%) diff --git a/library/server/request/rest/src/application/rest_application.e b/library/server/request/rest/src/application/rest_application_i.e similarity index 88% rename from library/server/request/rest/src/application/rest_application.e rename to library/server/request/rest/src/application/rest_application_i.e index b4536020..4591dee5 100644 --- a/library/server/request/rest/src/application/rest_application.e +++ b/library/server/request/rest/src/application/rest_application_i.e @@ -5,7 +5,7 @@ note revision: "$Revision$" deferred class - REST_APPLICATION [H -> REST_REQUEST_HANDLER [C], C -> REST_REQUEST_HANDLER_CONTEXT] + REST_APPLICATION_I [H -> REST_REQUEST_HANDLER [C], C -> REST_REQUEST_HANDLER_CONTEXT] inherit ROUTED_APPLICATION [H, C] diff --git a/library/server/request/rest/src/context/rest_request_uri_handler_context.e b/library/server/request/rest/src/context/rest_request_uri_handler_context.e index d9f91e76..69224ecd 100644 --- a/library/server/request/rest/src/context/rest_request_uri_handler_context.e +++ b/library/server/request/rest/src/context/rest_request_uri_handler_context.e @@ -8,7 +8,7 @@ class REST_REQUEST_URI_HANDLER_CONTEXT inherit - REQUEST_URI_HANDLER_CONTEXT + REQUEST_URI_HANDLER_CONTEXT_I REST_REQUEST_HANDLER_CONTEXT @@ -16,7 +16,7 @@ create make note - copyright: "2011-2011, Eiffel Software and others" + 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 diff --git a/library/server/request/rest/src/context/rest_request_uri_template_handler_context.e b/library/server/request/rest/src/context/rest_request_uri_template_handler_context.e index eefa61e7..cbc36a31 100644 --- a/library/server/request/rest/src/context/rest_request_uri_template_handler_context.e +++ b/library/server/request/rest/src/context/rest_request_uri_template_handler_context.e @@ -8,7 +8,7 @@ class REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT inherit - REQUEST_URI_TEMPLATE_HANDLER_CONTEXT + REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I REST_REQUEST_HANDLER_CONTEXT @@ -16,7 +16,7 @@ create make note - copyright: "2011-2011, Eiffel Software and others" + 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 diff --git a/library/server/request/rest/src/contrib/doc/rest_api_documentation.e b/library/server/request/rest/src/contrib/doc/rest_api_documentation.e index f4364ac1..276b2653 100644 --- a/library/server/request/rest/src/contrib/doc/rest_api_documentation.e +++ b/library/server/request/rest/src/contrib/doc/rest_api_documentation.e @@ -188,7 +188,7 @@ feature -- Execution s.append_string ("") end s.append_string ("
Authentication required: " + rq.authentication_required.out + "
") - if attached {REST_REQUEST_URI_TEMPLATE_ROUTER [REST_REQUEST_HANDLER [REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT]} router as l_uri_template_router then + if attached {REST_REQUEST_URI_TEMPLATE_ROUTER_I [REST_REQUEST_HANDLER [REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT]} router as l_uri_template_router then create l_uri_tpl.make (a_resource) if attached l_uri_tpl.query_variable_names as l_query_variable_names and then not l_query_variable_names.is_empty then s.append_string ("
Query parameters: ") diff --git a/library/server/request/rest/src/default/default_rest_application.e b/library/server/request/rest/src/default/rest_application.e similarity index 80% rename from library/server/request/rest/src/default/default_rest_application.e rename to library/server/request/rest/src/default/rest_application.e index 3c8ee966..4d5bbaa6 100644 --- a/library/server/request/rest/src/default/default_rest_application.e +++ b/library/server/request/rest/src/default/rest_application.e @@ -5,10 +5,10 @@ note revision: "$Revision$" deferred class - DEFAULT_REST_APPLICATION + REST_APPLICATION inherit - REST_APPLICATION [REST_REQUEST_HANDLER [REST_REQUEST_HANDLER_CONTEXT], REST_REQUEST_HANDLER_CONTEXT] + REST_APPLICATION_I [REST_REQUEST_HANDLER [REST_REQUEST_HANDLER_CONTEXT], REST_REQUEST_HANDLER_CONTEXT] note copyright: "Copyright (c) 1984-2011, Eiffel Software and others" diff --git a/library/server/request/rest/src/default/default_rest_request_uri_handler.e b/library/server/request/rest/src/default/rest_request_uri_handler.e similarity index 94% rename from library/server/request/rest/src/default/default_rest_request_uri_handler.e rename to library/server/request/rest/src/default/rest_request_uri_handler.e index efbf0ed7..1d162808 100644 --- a/library/server/request/rest/src/default/default_rest_request_uri_handler.e +++ b/library/server/request/rest/src/default/rest_request_uri_handler.e @@ -5,7 +5,7 @@ note revision: "$Revision$" deferred class - DEFAULT_REST_REQUEST_URI_HANDLER + REST_REQUEST_URI_HANDLER inherit REST_REQUEST_HANDLER [REST_REQUEST_URI_HANDLER_CONTEXT] diff --git a/library/server/request/rest/src/default/default_rest_request_uri_router.e b/library/server/request/rest/src/default/rest_request_uri_router.e similarity index 86% rename from library/server/request/rest/src/default/default_rest_request_uri_router.e rename to library/server/request/rest/src/default/rest_request_uri_router.e index 854f9c68..af2079f0 100644 --- a/library/server/request/rest/src/default/default_rest_request_uri_router.e +++ b/library/server/request/rest/src/default/rest_request_uri_router.e @@ -5,10 +5,10 @@ note revision: "$Revision$" class - DEFAULT_REST_REQUEST_URI_ROUTER + REST_REQUEST_URI_ROUTER inherit - REST_REQUEST_URI_ROUTER [REST_REQUEST_HANDLER [REST_REQUEST_URI_HANDLER_CONTEXT], REST_REQUEST_URI_HANDLER_CONTEXT] + REST_REQUEST_URI_ROUTER_I [REST_REQUEST_HANDLER [REST_REQUEST_URI_HANDLER_CONTEXT], REST_REQUEST_URI_HANDLER_CONTEXT] redefine map_agent_with_request_methods end diff --git a/library/server/request/rest/src/default/default_rest_request_uri_template_handler.e b/library/server/request/rest/src/default/rest_request_uri_template_handler.e similarity index 93% rename from library/server/request/rest/src/default/default_rest_request_uri_template_handler.e rename to library/server/request/rest/src/default/rest_request_uri_template_handler.e index a637ed60..59198577 100644 --- a/library/server/request/rest/src/default/default_rest_request_uri_template_handler.e +++ b/library/server/request/rest/src/default/rest_request_uri_template_handler.e @@ -5,7 +5,7 @@ note revision: "$Revision$" deferred class - DEFAULT_REST_REQUEST_URI_TEMPLATE_HANDLER + REST_REQUEST_URI_TEMPLATE_HANDLER inherit REST_REQUEST_HANDLER [REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] diff --git a/library/server/request/rest/src/default/default_rest_request_uri_template_router.e b/library/server/request/rest/src/default/rest_request_uri_template_router.e similarity index 84% rename from library/server/request/rest/src/default/default_rest_request_uri_template_router.e rename to library/server/request/rest/src/default/rest_request_uri_template_router.e index 2054255b..4ee89e57 100644 --- a/library/server/request/rest/src/default/default_rest_request_uri_template_router.e +++ b/library/server/request/rest/src/default/rest_request_uri_template_router.e @@ -5,10 +5,10 @@ note revision: "$Revision$" class - DEFAULT_REST_REQUEST_URI_TEMPLATE_ROUTER + REST_REQUEST_URI_TEMPLATE_ROUTER inherit - REST_REQUEST_URI_TEMPLATE_ROUTER [REST_REQUEST_HANDLER [REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] + REST_REQUEST_URI_TEMPLATE_ROUTER_I [REST_REQUEST_HANDLER [REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] redefine map_agent_with_request_methods end diff --git a/library/server/request/rest/src/default/default_rest_request_uri_template_routing_handler.e b/library/server/request/rest/src/default/rest_request_uri_template_routing_handler.e similarity index 70% rename from library/server/request/rest/src/default/default_rest_request_uri_template_routing_handler.e rename to library/server/request/rest/src/default/rest_request_uri_template_routing_handler.e index 67c37924..f89361ab 100644 --- a/library/server/request/rest/src/default/default_rest_request_uri_template_routing_handler.e +++ b/library/server/request/rest/src/default/rest_request_uri_template_routing_handler.e @@ -5,10 +5,10 @@ note revision: "$Revision$" class - DEFAULT_REST_REQUEST_URI_TEMPLATE_ROUTING_HANDLER + REST_REQUEST_URI_TEMPLATE_ROUTING_HANDLER inherit - REST_REQUEST_URI_TEMPLATE_ROUTING_HANDLER [REST_REQUEST_HANDLER [REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] + REST_REQUEST_URI_TEMPLATE_ROUTING_HANDLER_I [REST_REQUEST_HANDLER [REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] redefine router end @@ -18,7 +18,7 @@ create feature {NONE} -- Routing - router: DEFAULT_REST_REQUEST_URI_TEMPLATE_ROUTER + router: REST_REQUEST_URI_TEMPLATE_ROUTER ;note copyright: "Copyright (c) 1984-2011, Eiffel Software and others" diff --git a/library/server/request/rest/src/default/default_rest_uri_application.e b/library/server/request/rest/src/default/rest_uri_application.e similarity index 75% rename from library/server/request/rest/src/default/default_rest_uri_application.e rename to library/server/request/rest/src/default/rest_uri_application.e index b6bdd088..7ef6e0ff 100644 --- a/library/server/request/rest/src/default/default_rest_uri_application.e +++ b/library/server/request/rest/src/default/rest_uri_application.e @@ -5,17 +5,17 @@ note revision: "$Revision$" deferred class - DEFAULT_REST_URI_APPLICATION + REST_URI_APPLICATION inherit - REST_APPLICATION [REST_REQUEST_HANDLER [REST_REQUEST_URI_HANDLER_CONTEXT], REST_REQUEST_URI_HANDLER_CONTEXT] + REST_APPLICATION_I [REST_REQUEST_HANDLER [REST_REQUEST_URI_HANDLER_CONTEXT], REST_REQUEST_URI_HANDLER_CONTEXT] redefine router end feature -- Router - router: DEFAULT_REST_REQUEST_URI_ROUTER + router: REST_REQUEST_URI_ROUTER ;note copyright: "Copyright (c) 1984-2011, Eiffel Software and others" diff --git a/library/server/request/rest/src/default/default_rest_uri_template_application.e b/library/server/request/rest/src/default/rest_uri_template_application.e similarity index 72% rename from library/server/request/rest/src/default/default_rest_uri_template_application.e rename to library/server/request/rest/src/default/rest_uri_template_application.e index 0f1e76c6..753d49ea 100644 --- a/library/server/request/rest/src/default/default_rest_uri_template_application.e +++ b/library/server/request/rest/src/default/rest_uri_template_application.e @@ -5,17 +5,17 @@ note revision: "$Revision$" deferred class - DEFAULT_REST_URI_TEMPLATE_APPLICATION + REST_URI_TEMPLATE_APPLICATION inherit - REST_APPLICATION [REST_REQUEST_HANDLER [REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] + REST_APPLICATION_I [REST_REQUEST_HANDLER [REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] redefine router end feature -- Router - router: DEFAULT_REST_REQUEST_URI_TEMPLATE_ROUTER + router: REST_REQUEST_URI_TEMPLATE_ROUTER ;note copyright: "Copyright (c) 1984-2011, Eiffel Software and others" diff --git a/library/server/request/rest/src/handler/rest_request_uri_routing_handler.e b/library/server/request/rest/src/handler/rest_request_uri_routing_handler_i.e similarity index 86% rename from library/server/request/rest/src/handler/rest_request_uri_routing_handler.e rename to library/server/request/rest/src/handler/rest_request_uri_routing_handler_i.e index 6d6fb2f1..80365a96 100644 --- a/library/server/request/rest/src/handler/rest_request_uri_routing_handler.e +++ b/library/server/request/rest/src/handler/rest_request_uri_routing_handler_i.e @@ -5,11 +5,11 @@ note revision: "$Revision$" class - REST_REQUEST_URI_ROUTING_HANDLER [H -> REST_REQUEST_HANDLER [C], + REST_REQUEST_URI_ROUTING_HANDLER_I [H -> REST_REQUEST_HANDLER [C], C -> REST_REQUEST_URI_HANDLER_CONTEXT create make end] inherit - REQUEST_URI_ROUTING_HANDLER [H, C] + REQUEST_URI_ROUTING_HANDLER_I [H, C] redefine router, execute @@ -22,7 +22,7 @@ inherit create make - + feature -- Status report authentication_required: BOOLEAN @@ -36,7 +36,7 @@ feature -- Execution feature {NONE} -- Routing - router: REST_REQUEST_URI_ROUTER [H, C] + router: REST_REQUEST_URI_ROUTER_I [H, C] ;note copyright: "Copyright (c) 1984-2011, Eiffel Software and others" diff --git a/library/server/request/rest/src/handler/rest_request_uri_template_routing_handler.e b/library/server/request/rest/src/handler/rest_request_uri_template_routing_handler_i.e similarity index 84% rename from library/server/request/rest/src/handler/rest_request_uri_template_routing_handler.e rename to library/server/request/rest/src/handler/rest_request_uri_template_routing_handler_i.e index 606df5dc..e622203f 100644 --- a/library/server/request/rest/src/handler/rest_request_uri_template_routing_handler.e +++ b/library/server/request/rest/src/handler/rest_request_uri_template_routing_handler_i.e @@ -5,11 +5,11 @@ note revision: "$Revision$" class - REST_REQUEST_URI_TEMPLATE_ROUTING_HANDLER [H -> REST_REQUEST_HANDLER [C], + REST_REQUEST_URI_TEMPLATE_ROUTING_HANDLER_I [H -> REST_REQUEST_HANDLER [C], C -> REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT create make end] inherit - REQUEST_URI_TEMPLATE_ROUTING_HANDLER [H, C] + REQUEST_URI_TEMPLATE_ROUTING_HANDLER_I [H, C] redefine router, execute @@ -22,7 +22,7 @@ inherit create make - + feature -- Status report authentication_required: BOOLEAN @@ -36,7 +36,7 @@ feature -- Execution feature {NONE} -- Routing - router: REST_REQUEST_URI_TEMPLATE_ROUTER [H, C] + router: REST_REQUEST_URI_TEMPLATE_ROUTER_I [H, C] ;note copyright: "Copyright (c) 1984-2011, Eiffel Software and others" diff --git a/library/server/request/rest/src/router/rest_request_uri_router.e b/library/server/request/rest/src/router/rest_request_uri_router_i.e similarity index 84% rename from library/server/request/rest/src/router/rest_request_uri_router.e rename to library/server/request/rest/src/router/rest_request_uri_router_i.e index 57a0a362..2d27de34 100644 --- a/library/server/request/rest/src/router/rest_request_uri_router.e +++ b/library/server/request/rest/src/router/rest_request_uri_router_i.e @@ -5,10 +5,10 @@ note revision: "$Revision$" class - REST_REQUEST_URI_ROUTER [H -> REST_REQUEST_HANDLER [C], C -> REST_REQUEST_URI_HANDLER_CONTEXT create make end] + REST_REQUEST_URI_ROUTER_I [H -> REST_REQUEST_HANDLER [C], C -> REST_REQUEST_URI_HANDLER_CONTEXT create make end] inherit - REQUEST_URI_ROUTER [H, C] + REQUEST_URI_ROUTER_I [H, C] REST_REQUEST_ROUTER [H, C] diff --git a/library/server/request/rest/src/router/rest_request_uri_template_router.e b/library/server/request/rest/src/router/rest_request_uri_template_router_i.e similarity index 76% rename from library/server/request/rest/src/router/rest_request_uri_template_router.e rename to library/server/request/rest/src/router/rest_request_uri_template_router_i.e index d023dd3e..14987a13 100644 --- a/library/server/request/rest/src/router/rest_request_uri_template_router.e +++ b/library/server/request/rest/src/router/rest_request_uri_template_router_i.e @@ -5,10 +5,10 @@ note revision: "$Revision$" class - REST_REQUEST_URI_TEMPLATE_ROUTER [H -> REST_REQUEST_HANDLER [C], C -> REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT create make end] + REST_REQUEST_URI_TEMPLATE_ROUTER_I [H -> REST_REQUEST_HANDLER [C], C -> REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT create make end] inherit - REQUEST_URI_TEMPLATE_ROUTER [H, C] + REQUEST_URI_TEMPLATE_ROUTER_I [H, C] REST_REQUEST_ROUTER [H, C] diff --git a/library/server/request/router/src/default/default_request_uri_router.e b/library/server/request/router/src/default/request_uri_router.e similarity index 73% rename from library/server/request/router/src/default/default_request_uri_router.e rename to library/server/request/router/src/default/request_uri_router.e index 2c96678f..60a45988 100644 --- a/library/server/request/router/src/default/default_request_uri_router.e +++ b/library/server/request/router/src/default/request_uri_router.e @@ -5,10 +5,10 @@ note revision: "$Revision$" class - DEFAULT_REQUEST_URI_ROUTER + REQUEST_URI_ROUTER inherit - REQUEST_URI_ROUTER [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT], REQUEST_URI_HANDLER_CONTEXT] + REQUEST_URI_ROUTER_I [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT_I], REQUEST_URI_HANDLER_CONTEXT_I] redefine map_agent_with_request_methods end @@ -17,10 +17,10 @@ create feature -- Mapping - map_agent_with_request_methods (a_id: READABLE_STRING_8; a_action: PROCEDURE [ANY, TUPLE [ctx: 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: REQUEST_URI_HANDLER_CONTEXT_I; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER]]; rqst_methods: detachable ARRAY [READABLE_STRING_8]) local - h: REQUEST_AGENT_HANDLER [REQUEST_URI_HANDLER_CONTEXT] + h: REQUEST_AGENT_HANDLER [REQUEST_URI_HANDLER_CONTEXT_I] do create h.make (a_action) map_with_request_methods (a_id, h, rqst_methods) diff --git a/library/server/request/router/src/default/default_request_uri_routing_handler.e b/library/server/request/router/src/default/request_uri_routing_handler.e similarity index 76% rename from library/server/request/router/src/default/default_request_uri_routing_handler.e rename to library/server/request/router/src/default/request_uri_routing_handler.e index 32f15bfa..83b6358f 100644 --- a/library/server/request/router/src/default/default_request_uri_routing_handler.e +++ b/library/server/request/router/src/default/request_uri_routing_handler.e @@ -5,10 +5,10 @@ note revision: "$Revision$" class - DEFAULT_REQUEST_URI_ROUTING_HANDLER + REQUEST_URI_ROUTING_HANDLER inherit - REQUEST_URI_ROUTING_HANDLER [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT], REQUEST_URI_HANDLER_CONTEXT] + REQUEST_URI_ROUTING_HANDLER_I [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT_I], REQUEST_URI_HANDLER_CONTEXT_I] redefine router end @@ -18,7 +18,7 @@ create feature {NONE} -- Routing - router: DEFAULT_REQUEST_URI_ROUTER + router: REQUEST_URI_ROUTER ;note copyright: "2011-2011, Eiffel Software and others" diff --git a/library/server/request/router/src/default/default_request_uri_template_router.e b/library/server/request/router/src/default/request_uri_template_router.e similarity index 81% rename from library/server/request/router/src/default/default_request_uri_template_router.e rename to library/server/request/router/src/default/request_uri_template_router.e index 8ed69b4c..f0f9687e 100644 --- a/library/server/request/router/src/default/default_request_uri_template_router.e +++ b/library/server/request/router/src/default/request_uri_template_router.e @@ -5,10 +5,10 @@ note revision: "$Revision$" class - DEFAULT_REQUEST_URI_TEMPLATE_ROUTER + REQUEST_URI_TEMPLATE_ROUTER inherit - REQUEST_URI_TEMPLATE_ROUTER [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] + REQUEST_URI_TEMPLATE_ROUTER_I [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I] redefine map_agent_with_request_methods end @@ -18,10 +18,10 @@ create feature -- Mapping - map_agent_with_request_methods (a_id: READABLE_STRING_8; a_action: PROCEDURE [ANY, TUPLE [ctx: 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: REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER]]; rqst_methods: detachable ARRAY [READABLE_STRING_8]) local - h: REQUEST_AGENT_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] + h: REQUEST_AGENT_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I] do create h.make (a_action) map_with_request_methods (a_id, h, rqst_methods) diff --git a/library/server/request/router/src/default/default_request_uri_template_routing_handler.e b/library/server/request/router/src/default/request_uri_template_routing_handler.e similarity index 72% rename from library/server/request/router/src/default/default_request_uri_template_routing_handler.e rename to library/server/request/router/src/default/request_uri_template_routing_handler.e index f042fa00..0df31c5c 100644 --- a/library/server/request/router/src/default/default_request_uri_template_routing_handler.e +++ b/library/server/request/router/src/default/request_uri_template_routing_handler.e @@ -5,10 +5,10 @@ note revision: "$Revision$" class - DEFAULT_REQUEST_URI_TEMPLATE_ROUTING_HANDLER + REQUEST_URI_TEMPLATE_ROUTING_HANDLER inherit - REQUEST_URI_TEMPLATE_ROUTING_HANDLER [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] + REQUEST_URI_TEMPLATE_ROUTING_HANDLER_I [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I] redefine router end @@ -18,7 +18,7 @@ create feature {NONE} -- Routing - router: DEFAULT_REQUEST_URI_TEMPLATE_ROUTER + router: REQUEST_URI_TEMPLATE_ROUTER ;note copyright: "2011-2011, Eiffel Software and others" diff --git a/library/server/request/router/src/default/default_uri_routed_application.e b/library/server/request/router/src/default/uri_routed_application.e similarity index 85% rename from library/server/request/router/src/default/default_uri_routed_application.e rename to library/server/request/router/src/default/uri_routed_application.e index 831f134d..f8410b9a 100644 --- a/library/server/request/router/src/default/default_uri_routed_application.e +++ b/library/server/request/router/src/default/uri_routed_application.e @@ -5,17 +5,17 @@ note revision: "$Revision$" deferred class - DEFAULT_URI_ROUTED_APPLICATION + URI_ROUTED_APPLICATION inherit - ROUTED_APPLICATION [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT], REQUEST_URI_HANDLER_CONTEXT] + ROUTED_APPLICATION [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT_I], REQUEST_URI_HANDLER_CONTEXT_I] redefine router end feature -- Router - router: DEFAULT_REQUEST_URI_ROUTER + router: REQUEST_URI_ROUTER ;note copyright: "2011-2011, Eiffel Software and others" diff --git a/library/server/request/router/src/default/default_uri_template_routed_application.e b/library/server/request/router/src/default/uri_template_routed_application.e similarity index 82% rename from library/server/request/router/src/default/default_uri_template_routed_application.e rename to library/server/request/router/src/default/uri_template_routed_application.e index 155b1aa0..bc174e35 100644 --- a/library/server/request/router/src/default/default_uri_template_routed_application.e +++ b/library/server/request/router/src/default/uri_template_routed_application.e @@ -5,17 +5,17 @@ note revision: "$Revision$" deferred class - DEFAULT_URI_TEMPLATE_ROUTED_APPLICATION + URI_TEMPLATE_ROUTED_APPLICATION inherit - ROUTED_APPLICATION [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] + ROUTED_APPLICATION [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I] redefine router end feature -- Router - router: DEFAULT_REQUEST_URI_TEMPLATE_ROUTER + router: REQUEST_URI_TEMPLATE_ROUTER ;note copyright: "2011-2011, Eiffel Software and others" diff --git a/library/server/request/router/src/uri/request_uri_handler_context.e b/library/server/request/router/src/uri/request_uri_handler_context_i.e similarity index 96% rename from library/server/request/router/src/uri/request_uri_handler_context.e rename to library/server/request/router/src/uri/request_uri_handler_context_i.e index bfb167f1..c5289fe5 100644 --- a/library/server/request/router/src/uri/request_uri_handler_context.e +++ b/library/server/request/router/src/uri/request_uri_handler_context_i.e @@ -5,7 +5,7 @@ note revision: "$Revision$" class - REQUEST_URI_HANDLER_CONTEXT + REQUEST_URI_HANDLER_CONTEXT_I inherit REQUEST_HANDLER_CONTEXT diff --git a/library/server/request/router/src/uri/request_uri_router.e b/library/server/request/router/src/uri/request_uri_router_i.e similarity index 97% rename from library/server/request/router/src/uri/request_uri_router.e rename to library/server/request/router/src/uri/request_uri_router_i.e index eb272ad7..0b927fcb 100644 --- a/library/server/request/router/src/uri/request_uri_router.e +++ b/library/server/request/router/src/uri/request_uri_router_i.e @@ -5,7 +5,7 @@ note revision: "$Revision$" class - REQUEST_URI_ROUTER [H -> REQUEST_HANDLER [C], C -> REQUEST_URI_HANDLER_CONTEXT create make end] + REQUEST_URI_ROUTER_I [H -> REQUEST_HANDLER [C], C -> REQUEST_URI_HANDLER_CONTEXT_I create make end] inherit REQUEST_ROUTER [H, C] diff --git a/library/server/request/router/src/uri/request_uri_routing_handler.e b/library/server/request/router/src/uri/request_uri_routing_handler_i.e similarity index 80% rename from library/server/request/router/src/uri/request_uri_routing_handler.e rename to library/server/request/router/src/uri/request_uri_routing_handler_i.e index ff522762..413cc987 100644 --- a/library/server/request/router/src/uri/request_uri_routing_handler.e +++ b/library/server/request/router/src/uri/request_uri_routing_handler_i.e @@ -5,8 +5,8 @@ note revision: "$Revision$" class - REQUEST_URI_ROUTING_HANDLER [H -> REQUEST_HANDLER [C], - C -> REQUEST_URI_HANDLER_CONTEXT create make end] + REQUEST_URI_ROUTING_HANDLER_I [H -> REQUEST_HANDLER [C], + C -> REQUEST_URI_HANDLER_CONTEXT_I create make end] inherit REQUEST_ROUTING_HANDLER [H, C] @@ -23,7 +23,7 @@ feature {NONE} -- Initialization feature {NONE} -- Routing - router: REQUEST_URI_ROUTER [H, C] + router: REQUEST_URI_ROUTER_I [H, C] ;note copyright: "2011-2011, Eiffel Software and others" diff --git a/library/server/request/router/src/uri_template/request_uri_template_handler_context.e b/library/server/request/router/src/uri_template/request_uri_template_handler_context_i.e similarity index 97% rename from library/server/request/router/src/uri_template/request_uri_template_handler_context.e rename to library/server/request/router/src/uri_template/request_uri_template_handler_context_i.e index 5cf1c7db..312aaaf8 100644 --- a/library/server/request/router/src/uri_template/request_uri_template_handler_context.e +++ b/library/server/request/router/src/uri_template/request_uri_template_handler_context_i.e @@ -5,7 +5,7 @@ note revision: "$Revision$" class - REQUEST_URI_TEMPLATE_HANDLER_CONTEXT + REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I inherit REQUEST_HANDLER_CONTEXT diff --git a/library/server/request/router/src/uri_template/request_uri_template_router.e b/library/server/request/router/src/uri_template/request_uri_template_router_i.e similarity index 97% rename from library/server/request/router/src/uri_template/request_uri_template_router.e rename to library/server/request/router/src/uri_template/request_uri_template_router_i.e index adba8c02..2bfb0b6c 100644 --- a/library/server/request/router/src/uri_template/request_uri_template_router.e +++ b/library/server/request/router/src/uri_template/request_uri_template_router_i.e @@ -5,7 +5,7 @@ note revision: "$Revision$" class - REQUEST_URI_TEMPLATE_ROUTER [H -> REQUEST_HANDLER [C], C -> REQUEST_URI_TEMPLATE_HANDLER_CONTEXT create make end] + REQUEST_URI_TEMPLATE_ROUTER_I [H -> REQUEST_HANDLER [C], C -> REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I create make end] inherit REQUEST_ROUTER [H, C] diff --git a/library/server/request/router/src/uri_template/request_uri_template_routing_handler.e b/library/server/request/router/src/uri_template/request_uri_template_routing_handler_i.e similarity index 78% rename from library/server/request/router/src/uri_template/request_uri_template_routing_handler.e rename to library/server/request/router/src/uri_template/request_uri_template_routing_handler_i.e index dac329c4..6e2bfc21 100644 --- a/library/server/request/router/src/uri_template/request_uri_template_routing_handler.e +++ b/library/server/request/router/src/uri_template/request_uri_template_routing_handler_i.e @@ -5,8 +5,8 @@ note revision: "$Revision$" class - REQUEST_URI_TEMPLATE_ROUTING_HANDLER [H -> REQUEST_HANDLER [C], - C -> REQUEST_URI_TEMPLATE_HANDLER_CONTEXT create make end] + REQUEST_URI_TEMPLATE_ROUTING_HANDLER_I [H -> REQUEST_HANDLER [C], + C -> REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I create make end] inherit REQUEST_ROUTING_HANDLER [H, C] @@ -23,7 +23,7 @@ feature {NONE} -- Initialization feature {NONE} -- Routing - router: REQUEST_URI_TEMPLATE_ROUTER [H, C] + router: REQUEST_URI_TEMPLATE_ROUTER_I [H, C] ;note copyright: "2011-2011, Eiffel Software and others" From 76fa3e9ff50ab71bb79374da6b9935bfbcfe02cf Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Wed, 14 Sep 2011 15:46:45 +0200 Subject: [PATCH 06/11] Reorganized library "server/request/rest" --- .../rest/src/{default => }/rest_application.e | 0 .../{application => }/rest_application_i.e | 0 .../rest_request_agent_handler.e | 0 .../src/{handler => }/rest_request_handler.e | 0 .../rest_request_handler_context.e | 0 .../src/{router => }/rest_request_router.e | 0 .../rest_request_uri_handler.e | 0 .../rest_request_uri_handler_context.e | 0 .../rest_request_uri_router.e | 0 .../rest_request_uri_router_i.e | 0 .../uri/rest_request_uri_routing_handler.e | 33 +++++++++++++++++++ .../rest_request_uri_routing_handler_i.e | 0 .../{default => uri}/rest_uri_application.e | 0 .../rest_request_uri_template_handler.e | 0 ...est_request_uri_template_handler_context.e | 0 .../rest_request_uri_template_router.e | 0 .../rest_request_uri_template_router_i.e | 0 ...est_request_uri_template_routing_handler.e | 0 ...t_request_uri_template_routing_handler_i.e | 0 .../rest_uri_template_application.e | 0 20 files changed, 33 insertions(+) rename library/server/request/rest/src/{default => }/rest_application.e (100%) rename library/server/request/rest/src/{application => }/rest_application_i.e (100%) rename library/server/request/rest/src/{handler => }/rest_request_agent_handler.e (100%) rename library/server/request/rest/src/{handler => }/rest_request_handler.e (100%) rename library/server/request/rest/src/{context => }/rest_request_handler_context.e (100%) rename library/server/request/rest/src/{router => }/rest_request_router.e (100%) rename library/server/request/rest/src/{default => uri}/rest_request_uri_handler.e (100%) rename library/server/request/rest/src/{context => uri}/rest_request_uri_handler_context.e (100%) rename library/server/request/rest/src/{default => uri}/rest_request_uri_router.e (100%) rename library/server/request/rest/src/{router => uri}/rest_request_uri_router_i.e (100%) create mode 100644 library/server/request/rest/src/uri/rest_request_uri_routing_handler.e rename library/server/request/rest/src/{handler => uri}/rest_request_uri_routing_handler_i.e (100%) rename library/server/request/rest/src/{default => uri}/rest_uri_application.e (100%) rename library/server/request/rest/src/{default => uri_template}/rest_request_uri_template_handler.e (100%) rename library/server/request/rest/src/{context => uri_template}/rest_request_uri_template_handler_context.e (100%) rename library/server/request/rest/src/{default => uri_template}/rest_request_uri_template_router.e (100%) rename library/server/request/rest/src/{router => uri_template}/rest_request_uri_template_router_i.e (100%) rename library/server/request/rest/src/{default => uri_template}/rest_request_uri_template_routing_handler.e (100%) rename library/server/request/rest/src/{handler => uri_template}/rest_request_uri_template_routing_handler_i.e (100%) rename library/server/request/rest/src/{default => uri_template}/rest_uri_template_application.e (100%) diff --git a/library/server/request/rest/src/default/rest_application.e b/library/server/request/rest/src/rest_application.e similarity index 100% rename from library/server/request/rest/src/default/rest_application.e rename to library/server/request/rest/src/rest_application.e diff --git a/library/server/request/rest/src/application/rest_application_i.e b/library/server/request/rest/src/rest_application_i.e similarity index 100% rename from library/server/request/rest/src/application/rest_application_i.e rename to library/server/request/rest/src/rest_application_i.e diff --git a/library/server/request/rest/src/handler/rest_request_agent_handler.e b/library/server/request/rest/src/rest_request_agent_handler.e similarity index 100% rename from library/server/request/rest/src/handler/rest_request_agent_handler.e rename to library/server/request/rest/src/rest_request_agent_handler.e diff --git a/library/server/request/rest/src/handler/rest_request_handler.e b/library/server/request/rest/src/rest_request_handler.e similarity index 100% rename from library/server/request/rest/src/handler/rest_request_handler.e rename to library/server/request/rest/src/rest_request_handler.e diff --git a/library/server/request/rest/src/context/rest_request_handler_context.e b/library/server/request/rest/src/rest_request_handler_context.e similarity index 100% rename from library/server/request/rest/src/context/rest_request_handler_context.e rename to library/server/request/rest/src/rest_request_handler_context.e diff --git a/library/server/request/rest/src/router/rest_request_router.e b/library/server/request/rest/src/rest_request_router.e similarity index 100% rename from library/server/request/rest/src/router/rest_request_router.e rename to library/server/request/rest/src/rest_request_router.e diff --git a/library/server/request/rest/src/default/rest_request_uri_handler.e b/library/server/request/rest/src/uri/rest_request_uri_handler.e similarity index 100% rename from library/server/request/rest/src/default/rest_request_uri_handler.e rename to library/server/request/rest/src/uri/rest_request_uri_handler.e diff --git a/library/server/request/rest/src/context/rest_request_uri_handler_context.e b/library/server/request/rest/src/uri/rest_request_uri_handler_context.e similarity index 100% rename from library/server/request/rest/src/context/rest_request_uri_handler_context.e rename to library/server/request/rest/src/uri/rest_request_uri_handler_context.e diff --git a/library/server/request/rest/src/default/rest_request_uri_router.e b/library/server/request/rest/src/uri/rest_request_uri_router.e similarity index 100% rename from library/server/request/rest/src/default/rest_request_uri_router.e rename to library/server/request/rest/src/uri/rest_request_uri_router.e diff --git a/library/server/request/rest/src/router/rest_request_uri_router_i.e b/library/server/request/rest/src/uri/rest_request_uri_router_i.e similarity index 100% rename from library/server/request/rest/src/router/rest_request_uri_router_i.e rename to library/server/request/rest/src/uri/rest_request_uri_router_i.e diff --git a/library/server/request/rest/src/uri/rest_request_uri_routing_handler.e b/library/server/request/rest/src/uri/rest_request_uri_routing_handler.e new file mode 100644 index 00000000..374df903 --- /dev/null +++ b/library/server/request/rest/src/uri/rest_request_uri_routing_handler.e @@ -0,0 +1,33 @@ +note + description: "Summary description for {DEFAULT_REST_REQUEST_URI_ROUTING_HANDLER}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + REST_REQUEST_URI_ROUTING_HANDLER + +inherit + REST_REQUEST_URI_ROUTING_HANDLER_I [REST_REQUEST_HANDLER [REST_REQUEST_URI_HANDLER_CONTEXT], REST_REQUEST_URI_HANDLER_CONTEXT] + redefine + router + end + +create + make + +feature {NONE} -- Routing + + router: REST_REQUEST_URI_ROUTER + +;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/library/server/request/rest/src/handler/rest_request_uri_routing_handler_i.e b/library/server/request/rest/src/uri/rest_request_uri_routing_handler_i.e similarity index 100% rename from library/server/request/rest/src/handler/rest_request_uri_routing_handler_i.e rename to library/server/request/rest/src/uri/rest_request_uri_routing_handler_i.e diff --git a/library/server/request/rest/src/default/rest_uri_application.e b/library/server/request/rest/src/uri/rest_uri_application.e similarity index 100% rename from library/server/request/rest/src/default/rest_uri_application.e rename to library/server/request/rest/src/uri/rest_uri_application.e diff --git a/library/server/request/rest/src/default/rest_request_uri_template_handler.e b/library/server/request/rest/src/uri_template/rest_request_uri_template_handler.e similarity index 100% rename from library/server/request/rest/src/default/rest_request_uri_template_handler.e rename to library/server/request/rest/src/uri_template/rest_request_uri_template_handler.e diff --git a/library/server/request/rest/src/context/rest_request_uri_template_handler_context.e b/library/server/request/rest/src/uri_template/rest_request_uri_template_handler_context.e similarity index 100% rename from library/server/request/rest/src/context/rest_request_uri_template_handler_context.e rename to library/server/request/rest/src/uri_template/rest_request_uri_template_handler_context.e diff --git a/library/server/request/rest/src/default/rest_request_uri_template_router.e b/library/server/request/rest/src/uri_template/rest_request_uri_template_router.e similarity index 100% rename from library/server/request/rest/src/default/rest_request_uri_template_router.e rename to library/server/request/rest/src/uri_template/rest_request_uri_template_router.e diff --git a/library/server/request/rest/src/router/rest_request_uri_template_router_i.e b/library/server/request/rest/src/uri_template/rest_request_uri_template_router_i.e similarity index 100% rename from library/server/request/rest/src/router/rest_request_uri_template_router_i.e rename to library/server/request/rest/src/uri_template/rest_request_uri_template_router_i.e diff --git a/library/server/request/rest/src/default/rest_request_uri_template_routing_handler.e b/library/server/request/rest/src/uri_template/rest_request_uri_template_routing_handler.e similarity index 100% rename from library/server/request/rest/src/default/rest_request_uri_template_routing_handler.e rename to library/server/request/rest/src/uri_template/rest_request_uri_template_routing_handler.e diff --git a/library/server/request/rest/src/handler/rest_request_uri_template_routing_handler_i.e b/library/server/request/rest/src/uri_template/rest_request_uri_template_routing_handler_i.e similarity index 100% rename from library/server/request/rest/src/handler/rest_request_uri_template_routing_handler_i.e rename to library/server/request/rest/src/uri_template/rest_request_uri_template_routing_handler_i.e diff --git a/library/server/request/rest/src/default/rest_uri_template_application.e b/library/server/request/rest/src/uri_template/rest_uri_template_application.e similarity index 100% rename from library/server/request/rest/src/default/rest_uri_template_application.e rename to library/server/request/rest/src/uri_template/rest_uri_template_application.e From 8b6e9273fabde0a99f584328eb8b74d4aab5bb2b Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Wed, 14 Sep 2011 16:05:01 +0200 Subject: [PATCH 07/11] applied renaming for rest and router lib --- library/server/request/rest/src/rest_application_i.e | 2 +- library/server/request/rest/tests/src/app/app_test.e | 8 ++++---- .../request/rest/tests/src/handler/app_application.e | 2 +- .../request/rest/tests/src/handler/app_request_handler.e | 9 ++++----- .../request/rest/tests/src/handler/app_request_router.e | 2 +- .../rest/tests/src/handler/app_request_routing_handler.e | 2 +- ...default_routed_application.e => routed_application.e} | 4 ++-- .../request/router/src/default/uri_routed_application.e | 2 +- .../router/src/default/uri_template_routed_application.e | 2 +- .../src/{routed_application.e => routed_application_i.e} | 2 +- 10 files changed, 17 insertions(+), 18 deletions(-) rename library/server/request/router/src/default/{default_routed_application.e => routed_application.e} (81%) rename library/server/request/router/src/{routed_application.e => routed_application_i.e} (94%) diff --git a/library/server/request/rest/src/rest_application_i.e b/library/server/request/rest/src/rest_application_i.e index 4591dee5..d98e4d82 100644 --- a/library/server/request/rest/src/rest_application_i.e +++ b/library/server/request/rest/src/rest_application_i.e @@ -8,7 +8,7 @@ deferred class REST_APPLICATION_I [H -> REST_REQUEST_HANDLER [C], C -> REST_REQUEST_HANDLER_CONTEXT] inherit - ROUTED_APPLICATION [H, C] + ROUTED_APPLICATION_I [H, C] redefine router end diff --git a/library/server/request/rest/tests/src/app/app_test.e b/library/server/request/rest/tests/src/app/app_test.e index 5d3f1ca2..af6dc20f 100644 --- a/library/server/request/rest/tests/src/app/app_test.e +++ b/library/server/request/rest/tests/src/app/app_test.e @@ -47,8 +47,8 @@ feature -- Execution create s.make_empty s.append_string ("test") - if attached req.meta_variable ("REQUEST_COUNT") as l_request_count then - s.append_string ("(request_count="+ l_request_count +")%N") + if attached req.meta_variable ("REQUEST_COUNT") as l_request_count_val then + s.append_string ("(request_count="+ l_request_count_val.as_string +")%N") end -- ctx.request_format_id ("format", Void) @@ -57,13 +57,13 @@ feature -- Execution s.append_string (" format=" + l_format + "%N") end - if attached ctx.parameter ("op") as l_op then + if attached ctx.string_parameter ("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 (string_hash_table_string_string (req.parameters.new_cursor, False)) + s.append (wgi_value_iteration_to_string (req.parameters, False)) s.append_string ("
script_url(%"" + req.path_info + "%")=" + ctx.script_url (req.path_info) + "%N") -- if attached ctx.http_authorization_login_password as t then -- s.append_string ("Check login=" + t.login + "
%N") diff --git a/library/server/request/rest/tests/src/handler/app_application.e b/library/server/request/rest/tests/src/handler/app_application.e index 325f832f..1f8ba22a 100644 --- a/library/server/request/rest/tests/src/handler/app_application.e +++ b/library/server/request/rest/tests/src/handler/app_application.e @@ -8,7 +8,7 @@ deferred class APP_APPLICATION inherit - REST_APPLICATION [APP_REQUEST_HANDLER, APP_REQUEST_HANDLER_CONTEXT] + REST_APPLICATION_I [APP_REQUEST_HANDLER, APP_REQUEST_HANDLER_CONTEXT] redefine router end diff --git a/library/server/request/rest/tests/src/handler/app_request_handler.e b/library/server/request/rest/tests/src/handler/app_request_handler.e index f0298788..d4434670 100644 --- a/library/server/request/rest/tests/src/handler/app_request_handler.e +++ b/library/server/request/rest/tests/src/handler/app_request_handler.e @@ -13,19 +13,18 @@ inherit feature {NONE} -- Implementation - string_hash_table_string_string (ht: HASH_TABLE_ITERATION_CURSOR [READABLE_STRING_GENERAL, READABLE_STRING_GENERAL]; using_pre: BOOLEAN): STRING_8 + wgi_value_iteration_to_string (cur: ITERATION_CURSOR [WGI_VALUE]; using_pre: BOOLEAN): STRING_8 do create Result.make (100) if using_pre then Result.append ("
")
 			end
 			from
-				ht.start
 			until
-				ht.after
+				cur.after
 			loop
-				Result.append_string (ht.key.as_string_8 + " = " + ht.item.as_string_8 + "%N")
-				ht.forth
+				Result.append_string (cur.item.name.as_string_8 + " = " + cur.item.as_string.as_string_8 + "%N")
+				cur.forth
 			end
 			if using_pre then
 				Result.append ("
") diff --git a/library/server/request/rest/tests/src/handler/app_request_router.e b/library/server/request/rest/tests/src/handler/app_request_router.e index 25bd2a14..35c9093f 100644 --- a/library/server/request/rest/tests/src/handler/app_request_router.e +++ b/library/server/request/rest/tests/src/handler/app_request_router.e @@ -8,7 +8,7 @@ class APP_REQUEST_ROUTER inherit - REST_REQUEST_URI_TEMPLATE_ROUTER [APP_REQUEST_HANDLER, APP_REQUEST_HANDLER_CONTEXT] + REST_REQUEST_URI_TEMPLATE_ROUTER_I [APP_REQUEST_HANDLER, APP_REQUEST_HANDLER_CONTEXT] create make diff --git a/library/server/request/rest/tests/src/handler/app_request_routing_handler.e b/library/server/request/rest/tests/src/handler/app_request_routing_handler.e index e7bcee5e..63e0196f 100644 --- a/library/server/request/rest/tests/src/handler/app_request_routing_handler.e +++ b/library/server/request/rest/tests/src/handler/app_request_routing_handler.e @@ -15,7 +15,7 @@ inherit post_execute end - REST_REQUEST_URI_TEMPLATE_ROUTING_HANDLER [APP_REQUEST_HANDLER, APP_REQUEST_HANDLER_CONTEXT] + REST_REQUEST_URI_TEMPLATE_ROUTING_HANDLER_I [APP_REQUEST_HANDLER, APP_REQUEST_HANDLER_CONTEXT] redefine router end diff --git a/library/server/request/router/src/default/default_routed_application.e b/library/server/request/router/src/default/routed_application.e similarity index 81% rename from library/server/request/router/src/default/default_routed_application.e rename to library/server/request/router/src/default/routed_application.e index 1113a09f..a309e4c8 100644 --- a/library/server/request/router/src/default/default_routed_application.e +++ b/library/server/request/router/src/default/routed_application.e @@ -5,10 +5,10 @@ note revision: "$Revision$" deferred class - DEFAULT_ROUTED_APPLICATION + ROUTED_APPLICATION inherit - ROUTED_APPLICATION [REQUEST_HANDLER [REQUEST_HANDLER_CONTEXT], REQUEST_HANDLER_CONTEXT] + ROUTED_APPLICATION_I [REQUEST_HANDLER [REQUEST_HANDLER_CONTEXT], REQUEST_HANDLER_CONTEXT] note copyright: "2011-2011, Eiffel Software and others" diff --git a/library/server/request/router/src/default/uri_routed_application.e b/library/server/request/router/src/default/uri_routed_application.e index f8410b9a..038266bc 100644 --- a/library/server/request/router/src/default/uri_routed_application.e +++ b/library/server/request/router/src/default/uri_routed_application.e @@ -8,7 +8,7 @@ deferred class URI_ROUTED_APPLICATION inherit - ROUTED_APPLICATION [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT_I], REQUEST_URI_HANDLER_CONTEXT_I] + ROUTED_APPLICATION_I [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT_I], REQUEST_URI_HANDLER_CONTEXT_I] redefine router end diff --git a/library/server/request/router/src/default/uri_template_routed_application.e b/library/server/request/router/src/default/uri_template_routed_application.e index bc174e35..8e33f204 100644 --- a/library/server/request/router/src/default/uri_template_routed_application.e +++ b/library/server/request/router/src/default/uri_template_routed_application.e @@ -8,7 +8,7 @@ deferred class URI_TEMPLATE_ROUTED_APPLICATION inherit - ROUTED_APPLICATION [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I] + ROUTED_APPLICATION_I [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I] redefine router end diff --git a/library/server/request/router/src/routed_application.e b/library/server/request/router/src/routed_application_i.e similarity index 94% rename from library/server/request/router/src/routed_application.e rename to library/server/request/router/src/routed_application_i.e index 848d57de..eabefeb4 100644 --- a/library/server/request/router/src/routed_application.e +++ b/library/server/request/router/src/routed_application_i.e @@ -5,7 +5,7 @@ note revision: "$Revision$" deferred class - ROUTED_APPLICATION [H -> REQUEST_HANDLER [C], C -> REQUEST_HANDLER_CONTEXT] + ROUTED_APPLICATION_I [H -> REQUEST_HANDLER [C], C -> REQUEST_HANDLER_CONTEXT] feature -- Setup From 22fd7490febe3cd29266ac0ae310d97045834963 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Wed, 14 Sep 2011 16:48:27 +0200 Subject: [PATCH 08/11] Simplified interface of "router" library classes --- .../src/contrib/doc/rest_api_documentation.e | 7 +- .../rest/src/rest_request_agent_handler.e | 23 ++- .../request/rest/src/rest_request_handler.e | 168 ++++++++++++++++- .../uri/rest_request_uri_routing_handler_i.e | 10 +- ...t_request_uri_template_routing_handler_i.e | 18 +- .../src/app/app_account_verify_credential.e | 5 +- .../request/rest/tests/src/app/app_test.e | 4 +- .../tests/src/handler/app_request_handler.e | 7 + .../router/src/request_agent_handler.e | 3 +- .../request/router/src/request_handler.e | 170 +----------------- .../router/src/request_routing_handler.e | 2 +- 11 files changed, 219 insertions(+), 198 deletions(-) diff --git a/library/server/request/rest/src/contrib/doc/rest_api_documentation.e b/library/server/request/rest/src/contrib/doc/rest_api_documentation.e index 276b2653..939e0c27 100644 --- a/library/server/request/rest/src/contrib/doc/rest_api_documentation.e +++ b/library/server/request/rest/src/contrib/doc/rest_api_documentation.e @@ -20,7 +20,6 @@ feature {NONE} -- Initialization router := a_router base_doc_url := a_base_doc_url description := "Technical documention for the API" - initialize end feature {NONE} -- Access: Implementation @@ -31,7 +30,9 @@ feature {NONE} -- Access: Implementation feature -- Access - authentication_required: BOOLEAN = False + authentication_required (req: WGI_REQUEST): BOOLEAN + do + end feature -- Execution @@ -187,7 +188,7 @@ feature -- Execution end s.append_string ("
") end - s.append_string ("
Authentication required: " + rq.authentication_required.out + "
") + s.append_string ("
Authentication required: " + rq.authentication_required (req).out + "
") if attached {REST_REQUEST_URI_TEMPLATE_ROUTER_I [REST_REQUEST_HANDLER [REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT]} router as l_uri_template_router then create l_uri_tpl.make (a_resource) if attached l_uri_tpl.query_variable_names as l_query_variable_names and then not l_query_variable_names.is_empty then diff --git a/library/server/request/rest/src/rest_request_agent_handler.e b/library/server/request/rest/src/rest_request_agent_handler.e index ba85571e..eca7824a 100644 --- a/library/server/request/rest/src/rest_request_agent_handler.e +++ b/library/server/request/rest/src/rest_request_agent_handler.e @@ -22,26 +22,33 @@ create feature -- status - authentication_required: BOOLEAN + authentication_required (req: WGI_REQUEST): BOOLEAN + do + Result := internal_authentication_required + end feature -- Element change set_authentication_required (b: like authentication_required) do - authentication_required := b + internal_authentication_required := b end +feature {NONE} -- Implementation + + internal_authentication_required: BOOLEAN + feature -- Execution - execute (a_hdl_context: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) + execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) do - Precursor {REST_REQUEST_HANDLER} (a_hdl_context, req, res) + Precursor {REST_REQUEST_HANDLER} (ctx, req, res) end --- execute_application (ctx: REST_REQUEST_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) --- do --- action.call ([ctx, req, res]) --- end + execute_application (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) + do + check should_not_occur: False end + end ;note copyright: "Copyright (c) 1984-2011, Eiffel Software and others" diff --git a/library/server/request/rest/src/rest_request_handler.e b/library/server/request/rest/src/rest_request_handler.e index 8e9810a8..6f3c8bc6 100644 --- a/library/server/request/rest/src/rest_request_handler.e +++ b/library/server/request/rest/src/rest_request_handler.e @@ -15,32 +15,74 @@ inherit feature -- Access - authentication_required: BOOLEAN + authentication_required (req: WGI_REQUEST): BOOLEAN -- Is authentication required -- might depend on the request environment -- or the associated resources deferred end + description: detachable STRING + -- Optional descriptiong + +feature -- Element change + + set_description (s: like description) + -- Set `description' to `s' + do + description := s + end + feature -- Execution - execute (a_hdl_context: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) + execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) -- Execute request handler + local + rescued: BOOLEAN do - if authentication_required and then not a_hdl_context.authenticated then - execute_unauthorized (a_hdl_context, req, res) + if not rescued then + if request_method_name_supported (req.request_method) then + if authentication_required (req) and then not ctx.authenticated then + execute_unauthorized (ctx, req, res) + else + pre_execute (ctx, req, res) + execute_application (ctx, req, res) + post_execute (ctx, req, res) + end + else + execute_request_method_not_allowed (req, res, supported_request_method_names) + end else - Precursor (a_hdl_context, req, res) + rescue_execute (ctx, req, res) end + rescue + rescued := True + retry end - execute_unauthorized (a_hdl_context: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) + execute_application (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) + deferred + end + + pre_execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) + do + end + + post_execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) + do + end + + rescue_execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) + do + post_execute (ctx, req, res) + end + + execute_unauthorized (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) do res.set_status_code ({HTTP_STATUS_CODE}.unauthorized) - res.write_header ({HTTP_STATUS_CODE}.unauthorized, <<["WWW-Authenticate", "Basic realm=%"Eiffel auth%""]>>) + res.write_header ({HTTP_STATUS_CODE}.unauthorized, Void) res.write_string ("Unauthorized") end - feature {NONE} -- Implementation supported_formats: INTEGER @@ -152,6 +194,116 @@ feature -- Element change: formats supported_formats := supported_formats | f end +feature {NONE} -- Implementation + + supported_request_methods: INTEGER + -- Support request method such as GET, POST, ... + +feature {NONE} -- Status report + + request_method_id_supported (a_id: INTEGER): BOOLEAN + do + Result := (supported_request_methods & a_id) = a_id + end + + request_method_name_supported (n: STRING): BOOLEAN + -- Is request method `n' supported? + do + Result := request_method_id_supported (request_method_constants.method_id (n)) + end + + request_method_constants: HTTP_REQUEST_METHOD_CONSTANTS + once + create Result + end + +feature -- Status report + + supported_request_method_names: LIST [STRING] + -- Support request method such as GET, POST, ... + do + create {LINKED_LIST [STRING]} Result.make + if method_get_supported then + Result.extend (request_method_constants.method_get_name) + end + if method_post_supported then + Result.extend (request_method_constants.method_post_name) + end + if method_put_supported then + Result.extend (request_method_constants.method_put_name) + end + if method_delete_supported then + Result.extend (request_method_constants.method_delete_name) + end + if method_head_supported then + Result.extend (request_method_constants.method_head_name) + end + end + + method_get_supported: BOOLEAN + do + Result := request_method_id_supported ({HTTP_REQUEST_METHOD_CONSTANTS}.method_get) + end + + method_post_supported: BOOLEAN + do + Result := request_method_id_supported ({HTTP_REQUEST_METHOD_CONSTANTS}.method_post) + end + + method_put_supported: BOOLEAN + do + Result := request_method_id_supported ({HTTP_REQUEST_METHOD_CONSTANTS}.method_put) + end + + method_delete_supported: BOOLEAN + do + Result := request_method_id_supported ({HTTP_REQUEST_METHOD_CONSTANTS}.method_delete) + end + + method_head_supported: BOOLEAN + do + Result := request_method_id_supported ({HTTP_REQUEST_METHOD_CONSTANTS}.method_head) + end + +feature -- Element change: request methods + + reset_supported_request_methods + do + supported_request_methods := 0 + end + + enable_request_method_get + do + enable_request_method ({HTTP_REQUEST_METHOD_CONSTANTS}.method_get) + end + + enable_request_method_post + do + enable_request_method ({HTTP_REQUEST_METHOD_CONSTANTS}.method_post) + end + + enable_request_method_put + do + enable_request_method ({HTTP_REQUEST_METHOD_CONSTANTS}.method_put) + end + + enable_request_method_delete + do + enable_request_method ({HTTP_REQUEST_METHOD_CONSTANTS}.method_delete) + end + + enable_request_method_head + do + enable_request_method ({HTTP_REQUEST_METHOD_CONSTANTS}.method_head) + end + + enable_request_method (m: INTEGER) + do + supported_request_methods := supported_request_methods | m + end + + + note copyright: "Copyright (c) 1984-2011, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" diff --git a/library/server/request/rest/src/uri/rest_request_uri_routing_handler_i.e b/library/server/request/rest/src/uri/rest_request_uri_routing_handler_i.e index 80365a96..86c23462 100644 --- a/library/server/request/rest/src/uri/rest_request_uri_routing_handler_i.e +++ b/library/server/request/rest/src/uri/rest_request_uri_routing_handler_i.e @@ -29,11 +29,17 @@ feature -- Status report feature -- Execution - execute (a_hdl_context: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) + execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) do - Precursor {REST_REQUEST_HANDLER} (a_hdl_context, req, res) + Precursor {REST_REQUEST_HANDLER} (ctx, req, res) end + execute_application (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) + do + check should_not_occur: False end + end + + feature {NONE} -- Routing router: REST_REQUEST_URI_ROUTER_I [H, C] diff --git a/library/server/request/rest/src/uri_template/rest_request_uri_template_routing_handler_i.e b/library/server/request/rest/src/uri_template/rest_request_uri_template_routing_handler_i.e index e622203f..3cece40b 100644 --- a/library/server/request/rest/src/uri_template/rest_request_uri_template_routing_handler_i.e +++ b/library/server/request/rest/src/uri_template/rest_request_uri_template_routing_handler_i.e @@ -25,13 +25,25 @@ create feature -- Status report - authentication_required: BOOLEAN + authentication_required (req: WGI_REQUEST): BOOLEAN + do + Result := internal_authentication_required + end + +feature {NONE} -- Implementation + + internal_authentication_required: BOOLEAN feature -- Execution - execute (a_hdl_context: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) + execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) do - Precursor {REST_REQUEST_HANDLER} (a_hdl_context, req, res) + Precursor {REST_REQUEST_HANDLER} (ctx, req, res) + end + + execute_application (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) + do + check should_not_occur: False end end feature {NONE} -- Routing diff --git a/library/server/request/rest/tests/src/app/app_account_verify_credential.e b/library/server/request/rest/tests/src/app/app_account_verify_credential.e index 0bb06270..17efb516 100644 --- a/library/server/request/rest/tests/src/app/app_account_verify_credential.e +++ b/library/server/request/rest/tests/src/app/app_account_verify_credential.e @@ -35,7 +35,10 @@ feature {NONE} -- Initialization feature -- Access - authentication_required: BOOLEAN = True + authentication_required (req: WGI_REQUEST): BOOLEAN + do + Result := True + end feature -- Execution diff --git a/library/server/request/rest/tests/src/app/app_test.e b/library/server/request/rest/tests/src/app/app_test.e index af6dc20f..f642977a 100644 --- a/library/server/request/rest/tests/src/app/app_test.e +++ b/library/server/request/rest/tests/src/app/app_test.e @@ -32,7 +32,9 @@ feature {NONE} -- Initialization feature -- Access - authentication_required: BOOLEAN = False + authentication_required (req: WGI_REQUEST): BOOLEAN + do + end feature -- Execution diff --git a/library/server/request/rest/tests/src/handler/app_request_handler.e b/library/server/request/rest/tests/src/handler/app_request_handler.e index d4434670..01e78d9c 100644 --- a/library/server/request/rest/tests/src/handler/app_request_handler.e +++ b/library/server/request/rest/tests/src/handler/app_request_handler.e @@ -11,6 +11,13 @@ inherit APP_REQUEST_HELPER +feature {NONE} -- Initialization + + initialize + -- Initialize various attributes + do + end + feature {NONE} -- Implementation wgi_value_iteration_to_string (cur: ITERATION_CURSOR [WGI_VALUE]; using_pre: BOOLEAN): STRING_8 diff --git a/library/server/request/router/src/request_agent_handler.e b/library/server/request/router/src/request_agent_handler.e index 962cebc4..66704ece 100644 --- a/library/server/request/router/src/request_agent_handler.e +++ b/library/server/request/router/src/request_agent_handler.e @@ -18,7 +18,6 @@ feature -- Initialization make (act: like action) do action := act - initialize end feature -- Access @@ -27,7 +26,7 @@ feature -- Access feature -- Execution - execute_application (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) + execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) do action.call ([ctx, req, res]) end diff --git a/library/server/request/router/src/request_handler.e b/library/server/request/router/src/request_handler.e index a9908338..30f0fc54 100644 --- a/library/server/request/router/src/request_handler.e +++ b/library/server/request/router/src/request_handler.e @@ -15,24 +15,12 @@ inherit {NONE} all end -feature {NONE} -- Initialization - - initialize - -- Initialize various attributes - do - end - -feature -- Access - - description: detachable STRING - -- Optional descriptiong - feature -- Status report is_valid_context (req: WGI_REQUEST): BOOLEAN -- Is `req' valid context for current handler? do - Result := request_method_name_supported (req.request_method) + Result := True end feature -- Execution @@ -41,49 +29,9 @@ feature -- Execution -- Execute request handler require is_valid_context: is_valid_context (req) - local - rescued: BOOLEAN - do - if not rescued then - if request_method_name_supported (req.request_method) then - pre_execute (ctx, req, res) - execute_application (ctx, req, res) - post_execute (ctx, req, res) - else - execute_request_method_not_allowed (req, res, supported_request_method_names) - end - else - rescue_execute (ctx, req, res) - end - rescue - rescued := True - retry - end - - execute_application (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) - -- Execute request handler deferred end - pre_execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) - -- Operation processed before `execute' - do - --| To be redefined if needed - end - - post_execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) - -- Operation processed after `execute' - do - --| To be redefined if needed - end - - rescue_execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) - -- Operation processed after a rescue - do - --| To be redefined if needed - post_execute (ctx, req, res) - end - feature -- Execution: report url (req: WGI_REQUEST; a_base: detachable READABLE_STRING_8; args: detachable STRING; abs: BOOLEAN): STRING @@ -117,122 +65,6 @@ feature -- Execution: report result_attached: Result /= Void end -feature -- Element change - - set_description (s: like description) - -- Set `description' to `s' - do - description := s - end - -feature {NONE} -- Implementation - - supported_request_methods: INTEGER - -- Support request method such as GET, POST, ... - -feature {NONE} -- Status report - - request_method_id_supported (a_id: INTEGER): BOOLEAN - do - Result := (supported_request_methods & a_id) = a_id - end - - request_method_name_supported (n: STRING): BOOLEAN - -- Is request method `n' supported? - do - Result := request_method_id_supported (request_method_constants.method_id (n)) - end - - request_method_constants: HTTP_REQUEST_METHOD_CONSTANTS - once - create Result - end - -feature -- Status report - - supported_request_method_names: LIST [STRING] - -- Support request method such as GET, POST, ... - do - create {LINKED_LIST [STRING]} Result.make - if method_get_supported then - Result.extend (request_method_constants.method_get_name) - end - if method_post_supported then - Result.extend (request_method_constants.method_post_name) - end - if method_put_supported then - Result.extend (request_method_constants.method_put_name) - end - if method_delete_supported then - Result.extend (request_method_constants.method_delete_name) - end - if method_head_supported then - Result.extend (request_method_constants.method_head_name) - end - end - - method_get_supported: BOOLEAN - do - Result := request_method_id_supported ({HTTP_REQUEST_METHOD_CONSTANTS}.method_get) - end - - method_post_supported: BOOLEAN - do - Result := request_method_id_supported ({HTTP_REQUEST_METHOD_CONSTANTS}.method_post) - end - - method_put_supported: BOOLEAN - do - Result := request_method_id_supported ({HTTP_REQUEST_METHOD_CONSTANTS}.method_put) - end - - method_delete_supported: BOOLEAN - do - Result := request_method_id_supported ({HTTP_REQUEST_METHOD_CONSTANTS}.method_delete) - end - - method_head_supported: BOOLEAN - do - Result := request_method_id_supported ({HTTP_REQUEST_METHOD_CONSTANTS}.method_head) - end - -feature -- Element change: request methods - - reset_supported_request_methods - do - supported_request_methods := 0 - end - - enable_request_method_get - do - enable_request_method ({HTTP_REQUEST_METHOD_CONSTANTS}.method_get) - end - - enable_request_method_post - do - enable_request_method ({HTTP_REQUEST_METHOD_CONSTANTS}.method_post) - end - - enable_request_method_put - do - enable_request_method ({HTTP_REQUEST_METHOD_CONSTANTS}.method_put) - end - - enable_request_method_delete - do - enable_request_method ({HTTP_REQUEST_METHOD_CONSTANTS}.method_delete) - end - - enable_request_method_head - do - enable_request_method ({HTTP_REQUEST_METHOD_CONSTANTS}.method_head) - end - - enable_request_method (m: INTEGER) - do - supported_request_methods := supported_request_methods | m - end - note copyright: "2011-2011, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" diff --git a/library/server/request/router/src/request_routing_handler.e b/library/server/request/router/src/request_routing_handler.e index 117dba77..19940f5f 100644 --- a/library/server/request/router/src/request_routing_handler.e +++ b/library/server/request/router/src/request_routing_handler.e @@ -13,7 +13,7 @@ inherit feature -- Execution - execute_application (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) + execute (ctx: C; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) -- Execute request handler local hdl: detachable H From 68247a184919d435b62a03cf3679c908517e3213 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 15 Sep 2011 10:55:14 +0200 Subject: [PATCH 09/11] updated README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8bda4594..4b4f40d9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ Official project site for Eiffel Web Framework: -* https://github.com/Eiffel-World/Eiffel-Web-Framework +* http://eiffel-world.github.com/Eiffel-Web-Framework/ For more information please have a look at the related wiki: * https://github.com/Eiffel-World/Eiffel-Web-Framework/wiki @@ -20,6 +20,9 @@ Overview * library/server/ewsgi/connectors: various web server connectors for EWSGI * library/server/libfcgi: Wrapper for libfcgi SDK +* library/server/request/router: URL dispatching/routing based on uri, uri_template, or custom. +* library/server/request/rest: experimental: RESTful library to help building RESTful services + * library/protocol/http: HTTP related classes, constants for status code, content types, ... * library/protocol/uri_template: URI Template library (parsing and expander) From 774cd004db217cf87aba0b0c49c73019466a8883 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 15 Sep 2011 15:49:53 +0200 Subject: [PATCH 10/11] cosmetic --- library/server/request/rest/tests/htdocs/.htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/server/request/rest/tests/htdocs/.htaccess b/library/server/request/rest/tests/htdocs/.htaccess index 687d4c26..10b1467c 100644 --- a/library/server/request/rest/tests/htdocs/.htaccess +++ b/library/server/request/rest/tests/htdocs/.htaccess @@ -2,7 +2,7 @@ Options Indexes FollowSymLinks ExecCGI AddHandler fcgid-script .eapp -FcgidWrapper c:/_dev/Dev-Process/web-library/library/server/rest/tests/htdocs/../EIFGENs/rest_sample_cgi/W_code/sample.exe .eapp +FcgidWrapper c:/_dev/Dev-Process/web-framework/library/server/request/rest/tests/htdocs/../EIFGENs/rest_sample_cgi/W_code/sample.exe .eapp From 86825854ca15315f4a83c788307240a02e9cab62 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 15 Sep 2011 17:49:47 +0200 Subject: [PATCH 11/11] Added WGI_MULTIPLE_STRING_VALUE Renamed value as WGI_STRING_VALUE.string Renamed a few classes .._CONTEXT_I as .._CONTEXT updated example. --- .../src/hello_routed_world.e | 10 +- .../request/value/wgi_multiple_string_value.e | 122 ++++++++++++++++++ .../request/value/wgi_string_value.e | 14 +- .../src/request/wgi_request_from_table.e | 8 +- .../src/contrib/doc/rest_api_documentation.e | 2 +- .../uri/rest_request_uri_handler_context.e | 2 +- ...est_request_uri_template_handler_context.e | 2 +- .../router/src/request_handler_context.e | 2 +- .../{ => uri}/default/request_uri_router.e | 6 +- .../default/request_uri_routing_handler.e | 2 +- .../default/uri_routed_application.e | 2 +- ...text_i.e => request_uri_handler_context.e} | 2 +- .../router/src/uri/request_uri_router_i.e | 2 +- .../src/uri/request_uri_routing_handler_i.e | 2 +- .../default/request_uri_template_router.e | 6 +- .../request_uri_template_routing_handler.e | 2 +- .../default/uri_template_routed_application.e | 2 +- ...=> request_uri_template_handler_context.e} | 2 +- .../request_uri_template_router_i.e | 2 +- .../request_uri_template_routing_handler_i.e | 2 +- 20 files changed, 158 insertions(+), 36 deletions(-) create mode 100644 library/server/ewsgi/specification/request/value/wgi_multiple_string_value.e rename library/server/request/router/src/{ => uri}/default/request_uri_router.e (80%) rename library/server/request/router/src/{ => uri}/default/request_uri_routing_handler.e (93%) rename library/server/request/router/src/{ => uri}/default/uri_routed_application.e (94%) rename library/server/request/router/src/uri/{request_uri_handler_context_i.e => request_uri_handler_context.e} (96%) rename library/server/request/router/src/{ => uri_template}/default/request_uri_template_router.e (89%) rename library/server/request/router/src/{ => uri_template}/default/request_uri_template_routing_handler.e (90%) rename library/server/request/router/src/{ => uri_template}/default/uri_template_routed_application.e (92%) rename library/server/request/router/src/uri_template/{request_uri_template_handler_context_i.e => request_uri_template_handler_context.e} (97%) diff --git a/examples/hello_routed_world/src/hello_routed_world.e b/examples/hello_routed_world/src/hello_routed_world.e index c34f3bcd..ec73bb93 100644 --- a/examples/hello_routed_world/src/hello_routed_world.e +++ b/examples/hello_routed_world/src/hello_routed_world.e @@ -10,7 +10,7 @@ class inherit ANY - DEFAULT_URI_TEMPLATE_ROUTED_APPLICATION + URI_TEMPLATE_ROUTED_APPLICATION ROUTED_APPLICATION_HELPER @@ -35,7 +35,7 @@ feature {NONE} -- Initialization setup_router local ra: REQUEST_AGENT_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] - rag: DEFAULT_REQUEST_URI_TEMPLATE_ROUTING_HANDLER + rag: REQUEST_URI_TEMPLATE_ROUTING_HANDLER do router.map_agent ("/home", agent execute_home) @@ -125,8 +125,8 @@ feature -- Execution res.write_string ("
  • /hello/Joce
  • %N") res.write_string ("%N") - if attached req.parameter ("REQUEST_COUNT") as rqc then - res.write_string ("request #"+ rqc + "%N") + if attached req.item ("REQUEST_COUNT") as rqc then + res.write_string ("request #"+ rqc.as_string + "%N") end res.write_string ("%N") end @@ -182,7 +182,7 @@ feature -- Execution handle_anonymous_hello (ctx: REQUEST_URI_TEMPLATE_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) do - execute_hello (req, res, ctx.parameter ("name"), ctx) + execute_hello (req, res, ctx.string_parameter ("name"), ctx) end handle_method_any (ctx: REQUEST_URI_TEMPLATE_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) diff --git a/library/server/ewsgi/specification/request/value/wgi_multiple_string_value.e b/library/server/ewsgi/specification/request/value/wgi_multiple_string_value.e new file mode 100644 index 00000000..9654cbb5 --- /dev/null +++ b/library/server/ewsgi/specification/request/value/wgi_multiple_string_value.e @@ -0,0 +1,122 @@ +note + description: "Summary description for {WGI_MULTIPLE_STRING_VALUE}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + WGI_MULTIPLE_STRING_VALUE + +inherit + WGI_VALUE + + ITERABLE [WGI_STRING_VALUE] + +create + make_with_value, + make_with_string + +feature {NONE} -- Initialization + + make_with_value (a_value: WGI_VALUE) + do + name := a_value.name + create {LINKED_LIST [WGI_STRING_VALUE]} string_values.make + add_value (a_value) + end + + make_with_string (a_name: like name; a_string: READABLE_STRING_32) + do + make_with_value (create {WGI_STRING_VALUE}.make (a_name, a_string)) + end + +feature -- Access + + name: READABLE_STRING_GENERAL + + string_values: LIST [WGI_STRING_VALUE] + + first_string_value: WGI_STRING_VALUE + do + Result := string_values.first + end + +feature -- Traversing + + new_cursor: ITERATION_CURSOR [WGI_STRING_VALUE] + do + Result := string_values.new_cursor + end + +feature -- Helper + + same_string (a_other: READABLE_STRING_GENERAL): BOOLEAN + -- Does `a_other' represent the same string as `Current'? + do + if string_values.count = 1 then + Result := first_string_value.same_string (a_other) + end + end + + is_case_insensitive_equal (a_other: READABLE_STRING_8): BOOLEAN + -- Does `a_other' represent the same case insensitive string as `Current'? + do + if string_values.count = 1 then + Result := first_string_value.is_case_insensitive_equal (a_other) + end + end + + as_string: STRING_32 + do + if string_values.count = 1 then + create Result.make_from_string (first_string_value) + else + create Result.make_from_string ("[") + across + string_values as c + loop + if Result.count = 1 then + Result.append_character (',') + end + Result.append_string (c.item) + end + Result.append_character (']') + end + end + +feature -- Element change + + add_value (a_value: WGI_VALUE) + require + same_name: a_value.name.same_string (name) + do + if attached {WGI_STRING_VALUE} a_value as sval then + add_string_value (sval) + elseif attached {WGI_MULTIPLE_STRING_VALUE} a_value as slst then + across + slst as cur + loop + add_string_value (cur.item) + end + end + end + + add_string_value (s: WGI_STRING_VALUE) + do + string_values.extend (s) + end + +invariant + string_values_not_empty: string_values.count >= 1 + +;note + copyright: "2011-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/library/server/ewsgi/specification/request/value/wgi_string_value.e b/library/server/ewsgi/specification/request/value/wgi_string_value.e index c39664bc..765e321e 100644 --- a/library/server/ewsgi/specification/request/value/wgi_string_value.e +++ b/library/server/ewsgi/specification/request/value/wgi_string_value.e @@ -18,32 +18,32 @@ convert feature {NONE} -- Initialization - make (a_name: like name; a_value: like value) + make (a_name: like name; a_string: like string) do name := a_name - value := a_value + string := a_string end feature -- Access name: READABLE_STRING_GENERAL - value: READABLE_STRING_32 + string: READABLE_STRING_32 feature -- Helper same_string (a_other: READABLE_STRING_GENERAL): BOOLEAN -- Does `a_other' represent the same string as `Current'? do - Result := value.same_string_general (a_other) + Result := string.same_string_general (a_other) end is_case_insensitive_equal (a_other: READABLE_STRING_8): BOOLEAN -- Does `a_other' represent the same case insensitive string as `Current'? local - v: like value + v: like string do - v := value + v := string if v = a_other then Result := True elseif v.is_valid_as_string_8 then @@ -55,7 +55,7 @@ feature -- Conversion as_string: STRING_32 do - create Result.make_from_string (value) + create Result.make_from_string (string) end ;note diff --git a/library/server/ewsgi/src/request/wgi_request_from_table.e b/library/server/ewsgi/src/request/wgi_request_from_table.e index c24678f2..3a819e2a 100644 --- a/library/server/ewsgi/src/request/wgi_request_from_table.e +++ b/library/server/ewsgi/src/request/wgi_request_from_table.e @@ -161,9 +161,9 @@ feature -- Access extra information do if attached {WGI_STRING_VALUE} meta_variable ({WGI_META_NAMES}.request_time) as t and then - t.value.is_integer_64 + t.string.is_integer_64 then - Result := date_time_utilities.unix_time_stamp_to_date_time (t.value.to_integer_64) + Result := date_time_utilities.unix_time_stamp_to_date_time (t.string.to_integer_64) end end @@ -567,7 +567,7 @@ feature {NONE} -- Cookies l_cookies := internal_cookies_table if l_cookies = Void then if attached {WGI_STRING_VALUE} meta_variable ({WGI_META_NAMES}.http_cookie) as val then - s := val.value + s := val.string create l_cookies.make (5) from n := s.count @@ -698,7 +698,7 @@ feature -- Access: global variable string_item (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32 do if attached {WGI_STRING_VALUE} item (a_name) as val then - Result := val.value + Result := val.string else check is_string_value: False end end diff --git a/library/server/request/rest/src/contrib/doc/rest_api_documentation.e b/library/server/request/rest/src/contrib/doc/rest_api_documentation.e index 939e0c27..f20482a8 100644 --- a/library/server/request/rest/src/contrib/doc/rest_api_documentation.e +++ b/library/server/request/rest/src/contrib/doc/rest_api_documentation.e @@ -51,7 +51,7 @@ feature -- Execution if attached {WGI_STRING_VALUE} ctx.path_parameter ("resource") as l_resource_value and then - attached l_resource_value.value as l_resource + attached l_resource_value.string as l_resource then from hdl_cursor := router.new_cursor diff --git a/library/server/request/rest/src/uri/rest_request_uri_handler_context.e b/library/server/request/rest/src/uri/rest_request_uri_handler_context.e index 69224ecd..52566f06 100644 --- a/library/server/request/rest/src/uri/rest_request_uri_handler_context.e +++ b/library/server/request/rest/src/uri/rest_request_uri_handler_context.e @@ -8,7 +8,7 @@ class REST_REQUEST_URI_HANDLER_CONTEXT inherit - REQUEST_URI_HANDLER_CONTEXT_I + REQUEST_URI_HANDLER_CONTEXT REST_REQUEST_HANDLER_CONTEXT diff --git a/library/server/request/rest/src/uri_template/rest_request_uri_template_handler_context.e b/library/server/request/rest/src/uri_template/rest_request_uri_template_handler_context.e index cbc36a31..fd1c829f 100644 --- a/library/server/request/rest/src/uri_template/rest_request_uri_template_handler_context.e +++ b/library/server/request/rest/src/uri_template/rest_request_uri_template_handler_context.e @@ -8,7 +8,7 @@ class REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT inherit - REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I + REQUEST_URI_TEMPLATE_HANDLER_CONTEXT REST_REQUEST_HANDLER_CONTEXT diff --git a/library/server/request/router/src/request_handler_context.e b/library/server/request/router/src/request_handler_context.e index aaa652ca..1e4f0f4f 100644 --- a/library/server/request/router/src/request_handler_context.e +++ b/library/server/request/router/src/request_handler_context.e @@ -133,7 +133,7 @@ feature -- String query string_from (a_value: detachable WGI_VALUE): detachable READABLE_STRING_32 do if attached {WGI_STRING_VALUE} a_value as val then - Result := val.value + Result := val.string end end diff --git a/library/server/request/router/src/default/request_uri_router.e b/library/server/request/router/src/uri/default/request_uri_router.e similarity index 80% rename from library/server/request/router/src/default/request_uri_router.e rename to library/server/request/router/src/uri/default/request_uri_router.e index 60a45988..99c4d588 100644 --- a/library/server/request/router/src/default/request_uri_router.e +++ b/library/server/request/router/src/uri/default/request_uri_router.e @@ -8,7 +8,7 @@ class REQUEST_URI_ROUTER inherit - REQUEST_URI_ROUTER_I [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT_I], REQUEST_URI_HANDLER_CONTEXT_I] + REQUEST_URI_ROUTER_I [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT], REQUEST_URI_HANDLER_CONTEXT] redefine map_agent_with_request_methods end @@ -17,10 +17,10 @@ create feature -- Mapping - map_agent_with_request_methods (a_id: READABLE_STRING_8; a_action: PROCEDURE [ANY, TUPLE [ctx: REQUEST_URI_HANDLER_CONTEXT_I; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER]]; + map_agent_with_request_methods (a_id: READABLE_STRING_8; a_action: PROCEDURE [ANY, TUPLE [ctx: REQUEST_URI_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER]]; rqst_methods: detachable ARRAY [READABLE_STRING_8]) local - h: REQUEST_AGENT_HANDLER [REQUEST_URI_HANDLER_CONTEXT_I] + h: REQUEST_AGENT_HANDLER [REQUEST_URI_HANDLER_CONTEXT] do create h.make (a_action) map_with_request_methods (a_id, h, rqst_methods) diff --git a/library/server/request/router/src/default/request_uri_routing_handler.e b/library/server/request/router/src/uri/default/request_uri_routing_handler.e similarity index 93% rename from library/server/request/router/src/default/request_uri_routing_handler.e rename to library/server/request/router/src/uri/default/request_uri_routing_handler.e index 83b6358f..7492a92d 100644 --- a/library/server/request/router/src/default/request_uri_routing_handler.e +++ b/library/server/request/router/src/uri/default/request_uri_routing_handler.e @@ -8,7 +8,7 @@ class REQUEST_URI_ROUTING_HANDLER inherit - REQUEST_URI_ROUTING_HANDLER_I [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT_I], REQUEST_URI_HANDLER_CONTEXT_I] + REQUEST_URI_ROUTING_HANDLER_I [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT], REQUEST_URI_HANDLER_CONTEXT] redefine router end diff --git a/library/server/request/router/src/default/uri_routed_application.e b/library/server/request/router/src/uri/default/uri_routed_application.e similarity index 94% rename from library/server/request/router/src/default/uri_routed_application.e rename to library/server/request/router/src/uri/default/uri_routed_application.e index 038266bc..ff3272f0 100644 --- a/library/server/request/router/src/default/uri_routed_application.e +++ b/library/server/request/router/src/uri/default/uri_routed_application.e @@ -8,7 +8,7 @@ deferred class URI_ROUTED_APPLICATION inherit - ROUTED_APPLICATION_I [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT_I], REQUEST_URI_HANDLER_CONTEXT_I] + ROUTED_APPLICATION_I [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT], REQUEST_URI_HANDLER_CONTEXT] redefine router end diff --git a/library/server/request/router/src/uri/request_uri_handler_context_i.e b/library/server/request/router/src/uri/request_uri_handler_context.e similarity index 96% rename from library/server/request/router/src/uri/request_uri_handler_context_i.e rename to library/server/request/router/src/uri/request_uri_handler_context.e index c5289fe5..bfb167f1 100644 --- a/library/server/request/router/src/uri/request_uri_handler_context_i.e +++ b/library/server/request/router/src/uri/request_uri_handler_context.e @@ -5,7 +5,7 @@ note revision: "$Revision$" class - REQUEST_URI_HANDLER_CONTEXT_I + REQUEST_URI_HANDLER_CONTEXT inherit REQUEST_HANDLER_CONTEXT diff --git a/library/server/request/router/src/uri/request_uri_router_i.e b/library/server/request/router/src/uri/request_uri_router_i.e index 0b927fcb..b699f6c0 100644 --- a/library/server/request/router/src/uri/request_uri_router_i.e +++ b/library/server/request/router/src/uri/request_uri_router_i.e @@ -5,7 +5,7 @@ note revision: "$Revision$" class - REQUEST_URI_ROUTER_I [H -> REQUEST_HANDLER [C], C -> REQUEST_URI_HANDLER_CONTEXT_I create make end] + REQUEST_URI_ROUTER_I [H -> REQUEST_HANDLER [C], C -> REQUEST_URI_HANDLER_CONTEXT create make end] inherit REQUEST_ROUTER [H, C] diff --git a/library/server/request/router/src/uri/request_uri_routing_handler_i.e b/library/server/request/router/src/uri/request_uri_routing_handler_i.e index 413cc987..9a05d72e 100644 --- a/library/server/request/router/src/uri/request_uri_routing_handler_i.e +++ b/library/server/request/router/src/uri/request_uri_routing_handler_i.e @@ -6,7 +6,7 @@ note class REQUEST_URI_ROUTING_HANDLER_I [H -> REQUEST_HANDLER [C], - C -> REQUEST_URI_HANDLER_CONTEXT_I create make end] + C -> REQUEST_URI_HANDLER_CONTEXT create make end] inherit REQUEST_ROUTING_HANDLER [H, C] diff --git a/library/server/request/router/src/default/request_uri_template_router.e b/library/server/request/router/src/uri_template/default/request_uri_template_router.e similarity index 89% rename from library/server/request/router/src/default/request_uri_template_router.e rename to library/server/request/router/src/uri_template/default/request_uri_template_router.e index f0f9687e..41cefe4f 100644 --- a/library/server/request/router/src/default/request_uri_template_router.e +++ b/library/server/request/router/src/uri_template/default/request_uri_template_router.e @@ -8,7 +8,7 @@ class REQUEST_URI_TEMPLATE_ROUTER inherit - REQUEST_URI_TEMPLATE_ROUTER_I [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I] + REQUEST_URI_TEMPLATE_ROUTER_I [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] redefine map_agent_with_request_methods end @@ -18,10 +18,10 @@ create feature -- Mapping - map_agent_with_request_methods (a_id: READABLE_STRING_8; a_action: PROCEDURE [ANY, TUPLE [ctx: REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER]]; + map_agent_with_request_methods (a_id: READABLE_STRING_8; a_action: PROCEDURE [ANY, TUPLE [ctx: REQUEST_URI_TEMPLATE_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER]]; rqst_methods: detachable ARRAY [READABLE_STRING_8]) local - h: REQUEST_AGENT_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I] + h: REQUEST_AGENT_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] do create h.make (a_action) map_with_request_methods (a_id, h, rqst_methods) diff --git a/library/server/request/router/src/default/request_uri_template_routing_handler.e b/library/server/request/router/src/uri_template/default/request_uri_template_routing_handler.e similarity index 90% rename from library/server/request/router/src/default/request_uri_template_routing_handler.e rename to library/server/request/router/src/uri_template/default/request_uri_template_routing_handler.e index 0df31c5c..2e4a5aa4 100644 --- a/library/server/request/router/src/default/request_uri_template_routing_handler.e +++ b/library/server/request/router/src/uri_template/default/request_uri_template_routing_handler.e @@ -8,7 +8,7 @@ class REQUEST_URI_TEMPLATE_ROUTING_HANDLER inherit - REQUEST_URI_TEMPLATE_ROUTING_HANDLER_I [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I] + REQUEST_URI_TEMPLATE_ROUTING_HANDLER_I [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] redefine router end diff --git a/library/server/request/router/src/default/uri_template_routed_application.e b/library/server/request/router/src/uri_template/default/uri_template_routed_application.e similarity index 92% rename from library/server/request/router/src/default/uri_template_routed_application.e rename to library/server/request/router/src/uri_template/default/uri_template_routed_application.e index 8e33f204..bee5564c 100644 --- a/library/server/request/router/src/default/uri_template_routed_application.e +++ b/library/server/request/router/src/uri_template/default/uri_template_routed_application.e @@ -8,7 +8,7 @@ deferred class URI_TEMPLATE_ROUTED_APPLICATION inherit - ROUTED_APPLICATION_I [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I] + ROUTED_APPLICATION_I [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] redefine router end diff --git a/library/server/request/router/src/uri_template/request_uri_template_handler_context_i.e b/library/server/request/router/src/uri_template/request_uri_template_handler_context.e similarity index 97% rename from library/server/request/router/src/uri_template/request_uri_template_handler_context_i.e rename to library/server/request/router/src/uri_template/request_uri_template_handler_context.e index 312aaaf8..5cf1c7db 100644 --- a/library/server/request/router/src/uri_template/request_uri_template_handler_context_i.e +++ b/library/server/request/router/src/uri_template/request_uri_template_handler_context.e @@ -5,7 +5,7 @@ note revision: "$Revision$" class - REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I + REQUEST_URI_TEMPLATE_HANDLER_CONTEXT inherit REQUEST_HANDLER_CONTEXT diff --git a/library/server/request/router/src/uri_template/request_uri_template_router_i.e b/library/server/request/router/src/uri_template/request_uri_template_router_i.e index 2bfb0b6c..d2f61c4d 100644 --- a/library/server/request/router/src/uri_template/request_uri_template_router_i.e +++ b/library/server/request/router/src/uri_template/request_uri_template_router_i.e @@ -5,7 +5,7 @@ note revision: "$Revision$" class - REQUEST_URI_TEMPLATE_ROUTER_I [H -> REQUEST_HANDLER [C], C -> REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I create make end] + REQUEST_URI_TEMPLATE_ROUTER_I [H -> REQUEST_HANDLER [C], C -> REQUEST_URI_TEMPLATE_HANDLER_CONTEXT create make end] inherit REQUEST_ROUTER [H, C] diff --git a/library/server/request/router/src/uri_template/request_uri_template_routing_handler_i.e b/library/server/request/router/src/uri_template/request_uri_template_routing_handler_i.e index 6e2bfc21..32fd135c 100644 --- a/library/server/request/router/src/uri_template/request_uri_template_routing_handler_i.e +++ b/library/server/request/router/src/uri_template/request_uri_template_routing_handler_i.e @@ -6,7 +6,7 @@ note class REQUEST_URI_TEMPLATE_ROUTING_HANDLER_I [H -> REQUEST_HANDLER [C], - C -> REQUEST_URI_TEMPLATE_HANDLER_CONTEXT_I create make end] + C -> REQUEST_URI_TEMPLATE_HANDLER_CONTEXT create make end] inherit REQUEST_ROUTING_HANDLER [H, C]