Renamed "ext" folder as "contrib" folder and reorganized a little bit

Renamed any *_APPLICATION as *_SERVICE
   mainly because those components
   such as WSF_APPLICATION, renamed as WSF_SERVICE
   are not always the main application entry, and "service" describe them better
Minor implementation change in WSF_REQUEST
Cosmetics
This commit is contained in:
Jocelyn Fiat
2011-11-17 15:50:30 +01:00
parent cc11debf08
commit 49c3e8e789
52 changed files with 134 additions and 144 deletions

12
.gitmodules vendored
View File

@@ -1,12 +1,12 @@
[submodule "doc/wiki"] [submodule "doc/wiki"]
path = doc/wiki path = doc/wiki
url = https://github.com/Eiffel-World/Eiffel-Web-Framework.wiki.git url = https://github.com/Eiffel-World/Eiffel-Web-Framework.wiki.git
[submodule "ext/server/nino"] [submodule "contrib/library/server/nino"]
path = ext/server/nino path = contrib/library/server/nino
url = http://github.com/Eiffel-World/EiffelWebNino.git url = http://github.com/Eiffel-World/EiffelWebNino.git
[submodule "ext/text/json"] [submodule "contrib/library/text/parser/json"]
path = ext/text/json path = contrib/library/text/parser/json
url = http://github.com/Eiffel-World/ejson-svn.git url = http://github.com/Eiffel-World/ejson-svn.git
[submodule "ext/ise_library/curl"] [submodule "contrib/ise_library/cURL"]
path = ext/ise_library/curl path = contrib/ise_library/cURL
url = http://github.com/EiffelSoftware/mirror-Eiffel-cURL.git url = http://github.com/EiffelSoftware/mirror-Eiffel-cURL.git

View File

@@ -10,11 +10,11 @@ class
inherit inherit
ANY ANY
URI_TEMPLATE_ROUTED_APPLICATION URI_TEMPLATE_ROUTED_SERVICE
ROUTED_APPLICATION_HELPER ROUTED_SERVICE_HELPER
DEFAULT_APPLICATION DEFAULT_SERVICE
create create
make make

View File

@@ -12,7 +12,7 @@
<setting name="concurrency" value="thread"/> <setting name="concurrency" value="thread"/>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/> <library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="http_client" location="..\..\..\library\client\http_client\http_client-safe.ecf" readonly="false"/> <library name="http_client" location="..\..\..\library\client\http_client\http_client-safe.ecf" readonly="false"/>
<library name="json" location="..\..\..\ext\text\json\library\json-safe.ecf" readonly="false"/> <library name="json" location="..\..\..\contrib\library\text\parser\json\library\json-safe.ecf" readonly="false"/>
<library name="thread" location="$ISE_LIBRARY\library\thread\thread-safe.ecf"/> <library name="thread" location="$ISE_LIBRARY\library\thread\thread-safe.ecf"/>
<cluster name="src" location=".\src\" recursive="true"/> <cluster name="src" location=".\src\" recursive="true"/>
</target> </target>

View File

@@ -11,7 +11,7 @@
</option> </option>
<setting name="concurrency" value="thread"/> <setting name="concurrency" value="thread"/>
<library name="http_client" location="..\..\..\library\client\http_client\http_client.ecf"/> <library name="http_client" location="..\..\..\library\client\http_client\http_client.ecf"/>
<library name="json" location="..\..\..\ext\text\json\library\json.ecf" readonly="false"/> <library name="json" location="..\..\..\contrib\library\text\parser\json\library\json.ecf" readonly="false"/>
<library name="base" location="$ISE_LIBRARY/library/base/base.ecf"/> <library name="base" location="$ISE_LIBRARY/library/base/base.ecf"/>
<library name="thread" location="$ISE_LIBRARY/library/thread/thread.ecf"/> <library name="thread" location="$ISE_LIBRARY/library/thread/thread.ecf"/>
<cluster name="src" location="./src" recursive="true"/> <cluster name="src" location="./src" recursive="true"/>

View File

