diff --git a/examples/restbucksCRUD/src/restbucks_server.e b/examples/restbucksCRUD/src/restbucks_server.e index 653ce132..81008346 100644 --- a/examples/restbucksCRUD/src/restbucks_server.e +++ b/examples/restbucksCRUD/src/restbucks_server.e @@ -3,7 +3,7 @@ note date : "$Date$" revision : "$Revision$" -class RESTBUCKS_SERVER +class RESTBUCKS_SERVER inherit diff --git a/library/server/wsf/router/support/uri/helpers/wsf_uri_router_helper.e b/library/server/wsf/router/support/uri/helpers/wsf_uri_helper_for_routed_service.e similarity index 63% rename from library/server/wsf/router/support/uri/helpers/wsf_uri_router_helper.e rename to library/server/wsf/router/support/uri/helpers/wsf_uri_helper_for_routed_service.e index 607e5bb8..287fcbfd 100644 --- a/library/server/wsf/router/support/uri/helpers/wsf_uri_router_helper.e +++ b/library/server/wsf/router/support/uri/helpers/wsf_uri_helper_for_routed_service.e @@ -1,26 +1,33 @@ note - description: "Summary description for {WSF_URI_ROUTER_HELPER}." - author: "" + description: "Facilities inheritance to add URI base routing to a routed service" + date: "$Date$" revision: "$Revision$" -deferred class - WSF_URI_ROUTER_HELPER +deferred class WSF_URI_HELPER_FOR_ROUTED_SERVICE feature -- Access - + router: WSF_ROUTER + -- Router used to dispatch the request according to the WSF_REQUEST object + -- and associated request methods; + -- This should not be implemented by descendants. Instead, you gain an effective + -- version by also inheriting from WSF_ROUTED_SERVICE, or one of it's descendants. deferred - end + ensure + router_not_void: Result /= Void + end feature -- Mapping helper: uri map_uri (a_uri: READABLE_STRING_8; h: WSF_URI_HANDLER) + -- Map `h' as handler for `a_uri' 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) + -- Map `h' as handler for `a_uri' for request methods `rqst_methods'. do router.map_with_request_methods (create {WSF_URI_MAPPING}.make (a_uri, h), rqst_methods) end @@ -28,17 +35,19 @@ feature -- Mapping helper: uri feature -- Mapping helper: uri agent map_uri_agent (a_uri: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]) + -- Map `proc' as handler for `a_uri' 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) + -- Map `proc' as handler for `a_uri' for request methods `rqst_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" + 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 @@ -47,4 +56,5 @@ note Website http://www.eiffel.com Customer support http://support.eiffel.com ]" + end diff --git a/library/server/wsf/router/support/uri/helpers/wsf_uri_routed_service.e b/library/server/wsf/router/support/uri/helpers/wsf_uri_routed_service.e index f57ee2c2..4575190a 100644 --- a/library/server/wsf/router/support/uri/helpers/wsf_uri_routed_service.e +++ b/library/server/wsf/router/support/uri/helpers/wsf_uri_routed_service.e @@ -7,12 +7,12 @@ note deferred class WSF_URI_ROUTED_SERVICE -obsolete "Inherit from WSF_ROUTED_SERVICE and WSF_URI_ROUTER_HELPER [2013-mar-19]" +obsolete "Inherit from WSF_ROUTED_SERVICE and WSF_URI_HELPER_FOR_ROUTED_SERVICE [2013-mar-19]" inherit WSF_ROUTED_SERVICE - WSF_URI_ROUTER_HELPER + WSF_URI_HELPER_FOR_ROUTED_SERVICE note copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" diff --git a/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_helper_for_routed_service.e b/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_helper_for_routed_service.e index e304aae0..d61a6a4e 100644 --- a/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_helper_for_routed_service.e +++ b/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_helper_for_routed_service.e @@ -19,7 +19,7 @@ feature -- Access router_not_void: Result /= Void end -feature -- Mapping helper: uri +feature -- Mapping helper: uri template map_uri_template (a_tpl: STRING; h: WSF_URI_TEMPLATE_HANDLER) -- Map `h' as handler for `a_tpl' @@ -39,7 +39,7 @@ feature -- Mapping helper: uri router.map_with_request_methods (create {WSF_URI_TEMPLATE_MAPPING}.make (a_tpl, h), rqst_methods) end -feature -- Mapping helper: uri agent +feature -- Mapping helper: uri template 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' @@ -59,4 +59,15 @@ feature -- Mapping helper: uri agent 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 diff --git a/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_routed_service.e b/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_routed_service.e index 8db2b0e0..91052448 100644 --- a/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_routed_service.e +++ b/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_routed_service.e @@ -7,12 +7,12 @@ note deferred class WSF_URI_TEMPLATE_ROUTED_SERVICE -obsolete "Inherit from WSF_ROUTED_SERVICE and WSF_URI_ROUTER_HELPER [2013-mar-19]" +obsolete "Inherit from WSF_ROUTED_SERVICE and WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_SERVICE [2013-mar-19]" inherit WSF_ROUTED_SERVICE - WSF_URI_TEMPLATE_ROUTER_HELPER + WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_SERVICE note copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" diff --git a/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_router_helper.e b/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_router_helper.e deleted file mode 100644 index b1db35ad..00000000 --- a/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_router_helper.e +++ /dev/null @@ -1,68 +0,0 @@ -note - description: "Summary description for {WSF_URI_TEMPLATE_ROUTER_HELPER}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - WSF_URI_TEMPLATE_ROUTER_HELPER - - obsolete "Use class WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_SERVICE in conjunction with WSF_ROUTED_SKELETON_SERVICE" - -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