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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<library name="ewsgi" location="../../ewsgi/ewsgi-safe.ecf"/>
|
||||
<library name="wsf" location="../wsf-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"/>
|
||||
</library>
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<library name="ewsgi" location="../../ewsgi/ewsgi.ecf"/>
|
||||
<library name="wsf" location="../wsf.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"/>
|
||||
</library>
|
||||
|
||||
|
||||
@@ -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 := ""
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
-- <Precursor>
|
||||
local
|
||||
app: NINO_APPLICATION
|
||||
app: NINO_SERVICE
|
||||
wt: WORKER_THREAD
|
||||
e: EXECUTION_ENVIRONMENT
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user