@@ -18,7 +18,7 @@
<library name="eel" location="..\..\library\crypto\eel\eel-safe.ecf" readonly="false"/> <library name="eel" location="..\..\library\crypto\eel\eel-safe.ecf" readonly="false"/>
<library name="encoder" location="..\..\library\text\encoder\encoder-safe.ecf" readonly="false"/> <library name="encoder" location="..\..\library\text\encoder\encoder-safe.ecf" readonly="false"/>
<library name="http" location="..\..\library\protocol\http\http-safe.ecf" readonly="false"/> <library name="http" location="..\..\library\protocol\http\http-safe.ecf" readonly="false"/>
<library name="json" location="..\..\ext\text\json\library\json-safe.ecf" readonly="false"/> <library name="json" location="..\..\contrib\library\text\parser\json\library\json-safe.ecf" readonly="false"/>
<library name="router" location="..\..\library\server\request\router\router-safe.ecf" readonly="false"/> <library name="router" location="..\..\library\server\request\router\router-safe.ecf" readonly="false"/>
<library name="uri_template" location="..\..\library\protocol\uri_template\uri_template-safe.ecf" readonly="false"/> <library name="uri_template" location="..\..\library\protocol\uri_template\uri_template-safe.ecf" readonly="false"/>
<library name="wsf" location="..\..\library\server\wsf\wsf-safe.ecf" readonly="false"/> <library name="wsf" location="..\..\library\server\wsf\wsf-safe.ecf" readonly="false"/>

View File

@@ -60,18 +60,18 @@ feature -- HTTP Methods
end end
is_conditional_get (req : WSF_REQUEST; l_order : ORDER) : BOOLEAN 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 -- 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 -- if the representation hasn't changed, we return TRUE
-- then the response is a 304 with no entity body returned. -- then the response is a 304 with no entity body returned.
local local
etag_util : ETAG_UTILS etag_util : ETAG_UTILS
do do
if attached req.meta_variable ("HTTP_IF_NONE_MATCH") as if_none_match then if attached req.meta_variable ("HTTP_IF_NONE_MATCH") as if_none_match then
create etag_util create etag_util
if if_none_match.as_string.same_string (etag_util.md5_digest (l_order.out).as_string_32) then if if_none_match.as_string.same_string (etag_util.md5_digest (l_order.out).as_string_32) then
Result := True Result := True
end
end end
end
end end
compute_response_get (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE; l_order : ORDER) compute_response_get (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE; l_order : ORDER)

View File

@@ -10,11 +10,11 @@ class
inherit inherit
ANY ANY
URI_TEMPLATE_ROUTED_APPLICATION URI_TEMPLATE_ROUTED_SERVICE
ROUTED_APPLICATION_HELPER ROUTED_SERVICE_HELPER
DEFAULT_APPLICATION DEFAULT_SERVICE
create create
make make

View File

@@ -1,6 +1,5 @@
note note
description: "Summary description for {ETAG_UTILS}." description: "Summary description for {ETAG_UTILS}."
author: ""
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
@@ -8,25 +7,24 @@ class
ETAG_UTILS ETAG_UTILS
inherit inherit
ARRAY_FACILITIES ARRAY_FACILITIES
feature feature -- Access
md5_digest ( a_string : STRING ) : STRING
-- Cryptographic hash function that produces a 128-bit (16-byte) hash value, based on `a_string' md5_digest (a_string: STRING): STRING
-- Cryptographic hash function that produces a 128-bit (16-byte) hash value, based on `a_string'
local local
md5: MD5 md5: MD5
output: SPECIAL [NATURAL_8] output: SPECIAL [NATURAL_8]
do do
create md5.make create md5.make
create output.make_filled (0, 16) create output.make_filled (0, 16)
md5.sink_string (a_string) md5.sink_string (a_string)
md5.do_final (output, 0) md5.do_final (output, 0)
Result := as_natural_32_be (output, 0).to_hex_string Result := as_natural_32_be (output, 0).to_hex_string
Result := Result + as_natural_32_be (output, 4).to_hex_string Result.append (as_natural_32_be (output, 4).to_hex_string)
Result := Result + as_natural_32_be (output, 8).to_hex_string Result.append (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, 12).to_hex_string)
end end
note note

View File

