diff --git a/.gitmodules b/.gitmodules index ad9fdb20..44201abf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,12 @@ [submodule "doc/wiki"] path = doc/wiki url = https://github.com/Eiffel-World/Eiffel-Web-Framework.wiki.git -[submodule "ext/server/nino"] - path = ext/server/nino +[submodule "contrib/library/server/nino"] + path = contrib/library/server/nino url = http://github.com/Eiffel-World/EiffelWebNino.git -[submodule "ext/text/json"] - path = ext/text/json +[submodule "contrib/library/text/parser/json"] + path = contrib/library/text/parser/json url = http://github.com/Eiffel-World/ejson-svn.git -[submodule "ext/ise_library/curl"] - path = ext/ise_library/curl +[submodule "contrib/ise_library/cURL"] + path = contrib/ise_library/cURL url = http://github.com/EiffelSoftware/mirror-Eiffel-cURL.git diff --git a/ext/ise_library/curl b/contrib/ise_library/cURL similarity index 100% rename from ext/ise_library/curl rename to contrib/ise_library/cURL diff --git a/ext/ise_library/cURL-safe.ecf b/contrib/ise_library/cURL-safe.ecf similarity index 100% rename from ext/ise_library/cURL-safe.ecf rename to contrib/ise_library/cURL-safe.ecf diff --git a/ext/ise_library/cURL.ecf b/contrib/ise_library/cURL.ecf similarity index 100% rename from ext/ise_library/cURL.ecf rename to contrib/ise_library/cURL.ecf diff --git a/ext/server/nino b/contrib/library/server/nino similarity index 100% rename from ext/server/nino rename to contrib/library/server/nino diff --git a/ext/text/json b/contrib/library/text/parser/json similarity index 100% rename from ext/text/json rename to contrib/library/text/parser/json diff --git a/examples/hello_routed_world/src/hello_routed_world.e b/examples/hello_routed_world/src/hello_routed_world.e index 644c7cde..8d607ebc 100644 --- a/examples/hello_routed_world/src/hello_routed_world.e +++ b/examples/hello_routed_world/src/hello_routed_world.e @@ -10,11 +10,11 @@ class inherit ANY - URI_TEMPLATE_ROUTED_APPLICATION + URI_TEMPLATE_ROUTED_SERVICE - ROUTED_APPLICATION_HELPER + ROUTED_SERVICE_HELPER - DEFAULT_APPLICATION + DEFAULT_SERVICE create make diff --git a/examples/restbucks/client/client-safe.ecf b/examples/restbucks/client/client-safe.ecf index 39cf3bb9..63589edf 100644 --- a/examples/restbucks/client/client-safe.ecf +++ b/examples/restbucks/client/client-safe.ecf @@ -12,7 +12,7 @@ - + diff --git a/examples/restbucks/client/client.ecf b/examples/restbucks/client/client.ecf index b9d0f22f..8dd66985 100644 --- a/examples/restbucks/client/client.ecf +++ b/examples/restbucks/client/client.ecf @@ -11,7 +11,7 @@ - + diff --git a/examples/restbucks/restbucks-safe.ecf b/examples/restbucks/restbucks-safe.ecf index 2119f341..e5b2b10c 100644 --- a/examples/restbucks/restbucks-safe.ecf +++ b/examples/restbucks/restbucks-safe.ecf @@ -18,7 +18,7 @@ - + diff --git a/examples/restbucks/src/resource/order_handler.e b/examples/restbucks/src/resource/order_handler.e index af7adbb6..a747ee3a 100644 --- a/examples/restbucks/src/resource/order_handler.e +++ b/examples/restbucks/src/resource/order_handler.e @@ -60,18 +60,18 @@ feature -- HTTP Methods end is_conditional_get (req : WSF_REQUEST; l_order : ORDER) : BOOLEAN - -- Check if If-None-Match is present and then if there is a representation that has that etag - -- if the representation hasn't changed, we return TRUE - -- then the response is a 304 with no entity body returned. + -- Check if If-None-Match is present and then if there is a representation that has that etag + -- if the representation hasn't changed, we return TRUE + -- then the response is a 304 with no entity body returned. local etag_util : ETAG_UTILS do - if attached req.meta_variable ("HTTP_IF_NONE_MATCH") as if_none_match then - create etag_util - if if_none_match.as_string.same_string (etag_util.md5_digest (l_order.out).as_string_32) then - Result := True - end + if attached req.meta_variable ("HTTP_IF_NONE_MATCH") as if_none_match then + create etag_util + if if_none_match.as_string.same_string (etag_util.md5_digest (l_order.out).as_string_32) then + Result := True end + end end compute_response_get (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE; l_order : ORDER) diff --git a/examples/restbucks/src/restbucks_server.e b/examples/restbucks/src/restbucks_server.e index cc6cc3d4..10356e91 100644 --- a/examples/restbucks/src/restbucks_server.e +++ b/examples/restbucks/src/restbucks_server.e @@ -10,11 +10,11 @@ class inherit ANY - URI_TEMPLATE_ROUTED_APPLICATION + URI_TEMPLATE_ROUTED_SERVICE - ROUTED_APPLICATION_HELPER + ROUTED_SERVICE_HELPER - DEFAULT_APPLICATION + DEFAULT_SERVICE create make diff --git a/examples/restbucks/src/utils/etag_utils.e b/examples/restbucks/src/utils/etag_utils.e index c8854d57..92767077 100644 --- a/examples/restbucks/src/utils/etag_utils.e +++ b/examples/restbucks/src/utils/etag_utils.e @@ -1,6 +1,5 @@ note description: "Summary description for {ETAG_UTILS}." - author: "" date: "$Date$" revision: "$Revision$" @@ -8,25 +7,24 @@ class ETAG_UTILS inherit - ARRAY_FACILITIES -feature - md5_digest ( a_string : STRING ) : STRING - -- Cryptographic hash function that produces a 128-bit (16-byte) hash value, based on `a_string' +feature -- Access + + md5_digest (a_string: STRING): STRING + -- Cryptographic hash function that produces a 128-bit (16-byte) hash value, based on `a_string' local md5: MD5 output: SPECIAL [NATURAL_8] - do create md5.make create output.make_filled (0, 16) md5.sink_string (a_string) md5.do_final (output, 0) Result := as_natural_32_be (output, 0).to_hex_string - Result := Result + as_natural_32_be (output, 4).to_hex_string - Result := Result + as_natural_32_be (output, 8).to_hex_string - Result := Result + as_natural_32_be (output, 12).to_hex_string + Result.append (as_natural_32_be (output, 4).to_hex_string) + Result.append (as_natural_32_be (output, 8).to_hex_string) + Result.append (as_natural_32_be (output, 12).to_hex_string) end note diff --git a/library/client/http_client/http_client-safe.ecf b/library/client/http_client/http_client-safe.ecf index 8bc13e78..8ff790a5 100644 --- a/library/client/http_client/http_client-safe.ecf +++ b/library/client/http_client/http_client-safe.ecf @@ -15,7 +15,7 @@ - + diff --git a/library/client/http_client/http_client.ecf b/library/client/http_client/http_client.ecf index 9fbf1763..ee034729 100644 --- a/library/client/http_client/http_client.ecf +++ b/library/client/http_client/http_client.ecf @@ -15,7 +15,7 @@ - + diff --git a/library/server/ewsgi/README.md b/library/server/ewsgi/README.md index 6880a633..70c0b36c 100644 --- a/library/server/ewsgi/README.md +++ b/library/server/ewsgi/README.md @@ -1,7 +1,12 @@ # Eiffel Web Server Gateway Interface ## Overview +The main goal of this library is to provide a common layer on top of many different connectors. +A connector is a library used for the integration of Eiffel web server application with an underlying httpd server technology such as CGI, libFCGI, or even standalone Eiffel Web Nino (which is a httpd server written in Eiffel). + +Then one can build an Eiffel web service compliant with EWSGI specification, and thus with the same code (or almost), this could be compiled to run on any available connectors. ## Usage + ## diff --git a/library/server/ewsgi/connectors/common/wgi_connector.e b/library/server/ewsgi/connectors/common/wgi_connector.e index eac74fbe..87d345b5 100644 --- a/library/server/ewsgi/connectors/common/wgi_connector.e +++ b/library/server/ewsgi/connectors/common/wgi_connector.e @@ -22,8 +22,8 @@ feature {NONE} -- Initialization feature {NONE} -- Access - application: WGI_APPLICATION - -- Gateway Application + application: WGI_SERVICE + -- Gateway Service feature -- Server diff --git a/library/server/ewsgi/connectors/nino/nino-safe.ecf b/library/server/ewsgi/connectors/nino/nino-safe.ecf index 17f34c9e..06dc298e 100644 --- a/library/server/ewsgi/connectors/nino/nino-safe.ecf +++ b/library/server/ewsgi/connectors/nino/nino-safe.ecf @@ -13,7 +13,7 @@ - + diff --git a/library/server/ewsgi/connectors/nino/nino.ecf b/library/server/ewsgi/connectors/nino/nino.ecf index 375ae126..0e051988 100644 --- a/library/server/ewsgi/connectors/nino/nino.ecf +++ b/library/server/ewsgi/connectors/nino/nino.ecf @@ -13,7 +13,7 @@ - + diff --git a/library/server/ewsgi/connectors/nino/src/nino_application.e b/library/server/ewsgi/connectors/nino/src/nino_service.e similarity index 86% rename from library/server/ewsgi/connectors/nino/src/nino_application.e rename to library/server/ewsgi/connectors/nino/src/nino_service.e index 3d137bfb..b63bffd0 100644 --- a/library/server/ewsgi/connectors/nino/src/nino_application.e +++ b/library/server/ewsgi/connectors/nino/src/nino_service.e @@ -1,10 +1,10 @@ note - description: "Summary description for {NINO_APPLICATION}." + description: "Summary description for {NINO_SERVICE}." date: "$Date$" revision: "$Revision$" class - NINO_APPLICATION + NINO_SERVICE create make, @@ -12,18 +12,18 @@ create feature {NONE} -- Implementation - make (a_callback: like {WGI_AGENT_APPLICATION}.callback) + make (a_callback: like {WGI_AGENT_SERVICE}.callback) -- Initialize `Current'. do make_custom (a_callback, Void) end - make_custom (a_callback: like {WGI_AGENT_APPLICATION}.callback; a_base_url: detachable STRING) + make_custom (a_callback: like {WGI_AGENT_SERVICE}.callback; a_base_url: detachable STRING) -- Initialize `Current'. require base_url_starts_with_slash: (a_base_url /= Void and then not a_base_url.is_empty) implies a_base_url.starts_with ("/") local - app: WGI_AGENT_APPLICATION + app: WGI_AGENT_SERVICE do create app.make (a_callback) create connector.make_with_base (app, a_base_url) diff --git a/library/server/ewsgi/connectors/nino/src/wgi_nino_input_stream.e b/library/server/ewsgi/connectors/nino/src/wgi_nino_input_stream.e index 420a1df3..847d9c85 100644 --- a/library/server/ewsgi/connectors/nino/src/wgi_nino_input_stream.e +++ b/library/server/ewsgi/connectors/nino/src/wgi_nino_input_stream.e @@ -22,7 +22,7 @@ feature {NONE} -- Initialization set_source (a_source) end -feature {WGI_NINO_CONNECTOR, WGI_APPLICATION} -- Nino +feature {WGI_NINO_CONNECTOR, WGI_SERVICE} -- Nino set_source (i: like source) do diff --git a/library/server/ewsgi/connectors/nino/src/wgi_nino_output_stream.e b/library/server/ewsgi/connectors/nino/src/wgi_nino_output_stream.e index 559f7380..e7d99599 100644 --- a/library/server/ewsgi/connectors/nino/src/wgi_nino_output_stream.e +++ b/library/server/ewsgi/connectors/nino/src/wgi_nino_output_stream.e @@ -29,7 +29,7 @@ feature {NONE} -- Initialization set_target (a_target) end -feature {WGI_NINO_CONNECTOR, WGI_APPLICATION} -- Nino +feature {WGI_NINO_CONNECTOR, WGI_SERVICE} -- Nino set_target (o: like target) do diff --git a/library/server/ewsgi/examples/hello_world/src/hello_world.e b/library/server/ewsgi/examples/hello_world/src/hello_world.e index 522c0b48..d0fd4d36 100644 --- a/library/server/ewsgi/examples/hello_world/src/hello_world.e +++ b/library/server/ewsgi/examples/hello_world/src/hello_world.e @@ -15,7 +15,7 @@ feature {NONE} -- Initialization make do print ("Example: start a Nino web server on port " + port_number.out + ", %Nand reply Hello World for any request such as http://localhost:8123/%N") - (create {NINO_APPLICATION}.make_custom (agent execute, "")).listen (port_number) + (create {NINO_SERVICE}.make_custom (agent execute, "")).listen (port_number) end execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) diff --git a/library/server/ewsgi/specification/response/wgi_response_buffer.e b/library/server/ewsgi/specification/response/wgi_response_buffer.e index ccdb0a30..50b5aaf0 100644 --- a/library/server/ewsgi/specification/response/wgi_response_buffer.e +++ b/library/server/ewsgi/specification/response/wgi_response_buffer.e @@ -7,7 +7,7 @@ note deferred class WGI_RESPONSE_BUFFER -feature {WGI_APPLICATION} -- Commit +feature {WGI_SERVICE} -- Commit commit -- Commit the current response diff --git a/library/server/ewsgi/specification/wgi_application.e b/library/server/ewsgi/specification/wgi_service.e similarity index 92% rename from library/server/ewsgi/specification/wgi_application.e rename to library/server/ewsgi/specification/wgi_service.e index 121dd7e5..89a4b414 100644 --- a/library/server/ewsgi/specification/wgi_application.e +++ b/library/server/ewsgi/specification/wgi_service.e @@ -1,12 +1,12 @@ note - description: "Summary description for {WGI_APPLICATION}." + description: "Summary description for {WGI_SERVICE}." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" revision: "$Revision$" deferred class - WGI_APPLICATION + WGI_SERVICE feature {NONE} -- Execution diff --git a/library/server/ewsgi/src/helper/wgi_response_stream_buffer.e b/library/server/ewsgi/src/helper/wgi_response_stream_buffer.e index fa39f475..5de3610f 100644 --- a/library/server/ewsgi/src/helper/wgi_response_stream_buffer.e +++ b/library/server/ewsgi/src/helper/wgi_response_stream_buffer.e @@ -23,7 +23,7 @@ feature {NONE} -- Initialization output := a_output end -feature {WGI_APPLICATION} -- Commit +feature {WGI_SERVICE} -- Commit commit -- Commit the current response diff --git a/library/server/ewsgi/src/wgi_agent_application.e b/library/server/ewsgi/src/wgi_agent_service.e similarity index 89% rename from library/server/ewsgi/src/wgi_agent_application.e rename to library/server/ewsgi/src/wgi_agent_service.e index 6a5785a8..7635771e 100644 --- a/library/server/ewsgi/src/wgi_agent_application.e +++ b/library/server/ewsgi/src/wgi_agent_service.e @@ -1,14 +1,14 @@ note - description: "Summary description for {WGI_AGENT_APPLICATION}." + description: "Summary description for {WGI_AGENT_SERVICE}." author: "" date: "$Date$" revision: "$Revision$" class - WGI_AGENT_APPLICATION + WGI_AGENT_SERVICE inherit - WGI_APPLICATION + WGI_SERVICE create make diff --git a/library/server/ewsgi/src/wgi_application.e b/library/server/ewsgi/src/wgi_service.e similarity index 96% rename from library/server/ewsgi/src/wgi_application.e rename to library/server/ewsgi/src/wgi_service.e index 58df970f..e9adf6a0 100644 --- a/library/server/ewsgi/src/wgi_application.e +++ b/library/server/ewsgi/src/wgi_service.e @@ -1,6 +1,6 @@ note description: "[ - WGI_APPLICATION + WGI_SERVICE ]" specification: "EWSGI specification https://github.com/Eiffel-World/Eiffel-Web-Framework/wiki/EWSGI-specification" legal: "See notice at end of class." @@ -9,7 +9,7 @@ note revision: "$Revision$" deferred class - WGI_APPLICATION + WGI_SERVICE feature -- Execution diff --git a/library/server/request/rest/src/rest_application.e b/library/server/request/rest/src/rest_service.e similarity index 70% rename from library/server/request/rest/src/rest_application.e rename to library/server/request/rest/src/rest_service.e index 4d5bbaa6..1a395664 100644 --- a/library/server/request/rest/src/rest_application.e +++ b/library/server/request/rest/src/rest_service.e @@ -1,14 +1,14 @@ note - description: "Summary description for {DEFAULT_REST_APPLICATION}." + description: "Summary description for {DEFAULT_REST_SERVICE}." author: "" date: "$Date$" revision: "$Revision$" deferred class - REST_APPLICATION + REST_SERVICE inherit - REST_APPLICATION_I [REST_REQUEST_HANDLER [REST_REQUEST_HANDLER_CONTEXT], REST_REQUEST_HANDLER_CONTEXT] + REST_SERVICE_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/rest_application_i.e b/library/server/request/rest/src/rest_service_i.e similarity index 75% rename from library/server/request/rest/src/rest_application_i.e rename to library/server/request/rest/src/rest_service_i.e index d98e4d82..8c9ec1de 100644 --- a/library/server/request/rest/src/rest_application_i.e +++ b/library/server/request/rest/src/rest_service_i.e @@ -1,14 +1,14 @@ note - description: "Summary description for {REST_APPLICATION}." + description: "Summary description for {REST_SERVICE}." author: "" date: "$Date$" revision: "$Revision$" deferred class - REST_APPLICATION_I [H -> REST_REQUEST_HANDLER [C], C -> REST_REQUEST_HANDLER_CONTEXT] + REST_SERVICE_I [H -> REST_REQUEST_HANDLER [C], C -> REST_REQUEST_HANDLER_CONTEXT] inherit - ROUTED_APPLICATION_I [H, C] + ROUTED_SERVICE_I [H, C] redefine router end diff --git a/library/server/request/rest/src/uri/rest_uri_application.e b/library/server/request/rest/src/uri/rest_uri_service.e similarity index 71% rename from library/server/request/rest/src/uri/rest_uri_application.e rename to library/server/request/rest/src/uri/rest_uri_service.e index 7ef6e0ff..8d86f861 100644 --- a/library/server/request/rest/src/uri/rest_uri_application.e +++ b/library/server/request/rest/src/uri/rest_uri_service.e @@ -1,14 +1,14 @@ note - description: "Summary description for {DEFAULT_REST_URI_APPLICATION}." + description: "Summary description for {DEFAULT_REST_URI_SERVICE}." author: "" date: "$Date$" revision: "$Revision$" deferred class - REST_URI_APPLICATION + REST_URI_SERVICE inherit - REST_APPLICATION_I [REST_REQUEST_HANDLER [REST_REQUEST_URI_HANDLER_CONTEXT], REST_REQUEST_URI_HANDLER_CONTEXT] + REST_SERVICE_I [REST_REQUEST_HANDLER [REST_REQUEST_URI_HANDLER_CONTEXT], REST_REQUEST_URI_HANDLER_CONTEXT] redefine router end diff --git a/library/server/request/rest/src/uri_template/rest_uri_template_application.e b/library/server/request/rest/src/uri_template/rest_uri_template_service.e similarity index 77% rename from library/server/request/rest/src/uri_template/rest_uri_template_application.e rename to library/server/request/rest/src/uri_template/rest_uri_template_service.e index 753d49ea..d8c5bb89 100644 --- a/library/server/request/rest/src/uri_template/rest_uri_template_application.e +++ b/library/server/request/rest/src/uri_template/rest_uri_template_service.e @@ -1,14 +1,14 @@ note - description: "Summary description for {DEFAULT_URI_TEMPLATE_REST_APPLICATION}." + description: "Summary description for {DEFAULT_URI_TEMPLATE_REST_SERVICE}." author: "" date: "$Date$" revision: "$Revision$" deferred class - REST_URI_TEMPLATE_APPLICATION + REST_URI_TEMPLATE_SERVICE inherit - REST_APPLICATION_I [REST_REQUEST_HANDLER [REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] + REST_SERVICE_I [REST_REQUEST_HANDLER [REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REST_REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] redefine router end diff --git a/library/server/request/rest/tests/src/app_server.e b/library/server/request/rest/tests/src/app_server.e index 7e497c0b..b5ac30f1 100644 --- a/library/server/request/rest/tests/src/app_server.e +++ b/library/server/request/rest/tests/src/app_server.e @@ -8,12 +8,12 @@ class APP_SERVER inherit - APP_APPLICATION + APP_SERVICE redefine execute end - REST_APPLICATION_GATEWAY + REST_SERVICE_GATEWAY create make diff --git a/library/server/request/rest/tests/src/gateway/cgi/rest_application_gateway.e b/library/server/request/rest/tests/src/gateway/cgi/rest_service_gateway.e similarity index 86% rename from library/server/request/rest/tests/src/gateway/cgi/rest_application_gateway.e rename to library/server/request/rest/tests/src/gateway/cgi/rest_service_gateway.e index 17460d10..ad30f164 100644 --- a/library/server/request/rest/tests/src/gateway/cgi/rest_application_gateway.e +++ b/library/server/request/rest/tests/src/gateway/cgi/rest_service_gateway.e @@ -1,8 +1,8 @@ deferred class - REST_APPLICATION_GATEWAY + REST_SERVICE_GATEWAY inherit - WSF_APPLICATION + WSF_SERVICE feature -- Access diff --git a/library/server/request/rest/tests/src/gateway/fcgi/rest_application_gateway.e b/library/server/request/rest/tests/src/gateway/fcgi/rest_service_gateway.e similarity index 93% rename from library/server/request/rest/tests/src/gateway/fcgi/rest_application_gateway.e rename to library/server/request/rest/tests/src/gateway/fcgi/rest_service_gateway.e index e60c9fed..d2b88f43 100644 --- a/library/server/request/rest/tests/src/gateway/fcgi/rest_application_gateway.e +++ b/library/server/request/rest/tests/src/gateway/fcgi/rest_service_gateway.e @@ -1,8 +1,8 @@ deferred class - REST_APPLICATION_GATEWAY + REST_SERVICE_GATEWAY inherit - WSF_APPLICATION + WSF_SERVICE feature -- Access diff --git a/library/server/request/rest/tests/src/gateway/nino/rest_application_gateway.e b/library/server/request/rest/tests/src/gateway/nino/rest_service_gateway.e similarity index 93% rename from library/server/request/rest/tests/src/gateway/nino/rest_application_gateway.e rename to library/server/request/rest/tests/src/gateway/nino/rest_service_gateway.e index 34bf8341..c83eec29 100644 --- a/library/server/request/rest/tests/src/gateway/nino/rest_application_gateway.e +++ b/library/server/request/rest/tests/src/gateway/nino/rest_service_gateway.e @@ -1,14 +1,14 @@ deferred class - REST_APPLICATION_GATEWAY + REST_SERVICE_GATEWAY inherit - WSF_APPLICATION + WSF_SERVICE feature -- Access build_gateway_and_launch local - app: NINO_APPLICATION + app: NINO_SERVICE port_number: INTEGER base_url: STRING do diff --git a/library/server/request/rest/tests/src/handler/app_application.e b/library/server/request/rest/tests/src/handler/app_service.e similarity index 78% rename from library/server/request/rest/tests/src/handler/app_application.e rename to library/server/request/rest/tests/src/handler/app_service.e index 1f8ba22a..d1ed763a 100644 --- a/library/server/request/rest/tests/src/handler/app_application.e +++ b/library/server/request/rest/tests/src/handler/app_service.e @@ -1,14 +1,14 @@ note - description: "Summary description for {APP_APPLICATION}." + description: "Summary description for {APP_SERVICE}." author: "" date: "$Date$" revision: "$Revision$" deferred class - APP_APPLICATION + APP_SERVICE inherit - REST_APPLICATION_I [APP_REQUEST_HANDLER, APP_REQUEST_HANDLER_CONTEXT] + REST_SERVICE_I [APP_REQUEST_HANDLER, APP_REQUEST_HANDLER_CONTEXT] redefine router end diff --git a/library/server/request/router/src/default/routed_application.e b/library/server/request/router/src/default/routed_service.e similarity index 70% rename from library/server/request/router/src/default/routed_application.e rename to library/server/request/router/src/default/routed_service.e index a309e4c8..bbf289e1 100644 --- a/library/server/request/router/src/default/routed_application.e +++ b/library/server/request/router/src/default/routed_service.e @@ -1,14 +1,14 @@ note - description: "Summary description for {DEFAULT_ROUTED_APPLICATION}." + description: "Summary description for {DEFAULT_ROUTED_SERVICE}." author: "" date: "$Date$" revision: "$Revision$" deferred class - ROUTED_APPLICATION + ROUTED_SERVICE inherit - ROUTED_APPLICATION_I [REQUEST_HANDLER [REQUEST_HANDLER_CONTEXT], REQUEST_HANDLER_CONTEXT] + ROUTED_SERVICE_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/misc/routed_application_helper.e b/library/server/request/router/src/misc/routed_service_helper.e similarity index 96% rename from library/server/request/router/src/misc/routed_application_helper.e rename to library/server/request/router/src/misc/routed_service_helper.e index 681c3f5d..ac0524d2 100644 --- a/library/server/request/router/src/misc/routed_application_helper.e +++ b/library/server/request/router/src/misc/routed_service_helper.e @@ -1,11 +1,11 @@ note - description: "Summary description for {ROUTED_APPLICATION_HELPER}." + description: "Summary description for {ROUTED_SERVICE_HELPER}." author: "" date: "$Date$" revision: "$Revision$" class - ROUTED_APPLICATION_HELPER + ROUTED_SERVICE_HELPER inherit ANY diff --git a/library/server/request/router/src/request_handler.e b/library/server/request/router/src/request_handler.e index 71822760..e3cc7fa2 100644 --- a/library/server/request/router/src/request_handler.e +++ b/library/server/request/router/src/request_handler.e @@ -10,7 +10,7 @@ deferred class inherit ANY - ROUTED_APPLICATION_HELPER + ROUTED_SERVICE_HELPER export {NONE} all end diff --git a/library/server/request/router/src/routed_application_i.e b/library/server/request/router/src/routed_service_i.e similarity index 90% rename from library/server/request/router/src/routed_application_i.e rename to library/server/request/router/src/routed_service_i.e index 3c68daf1..56f86913 100644 --- a/library/server/request/router/src/routed_application_i.e +++ b/library/server/request/router/src/routed_service_i.e @@ -1,11 +1,11 @@ note - description: "Summary description for {ROUTED_APPLICATION}." + description: "Summary description for {ROUTED_SERVICE}." author: "" date: "$Date$" revision: "$Revision$" deferred class - ROUTED_APPLICATION_I [H -> REQUEST_HANDLER [C], C -> REQUEST_HANDLER_CONTEXT] + ROUTED_SERVICE_I [H -> REQUEST_HANDLER [C], C -> REQUEST_HANDLER_CONTEXT] feature -- Setup diff --git a/library/server/request/router/src/uri/default/uri_routed_application.e b/library/server/request/router/src/uri/default/uri_routed_service.e similarity index 72% rename from library/server/request/router/src/uri/default/uri_routed_application.e rename to library/server/request/router/src/uri/default/uri_routed_service.e index ff3272f0..69b9bf11 100644 --- a/library/server/request/router/src/uri/default/uri_routed_application.e +++ b/library/server/request/router/src/uri/default/uri_routed_service.e @@ -1,14 +1,14 @@ note - description: "Summary description for {DEFAULT_URI_ROUTED_APPLICATION}." + description: "Summary description for {DEFAULT_URI_ROUTED_SERVICE}." author: "" date: "$Date$" revision: "$Revision$" deferred class - URI_ROUTED_APPLICATION + URI_ROUTED_SERVICE inherit - ROUTED_APPLICATION_I [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT], REQUEST_URI_HANDLER_CONTEXT] + ROUTED_SERVICE_I [REQUEST_HANDLER [REQUEST_URI_HANDLER_CONTEXT], REQUEST_URI_HANDLER_CONTEXT] redefine router end diff --git a/library/server/request/router/src/uri_template/default/uri_template_routed_application.e b/library/server/request/router/src/uri_template/default/uri_template_routed_service.e similarity index 77% rename from library/server/request/router/src/uri_template/default/uri_template_routed_application.e rename to library/server/request/router/src/uri_template/default/uri_template_routed_service.e index bee5564c..1307d77b 100644 --- a/library/server/request/router/src/uri_template/default/uri_template_routed_application.e +++ b/library/server/request/router/src/uri_template/default/uri_template_routed_service.e @@ -1,14 +1,14 @@ note - description: "Summary description for {DEFAULT_URI_TEMPLATE_ROUTED_APPLICATION}." + description: "Summary description for {DEFAULT_URI_TEMPLATE_ROUTED_SERVICE}." author: "" date: "$Date$" revision: "$Revision$" deferred class - URI_TEMPLATE_ROUTED_APPLICATION + URI_TEMPLATE_ROUTED_SERVICE inherit - ROUTED_APPLICATION_I [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] + ROUTED_SERVICE_I [REQUEST_HANDLER [REQUEST_URI_TEMPLATE_HANDLER_CONTEXT], REQUEST_URI_TEMPLATE_HANDLER_CONTEXT] redefine router end diff --git a/library/server/wsf/default/cgi/default_application.e b/library/server/wsf/default/cgi/default_service.e similarity index 84% rename from library/server/wsf/default/cgi/default_application.e rename to library/server/wsf/default/cgi/default_service.e index 7fb7b785..425fe5ba 100644 --- a/library/server/wsf/default/cgi/default_application.e +++ b/library/server/wsf/default/cgi/default_service.e @@ -1,13 +1,13 @@ note - description: "Summary description for {DEFAULT_APPLICATION}." + description: "Summary description for {DEFAULT_SERVICE}." date: "$Date$" revision: "$Revision$" deferred class - DEFAULT_APPLICATION + DEFAULT_SERVICE inherit - WSF_APPLICATION + WSF_SERVICE feature {NONE} -- Initialization diff --git a/library/server/wsf/default/libfcgi/default_application.e b/library/server/wsf/default/libfcgi/default_service.e similarity index 84% rename from library/server/wsf/default/libfcgi/default_application.e rename to library/server/wsf/default/libfcgi/default_service.e index fd011bea..26b67e7a 100644 --- a/library/server/wsf/default/libfcgi/default_application.e +++ b/library/server/wsf/default/libfcgi/default_service.e @@ -1,13 +1,13 @@ note - description: "Summary description for {DEFAULT_APPLICATION}." + description: "Summary description for {DEFAULT_SERVICE}." date: "$Date$" revision: "$Revision$" deferred class - DEFAULT_APPLICATION + DEFAULT_SERVICE inherit - WSF_APPLICATION + WSF_SERVICE feature {NONE} -- Initialization diff --git a/library/server/wsf/default/nino-safe.ecf b/library/server/wsf/default/nino-safe.ecf index 8965e4d9..ca03c25c 100644 --- a/library/server/wsf/default/nino-safe.ecf +++ b/library/server/wsf/default/nino-safe.ecf @@ -14,7 +14,7 @@ - + diff --git a/library/server/wsf/default/nino.ecf b/library/server/wsf/default/nino.ecf index 9b2ac5da..bec96cc0 100644 --- a/library/server/wsf/default/nino.ecf +++ b/library/server/wsf/default/nino.ecf @@ -14,7 +14,7 @@ - + diff --git a/library/server/wsf/default/nino/default_application.e b/library/server/wsf/default/nino/default_service.e similarity index 87% rename from library/server/wsf/default/nino/default_application.e rename to library/server/wsf/default/nino/default_service.e index becc688a..0eb3c0d1 100644 --- a/library/server/wsf/default/nino/default_application.e +++ b/library/server/wsf/default/nino/default_service.e @@ -1,19 +1,19 @@ note - description: "Summary description for {DEFAULT_APPLICATION}." + description: "Summary description for {DEFAULT_SERVICE}." date: "$Date$" revision: "$Revision$" deferred class - DEFAULT_APPLICATION + DEFAULT_SERVICE inherit - WSF_APPLICATION + WSF_SERVICE feature {NONE} -- Initialization make_and_launch local - app: NINO_APPLICATION + app: NINO_SERVICE do port_number := 8080 base_url := "" diff --git a/library/server/wsf/src/wsf_request.e b/library/server/wsf/src/wsf_request.e index 9878c73a..17ac65fc 100644 --- a/library/server/wsf/src/wsf_request.e +++ b/library/server/wsf/src/wsf_request.e @@ -5,7 +5,7 @@ note It includes CGI interface and a few extra values that are usually valuable In addition it provides query_parameter(s) - form_data_parameter(s) + form_parameter(s) ... ]" date: "$Date$" @@ -17,7 +17,7 @@ class inherit DEBUG_OUTPUT -create {WSF_APPLICATION} +create {WSF_SERVICE} make_from_wgi convert @@ -1001,7 +1001,7 @@ feature {NONE} -- Form fields and related -- Variables sent by POST request local vars: like internal_form_data_parameters_table - s: STRING + s: READABLE_STRING_8 n: NATURAL_64 l_type: like content_type do @@ -1017,10 +1017,10 @@ feature {NONE} -- Form fields and related create vars.make (5) vars.compare_objects --| FIXME: optimization ... fetch the input data progressively, otherwise we might run out of memory ... - s := form_input_data (n.to_integer_32) --| FIXME truncated from NAT64 to INT32 + s := form_input_data (n) analyze_multipart_form (l_type, s, vars) else - s := form_input_data (n.to_integer_32) --| FIXME truncated from NAT64 to INT32 + s := form_input_data (n) vars := urlencoded_parameters (s) end if raw_post_data_recorded then @@ -1480,15 +1480,19 @@ feature {NONE} -- Internal value default_content_type: STRING = "text/plain" -- Default content type - form_input_data (nb: INTEGER): STRING + form_input_data (nb: NATURAL_64): READABLE_STRING_8 -- data from input form local + nb32: INTEGER n: INTEGER t: STRING + s: STRING_8 do from - n := nb - create Result.make (n) + nb32 := nb.to_integer_32 + n := nb32 + create s.make (n) + Result := s if n > 1_024 then n := 1_024 end @@ -1497,11 +1501,11 @@ feature {NONE} -- Internal value loop input.read_string (n) t := input.last_string - Result.append_string (t) + s.append_string (t) if t.count < n then n := 0 end - n := nb - t.count + n := nb32 - t.count end end diff --git a/library/server/wsf/src/wsf_response.e b/library/server/wsf/src/wsf_response.e index 13f6278e..e74ecb31 100644 --- a/library/server/wsf/src/wsf_response.e +++ b/library/server/wsf/src/wsf_response.e @@ -1,6 +1,6 @@ note description: "[ - Summary description for {WSF_RESPONSE}. + Main interface to send message back to the client ]" date: "$Date$" revision: "$Revision$" @@ -8,7 +8,7 @@ note class WSF_RESPONSE -create {WSF_APPLICATION} +create {WSF_SERVICE} make_from_wgi convert @@ -23,18 +23,6 @@ feature {NONE} -- Initialization wgi_response: WGI_RESPONSE_BUFFER ---feature {WSF_APPLICATION} -- Commit - --- commit --- -- Commit the current response --- do --- wgi_response.commit --- ensure --- status_is_set: status_is_set --- header_committed: header_committed --- message_committed: message_committed --- end - feature -- Status report header_committed: BOOLEAN @@ -55,15 +43,6 @@ feature -- Status report Result := wgi_response.message_writable end ---feature {WGI_RESPONSE_BUFFER} -- Core output operation - --- write (s: READABLE_STRING_8) --- -- Send the string `s' --- -- this can be used for header and body --- do --- wgi_response.write (s) --- end - feature -- Status setting status_is_set: BOOLEAN diff --git a/library/server/wsf/src/wsf_application.e b/library/server/wsf/src/wsf_service.e similarity index 70% rename from library/server/wsf/src/wsf_application.e rename to library/server/wsf/src/wsf_service.e index 29a728d8..a42fcfb6 100644 --- a/library/server/wsf/src/wsf_application.e +++ b/library/server/wsf/src/wsf_service.e @@ -1,13 +1,17 @@ note - description: "Objects that ..." + description: "[ + Inherit from this class to implement the main entry of your web service + You just need to implement `execute', get data from the request `req' + and write the response in `res' + ]" date: "$Date$" revision: "$Revision$" deferred class - WSF_APPLICATION + WSF_SERVICE inherit - WGI_APPLICATION + WGI_SERVICE rename execute as wgi_execute end diff --git a/library/server/wsf/tests/src/test_wsf_request.e b/library/server/wsf/tests/src/test_wsf_request.e index 539756be..fbe165d6 100644 --- a/library/server/wsf/tests/src/test_wsf_request.e +++ b/library/server/wsf/tests/src/test_wsf_request.e @@ -17,14 +17,14 @@ inherit on_clean end - WSF_APPLICATION + WSF_SERVICE undefine default_create end feature {NONE} -- Events - web_app: detachable NINO_APPLICATION + web_app: detachable NINO_SERVICE port_number: INTEGER base_url: detachable STRING @@ -32,7 +32,7 @@ feature {NONE} -- Events on_prepare -- local - app: NINO_APPLICATION + app: NINO_SERVICE wt: WORKER_THREAD e: EXECUTION_ENVIRONMENT do