fix merge conflict from master
This commit is contained in:
15
doc/how-to-include-ewf-in-my-git-repository.txt
Normal file
15
doc/how-to-include-ewf-in-my-git-repository.txt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
GOAL: include EWF into your own git repository
|
||||||
|
For instance, let's put it under lib/EWF
|
||||||
|
|
||||||
|
git remote add -f _ewf https://github.com/EiffelWebFramework/EWF.git
|
||||||
|
git merge --squash -s ours --no-commit _ewf/master
|
||||||
|
git read-tree --prefix=lib/EWF/ -u _ewf/master
|
||||||
|
git commit -m "Imported EWF into subtree lib/EWF/"
|
||||||
|
|
||||||
|
Then to update lib/EWF
|
||||||
|
git pull -X subtree=lib/EWF _ewf master
|
||||||
|
|
||||||
|
From another git clone, reconnect this "import"
|
||||||
|
git remote add -f _ewf https://github.com/EiffelWebFramework/EWF.git
|
||||||
|
git merge -s ours --no-commit --squash _ewf/master
|
||||||
|
and then update lib/EWF as described before
|
||||||
@@ -13,10 +13,12 @@
|
|||||||
</option>
|
</option>
|
||||||
<setting name="concurrency" value="thread"/>
|
<setting name="concurrency" value="thread"/>
|
||||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf" readonly="true"/>
|
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf" readonly="true"/>
|
||||||
|
<library name="net" location="$ISE_LIBRARY\library\net\net-safe.ecf" readonly="true"/>
|
||||||
<library name="default_nino" location="..\..\library\server\wsf\default\nino-safe.ecf" readonly="true"/>
|
<library name="default_nino" location="..\..\library\server\wsf\default\nino-safe.ecf" readonly="true"/>
|
||||||
<library name="http" location="../../library/network/protocol/http/http-safe.ecf" readonly="true"/>
|
<library name="http" location="../../library/network/protocol/http/http-safe.ecf" readonly="true"/>
|
||||||
<library name="json" location="..\..\contrib\library\text\parser\json\library\json-safe.ecf" readonly="true"/>
|
<library name="json" location="..\..\contrib\library\text\parser\json\library\json-safe.ecf" readonly="true"/>
|
||||||
<library name="wsf" location="..\..\library\server\wsf\wsf-safe.ecf" readonly="true"/>
|
<library name="wsf" location="..\..\library\server\wsf\wsf-safe.ecf" readonly="true"/>
|
||||||
|
<library name="wsf_router_context" location="..\..\library\server\wsf\wsf_router_context-safe.ecf" readonly="true"/>
|
||||||
<library name="wsf_extension" location="..\..\library\server\wsf\wsf_extension-safe.ecf" readonly="true"/>
|
<library name="wsf_extension" location="..\..\library\server\wsf\wsf_extension-safe.ecf" readonly="true"/>
|
||||||
<library name="http_authorization" location="..\..\library\server\authentication\http_authorization\http_authorization-safe.ecf" readonly="true"/>
|
<library name="http_authorization" location="..\..\library\server\authentication\http_authorization\http_authorization-safe.ecf" readonly="true"/>
|
||||||
<cluster name="src" location="src\" recursive="true"/>
|
<cluster name="src" location="src\" recursive="true"/>
|
||||||
|
|||||||
@@ -10,12 +10,22 @@ class
|
|||||||
inherit
|
inherit
|
||||||
ANY
|
ANY
|
||||||
|
|
||||||
WSF_FILTERED_SERVICE
|
|
||||||
|
|
||||||
WSF_HANDLER_HELPER
|
WSF_HANDLER_HELPER
|
||||||
|
|
||||||
WSF_DEFAULT_SERVICE
|
WSF_DEFAULT_SERVICE
|
||||||
|
|
||||||
|
WSF_ROUTED_SERVICE
|
||||||
|
rename
|
||||||
|
execute as execute_router
|
||||||
|
end
|
||||||
|
|
||||||
|
WSF_FILTERED_SERVICE
|
||||||
|
|
||||||
|
WSF_FILTER
|
||||||
|
rename
|
||||||
|
execute as execute_router
|
||||||
|
end
|
||||||
|
|
||||||
SHARED_EJSON
|
SHARED_EJSON
|
||||||
|
|
||||||
create
|
create
|
||||||
@@ -24,29 +34,29 @@ create
|
|||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make
|
make
|
||||||
|
local
|
||||||
|
l_message: STRING
|
||||||
|
l_factory: INET_ADDRESS_FACTORY
|
||||||
do
|
do
|
||||||
|
initialize_router
|
||||||
initialize_filter
|
initialize_filter
|
||||||
initialize_json
|
initialize_json
|
||||||
set_service_option ("port", 9090)
|
set_service_option ("port", port)
|
||||||
|
create l_message.make_empty
|
||||||
|
l_message.append_string ("Launching filter server at ")
|
||||||
|
create l_factory
|
||||||
|
l_message.append_string (l_factory.create_localhost.host_name)
|
||||||
|
l_message.append_string (" port ")
|
||||||
|
l_message.append_integer (port)
|
||||||
|
io.put_string (l_message)
|
||||||
|
io.put_new_line
|
||||||
make_and_launch
|
make_and_launch
|
||||||
end
|
end
|
||||||
|
|
||||||
create_filter
|
create_filter
|
||||||
-- Create `filter'
|
-- Create `filter'
|
||||||
local
|
|
||||||
l_authentication_filter_hdl: AUTHENTICATION_FILTER
|
|
||||||
l_user_filter: USER_HANDLER
|
|
||||||
l_routing_filter: WSF_ROUTING_FILTER
|
|
||||||
do
|
do
|
||||||
create router.make (1)
|
create {WSF_CORS_FILTER} filter
|
||||||
create l_authentication_filter_hdl
|
|
||||||
create l_user_filter
|
|
||||||
l_authentication_filter_hdl.set_next (l_user_filter)
|
|
||||||
|
|
||||||
router.handle_with_request_methods ("/user/{userid}", l_authentication_filter_hdl, router.methods_get)
|
|
||||||
create l_routing_filter.make (router)
|
|
||||||
l_routing_filter.set_execute_default_action (agent execute_default)
|
|
||||||
filter := l_routing_filter
|
|
||||||
end
|
end
|
||||||
|
|
||||||
setup_filter
|
setup_filter
|
||||||
@@ -56,6 +66,28 @@ feature {NONE} -- Initialization
|
|||||||
do
|
do
|
||||||
create l_logging_filter
|
create l_logging_filter
|
||||||
filter.set_next (l_logging_filter)
|
filter.set_next (l_logging_filter)
|
||||||
|
l_logging_filter.set_next (Current)
|
||||||
|
end
|
||||||
|
|
||||||
|
setup_router
|
||||||
|
-- Setup `router'
|
||||||
|
local
|
||||||
|
l_options_filter: WSF_CORS_OPTIONS_FILTER
|
||||||
|
l_authentication_filter: AUTHENTICATION_FILTER
|
||||||
|
l_user_filter: USER_HANDLER
|
||||||
|
l_methods: WSF_REQUEST_METHODS
|
||||||
|
do
|
||||||
|
create l_options_filter.make (router)
|
||||||
|
create l_authentication_filter
|
||||||
|
create l_user_filter
|
||||||
|
|
||||||
|
l_options_filter.set_next (l_authentication_filter)
|
||||||
|
l_authentication_filter.set_next (l_user_filter)
|
||||||
|
|
||||||
|
create l_methods
|
||||||
|
l_methods.enable_options
|
||||||
|
l_methods.enable_get
|
||||||
|
router.handle_with_request_methods ("/user/{userid}", create {WSF_URI_TEMPLATE_AGENT_HANDLER}.make (agent l_options_filter.execute), l_methods)
|
||||||
end
|
end
|
||||||
|
|
||||||
initialize_json
|
initialize_json
|
||||||
@@ -64,26 +96,10 @@ feature {NONE} -- Initialization
|
|||||||
json.add_converter (create {JSON_USER_CONVERTER}.make)
|
json.add_converter (create {JSON_USER_CONVERTER}.make)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Basic operations
|
|
||||||
|
|
||||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
|
||||||
do
|
|
||||||
filter.execute (req, res)
|
|
||||||
end
|
|
||||||
|
|
||||||
execute_default (req: WSF_REQUEST; res: WSF_RESPONSE)
|
|
||||||
local
|
|
||||||
l_message: WSF_DEFAULT_ROUTER_RESPONSE
|
|
||||||
do
|
|
||||||
create l_message.make_with_router (req, router)
|
|
||||||
l_message.set_documentation_included (True)
|
|
||||||
res.send (l_message)
|
|
||||||
end
|
|
||||||
|
|
||||||
feature {NONE} -- Implementation
|
feature {NONE} -- Implementation
|
||||||
|
|
||||||
router: WSF_ROUTER;
|
port: INTEGER = 9090
|
||||||
-- Router
|
-- Port number
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2013, Olivier Ligot, Jocelyn Fiat and others"
|
copyright: "2011-2013, Olivier Ligot, Jocelyn Fiat and others"
|
||||||
|
|||||||
@@ -504,6 +504,32 @@ feature -- Content-type helpers
|
|||||||
put_content_type_multipart_encrypted do put_content_type ({HTTP_MIME_TYPES}.multipart_encrypted) end
|
put_content_type_multipart_encrypted do put_content_type ({HTTP_MIME_TYPES}.multipart_encrypted) end
|
||||||
put_content_type_application_x_www_form_encoded do put_content_type ({HTTP_MIME_TYPES}.application_x_www_form_encoded) end
|
put_content_type_application_x_www_form_encoded do put_content_type ({HTTP_MIME_TYPES}.application_x_www_form_encoded) end
|
||||||
|
|
||||||
|
feature -- Cross-Origin Resource Sharing
|
||||||
|
|
||||||
|
put_access_control_allow_origin (s: READABLE_STRING_8)
|
||||||
|
-- Put "Access-Control-Allow-Origin" header.
|
||||||
|
do
|
||||||
|
put_header_key_value ({HTTP_HEADER_NAMES}.header_access_control_allow_origin, s)
|
||||||
|
end
|
||||||
|
|
||||||
|
put_access_control_allow_all_origin
|
||||||
|
-- Put "Access-Control-Allow-Origin: *" header.
|
||||||
|
do
|
||||||
|
put_access_control_allow_origin ("*")
|
||||||
|
end
|
||||||
|
|
||||||
|
put_access_control_allow_methods (a_methods: ITERABLE [READABLE_STRING_8])
|
||||||
|
-- If `a_methods' is not empty, put `Access-Control-Allow-Methods' header with list `a_methods' of methods
|
||||||
|
do
|
||||||
|
put_header_key_values ({HTTP_HEADER_NAMES}.header_access_control_allow_methods, a_methods, Void)
|
||||||
|
end
|
||||||
|
|
||||||
|
put_access_control_allow_headers (s: READABLE_STRING_8)
|
||||||
|
-- Put "Access-Control-Allow-Headers" header.
|
||||||
|
do
|
||||||
|
put_header_key_value ({HTTP_HEADER_NAMES}.header_access_control_allow_headers, s)
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Method related
|
feature -- Method related
|
||||||
|
|
||||||
put_allow (a_methods: ITERABLE [READABLE_STRING_8])
|
put_allow (a_methods: ITERABLE [READABLE_STRING_8])
|
||||||
|
|||||||
@@ -194,6 +194,23 @@ feature -- Response header name
|
|||||||
-- Indicates the authentication scheme that should be used to access the requested entity.
|
-- Indicates the authentication scheme that should be used to access the requested entity.
|
||||||
--| Example: WWW-Authenticate: Basic
|
--| Example: WWW-Authenticate: Basic
|
||||||
|
|
||||||
|
feature -- Cross-Origin Resource Sharing
|
||||||
|
|
||||||
|
header_access_control_allow_origin: STRING = "Access-Control-Allow-Origin"
|
||||||
|
-- Indicates whether a resource can be shared based by returning
|
||||||
|
-- the value of the Origin request header in the response.
|
||||||
|
-- | Example: Access-Control-Allow-Origin: http://example.org
|
||||||
|
|
||||||
|
header_access_control_allow_methods: STRING = "Access-Control-Allow-Methods"
|
||||||
|
-- Indicates, as part of the response to a preflight request,
|
||||||
|
-- which methods can be used during the actual request.
|
||||||
|
-- | Example: Access-Control-Allow-Methods: PUT, DELETE
|
||||||
|
|
||||||
|
header_access_control_allow_headers: STRING = "Access-Control-Allow-Headers"
|
||||||
|
-- Indicates, as part of the response to a preflight request,
|
||||||
|
-- which header field names can be used during the actual request.
|
||||||
|
-- | Example: Access-Control-Allow-Headers: Authorization
|
||||||
|
|
||||||
feature -- Request or Response header name
|
feature -- Request or Response header name
|
||||||
|
|
||||||
header_cache_control: STRING = "Cache-Control"
|
header_cache_control: STRING = "Cache-Control"
|
||||||
@@ -248,7 +265,7 @@ feature -- MIME related
|
|||||||
header_content_transfer_encoding: STRING = "Content-Transfer-Encoding"
|
header_content_transfer_encoding: STRING = "Content-Transfer-Encoding"
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -92,5 +92,19 @@ feature -- Access
|
|||||||
|
|
||||||
http_authorization: detachable IMMUTABLE_STRING_8
|
http_authorization: detachable IMMUTABLE_STRING_8
|
||||||
|
|
||||||
|
feature -- Status report
|
||||||
|
|
||||||
|
is_basic: BOOLEAN
|
||||||
|
-- Is Basic authorization?
|
||||||
|
do
|
||||||
|
if attached type as t then
|
||||||
|
Result := t.same_string ("basic")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
invariant
|
||||||
|
|
||||||
|
type_is_lower: attached type as t implies t.same_string (t.as_lower)
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ feature -- Access
|
|||||||
|
|
||||||
http_transfer_encoding: STRING = "HTTP_TRANSFER_ENCODING"
|
http_transfer_encoding: STRING = "HTTP_TRANSFER_ENCODING"
|
||||||
|
|
||||||
|
http_access_control_request_headers: STRING = "HTTP_ACCESS_CONTROL_REQUEST_HEADERS"
|
||||||
|
|
||||||
gateway_interface: STRING = "GATEWAY_INTERFACE"
|
gateway_interface: STRING = "GATEWAY_INTERFACE"
|
||||||
|
|
||||||
auth_type: STRING = "AUTH_TYPE"
|
auth_type: STRING = "AUTH_TYPE"
|
||||||
|
|||||||
@@ -598,6 +598,12 @@ feature -- HTTP_*
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
|
http_access_control_request_headers: detachable READABLE_STRING_8
|
||||||
|
-- Indicates which headers will be used in the actual request
|
||||||
|
-- as part of the preflight request
|
||||||
|
deferred
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Extra CGI environment variables
|
feature -- Extra CGI environment variables
|
||||||
|
|
||||||
request_uri: READABLE_STRING_8
|
request_uri: READABLE_STRING_8
|
||||||
|
|||||||
@@ -241,6 +241,13 @@ feature -- Access: HTTP_* CGI meta parameters - 1.1
|
|||||||
Result := meta_string_variable ({WGI_META_NAMES}.http_transfer_encoding)
|
Result := meta_string_variable ({WGI_META_NAMES}.http_transfer_encoding)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
http_access_control_request_headers: detachable READABLE_STRING_8
|
||||||
|
-- Indicates which headers will be used in the actual request
|
||||||
|
-- as part of the preflight request
|
||||||
|
do
|
||||||
|
Result := meta_string_variable ({WGI_META_NAMES}.http_access_control_request_headers)
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Access: Extension to CGI meta parameters - 1.1
|
feature -- Access: Extension to CGI meta parameters - 1.1
|
||||||
|
|
||||||
request_uri: READABLE_STRING_8
|
request_uri: READABLE_STRING_8
|
||||||
|
|||||||
37
library/server/wsf/router/filter/wsf_cors_filter.e
Normal file
37
library/server/wsf/router/filter/wsf_cors_filter.e
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
note
|
||||||
|
description: "Cross-Origin Resource Sharing filter."
|
||||||
|
author: "Olivier Ligot"
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
EIS: "name=Cross-Origin Resource Sharing", "src=http://www.w3.org/TR/cors/", "tag=W3C"
|
||||||
|
|
||||||
|
class
|
||||||
|
WSF_CORS_FILTER
|
||||||
|
|
||||||
|
inherit
|
||||||
|
WSF_FILTER
|
||||||
|
|
||||||
|
feature -- Basic operations
|
||||||
|
|
||||||
|
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
|
-- Execute the filter.
|
||||||
|
local
|
||||||
|
l_header: HTTP_HEADER
|
||||||
|
do
|
||||||
|
create l_header.make
|
||||||
|
l_header.put_access_control_allow_all_origin
|
||||||
|
res.put_header_text (l_header.string)
|
||||||
|
execute_next (req, res)
|
||||||
|
end
|
||||||
|
|
||||||
|
note
|
||||||
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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
|
||||||
57
library/server/wsf/router/filter/wsf_cors_options_filter.e
Normal file
57
library/server/wsf/router/filter/wsf_cors_options_filter.e
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
note
|
||||||
|
description: "Filter that handles an OPTIONS request, with Cross-Origin Resource Sharing support."
|
||||||
|
author: "Olvier Ligot"
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
EIS: "name=Cross-Origin Resource Sharing", "src=http://www.w3.org/TR/cors/", "tag=W3C"
|
||||||
|
|
||||||
|
class
|
||||||
|
WSF_CORS_OPTIONS_FILTER
|
||||||
|
|
||||||
|
inherit
|
||||||
|
WSF_FILTER
|
||||||
|
|
||||||
|
create
|
||||||
|
make
|
||||||
|
|
||||||
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
|
make (a_router: like router)
|
||||||
|
-- Initialize Current with `a_router'.
|
||||||
|
do
|
||||||
|
router := a_router
|
||||||
|
ensure
|
||||||
|
router_set: router = a_router
|
||||||
|
end
|
||||||
|
|
||||||
|
feature -- Access
|
||||||
|
|
||||||
|
router: WSF_ROUTER
|
||||||
|
-- Associated router
|
||||||
|
|
||||||
|
feature -- Basic operations
|
||||||
|
|
||||||
|
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
|
-- Execute the filter.
|
||||||
|
local
|
||||||
|
msg: WSF_CORS_OPTIONS_RESPONSE
|
||||||
|
do
|
||||||
|
if req.is_request_method ({HTTP_REQUEST_METHODS}.method_options) then
|
||||||
|
create msg.make (req, router)
|
||||||
|
res.send (msg)
|
||||||
|
else
|
||||||
|
execute_next (req, res)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
note
|
||||||
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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
|
||||||
@@ -14,7 +14,7 @@ feature -- Access
|
|||||||
|
|
||||||
feature -- Element change
|
feature -- Element change
|
||||||
|
|
||||||
set_next (a_next: WSF_FILTER)
|
set_next (a_next: like next)
|
||||||
-- Set `next' to `a_next'
|
-- Set `next' to `a_next'
|
||||||
do
|
do
|
||||||
next := a_next
|
next := a_next
|
||||||
@@ -26,6 +26,9 @@ feature -- Basic operations
|
|||||||
|
|
||||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
-- Execute the filter.
|
-- Execute the filter.
|
||||||
|
require
|
||||||
|
req_attached: req /= Void
|
||||||
|
res_attached: res /= Void
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -33,6 +36,9 @@ feature {NONE} -- Implementation
|
|||||||
|
|
||||||
execute_next (req: WSF_REQUEST; res: WSF_RESPONSE)
|
execute_next (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
-- Execute the `next' filter.
|
-- Execute the `next' filter.
|
||||||
|
require
|
||||||
|
req_attached: req /= Void
|
||||||
|
res_attached: res /= Void
|
||||||
do
|
do
|
||||||
if attached next as n then
|
if attached next as n then
|
||||||
n.execute (req, res)
|
n.execute (req, res)
|
||||||
@@ -40,7 +46,7 @@ feature {NONE} -- Implementation
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ note
|
|||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
WSF_FILTER_HANDLER
|
WSF_FILTER_HANDLER [G -> WSF_HANDLER]
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
WSF_HANDLER
|
WSF_HANDLER
|
||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
next: detachable WSF_HANDLER
|
next: detachable G
|
||||||
-- Next handler
|
-- Next handler
|
||||||
|
|
||||||
feature -- Element change
|
feature -- Element change
|
||||||
@@ -29,7 +29,7 @@ feature -- Element change
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -35,8 +35,15 @@ feature -- Access
|
|||||||
filter: WSF_FILTER
|
filter: WSF_FILTER
|
||||||
-- Filter
|
-- Filter
|
||||||
|
|
||||||
|
feature -- Execution
|
||||||
|
|
||||||
|
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
|
do
|
||||||
|
filter.execute (req, res)
|
||||||
|
end
|
||||||
|
|
||||||
;note
|
;note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
note
|
||||||
|
description: "[
|
||||||
|
Handler wrapping a filter
|
||||||
|
]"
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
|
||||||
|
class
|
||||||
|
WSF_HANDLER_FILTER_WRAPPER
|
||||||
|
|
||||||
|
inherit
|
||||||
|
WSF_HANDLER
|
||||||
|
|
||||||
|
create
|
||||||
|
make_with_filter
|
||||||
|
|
||||||
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
|
make_with_filter (f: WSF_FILTER)
|
||||||
|
-- Build Current with `f'.
|
||||||
|
require
|
||||||
|
f_attached: f /= Void
|
||||||
|
do
|
||||||
|
filter := f
|
||||||
|
ensure
|
||||||
|
filter_set: filter = f
|
||||||
|
end
|
||||||
|
|
||||||
|
feature -- Access
|
||||||
|
|
||||||
|
filter: WSF_FILTER
|
||||||
|
-- Associated filter.
|
||||||
|
|
||||||
|
feature -- Execution
|
||||||
|
|
||||||
|
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
|
-- Execute handler for `req' and respond in `res'
|
||||||
|
-- by passing through filter `filter'
|
||||||
|
do
|
||||||
|
filter.execute (req, res)
|
||||||
|
end
|
||||||
|
|
||||||
|
note
|
||||||
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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
|
||||||
@@ -44,10 +44,12 @@ feature -- Basic operations
|
|||||||
|
|
||||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
-- Execute the filter
|
-- Execute the filter
|
||||||
|
local
|
||||||
|
sess: WSF_ROUTER_SESSION
|
||||||
do
|
do
|
||||||
if attached router.dispatch_and_return_handler (req, res) then
|
create sess
|
||||||
check router.is_dispatched end
|
router.dispatch (req, res, sess)
|
||||||
else
|
if not sess.dispatched then
|
||||||
execute_default (req, res)
|
execute_default (req, res)
|
||||||
end
|
end
|
||||||
execute_next (req, res)
|
execute_next (req, res)
|
||||||
@@ -63,7 +65,7 @@ feature -- Basic operations
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -8,18 +8,10 @@ deferred class
|
|||||||
WSF_STARTS_WITH_FILTER_HANDLER
|
WSF_STARTS_WITH_FILTER_HANDLER
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
WSF_FILTER_HANDLER
|
WSF_FILTER_HANDLER [WSF_STARTS_WITH_HANDLER]
|
||||||
redefine
|
|
||||||
next
|
|
||||||
end
|
|
||||||
|
|
||||||
WSF_STARTS_WITH_HANDLER
|
WSF_STARTS_WITH_HANDLER
|
||||||
|
|
||||||
feature -- Access
|
|
||||||
|
|
||||||
next: detachable WSF_STARTS_WITH_FILTER_HANDLER
|
|
||||||
-- Next handler
|
|
||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|
||||||
execute_next (a_start_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE)
|
execute_next (a_start_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
@@ -30,7 +22,7 @@ feature -- Execution
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ feature -- Status
|
|||||||
Result := p.starts_with (s)
|
Result := p.starts_with (s)
|
||||||
end
|
end
|
||||||
|
|
||||||
routed_handler (req: WSF_REQUEST; res: WSF_RESPONSE; a_router: WSF_ROUTER): detachable WSF_HANDLER
|
try (req: WSF_REQUEST; res: WSF_RESPONSE; sess: WSF_ROUTER_SESSION; a_router: WSF_ROUTER)
|
||||||
-- Return the handler if Current matches the request `req'.
|
-- Return the handler if Current matches the request `req'.
|
||||||
local
|
local
|
||||||
p: READABLE_STRING_8
|
p: READABLE_STRING_8
|
||||||
@@ -67,7 +67,7 @@ feature -- Status
|
|||||||
p := path_from_request (req)
|
p := path_from_request (req)
|
||||||
s := based_uri (uri, a_router)
|
s := based_uri (uri, a_router)
|
||||||
if p.starts_with (s) then
|
if p.starts_with (s) then
|
||||||
Result := handler
|
sess.set_dispatched_handler (handler)
|
||||||
a_router.execute_before (Current)
|
a_router.execute_before (Current)
|
||||||
execute_handler (handler, s, req, res)
|
execute_handler (handler, s, req, res)
|
||||||
a_router.execute_after (Current)
|
a_router.execute_after (Current)
|
||||||
@@ -113,7 +113,7 @@ invariant
|
|||||||
uri_attached: uri /= Void
|
uri_attached: uri /= Void
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ feature {NONE} -- Initialization
|
|||||||
action := a_action
|
action := a_action
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature -- Access
|
||||||
|
|
||||||
action: PROCEDURE [ANY, TUPLE [request: WSF_REQUEST; response: WSF_RESPONSE]]
|
action: PROCEDURE [ANY, TUPLE [request: WSF_REQUEST; response: WSF_RESPONSE]]
|
||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
@@ -30,7 +32,7 @@ feature -- Execution
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -8,18 +8,10 @@ deferred class
|
|||||||
WSF_URI_FILTER_HANDLER
|
WSF_URI_FILTER_HANDLER
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
WSF_FILTER_HANDLER
|
WSF_FILTER_HANDLER [WSF_URI_HANDLER]
|
||||||
redefine
|
|
||||||
next
|
|
||||||
end
|
|
||||||
|
|
||||||
WSF_URI_HANDLER
|
WSF_URI_HANDLER
|
||||||
|
|
||||||
feature -- Access
|
|
||||||
|
|
||||||
next: detachable WSF_URI_FILTER_HANDLER
|
|
||||||
-- Next handler
|
|
||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|
||||||
execute_next (req: WSF_REQUEST; res: WSF_RESPONSE)
|
execute_next (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
@@ -30,7 +22,7 @@ feature -- Execution
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -7,35 +7,15 @@ note
|
|||||||
deferred class
|
deferred class
|
||||||
WSF_URI_ROUTED_SERVICE
|
WSF_URI_ROUTED_SERVICE
|
||||||
|
|
||||||
|
obsolete "Inherit from WSF_ROUTED_SERVICE and WSF_URI_ROUTER_HELPER [2013-mar-19]"
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
WSF_ROUTED_SERVICE
|
WSF_ROUTED_SERVICE
|
||||||
|
|
||||||
feature -- Mapping helper: uri
|
WSF_URI_ROUTER_HELPER
|
||||||
|
|
||||||
map_uri (a_uri: READABLE_STRING_8; h: WSF_URI_HANDLER)
|
|
||||||
do
|
|
||||||
map_uri_with_request_methods (a_uri, h, Void)
|
|
||||||
end
|
|
||||||
|
|
||||||
map_uri_with_request_methods (a_uri: READABLE_STRING_8; h: WSF_URI_HANDLER; rqst_methods: detachable WSF_REQUEST_METHODS)
|
|
||||||
do
|
|
||||||
router.map_with_request_methods (create {WSF_URI_MAPPING}.make (a_uri, h), rqst_methods)
|
|
||||||
end
|
|
||||||
|
|
||||||
feature -- Mapping helper: uri agent
|
|
||||||
|
|
||||||
map_uri_agent (a_uri: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]])
|
|
||||||
do
|
|
||||||
map_uri_agent_with_request_methods (a_uri, proc, Void)
|
|
||||||
end
|
|
||||||
|
|
||||||
map_uri_agent_with_request_methods (a_uri: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
|
|
||||||
do
|
|
||||||
map_uri_with_request_methods (a_uri, create {WSF_URI_AGENT_HANDLER}.make (proc), rqst_methods)
|
|
||||||
end
|
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
note
|
||||||
|
description: "Summary description for {WSF_URI_ROUTER_HELPER}."
|
||||||
|
author: ""
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
|
||||||
|
deferred class
|
||||||
|
WSF_URI_ROUTER_HELPER
|
||||||
|
|
||||||
|
feature -- Access
|
||||||
|
|
||||||
|
router: WSF_ROUTER
|
||||||
|
deferred
|
||||||
|
end
|
||||||
|
|
||||||
|
feature -- Mapping helper: uri
|
||||||
|
|
||||||
|
map_uri (a_uri: READABLE_STRING_8; h: WSF_URI_HANDLER)
|
||||||
|
do
|
||||||
|
map_uri_with_request_methods (a_uri, h, Void)
|
||||||
|
end
|
||||||
|
|
||||||
|
map_uri_with_request_methods (a_uri: READABLE_STRING_8; h: WSF_URI_HANDLER; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||||
|
do
|
||||||
|
router.map_with_request_methods (create {WSF_URI_MAPPING}.make (a_uri, h), rqst_methods)
|
||||||
|
end
|
||||||
|
|
||||||
|
feature -- Mapping helper: uri agent
|
||||||
|
|
||||||
|
map_uri_agent (a_uri: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]])
|
||||||
|
do
|
||||||
|
map_uri_agent_with_request_methods (a_uri, proc, Void)
|
||||||
|
end
|
||||||
|
|
||||||
|
map_uri_agent_with_request_methods (a_uri: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||||
|
do
|
||||||
|
map_uri_with_request_methods (a_uri, create {WSF_URI_AGENT_HANDLER}.make (proc), rqst_methods)
|
||||||
|
end
|
||||||
|
|
||||||
|
note
|
||||||
|
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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
|
||||||
@@ -72,10 +72,10 @@ feature -- Status
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
routed_handler (req: WSF_REQUEST; res: WSF_RESPONSE; a_router: WSF_ROUTER): detachable WSF_HANDLER
|
try (req: WSF_REQUEST; res: WSF_RESPONSE; sess: WSF_ROUTER_SESSION; a_router: WSF_ROUTER)
|
||||||
do
|
do
|
||||||
if is_mapping (req, a_router) then
|
if is_mapping (req, a_router) then
|
||||||
Result := handler
|
sess.set_dispatched_handler (handler)
|
||||||
a_router.execute_before (Current)
|
a_router.execute_before (Current)
|
||||||
execute_handler (handler, req, res)
|
execute_handler (handler, req, res)
|
||||||
a_router.execute_after (Current)
|
a_router.execute_after (Current)
|
||||||
@@ -105,7 +105,7 @@ feature {NONE} -- Implementation
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ feature {NONE} -- Initialization
|
|||||||
action := a_action
|
action := a_action
|
||||||
end
|
end
|
||||||
|
|
||||||
|
feature -- Access
|
||||||
|
|
||||||
action: PROCEDURE [ANY, TUPLE [request: WSF_REQUEST; response: WSF_RESPONSE]]
|
action: PROCEDURE [ANY, TUPLE [request: WSF_REQUEST; response: WSF_RESPONSE]]
|
||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
@@ -30,7 +32,7 @@ feature -- Execution
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -8,18 +8,10 @@ deferred class
|
|||||||
WSF_URI_TEMPLATE_FILTER_HANDLER
|
WSF_URI_TEMPLATE_FILTER_HANDLER
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
WSF_FILTER_HANDLER
|
WSF_FILTER_HANDLER [WSF_URI_TEMPLATE_HANDLER]
|
||||||
redefine
|
|
||||||
next
|
|
||||||
end
|
|
||||||
|
|
||||||
WSF_URI_TEMPLATE_HANDLER
|
WSF_URI_TEMPLATE_HANDLER
|
||||||
|
|
||||||
feature -- Access
|
|
||||||
|
|
||||||
next: detachable WSF_URI_TEMPLATE_HANDLER
|
|
||||||
-- Next handler
|
|
||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|
||||||
execute_next (req: WSF_REQUEST; res: WSF_RESPONSE)
|
execute_next (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
@@ -30,7 +22,7 @@ feature -- Execution
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -6,11 +6,14 @@ note
|
|||||||
|
|
||||||
deferred class WSF_URI_TEMPLATE_ROUTED_SERVICE
|
deferred class WSF_URI_TEMPLATE_ROUTED_SERVICE
|
||||||
|
|
||||||
|
obsolete "Inherit from WSF_ROUTED_SERVICE and WSF_URI_ROUTER_HELPER [2013-mar-19]"
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
|
|
||||||
WSF_ROUTED_SERVICE
|
WSF_ROUTED_SERVICE
|
||||||
|
|
||||||
WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_SERVICE
|
WSF_URI_TEMPLATE_ROUTER_HELPER
|
||||||
|
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
note
|
||||||
|
description: "Summary description for {WSF_URI_TEMPLATE_ROUTER_HELPER}."
|
||||||
|
author: ""
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
|
||||||
|
deferred class
|
||||||
|
WSF_URI_TEMPLATE_ROUTER_HELPER
|
||||||
|
|
||||||
|
feature -- Access
|
||||||
|
|
||||||
|
router: WSF_ROUTER
|
||||||
|
deferred
|
||||||
|
end
|
||||||
|
|
||||||
|
feature -- Mapping helper: uri
|
||||||
|
|
||||||
|
map_uri_template (a_tpl: STRING; h: WSF_URI_TEMPLATE_HANDLER)
|
||||||
|
-- Map `h' as handler for `a_tpl'
|
||||||
|
require
|
||||||
|
a_tpl_attached: a_tpl /= Void
|
||||||
|
h_attached: h /= Void
|
||||||
|
do
|
||||||
|
map_uri_template_with_request_methods (a_tpl, h, Void)
|
||||||
|
end
|
||||||
|
|
||||||
|
map_uri_template_with_request_methods (a_tpl: READABLE_STRING_8; h: WSF_URI_TEMPLATE_HANDLER; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||||
|
-- Map `h' as handler for `a_tpl' for request methods `rqst_methods'.
|
||||||
|
require
|
||||||
|
a_tpl_attached: a_tpl /= Void
|
||||||
|
h_attached: h /= Void
|
||||||
|
do
|
||||||
|
router.map_with_request_methods (create {WSF_URI_TEMPLATE_MAPPING}.make (a_tpl, h), rqst_methods)
|
||||||
|
end
|
||||||
|
|
||||||
|
feature -- Mapping helper: uri agent
|
||||||
|
|
||||||
|
map_uri_template_agent (a_tpl: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]])
|
||||||
|
-- Map `proc' as handler for `a_tpl'
|
||||||
|
require
|
||||||
|
a_tpl_attached: a_tpl /= Void
|
||||||
|
proc_attached: proc /= Void
|
||||||
|
do
|
||||||
|
map_uri_template_agent_with_request_methods (a_tpl, proc, Void)
|
||||||
|
end
|
||||||
|
|
||||||
|
map_uri_template_agent_with_request_methods (a_tpl: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||||
|
-- Map `proc' as handler for `a_tpl' for request methods `rqst_methods'.
|
||||||
|
require
|
||||||
|
a_tpl_attached: a_tpl /= Void
|
||||||
|
proc_attached: proc /= Void
|
||||||
|
do
|
||||||
|
map_uri_template_with_request_methods (a_tpl, create {WSF_URI_TEMPLATE_AGENT_HANDLER}.make (proc), rqst_methods)
|
||||||
|
end
|
||||||
|
|
||||||
|
note
|
||||||
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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
|
||||||
@@ -68,7 +68,7 @@ feature -- Status
|
|||||||
Result := tpl.match (p) /= Void
|
Result := tpl.match (p) /= Void
|
||||||
end
|
end
|
||||||
|
|
||||||
routed_handler (req: WSF_REQUEST; res: WSF_RESPONSE; a_router: WSF_ROUTER): detachable WSF_HANDLER
|
try (req: WSF_REQUEST; res: WSF_RESPONSE; sess: WSF_ROUTER_SESSION; a_router: WSF_ROUTER)
|
||||||
-- <Precursor>
|
-- <Precursor>
|
||||||
local
|
local
|
||||||
tpl: URI_TEMPLATE
|
tpl: URI_TEMPLATE
|
||||||
@@ -78,7 +78,7 @@ feature -- Status
|
|||||||
p := path_from_request (req)
|
p := path_from_request (req)
|
||||||
tpl := based_uri_template (template, a_router)
|
tpl := based_uri_template (template, a_router)
|
||||||
if attached tpl.match (p) as tpl_res then
|
if attached tpl.match (p) as tpl_res then
|
||||||
Result := handler
|
sess.set_dispatched_handler (handler)
|
||||||
a_router.execute_before (Current)
|
a_router.execute_before (Current)
|
||||||
--| Applied the context to the request
|
--| Applied the context to the request
|
||||||
--| in practice, this will fill the {WSF_REQUEST}.path_parameters
|
--| in practice, this will fill the {WSF_REQUEST}.path_parameters
|
||||||
@@ -126,7 +126,7 @@ feature {NONE} -- Implementation
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {WSF_HANDLER}."
|
description: "[
|
||||||
author: ""
|
Represents the ancestor of all the WSF_ROUTER handler.
|
||||||
|
]"
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ feature {WSF_ROUTER} -- Mapping
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -40,10 +40,12 @@ feature -- Execution
|
|||||||
require
|
require
|
||||||
req_attached: req /= Void
|
req_attached: req /= Void
|
||||||
res_attached: res /= Void
|
res_attached: res /= Void
|
||||||
|
local
|
||||||
|
sess: WSF_ROUTER_SESSION
|
||||||
do
|
do
|
||||||
if attached router.dispatch_and_return_handler (req, res) as p then
|
create sess
|
||||||
-- executed
|
router.dispatch (req, res, sess)
|
||||||
else
|
if not sess.dispatched then
|
||||||
execute_default (req, res)
|
execute_default (req, res)
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
|
|||||||
@@ -112,75 +112,84 @@ feature -- Mapping handler
|
|||||||
map_with_request_methods (f.new_mapping (a_resource), rqst_methods)
|
map_with_request_methods (f.new_mapping (a_resource), rqst_methods)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Access
|
|
||||||
|
|
||||||
is_dispatched: BOOLEAN
|
|
||||||
-- `dispatch' set `is_dispatched' to True
|
|
||||||
-- if mapping was found, and associated handler executed
|
|
||||||
|
|
||||||
feature -- Basic operations
|
feature -- Basic operations
|
||||||
|
|
||||||
dispatch (req: WSF_REQUEST; res: WSF_RESPONSE)
|
dispatch (req: WSF_REQUEST; res: WSF_RESPONSE; sess: detachable WSF_ROUTER_SESSION)
|
||||||
-- Dispatch request `req' among the `mappings'.
|
-- Dispatch request `req' among the `mappings'.
|
||||||
-- Set `is_dispatched' if the request were dispatched.
|
-- Set `sess' if the request were dispatched and `sess' attached.
|
||||||
require
|
require
|
||||||
req_attached: req /= Void
|
req_attached: req /= Void
|
||||||
res_attached: res /= Void
|
res_attached: res /= Void
|
||||||
|
local
|
||||||
|
l_sess: detachable WSF_ROUTER_SESSION
|
||||||
do
|
do
|
||||||
if attached dispatch_and_return_handler (req, res) then
|
l_sess := sess
|
||||||
check is_dispatched: is_dispatched end
|
if l_sess = Void then
|
||||||
|
create l_sess
|
||||||
end
|
end
|
||||||
|
router_dispatch (req, res, l_sess)
|
||||||
end
|
end
|
||||||
|
|
||||||
dispatch_and_return_handler (req: WSF_REQUEST; res: WSF_RESPONSE): detachable WSF_HANDLER
|
dispatch_and_return_handler (req: WSF_REQUEST; res: WSF_RESPONSE): detachable WSF_HANDLER
|
||||||
-- Dispatch request `req' among the `mappings'
|
-- Dispatch request `req' among the `mappings'
|
||||||
-- And return the associated handler if mapping found and handler executed.
|
-- And return the associated handler if mapping found and handler executed.
|
||||||
--| Violates CQS
|
--| Violates CQS
|
||||||
|
obsolete
|
||||||
|
"Use `dispatch' [2013-mar-21]"
|
||||||
require
|
require
|
||||||
req_attached: req /= Void
|
req_attached: req /= Void
|
||||||
res_attached: res /= Void
|
res_attached: res /= Void
|
||||||
|
local
|
||||||
|
sess: WSF_ROUTER_SESSION
|
||||||
|
do
|
||||||
|
create sess
|
||||||
|
router_dispatch (req, res, sess)
|
||||||
|
Result := sess.dispatched_handler
|
||||||
|
end
|
||||||
|
|
||||||
|
feature {NONE} -- Dispatch implementation
|
||||||
|
|
||||||
|
router_dispatch (req: WSF_REQUEST; res: WSF_RESPONSE; sess: WSF_ROUTER_SESSION)
|
||||||
|
require
|
||||||
|
req_attached: req /= Void
|
||||||
|
res_attached: res /= Void
|
||||||
|
sess_attached: sess /= Void
|
||||||
|
sess_not_dispatched: not sess.dispatched
|
||||||
local
|
local
|
||||||
l_req_method: READABLE_STRING_8
|
l_req_method: READABLE_STRING_8
|
||||||
head_res: WSF_HEAD_RESPONSE_WRAPPER
|
head_res: WSF_HEAD_RESPONSE_WRAPPER
|
||||||
do
|
do
|
||||||
l_req_method := request_method (req)
|
l_req_method := request_method (req)
|
||||||
is_dispatched := False
|
router_dispatch_for_request_method (req, res, sess, l_req_method)
|
||||||
Result := dispatch_and_return_handler_for_request_method (req, res, l_req_method)
|
if not sess.dispatched and l_req_method = {HTTP_REQUEST_METHODS}.method_head then
|
||||||
if Result = Void and l_req_method = {HTTP_REQUEST_METHODS}.method_head then
|
|
||||||
check is_not_dispatched: not is_dispatched end
|
|
||||||
create head_res.make_from_response (res)
|
create head_res.make_from_response (res)
|
||||||
req.set_request_method ({HTTP_REQUEST_METHODS}.method_GET)
|
req.set_request_method ({HTTP_REQUEST_METHODS}.method_GET)
|
||||||
Result := dispatch_and_return_handler_for_request_method (req, head_res, {HTTP_REQUEST_METHODS}.method_GET)
|
router_dispatch_for_request_method (req, head_res, sess, {HTTP_REQUEST_METHODS}.method_GET)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {NONE} -- Dispatch implementation
|
router_dispatch_for_request_method (req: WSF_REQUEST; res: WSF_RESPONSE; sess: WSF_ROUTER_SESSION; a_request_method: READABLE_STRING_8)
|
||||||
|
|
||||||
dispatch_and_return_handler_for_request_method (req: WSF_REQUEST; res: WSF_RESPONSE; a_request_method: READABLE_STRING_8): detachable WSF_HANDLER
|
|
||||||
-- Dispatch request `req' among the `mappings'
|
-- Dispatch request `req' among the `mappings'
|
||||||
-- And return the associated handler if mapping found and handler executed.
|
-- And return the associated handler if mapping found and handler executed.
|
||||||
--| Violates CQS
|
--| Violates CQS
|
||||||
require
|
require
|
||||||
req_attached: req /= Void
|
req_attached: req /= Void
|
||||||
res_attached: res /= Void
|
res_attached: res /= Void
|
||||||
|
sess_attached: sess /= Void
|
||||||
|
sess_not_dispatched: not sess.dispatched
|
||||||
a_request_method_attached: a_request_method /= Void
|
a_request_method_attached: a_request_method /= Void
|
||||||
local
|
local
|
||||||
m: WSF_ROUTER_MAPPING
|
m: WSF_ROUTER_MAPPING
|
||||||
do
|
do
|
||||||
is_dispatched := False
|
|
||||||
|
|
||||||
across
|
across
|
||||||
mappings as c
|
mappings as c
|
||||||
until
|
until
|
||||||
Result /= Void
|
sess.dispatched
|
||||||
loop
|
loop
|
||||||
if attached c.item as l_info then
|
if attached c.item as l_info then
|
||||||
if is_matching_request_methods (a_request_method, l_info.request_methods) then
|
if is_matching_request_methods (a_request_method, l_info.request_methods) then
|
||||||
m := l_info.mapping
|
m := l_info.mapping
|
||||||
if attached m.routed_handler (req, res, Current) as r then
|
m.try (req, res, sess, Current)
|
||||||
is_dispatched := True
|
|
||||||
Result := r
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {WSF_ROUTER_MAPPING}."
|
description: "[
|
||||||
author: ""
|
Describes a route or mapping for the WSF_ROUTER
|
||||||
|
]"
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
@@ -23,14 +24,14 @@ feature {NONE} -- Initialization
|
|||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
associated_resource: READABLE_STRING_8
|
associated_resource: READABLE_STRING_8
|
||||||
-- Name (URI, or URI template or regular expression or ...) of handled resource
|
-- Name (URI, or URI template or regular expression or ...) of handled resource.
|
||||||
deferred
|
deferred
|
||||||
ensure
|
ensure
|
||||||
assciated_resource_not_void: Result /= Void
|
assciated_resource_not_void: Result /= Void
|
||||||
end
|
end
|
||||||
|
|
||||||
handler: WSF_HANDLER
|
handler: WSF_HANDLER
|
||||||
-- Handler associated with `Current' mapping
|
-- Handler associated with `Current' mapping.
|
||||||
deferred
|
deferred
|
||||||
ensure
|
ensure
|
||||||
handler_attached: Result /= Void
|
handler_attached: Result /= Void
|
||||||
@@ -39,7 +40,7 @@ feature -- Access
|
|||||||
feature -- Documentation
|
feature -- Documentation
|
||||||
|
|
||||||
description: READABLE_STRING_32
|
description: READABLE_STRING_32
|
||||||
-- Short description of associated mapping
|
-- Short description of associated mapping.
|
||||||
deferred
|
deferred
|
||||||
ensure
|
ensure
|
||||||
description_attached: Result /= Void
|
description_attached: Result /= Void
|
||||||
@@ -63,11 +64,13 @@ feature -- Status
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
routed_handler (req: WSF_REQUEST; res: WSF_RESPONSE; a_router: WSF_ROUTER): detachable WSF_HANDLER
|
try (req: WSF_REQUEST; res: WSF_RESPONSE; sess: WSF_ROUTER_SESSION; a_router: WSF_ROUTER)
|
||||||
-- Handler when `Current' matches the request `req'
|
-- Try using `Current' mapping and if it matches request `req'
|
||||||
|
-- execute associated handler and set this handler in session `sess'.
|
||||||
require
|
require
|
||||||
req_attached: req /= Void
|
req_attached: req /= Void
|
||||||
res_attached: res /= Void
|
res_attached: res /= Void
|
||||||
|
sess_attached: sess /= Void
|
||||||
a_router_attached: a_router /= Void
|
a_router_attached: a_router /= Void
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
@@ -75,7 +78,7 @@ feature -- Status
|
|||||||
feature -- Helper
|
feature -- Helper
|
||||||
|
|
||||||
path_from_request (req: WSF_REQUEST): READABLE_STRING_32
|
path_from_request (req: WSF_REQUEST): READABLE_STRING_32
|
||||||
-- Path used by `Current' to check that mapping matches request `req'
|
-- Path used by `Current' to check that mapping matches request `req'.
|
||||||
require
|
require
|
||||||
req_attached: req /= Void
|
req_attached: req /= Void
|
||||||
do
|
do
|
||||||
|
|||||||
46
library/server/wsf/router/wsf_router_session.e
Normal file
46
library/server/wsf/router/wsf_router_session.e
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
note
|
||||||
|
description: "[
|
||||||
|
This class represents the processing of a request via a WSF_ROUTER.
|
||||||
|
|
||||||
|
]"
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
|
||||||
|
class
|
||||||
|
WSF_ROUTER_SESSION
|
||||||
|
|
||||||
|
feature -- Status report
|
||||||
|
|
||||||
|
dispatched: BOOLEAN
|
||||||
|
-- Handler dispatched?
|
||||||
|
do
|
||||||
|
Result := dispatched_handler /= Void
|
||||||
|
ensure
|
||||||
|
Result implies dispatched_handler /= Void
|
||||||
|
end
|
||||||
|
|
||||||
|
feature -- Access
|
||||||
|
|
||||||
|
dispatched_handler: detachable WSF_HANDLER
|
||||||
|
-- Handler dispatched
|
||||||
|
|
||||||
|
feature -- Change
|
||||||
|
|
||||||
|
set_dispatched_handler (h: like dispatched_handler)
|
||||||
|
do
|
||||||
|
dispatched_handler := h
|
||||||
|
ensure
|
||||||
|
h_set: dispatched_handler = h
|
||||||
|
end
|
||||||
|
|
||||||
|
note
|
||||||
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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
|
||||||
@@ -54,16 +54,18 @@ feature -- Execution
|
|||||||
|
|
||||||
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
-- Execute request handler
|
-- Execute request handler
|
||||||
|
local
|
||||||
|
sess: WSF_ROUTER_SESSION
|
||||||
do
|
do
|
||||||
if attached router.dispatch_and_return_handler (req, res) as h then
|
create sess
|
||||||
check is_dispatched: router.is_dispatched end
|
router.dispatch (req, res, sess)
|
||||||
else
|
if not sess.dispatched then
|
||||||
res.put_header ({HTTP_STATUS_CODE}.not_found, <<[{HTTP_HEADER_NAMES}.header_content_length, "0"]>>)
|
res.put_header ({HTTP_STATUS_CODE}.not_found, <<[{HTTP_HEADER_NAMES}.header_content_length, "0"]>>)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
note
|
||||||
|
description: "Summary description for {WSF_STARTS_WITH_CONTEXT_ROUTED_SERVICE}."
|
||||||
|
author: ""
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
|
||||||
|
deferred class
|
||||||
|
WSF_STARTS_WITH_CONTEXT_ROUTED_SERVICE [C -> WSF_HANDLER_CONTEXT create make end]
|
||||||
|
|
||||||
|
obsolete "Inherit from WSF_ROUTED_SERVICE and WSF_STARTS_WITH_CONTEXT_ROUTER_HELPER [2013-mar-19]"
|
||||||
|
|
||||||
|
inherit
|
||||||
|
WSF_ROUTED_SERVICE
|
||||||
|
|
||||||
|
WSF_STARTS_WITH_CONTEXT_ROUTER_HELPER [C]
|
||||||
|
|
||||||
|
note
|
||||||
|
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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
|
||||||
@@ -5,10 +5,13 @@ note
|
|||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
WSF_STARTS_WITH_CONTEXT_ROUTED_SERVICE [C -> WSF_HANDLER_CONTEXT create make end]
|
WSF_STARTS_WITH_CONTEXT_ROUTER_HELPER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||||
|
|
||||||
inherit
|
feature -- Access
|
||||||
WSF_ROUTED_SERVICE
|
|
||||||
|
router: WSF_ROUTER
|
||||||
|
deferred
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Mapping helper: starts_with
|
feature -- Mapping helper: starts_with
|
||||||
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
note
|
||||||
|
description: "Summary description for {WSF_URI_CONTEXT_ROUTED_SERVICE}."
|
||||||
|
author: ""
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
|
||||||
|
deferred class
|
||||||
|
WSF_URI_CONTEXT_ROUTED_SERVICE [C -> WSF_HANDLER_CONTEXT create make end]
|
||||||
|
|
||||||
|
obsolete "Inherit from WSF_ROUTED_SERVICE and WSF_URI_CONTEXT_ROUTER_HELPER [2013-mar-19]"
|
||||||
|
|
||||||
|
inherit
|
||||||
|
WSF_ROUTED_SERVICE
|
||||||
|
|
||||||
|
WSF_URI_CONTEXT_ROUTER_HELPER [C]
|
||||||
|
|
||||||
|
|
||||||
|
note
|
||||||
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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
|
||||||
@@ -1,14 +1,17 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {WSF_URI_CONTEXT_ROUTED_SERVICE}."
|
description: "Summary description for {WSF_URI_CONTEXT_ROUTER_HELPER}."
|
||||||
author: ""
|
author: ""
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
WSF_URI_CONTEXT_ROUTED_SERVICE [C -> WSF_HANDLER_CONTEXT create make end]
|
WSF_URI_CONTEXT_ROUTER_HELPER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||||
|
|
||||||
inherit
|
feature -- Access
|
||||||
WSF_ROUTED_SERVICE
|
|
||||||
|
router: WSF_ROUTER
|
||||||
|
deferred
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Mapping helper: uri
|
feature -- Mapping helper: uri
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
note
|
||||||
|
description: "Summary description for {WSF_URI_TEMPLATE_CONTEXT_ROUTED_SERVICE}."
|
||||||
|
author: ""
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
|
||||||
|
deferred class
|
||||||
|
WSF_URI_TEMPLATE_CONTEXT_ROUTED_SERVICE [C -> WSF_HANDLER_CONTEXT create make end]
|
||||||
|
|
||||||
|
obsolete "Inherit from WSF_ROUTED_SERVICE and WSF_URI_TEMPLATE_CONTEXT_ROUTER_HELPER [2013-mar-19]"
|
||||||
|
|
||||||
|
inherit
|
||||||
|
WSF_ROUTED_SERVICE
|
||||||
|
|
||||||
|
WSF_URI_TEMPLATE_CONTEXT_ROUTER_HELPER [C]
|
||||||
|
|
||||||
|
note
|
||||||
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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
|
||||||
@@ -1,14 +1,17 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {WSF_URI_TEMPLATE_CONTEXT_ROUTED_SERVICE}."
|
description: "Summary description for {WSF_URI_TEMPLATE_CONTEXT_ROUTER_HELPER}."
|
||||||
author: ""
|
author: ""
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
WSF_URI_TEMPLATE_CONTEXT_ROUTED_SERVICE [C -> WSF_HANDLER_CONTEXT create make end]
|
WSF_URI_TEMPLATE_CONTEXT_ROUTER_HELPER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||||
|
|
||||||
inherit
|
feature -- Access
|
||||||
WSF_ROUTED_SERVICE
|
|
||||||
|
router: WSF_ROUTER
|
||||||
|
deferred
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Mapping helper: uri
|
feature -- Mapping helper: uri
|
||||||
|
|
||||||
@@ -8,18 +8,10 @@ deferred class
|
|||||||
WSF_FILTER_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
|
WSF_FILTER_CONTEXT_HANDLER [C -> WSF_HANDLER_CONTEXT create make end]
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
WSF_FILTER_HANDLER
|
WSF_FILTER_HANDLER [WSF_CONTEXT_HANDLER [C]]
|
||||||
redefine
|
|
||||||
next
|
|
||||||
end
|
|
||||||
|
|
||||||
WSF_CONTEXT_HANDLER [C]
|
WSF_CONTEXT_HANDLER [C]
|
||||||
|
|
||||||
feature -- Access
|
|
||||||
|
|
||||||
next: detachable WSF_CONTEXT_HANDLER [C]
|
|
||||||
-- Next handler
|
|
||||||
|
|
||||||
feature {NONE} -- Implementation
|
feature {NONE} -- Implementation
|
||||||
|
|
||||||
execute_next (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
|
execute_next (ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
@@ -30,7 +22,7 @@ feature {NONE} -- Implementation
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
@@ -31,7 +31,7 @@ feature -- Access
|
|||||||
-- Associated mapping
|
-- Associated mapping
|
||||||
|
|
||||||
;note
|
;note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
68
library/server/wsf/src/response/wsf_cors_options_response.e
Normal file
68
library/server/wsf/src/response/wsf_cors_options_response.e
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
note
|
||||||
|
description: "Response to an OPTIONS request, with Cross-Origin Resource Sharing support."
|
||||||
|
author: "Olivier Ligt"
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
EIS: "name=Cross-Origin Resource Sharing", "src=http://www.w3.org/TR/cors/", "tag=W3C"
|
||||||
|
|
||||||
|
class
|
||||||
|
WSF_CORS_OPTIONS_RESPONSE
|
||||||
|
|
||||||
|
inherit
|
||||||
|
WSF_RESPONSE_MESSAGE
|
||||||
|
|
||||||
|
create
|
||||||
|
make
|
||||||
|
|
||||||
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
|
make (req: WSF_REQUEST; a_router: like router)
|
||||||
|
do
|
||||||
|
request := req
|
||||||
|
router := a_router
|
||||||
|
create header.make
|
||||||
|
end
|
||||||
|
|
||||||
|
feature -- Access
|
||||||
|
|
||||||
|
request: WSF_REQUEST
|
||||||
|
-- Associated request
|
||||||
|
|
||||||
|
router: WSF_ROUTER
|
||||||
|
-- Associated router
|
||||||
|
|
||||||
|
header: HTTP_HEADER
|
||||||
|
-- Response' header
|
||||||
|
|
||||||
|
feature {WSF_RESPONSE} -- Output
|
||||||
|
|
||||||
|
send_to (res: WSF_RESPONSE)
|
||||||
|
local
|
||||||
|
l_methods: WSF_REQUEST_METHODS
|
||||||
|
do
|
||||||
|
res.set_status_code ({HTTP_STATUS_CODE}.Ok)
|
||||||
|
header.put_content_type ({HTTP_MIME_TYPES}.text_plain)
|
||||||
|
header.put_current_date
|
||||||
|
header.put_content_length (0)
|
||||||
|
if attached request.http_access_control_request_headers as l_headers then
|
||||||
|
header.put_access_control_allow_headers (l_headers)
|
||||||
|
end
|
||||||
|
l_methods := router.allowed_methods_for_request (request)
|
||||||
|
if not l_methods.is_empty then
|
||||||
|
header.put_allow (l_methods)
|
||||||
|
header.put_access_control_allow_methods (l_methods)
|
||||||
|
end
|
||||||
|
res.put_header_text (header.string)
|
||||||
|
end
|
||||||
|
|
||||||
|
note
|
||||||
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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
|
||||||
@@ -19,6 +19,7 @@ feature {NONE} -- Initialization
|
|||||||
|
|
||||||
make (a_file_name: READABLE_STRING_8)
|
make (a_file_name: READABLE_STRING_8)
|
||||||
do
|
do
|
||||||
|
set_status_code ({HTTP_STATUS_CODE}.ok)
|
||||||
file_name := a_file_name
|
file_name := a_file_name
|
||||||
base_name := basename (a_file_name)
|
base_name := basename (a_file_name)
|
||||||
get_content_type
|
get_content_type
|
||||||
@@ -28,6 +29,7 @@ feature {NONE} -- Initialization
|
|||||||
make_with_content_type (a_content_type: READABLE_STRING_8; a_filename: READABLE_STRING_8)
|
make_with_content_type (a_content_type: READABLE_STRING_8; a_filename: READABLE_STRING_8)
|
||||||
-- Initialize `Current'.
|
-- Initialize `Current'.
|
||||||
do
|
do
|
||||||
|
set_status_code ({HTTP_STATUS_CODE}.ok)
|
||||||
file_name := a_filename
|
file_name := a_filename
|
||||||
base_name := basename (a_filename)
|
base_name := basename (a_filename)
|
||||||
content_type := a_content_type
|
content_type := a_content_type
|
||||||
@@ -54,6 +56,14 @@ feature {NONE} -- Initialization
|
|||||||
|
|
||||||
feature -- Element change
|
feature -- Element change
|
||||||
|
|
||||||
|
set_base_name (n: like base_name)
|
||||||
|
do
|
||||||
|
base_name := n
|
||||||
|
header.put_content_disposition ("attachment", "filename=%""+ n +"%"")
|
||||||
|
ensure
|
||||||
|
base_name_set: n.same_string (base_name)
|
||||||
|
end
|
||||||
|
|
||||||
set_expires (t: INTEGER)
|
set_expires (t: INTEGER)
|
||||||
do
|
do
|
||||||
header.put_expires (t)
|
header.put_expires (t)
|
||||||
@@ -91,7 +101,7 @@ feature -- Element change
|
|||||||
set_status_code (c: like status_code)
|
set_status_code (c: like status_code)
|
||||||
-- Set `status_code' to `c'.
|
-- Set `status_code' to `c'.
|
||||||
require
|
require
|
||||||
valid_status_code: status_code > 0
|
valid_status_code: c > 0
|
||||||
do
|
do
|
||||||
status_code := c
|
status_code := c
|
||||||
ensure
|
ensure
|
||||||
@@ -207,8 +217,11 @@ feature -- Implementation: output
|
|||||||
f.close
|
f.close
|
||||||
end
|
end
|
||||||
|
|
||||||
|
invariant
|
||||||
|
status_code_set: status_code /= 0
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ feature {NONE} -- Initialization
|
|||||||
|
|
||||||
make (a_file_name: READABLE_STRING_8)
|
make (a_file_name: READABLE_STRING_8)
|
||||||
do
|
do
|
||||||
|
set_status_code ({HTTP_STATUS_CODE}.ok)
|
||||||
file_name := a_file_name
|
file_name := a_file_name
|
||||||
get_content_type
|
get_content_type
|
||||||
initialize
|
initialize
|
||||||
@@ -27,6 +28,7 @@ feature {NONE} -- Initialization
|
|||||||
make_with_content_type (a_content_type: READABLE_STRING_8; a_filename: READABLE_STRING_8)
|
make_with_content_type (a_content_type: READABLE_STRING_8; a_filename: READABLE_STRING_8)
|
||||||
-- Initialize `Current'.
|
-- Initialize `Current'.
|
||||||
do
|
do
|
||||||
|
set_status_code ({HTTP_STATUS_CODE}.ok)
|
||||||
file_name := a_filename
|
file_name := a_filename
|
||||||
content_type := a_content_type
|
content_type := a_content_type
|
||||||
initialize
|
initialize
|
||||||
@@ -279,7 +281,7 @@ feature {NONE} -- Implementation: output
|
|||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
Eiffel Software
|
Eiffel Software
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
note
|
||||||
|
description: "[
|
||||||
|
This class is used to report a 501 not implemented
|
||||||
|
]"
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
|
||||||
|
class
|
||||||
|
WSF_NOT_IMPLEMENTED_RESPONSE
|
||||||
|
|
||||||
|
inherit
|
||||||
|
WSF_RESPONSE_MESSAGE
|
||||||
|
|
||||||
|
SHARED_HTML_ENCODER
|
||||||
|
|
||||||
|
create
|
||||||
|
make
|
||||||
|
|
||||||
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
|
make (req: WSF_REQUEST)
|
||||||
|
do
|
||||||
|
create header.make
|
||||||
|
request := req
|
||||||
|
end
|
||||||
|
|
||||||
|
feature -- Header
|
||||||
|
|
||||||
|
header: HTTP_HEADER
|
||||||
|
-- Response' header
|
||||||
|
|
||||||
|
request: WSF_REQUEST
|
||||||
|
-- Associated request.
|
||||||
|
|
||||||
|
body: detachable READABLE_STRING_8
|
||||||
|
-- Optional body
|
||||||
|
-- Displayed as extra content
|
||||||
|
|
||||||
|
feature -- Element change
|
||||||
|
|
||||||
|
set_body (b: like body)
|
||||||
|
-- Set `body' to `b'
|
||||||
|
do
|
||||||
|
body := b
|
||||||
|
end
|
||||||
|
|
||||||
|
feature {WSF_RESPONSE} -- Output
|
||||||
|
|
||||||
|
send_to (res: WSF_RESPONSE)
|
||||||
|
local
|
||||||
|
s: STRING
|
||||||
|
h: like header
|
||||||
|
do
|
||||||
|
h := header
|
||||||
|
res.set_status_code ({HTTP_STATUS_CODE}.not_implemented)
|
||||||
|
|
||||||
|
s := "Error 501 Not Implemented ! "
|
||||||
|
s.append (request.request_uri)
|
||||||
|
if attached body as b then
|
||||||
|
s.append ("%N")
|
||||||
|
s.append (b)
|
||||||
|
s.append ("%N")
|
||||||
|
end
|
||||||
|
h.put_content_type_text_plain
|
||||||
|
h.put_content_length (s.count)
|
||||||
|
res.put_header_text (h.string)
|
||||||
|
res.put_string (s)
|
||||||
|
res.flush
|
||||||
|
end
|
||||||
|
|
||||||
|
note
|
||||||
|
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, 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
|
||||||
@@ -1041,6 +1041,13 @@ feature -- HTTP_*
|
|||||||
Result := wgi_request.http_transfer_encoding
|
Result := wgi_request.http_transfer_encoding
|
||||||
end
|
end
|
||||||
|
|
||||||
|
http_access_control_request_headers: detachable READABLE_STRING_8
|
||||||
|
-- Indicates which headers will be used in the actual request
|
||||||
|
-- as part of the preflight request
|
||||||
|
do
|
||||||
|
Result := wgi_request.http_access_control_request_headers
|
||||||
|
end
|
||||||
|
|
||||||
feature -- Extra CGI environment variables
|
feature -- Extra CGI environment variables
|
||||||
|
|
||||||
request_uri: READABLE_STRING_8
|
request_uri: READABLE_STRING_8
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
<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" location="../../network/protocol/http/http-safe.ecf"/>
|
<library name="http" location="../../network/protocol/http/http-safe.ecf"/>
|
||||||
<library name="ewsgi" location="..\ewsgi\ewsgi-safe.ecf"/>
|
<library name="ewsgi" location="..\ewsgi\ewsgi-safe.ecf"/>
|
||||||
<library name="wsf-safe" location="wsf-safe.ecf"/>
|
<library name="wsf" location="wsf-safe.ecf"/>
|
||||||
|
<library name="wsf_router_context" location="wsf_router_context-safe.ecf" readonly="true"/>
|
||||||
<cluster name="extension" location="./extension" recursive="true"/>
|
<cluster name="extension" location="./extension" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
<library name="http" location="../../network/protocol/http/http.ecf"/>
|
<library name="http" location="../../network/protocol/http/http.ecf"/>
|
||||||
<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="wsf_router_context" location="wsf_router_context.ecf" readonly="true"/>
|
||||||
<cluster name="extension" location="./extension" recursive="true"/>
|
<cluster name="extension" location="./extension" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
16
library/server/wsf/wsf_router_context-safe.ecf
Normal file
16
library/server/wsf/wsf_router_context-safe.ecf
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="wsf_router_context" uuid="1A0F9B0E-26CE-4DE0-BE47-C74D1AB2B389" library_target="wsf_router_context">
|
||||||
|
<target name="wsf_router_context">
|
||||||
|
<root all_classes="true"/>
|
||||||
|
<file_rule>
|
||||||
|
<exclude>/.git$</exclude>
|
||||||
|
<exclude>/EIFGENs$</exclude>
|
||||||
|
<exclude>/.svn$</exclude>
|
||||||
|
</file_rule>
|
||||||
|
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all">
|
||||||
|
</option>
|
||||||
|
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||||
|
<library name="wsf" location="wsf-safe.ecf"/>
|
||||||
|
<cluster name="router_context" location=".\router_context" recursive="true"/>
|
||||||
|
</target>
|
||||||
|
</system>
|
||||||
17
library/server/wsf/wsf_router_context.ecf
Normal file
17
library/server/wsf/wsf_router_context.ecf
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="wsf_router_context" uuid="1A0F9B0E-26CE-4DE0-BE47-C74D1AB2B389" library_target="wsf_router_context">
|
||||||
|
|
||||||
|
<target name="wsf_router_context">
|
||||||
|
<root all_classes="true"/>
|
||||||
|
<file_rule>
|
||||||
|
<exclude>/.git$</exclude>
|
||||||
|
<exclude>/EIFGENs$</exclude>
|
||||||
|
<exclude>/.svn$</exclude>
|
||||||
|
</file_rule>
|
||||||
|
<option warning="true" full_class_checking="true">
|
||||||
|
</option>
|
||||||
|
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
||||||
|
<library name="wsf" location="wsf.ecf"/>
|
||||||
|
<cluster name="router_context" location=".\router_context" recursive="true"/>
|
||||||
|
</target>
|
||||||
|
</system>
|
||||||
@@ -31,6 +31,7 @@
|
|||||||
<library name="ewf_support" location="..\library\server\ewf_support\ewf_support-safe.ecf" readonly="false"/>
|
<library name="ewf_support" location="..\library\server\ewf_support\ewf_support-safe.ecf" readonly="false"/>
|
||||||
<library name="wsf_extension" location="..\library\server\wsf\wsf_extension-safe.ecf" readonly="false"/>
|
<library name="wsf_extension" location="..\library\server\wsf\wsf_extension-safe.ecf" readonly="false"/>
|
||||||
<library name="wsf_session" location="..\library\server\wsf\wsf_session-safe.ecf" readonly="false"/>
|
<library name="wsf_session" location="..\library\server\wsf\wsf_session-safe.ecf" readonly="false"/>
|
||||||
|
<library name="wsf_router_context" location="..\library\server\wsf\wsf_router_context-safe.ecf" readonly="false"/>
|
||||||
<library name="ex_restbuck" location="..\examples\restbucksCRUD\restbucks-safe.ecf" readonly="false"/>
|
<library name="ex_restbuck" location="..\examples\restbucksCRUD\restbucks-safe.ecf" readonly="false"/>
|
||||||
<library name="ex_simple" location="..\examples\simple\simple.ecf" readonly="false"/>
|
<library name="ex_simple" location="..\examples\simple\simple.ecf" readonly="false"/>
|
||||||
<library name="ex_filter" location="..\examples\filter\filter-safe.ecf" readonly="false"/>
|
<library name="ex_filter" location="..\examples\filter\filter-safe.ecf" readonly="false"/>
|
||||||
|
|||||||
@@ -77,6 +77,11 @@ echo Install library: http
|
|||||||
echo Install library: http_authorization
|
echo Install library: http_authorization
|
||||||
%SAFE_MD% %TMP_CONTRIB_DIR%\library\network\authentication
|
%SAFE_MD% %TMP_CONTRIB_DIR%\library\network\authentication
|
||||||
%COPYCMD% %TMP_DIR%\library\server\authentication\http_authorization %TMP_CONTRIB_DIR%\library\network\authentication\http_authorization
|
%COPYCMD% %TMP_DIR%\library\server\authentication\http_authorization %TMP_CONTRIB_DIR%\library\network\authentication\http_authorization
|
||||||
|
|
||||||
|
echo Install library: openid
|
||||||
|
%SAFE_MD% %TMP_CONTRIB_DIR%\library\security
|
||||||
|
%COPYCMD% %TMP_DIR%\library\security\openid %TMP_CONTRIB_DIR%\library\security\openid
|
||||||
|
|
||||||
echo Install library: uri_template
|
echo Install library: uri_template
|
||||||
%COPYCMD% %TMP_DIR%\library\text\parser\uri_template %TMP_CONTRIB_DIR%\library\text\parser\uri_template
|
%COPYCMD% %TMP_DIR%\library\text\parser\uri_template %TMP_CONTRIB_DIR%\library\text\parser\uri_template
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,9 @@ COPYCMD $TMP_DIR/library/network/protocol/http $TMP_CONTRIB_DIR/library/network/
|
|||||||
echo Install library: http_authorization
|
echo Install library: http_authorization
|
||||||
mkdir -p $TMP_CONTRIB_DIR/library/network/authentication
|
mkdir -p $TMP_CONTRIB_DIR/library/network/authentication
|
||||||
COPYCMD $TMP_DIR/library/server/authentication/http_authorization $TMP_CONTRIB_DIR/library/network/authentication/http_authorization
|
COPYCMD $TMP_DIR/library/server/authentication/http_authorization $TMP_CONTRIB_DIR/library/network/authentication/http_authorization
|
||||||
|
echo Install library: openid
|
||||||
|
mkdir -p $TMP_CONTRIB_DIR/library/security/openid
|
||||||
|
COPYCMD $TMP_DIR/library/security/openid $TMP_CONTRIB_DIR/library/security/openid
|
||||||
echo Install library: uri_template
|
echo Install library: uri_template
|
||||||
mkdir -p $TMP_CONTRIB_DIR/library/text/parser
|
mkdir -p $TMP_CONTRIB_DIR/library/text/parser
|
||||||
COPYCMD $TMP_DIR/library/text/parser/uri_template $TMP_CONTRIB_DIR/library/text/parser/uri_template
|
COPYCMD $TMP_DIR/library/text/parser/uri_template $TMP_CONTRIB_DIR/library/text/parser/uri_template
|
||||||
|
|||||||
@@ -54,10 +54,14 @@ echo Uninstall library: http_client
|
|||||||
%RDCMD% %TMP_CONTRIB_DIR%\library\network\http_client
|
%RDCMD% %TMP_CONTRIB_DIR%\library\network\http_client
|
||||||
echo Uninstall library: http
|
echo Uninstall library: http
|
||||||
%RDCMD% %TMP_CONTRIB_DIR%\library\network\protocol\http
|
%RDCMD% %TMP_CONTRIB_DIR%\library\network\protocol\http
|
||||||
|
echo Uninstall library: http_authorization
|
||||||
|
%RDCMD% %TMP_CONTRIB_DIR%\library\network\authentication\http_authorization
|
||||||
|
echo Uninstall library: security\openid
|
||||||
|
%RDCMD% %TMP_CONTRIB_DIR%\library\security\openid
|
||||||
echo Uninstall library: uri_template
|
echo Uninstall library: uri_template
|
||||||
%RDCMD% %TMP_CONTRIB_DIR%\library\text\parser\uri_template
|
%RDCMD% %TMP_CONTRIB_DIR%\library\text\parser\uri_template
|
||||||
|
|
||||||
echo Uninstall contrib library: nino
|
echo Uninstall contrib library: nino
|
||||||
%RDCMD% %TMP_CONTRIB_DIR%\contrib\library\network\server\nino
|
%RDCMD% %TMP_CONTRIB_DIR%\library\network\server\nino
|
||||||
|
|
||||||
:end
|
:end
|
||||||
|
|||||||
Reference in New Issue
Block a user