@@ -15,7 +15,7 @@
<version type="compiler" min="7.0.8.7340"/> <version type="compiler" min="7.0.8.7340"/>
</condition> </condition>
</library> </library>
<library name="curl_local" location="..\..\..\ext\ise_library\cURL-safe.ecf"> <library name="curl_local" location="..\..\..\contrib\ise_library\cURL-safe.ecf">
<condition> <condition>
<version type="compiler" max="7.0.8.7339"/> <version type="compiler" max="7.0.8.7339"/>
</condition> </condition>

View File

@@ -15,7 +15,7 @@
<version type="compiler" min="7.0.8.7340"/> <version type="compiler" min="7.0.8.7340"/>
</condition> </condition>
</library> </library>
<library name="curl_local" location="..\..\..\ext\ise_library\cURL.ecf"> <library name="curl_local" location="..\..\..\contrib\ise_library\cURL.ecf">
<condition> <condition>
<version type="compiler" max="7.0.8.7339"/> <version type="compiler" max="7.0.8.7339"/>
</condition> </condition>

View File

@@ -1,7 +1,12 @@
# Eiffel Web Server Gateway Interface # Eiffel Web Server Gateway Interface
## Overview ## 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 ## Usage
## ##

View File

@@ -22,8 +22,8 @@ feature {NONE} -- Initialization
feature {NONE} -- Access feature {NONE} -- Access
application: WGI_APPLICATION application: WGI_SERVICE
-- Gateway Application -- Gateway Service
feature -- Server feature -- Server

View File

@@ -13,7 +13,7 @@
<library name="connector" location="..\connector-safe.ecf" readonly="false"/> <library name="connector" location="..\connector-safe.ecf" readonly="false"/>
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/> <library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
<library name="http" location="..\..\..\..\protocol\http\http-safe.ecf"/> <library name="http" location="..\..\..\..\protocol\http\http-safe.ecf"/>
<library name="nino" location="..\..\..\..\..\ext\server\nino\nino-safe.ecf" readonly="false"> <library name="nino" location="..\..\..\..\..\contrib\library\server\nino\nino-safe.ecf" readonly="false">
<renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/> <renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/>
</library> </library>
<cluster name="src" location=".\src\" recursive="true"/> <cluster name="src" location=".\src\" recursive="true"/>

View File

@@ -13,7 +13,7 @@
<library name="connector" location="..\connector.ecf" readonly="false"/> <library name="connector" location="..\connector.ecf" readonly="false"/>
<library name="ewsgi" location="..\..\ewsgi.ecf" readonly="false"/> <library name="ewsgi" location="..\..\ewsgi.ecf" readonly="false"/>
<library name="http" location="..\..\..\..\protocol\http\http.ecf"/> <library name="http" location="..\..\..\..\protocol\http\http.ecf"/>
<library name="nino" location="..\..\..\..\..\ext\server\nino\nino.ecf" readonly="false"> <library name="nino" location="..\..\..\..\..\contrib\library\server\nino\nino.ecf" readonly="false">
<renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/> <renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/>
</library> </library>
<cluster name="src" location=".\src\" recursive="true"/> <cluster name="src" location=".\src\" recursive="true"/>

View File

@@ -1,10 +1,10 @@
note note
description: "Summary description for {NINO_APPLICATION}." description: "Summary description for {NINO_SERVICE}."
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
class class
NINO_APPLICATION NINO_SERVICE
create create
make, make,
@@ -12,18 +12,18 @@ create
feature {NONE} -- Implementation feature {NONE} -- Implementation
make (a_callback: like {WGI_AGENT_APPLICATION}.callback) make (a_callback: like {WGI_AGENT_SERVICE}.callback)
-- Initialize `Current'. -- Initialize `Current'.
do do
make_custom (a_callback, Void) make_custom (a_callback, Void)
end 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'. -- Initialize `Current'.
require require
base_url_starts_with_slash: (a_base_url /= Void and then not a_base_url.is_empty) implies a_base_url.starts_with ("/") base_url_starts_with_slash: (a_base_url /= Void and then not a_base_url.is_empty) implies a_base_url.starts_with ("/")
local local
app: WGI_AGENT_APPLICATION app: WGI_AGENT_SERVICE
do do
create app.make (a_callback) create app.make (a_callback)
create connector.make_with_base (app, a_base_url) create connector.make_with_base (app, a_base_url)

View File

@@ -22,7 +22,7 @@ feature {NONE} -- Initialization
set_source (a_source) set_source (a_source)
end end
feature {WGI_NINO_CONNECTOR, WGI_APPLICATION} -- Nino feature {WGI_NINO_CONNECTOR, WGI_SERVICE} -- Nino
set_source (i: like source) set_source (i: like source)
do do

View File

@@ -29,7 +29,7 @@ feature {NONE} -- Initialization
set_target (a_target) set_target (a_target)
end end
feature {WGI_NINO_CONNECTOR, WGI_APPLICATION} -- Nino feature {WGI_NINO_CONNECTOR, WGI_SERVICE} -- Nino
set_target (o: like target) set_target (o: like target)
do do

View File

@@ -15,7 +15,7 @@ feature {NONE} -- Initialization
make make
do 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") 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 end
execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)

View File

@@ -7,7 +7,7 @@ note
deferred class deferred class
WGI_RESPONSE_BUFFER WGI_RESPONSE_BUFFER
feature {WGI_APPLICATION} -- Commit feature {WGI_SERVICE} -- Commit
commit commit
-- Commit the current response -- Commit the current response

View File

@@ -1,12 +1,12 @@
note note
description: "Summary description for {WGI_APPLICATION}." description: "Summary description for {WGI_SERVICE}."
legal: "See notice at end of class." legal: "See notice at end of class."
status: "See notice at end of class." status: "See notice at end of class."
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
deferred class deferred class
WGI_APPLICATION WGI_SERVICE
feature {NONE} -- Execution feature {NONE} -- Execution

View File

@@ -23,7 +23,7 @@ feature {NONE} -- Initialization
output := a_output output := a_output
end end
feature {WGI_APPLICATION} -- Commit feature {WGI_SERVICE} -- Commit
commit commit
-- Commit the current response -- Commit the current response

View File

@@ -1,14 +1,14 @@
note note
description: "Summary description for {WGI_AGENT_APPLICATION}." description: "Summary description for {WGI_AGENT_SERVICE}."
author: "" author: ""
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
class class
WGI_AGENT_APPLICATION WGI_AGENT_SERVICE
inherit inherit
WGI_APPLICATION WGI_SERVICE
create create
make make

View File

@@ -1,6 +1,6 @@
note note
description: "[ description: "[
WGI_APPLICATION WGI_SERVICE
]" ]"
specification: "EWSGI specification https://github.com/Eiffel-World/Eiffel-Web-Framework/wiki/EWSGI-specification" specification: "EWSGI specification https://github.com/Eiffel-World/Eiffel-Web-Framework/wiki/EWSGI-specification"
legal: "See notice at end of class." legal: "See notice at end of class."
@@ -9,7 +9,7 @@ note
revision: "$Revision$" revision: "$Revision$"
deferred class deferred class
WGI_APPLICATION WGI_SERVICE
feature -- Execution feature -- Execution

View File

@@ -1,14 +1,14 @@
note note
description: "Summary description for {DEFAULT_REST_APPLICATION}." description: "Summary description for {DEFAULT_REST_SERVICE}."
author: "" author: ""
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
deferred class deferred class
REST_APPLICATION REST_SERVICE
inherit 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 note
copyright: "Copyright (c) 1984-2011, Eiffel Software and others" copyright: "Copyright (c) 1984-2011, Eiffel Software and others"

View File

@@ -1,14 +1,14 @@
note note
description: "Summary description for {REST_APPLICATION}." description: "Summary description for {REST_SERVICE}."
author: "" author: ""
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
deferred class 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 inherit
ROUTED_APPLICATION_I [H, C] ROUTED_SERVICE_I [H, C]
redefine redefine
router router
end end

View File

@@ -1,14 +1,14 @@
note note
description: "Summary description for {DEFAULT_REST_URI_APPLICATION}." description: "Summary description for {DEFAULT_REST_URI_SERVICE}."
author: "" author: ""
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
deferred class deferred class
REST_URI_APPLICATION REST_URI_SERVICE
inherit 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 redefine
router router
end end

View File

@@ -1,14 +1,14 @@
note note
description: "Summary description for {DEFAULT_URI_TEMPLATE_REST_APPLICATION}." description: "Summary description for {DEFAULT_URI_TEMPLATE_REST_SERVICE}."
author: "" author: ""
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
deferred class deferred class
REST_URI_TEMPLATE_APPLICATION REST_URI_TEMPLATE_SERVICE
inherit 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 redefine
router router
end end

View File

@@ -8,12 +8,12 @@ class
APP_SERVER APP_SERVER
inherit inherit
APP_APPLICATION APP_SERVICE
redefine redefine
execute execute
end end
REST_APPLICATION_GATEWAY REST_SERVICE_GATEWAY
create create
make make

View File

@@ -1,8 +1,8 @@
deferred class deferred class
REST_APPLICATION_GATEWAY REST_SERVICE_GATEWAY
inherit inherit
WSF_APPLICATION WSF_SERVICE
feature -- Access feature -- Access

View File

@@ -1,8 +1,8 @@
deferred class deferred class
REST_APPLICATION_GATEWAY REST_SERVICE_GATEWAY
inherit inherit
WSF_APPLICATION WSF_SERVICE
feature -- Access feature -- Access

View File

@@ -1,14 +1,14 @@
deferred class deferred class
REST_APPLICATION_GATEWAY REST_SERVICE_GATEWAY
inherit inherit
WSF_APPLICATION WSF_SERVICE
feature -- Access feature -- Access
build_gateway_and_launch build_gateway_and_launch
local local
app: NINO_APPLICATION app: NINO_SERVICE
port_number: INTEGER port_number: INTEGER
base_url: STRING base_url: STRING
do do

View File

@@ -1,14 +1,14 @@
note note
description: "Summary description for {APP_APPLICATION}." description: "Summary description for {APP_SERVICE}."
author: "" author: ""
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
deferred class deferred class
APP_APPLICATION APP_SERVICE
inherit inherit
REST_APPLICATION_I [APP_REQUEST_HANDLER, APP_REQUEST_HANDLER_CONTEXT] REST_SERVICE_I [APP_REQUEST_HANDLER, APP_REQUEST_HANDLER_CONTEXT]
redefine redefine
router router
end end

View File

@@ -1,14 +1,14 @@
note note
description: "Summary description for {DEFAULT_ROUTED_APPLICATION}." description: "Summary description for {DEFAULT_ROUTED_SERVICE}."
author: "" author: ""
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
deferred class deferred class
ROUTED_APPLICATION ROUTED_SERVICE
inherit inherit
ROUTED_APPLICATION_I [REQUEST_HANDLER [REQUEST_HANDLER_CONTEXT], REQUEST_HANDLER_CONTEXT] ROUTED_SERVICE_I [REQUEST_HANDLER [REQUEST_HANDLER_CONTEXT], REQUEST_HANDLER_CONTEXT]
note note
copyright: "2011-2011, Eiffel Software and others" copyright: "2011-2011, Eiffel Software and others"

View File

@@ -1,11 +1,11 @@
note note
description: "Summary description for {ROUTED_APPLICATION_HELPER}." description: "Summary description for {ROUTED_SERVICE_HELPER}."
author: "" author: ""
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
class class
ROUTED_APPLICATION_HELPER ROUTED_SERVICE_HELPER
inherit inherit
ANY ANY

View File

@@ -10,7 +10,7 @@ deferred class
inherit inherit
ANY ANY
ROUTED_APPLICATION_HELPER ROUTED_SERVICE_HELPER
export export
{NONE} all {NONE} all
end end

View File

@@ -1,11 +1,11 @@
note note
description: "Summary description for {ROUTED_APPLICATION}." description: "Summary description for {ROUTED_SERVICE}."
author: "" author: ""
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
deferred class 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 feature -- Setup

View File

@@ -1,14 +1,14 @@
note note
description: "Summary description for {DEFAULT_URI_ROUTED_APPLICATION}." description: "Summary description for {DEFAULT_URI_ROUTED_SERVICE}."
author: "" author: ""
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
deferred class deferred class
URI_ROUTED_APPLICATION URI_ROUTED_SERVICE
inherit 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 redefine
router router
end end

View File

@@ -1,14 +1,14 @@
note note
description: "Summary description for {DEFAULT_URI_TEMPLATE_ROUTED_APPLICATION}." description: "Summary description for {DEFAULT_URI_TEMPLATE_ROUTED_SERVICE}."
author: "" author: ""
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
deferred class deferred class
URI_TEMPLATE_ROUTED_APPLICATION URI_TEMPLATE_ROUTED_SERVICE
inherit 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 redefine
router router
end end

View File

@@ -1,13 +1,13 @@
note note
description: "Summary description for {DEFAULT_APPLICATION}." description: "Summary description for {DEFAULT_SERVICE}."
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
deferred class deferred class
DEFAULT_APPLICATION DEFAULT_SERVICE
inherit inherit
WSF_APPLICATION WSF_SERVICE
feature {NONE} -- Initialization feature {NONE} -- Initialization

View File

@@ -1,13 +1,13 @@
note note
description: "Summary description for {DEFAULT_APPLICATION}." description: "Summary description for {DEFAULT_SERVICE}."
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
deferred class deferred class
DEFAULT_APPLICATION DEFAULT_SERVICE
inherit inherit
WSF_APPLICATION WSF_SERVICE
feature {NONE} -- Initialization feature {NONE} -- Initialization

View File

@@ -14,7 +14,7 @@
<library name="ewsgi" location="../../ewsgi/ewsgi-safe.ecf"/> <library name="ewsgi" location="../../ewsgi/ewsgi-safe.ecf"/>
<library name="wsf" location="../wsf-safe.ecf"/> <library name="wsf" location="../wsf-safe.ecf"/>
<library name="connector_nino" location="../../ewsgi/connectors/nino/nino-safe.ecf"/> <library name="connector_nino" location="../../ewsgi/connectors/nino/nino-safe.ecf"/>
<library name="nino" location="..\..\..\..\ext\server\nino\nino-safe.ecf" readonly="false"> <library name="nino" location="..\..\..\..\contrib\library\server\nino\nino-safe.ecf" readonly="false">
<renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/> <renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/>
</library> </library>

View File

@@ -14,7 +14,7 @@
<library name="ewsgi" location="../../ewsgi/ewsgi.ecf"/> <library name="ewsgi" location="../../ewsgi/ewsgi.ecf"/>
<library name="wsf" location="../wsf.ecf"/> <library name="wsf" location="../wsf.ecf"/>
<library name="connector_nino" location="../../ewsgi/connectors/nino/nino.ecf"/> <library name="connector_nino" location="../../ewsgi/connectors/nino/nino.ecf"/>
<library name="nino" location="..\..\..\..\ext\server\nino\nino.ecf" readonly="false"> <library name="nino" location="..\..\..\..\contrib\library\server\nino\nino.ecf" readonly="false">
<renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/> <renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/>
</library> </library>

View File

@@ -1,19 +1,19 @@
note note
description: "Summary description for {DEFAULT_APPLICATION}." description: "Summary description for {DEFAULT_SERVICE}."
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
deferred class deferred class
DEFAULT_APPLICATION DEFAULT_SERVICE
inherit inherit
WSF_APPLICATION WSF_SERVICE
feature {NONE} -- Initialization feature {NONE} -- Initialization
make_and_launch make_and_launch
local local
app: NINO_APPLICATION app: NINO_SERVICE
do do
port_number := 8080 port_number := 8080
base_url := "" base_url := ""

View File

@@ -5,7 +5,7 @@ note
It includes CGI interface and a few extra values that are usually valuable It includes CGI interface and a few extra values that are usually valuable
In addition it provides In addition it provides
query_parameter(s) query_parameter(s)
form_data_parameter(s) form_parameter(s)
... ...
]" ]"
date: "$Date$" date: "$Date$"
@@ -17,7 +17,7 @@ class
inherit inherit
DEBUG_OUTPUT DEBUG_OUTPUT
create {WSF_APPLICATION} create {WSF_SERVICE}
make_from_wgi make_from_wgi
convert convert
@@ -1001,7 +1001,7 @@ feature {NONE} -- Form fields and related
-- Variables sent by POST request -- Variables sent by POST request
local local
vars: like internal_form_data_parameters_table vars: like internal_form_data_parameters_table
s: STRING s: READABLE_STRING_8
n: NATURAL_64 n: NATURAL_64
l_type: like content_type l_type: like content_type
do do
@@ -1017,10 +1017,10 @@ feature {NONE} -- Form fields and related
create vars.make (5) create vars.make (5)
vars.compare_objects vars.compare_objects
--| FIXME: optimization ... fetch the input data progressively, otherwise we might run out of memory ... --| 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) analyze_multipart_form (l_type, s, vars)
else else
s := form_input_data (n.to_integer_32) --| FIXME truncated from NAT64 to INT32 s := form_input_data (n)
vars := urlencoded_parameters (s) vars := urlencoded_parameters (s)
end end
if raw_post_data_recorded then if raw_post_data_recorded then
@@ -1480,15 +1480,19 @@ feature {NONE} -- Internal value
default_content_type: STRING = "text/plain" default_content_type: STRING = "text/plain"
-- Default content type -- Default content type
form_input_data (nb: INTEGER): STRING form_input_data (nb: NATURAL_64): READABLE_STRING_8
-- data from input form -- data from input form
local local
nb32: INTEGER
n: INTEGER n: INTEGER
t: STRING t: STRING
s: STRING_8
do do
from from
n := nb nb32 := nb.to_integer_32
create Result.make (n) n := nb32
create s.make (n)
Result := s
if n > 1_024 then if n > 1_024 then
n := 1_024 n := 1_024
end end
@@ -1497,11 +1501,11 @@ feature {NONE} -- Internal value
loop loop
input.read_string (n) input.read_string (n)
t := input.last_string t := input.last_string
Result.append_string (t) s.append_string (t)
if t.count < n then if t.count < n then
n := 0 n := 0
end end
n := nb - t.count n := nb32 - t.count
end end
end end

View File

@@ -1,6 +1,6 @@
note note
description: "[ description: "[
Summary description for {WSF_RESPONSE}. Main interface to send message back to the client
]" ]"
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
@@ -8,7 +8,7 @@ note
class class
WSF_RESPONSE WSF_RESPONSE
create {WSF_APPLICATION} create {WSF_SERVICE}
make_from_wgi make_from_wgi
convert convert
@@ -23,18 +23,6 @@ feature {NONE} -- Initialization
wgi_response: WGI_RESPONSE_BUFFER 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 feature -- Status report
header_committed: BOOLEAN header_committed: BOOLEAN
@@ -55,15 +43,6 @@ feature -- Status report
Result := wgi_response.message_writable Result := wgi_response.message_writable
end 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 feature -- Status setting
status_is_set: BOOLEAN status_is_set: BOOLEAN

View File

@@ -1,13 +1,17 @@
note 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$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
deferred class deferred class
WSF_APPLICATION WSF_SERVICE
inherit inherit
WGI_APPLICATION WGI_SERVICE
rename rename
execute as wgi_execute execute as wgi_execute
end end

View File

@@ -17,14 +17,14 @@ inherit
on_clean on_clean
end end
WSF_APPLICATION WSF_SERVICE
undefine undefine
default_create default_create
end end
feature {NONE} -- Events feature {NONE} -- Events
web_app: detachable NINO_APPLICATION web_app: detachable NINO_SERVICE
port_number: INTEGER port_number: INTEGER
base_url: detachable STRING base_url: detachable STRING
@@ -32,7 +32,7 @@ feature {NONE} -- Events
on_prepare on_prepare
-- <Precursor> -- <Precursor>
local local
app: NINO_APPLICATION app: NINO_SERVICE
wt: WORKER_THREAD wt: WORKER_THREAD
e: EXECUTION_ENVIRONMENT e: EXECUTION_ENVIRONMENT
do do