diff --git a/examples/filter/src/filter/logging_filter.e b/examples/filter/src/filter/logging_filter.e deleted file mode 100644 index e6a8b89b..00000000 --- a/examples/filter/src/filter/logging_filter.e +++ /dev/null @@ -1,40 +0,0 @@ -note - description: "Logging filter." - author: "Olivier Ligot" - date: "$Date$" - revision: "$Revision$" - -class - LOGGING_FILTER - -inherit - WSF_FILTER - -feature -- Basic operations - - execute (req: WSF_REQUEST; res: WSF_RESPONSE) - -- Execute the filter - local - l_user_agent: STRING - l_date: DATE_TIME - do - if attached req.http_user_agent as ua then - l_user_agent := ua.as_string_8 - else - l_user_agent := "-" - end - create l_date.make_now - io.put_string ("[" + l_date.formatted_out (Date_time_format) + "] %"" + req.request_method + " " + req.request_uri - + " " + {HTTP_CONSTANTS}.http_version_1_1 + "%" " + res.status_code.out + " " + l_user_agent) - io.put_new_line - execute_next (req, res) - end - -feature -- Constants - - Date_time_format: STRING = "yyyy/[0]mm/[0]dd [0]hh:[0]mi:[0]ss.ff3" - -note - copyright: "2011-2012, Olivier Ligot, Jocelyn Fiat and others" - license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" -end diff --git a/examples/filter/src/filter_server.e b/examples/filter/src/filter_server.e index fff542ac..25d16fef 100644 --- a/examples/filter/src/filter_server.e +++ b/examples/filter/src/filter_server.e @@ -53,7 +53,7 @@ feature {NONE} -- Initialization setup_filter -- Setup `filter' local - l_logging_filter: LOGGING_FILTER + l_logging_filter: WSF_LOGGING_FILTER do create l_logging_filter filter.set_next (l_logging_filter) diff --git a/examples/restbucksCRUD/client/src/restbuck_client.e b/examples/restbucksCRUD/client/src/restbuck_client.e index c325e5c3..22f84bbd 100644 --- a/examples/restbucksCRUD/client/src/restbuck_client.e +++ b/examples/restbucksCRUD/client/src/restbuck_client.e @@ -17,7 +17,7 @@ feature {NONE} -- Initialization local h: LIBCURL_HTTP_CLIENT sess: HTTP_CLIENT_SESSION - resp : HTTP_CLIENT_RESPONSE + resp : detachable HTTP_CLIENT_RESPONSE l_location : detachable READABLE_STRING_8 body : STRING do @@ -39,7 +39,7 @@ feature {NONE} -- Initialization -- Update the Order - if attached resp.body as l_body then + if resp /= Void and then attached resp.body as l_body then body := l_body.as_string_8 body.replace_substring_all ("takeAway", "in Shop") print ("%N Update Order %N") @@ -47,11 +47,10 @@ feature {NONE} -- Initialization end end - update_order ( sess: HTTP_CLIENT_SESSION; uri : detachable READABLE_STRING_8; a_body : STRING) : HTTP_CLIENT_RESPONSE + update_order ( sess: HTTP_CLIENT_SESSION; uri : detachable READABLE_STRING_8; a_body : STRING): detachable HTTP_CLIENT_RESPONSE local context : HTTP_CLIENT_REQUEST_CONTEXT do - create Result.make if attached uri as l_uri then sess.set_base_url (l_uri) create context.make @@ -74,9 +73,8 @@ feature {NONE} -- Initialization end - read_order ( sess: HTTP_CLIENT_SESSION; uri : detachable READABLE_STRING_8) : HTTP_CLIENT_RESPONSE + read_order ( sess: HTTP_CLIENT_SESSION; uri : detachable READABLE_STRING_8): detachable HTTP_CLIENT_RESPONSE do - create Result.make if attached uri as l_uri then sess.set_base_url (l_uri) Result := sess.get ("", Void) diff --git a/examples/restbucksCRUD/src/restbucks_server.e b/examples/restbucksCRUD/src/restbucks_server.e index ad1beb4d..79870862 100644 --- a/examples/restbucksCRUD/src/restbucks_server.e +++ b/examples/restbucksCRUD/src/restbucks_server.e @@ -10,6 +10,9 @@ inherit ANY WSF_URI_TEMPLATE_ROUTED_SERVICE + redefine + execute_default + end WSF_HANDLER_HELPER @@ -30,10 +33,13 @@ feature {NONE} -- Initialization setup_router local order_handler: ORDER_HANDLER + doc: WSF_ROUTER_SELF_DOCUMENTATION_HANDLER do create order_handler router.handle_with_request_methods ("/order", order_handler, router.methods_POST) router.handle_with_request_methods ("/order/{orderid}", order_handler, router.methods_GET + router.methods_DELETE + router.methods_PUT) + create doc.make_hidden (router) + router.handle_with_request_methods ("/api/doc", doc, router.methods_GET) end feature -- Execution @@ -54,6 +60,7 @@ feature -- Execution h.put_content_type_text_plain l_api_doc := "%NPlease check the API%NURI:/order METHOD: POST%NURI:/order/{orderid} METHOD: GET, PUT, DELETE%N" l_description := req.request_method + req.request_uri + " is not allowed" + "%N" + l_api_doc + l_description.append ("%NHTML documentation:/api/doc METHOD: GET%N") h.put_content_length (l_description.count) h.put_current_date res.set_status_code ({HTTP_STATUS_CODE}.method_not_allowed) diff --git a/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e b/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e index b237ef81..dc98f64f 100644 --- a/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e +++ b/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e @@ -62,7 +62,7 @@ feature -- Execution end note - copyright: "2011-2011, Eiffel Software and others" + copyright: "2011-2012, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/ewsgi/connectors/nino/src/wgi_nino_handler.e b/library/server/ewsgi/connectors/nino/src/wgi_nino_handler.e index 07b683b2..b1602527 100644 --- a/library/server/ewsgi/connectors/nino/src/wgi_nino_handler.e +++ b/library/server/ewsgi/connectors/nino/src/wgi_nino_handler.e @@ -61,7 +61,7 @@ feature -- Request processing process_request (a_handler: HTTP_CONNECTION_HANDLER; a_socket: TCP_STREAM_SOCKET) -- Process request ... local - env, vars: HASH_TABLE [STRING, STRING] + env: HASH_TABLE [STRING, STRING] p: INTEGER l_request_uri, l_script_name, l_query_string, l_path_info: STRING l_server_name, l_server_port: detachable STRING @@ -73,8 +73,16 @@ feature -- Request processing l_request_uri := a_handler.uri a_headers_map := a_handler.request_header_map create e - vars := e.starting_environment_variables - env := vars.twin + if attached e.starting_environment_variables as vars then + create env.make (vars.count) + across + vars as c + loop + env.force (c.item.to_string_8, c.key.to_string_8) + end + else + create env.make (0) + end --| for Any Abc-Def-Ghi add (or replace) the HTTP_ABC_DEF_GHI variable to `env' from @@ -189,7 +197,7 @@ feature -- Request processing end note - copyright: "2011-2011, Eiffel Software and others" + copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/library/server/ewsgi/connectors/null/null-safe.ecf b/library/server/ewsgi/connectors/null/null-safe.ecf index 9ad9cd54..6d82d779 100644 --- a/library/server/ewsgi/connectors/null/null-safe.ecf +++ b/library/server/ewsgi/connectors/null/null-safe.ecf @@ -1,6 +1,6 @@ - - + + /EIFGENs$ diff --git a/library/server/ewsgi/connectors/null/null.ecf b/library/server/ewsgi/connectors/null/null.ecf index c8df2ee7..5255edb0 100644 --- a/library/server/ewsgi/connectors/null/null.ecf +++ b/library/server/ewsgi/connectors/null/null.ecf @@ -1,6 +1,6 @@ - - + + /EIFGENs$ diff --git a/library/server/ewsgi/src/implementation/wgi_request_from_table.e b/library/server/ewsgi/src/implementation/wgi_request_from_table.e index 29dec9d2..1545e2a1 100644 --- a/library/server/ewsgi/src/implementation/wgi_request_from_table.e +++ b/library/server/ewsgi/src/implementation/wgi_request_from_table.e @@ -19,7 +19,7 @@ create feature {NONE} -- Initialization - make (a_vars: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8]; a_input: like input; a_wgi_connector: like wgi_connector) + make (a_vars: HASH_TABLE [READABLE_STRING_GENERAL, READABLE_STRING_GENERAL]; a_input: like input; a_wgi_connector: like wgi_connector) require vars_attached: a_vars /= Void do @@ -244,7 +244,7 @@ feature -- Access: Extension to CGI meta parameters - 1.1 feature {NONE} -- Element change: CGI meta parameter related to PATH_INFO - set_meta_variables (a_vars: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8]) + set_meta_variables (a_vars: HASH_TABLE [READABLE_STRING_GENERAL, READABLE_STRING_GENERAL]) -- Fill with variable from `a_vars' local s: like meta_string_variable @@ -264,7 +264,7 @@ feature {NONE} -- Element change: CGI meta parameter related to PATH_INFO until a_vars.after loop - table.force (a_vars.item_for_iteration, a_vars.key_for_iteration) + table.force (a_vars.item_for_iteration.to_string_8, a_vars.key_for_iteration.to_string_8) a_vars.forth end diff --git a/library/server/libfcgi/fcgi-safe.ecf b/library/server/libfcgi/fcgi-safe.ecf deleted file mode 100644 index 18fd9512..00000000 --- a/library/server/libfcgi/fcgi-safe.ecf +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - /\.svn$ - /\.git$ - /EIFGENs$ - - - - - - - - - - - - - - - - - - - - - - - - - - - - /linux$ - /fake$ - - - - - - /windows$ - /fake$ - - - - - - - diff --git a/library/server/libfcgi/fcgi.ecf b/library/server/libfcgi/fcgi.ecf deleted file mode 100644 index 05d15197..00000000 --- a/library/server/libfcgi/fcgi.ecf +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - /\.svn$ - /\.git$ - /EIFGENs$ - - - - - - - - - - - - - - - - - - - - - - - - - - - - /linux$ - /fake$ - - - - - - /windows$ - /fake$ - - - - - - - diff --git a/library/server/libfcgi/tests/eiffelweb-safe.ecf b/library/server/libfcgi/tests/eiffelweb-safe.ecf index 31acd804..781bae86 100644 --- a/library/server/libfcgi/tests/eiffelweb-safe.ecf +++ b/library/server/libfcgi/tests/eiffelweb-safe.ecf @@ -10,7 +10,7 @@ - + diff --git a/library/server/libfcgi/tests/eiffelweb.ecf b/library/server/libfcgi/tests/eiffelweb.ecf index 35a36f2f..2167feb5 100644 --- a/library/server/libfcgi/tests/eiffelweb.ecf +++ b/library/server/libfcgi/tests/eiffelweb.ecf @@ -10,7 +10,7 @@ - + diff --git a/library/server/request/router/OBSOLETE.txt b/library/server/request/router/OBSOLETE.txt deleted file mode 100644 index aecee2d5..00000000 --- a/library/server/request/router/OBSOLETE.txt +++ /dev/null @@ -1 +0,0 @@ -Now the router library is part of ../../wsf library \ No newline at end of file diff --git a/library/server/request/router/router-safe.ecf b/library/server/request/router/router-safe.ecf deleted file mode 100644 index 3af161c9..00000000 --- a/library/server/request/router/router-safe.ecf +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - /.git$ - /EIFGENs$ - /.svn$ - - - - - - diff --git a/library/server/request/router/router.ecf b/library/server/request/router/router.ecf deleted file mode 100644 index 3ffd7d4c..00000000 --- a/library/server/request/router/router.ecf +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - /.git$ - /EIFGENs$ - /.svn$ - - - - - - diff --git a/library/server/wsf/default/cgi-safe.ecf b/library/server/wsf/default/cgi-safe.ecf index f10d0274..ed590547 100644 --- a/library/server/wsf/default/cgi-safe.ecf +++ b/library/server/wsf/default/cgi-safe.ecf @@ -8,6 +8,7 @@ /\.svn$ diff --git a/library/server/wsf/wsf_extension.ecf b/library/server/wsf/wsf_extension.ecf index e3622f9b..cef881de 100644 --- a/library/server/wsf/wsf_extension.ecf +++ b/library/server/wsf/wsf_extension.ecf @@ -12,7 +12,7 @@ - + diff --git a/library/server/wsf/wsf_session-safe.ecf b/library/server/wsf/wsf_session-safe.ecf index 0c679d78..b94c5e7a 100644 --- a/library/server/wsf/wsf_session-safe.ecf +++ b/library/server/wsf/wsf_session-safe.ecf @@ -14,7 +14,7 @@ - + diff --git a/library/server/wsf/wsf_session.ecf b/library/server/wsf/wsf_session.ecf index 5c2e26b0..f085bc3b 100644 --- a/library/server/wsf/wsf_session.ecf +++ b/library/server/wsf/wsf_session.ecf @@ -14,7 +14,7 @@ - + diff --git a/library/text/encoder/encoder-safe.ecf b/library/text/encoder/encoder-safe.ecf index 7db8d66c..513e1e4e 100644 --- a/library/text/encoder/encoder-safe.ecf +++ b/library/text/encoder/encoder-safe.ecf @@ -1,5 +1,5 @@ - + @@ -7,7 +7,7 @@ /EIFGENs$ /.svn$ - @@ -17,12 +17,12 @@ /tests$ /spec$ - + - + diff --git a/library/text/encoder/encoder.ecf b/library/text/encoder/encoder.ecf index 5c3184fc..71732816 100644 --- a/library/text/encoder/encoder.ecf +++ b/library/text/encoder/encoder.ecf @@ -7,7 +7,7 @@ /EIFGENs$ /.svn$ - diff --git a/library/utility/general/error/error-safe.ecf b/library/utility/general/error/error-safe.ecf index b5eb8493..e6da0b5a 100644 --- a/library/utility/general/error/error-safe.ecf +++ b/library/utility/general/error/error-safe.ecf @@ -7,7 +7,7 @@ /EIFGENs$ /.svn$ - diff --git a/library/utility/general/error/error.ecf b/library/utility/general/error/error.ecf index ea7b6080..f21ea9b9 100644 --- a/library/utility/general/error/error.ecf +++ b/library/utility/general/error/error.ecf @@ -7,7 +7,7 @@ /EIFGENs$ /.svn$ - diff --git a/tests/all-safe.ecf b/tests/all-safe.ecf new file mode 100644 index 00000000..98fb312d --- /dev/null +++ b/tests/all-safe.ecf @@ -0,0 +1,39 @@ + + + compile many lib from EWF + + + + /.git$ + /EIFGENs$ + /.svn$ + + + + + + + + + + + + + + + + + + + Compiling as Windows , on other platforms than Windows + + + + + Compiling as UNIX , on other platforms than Unix + + + + + diff --git a/tools/ise_wizard/install_ise_wizard.sh b/tools/ise_wizard/install_ise_wizard.sh new file mode 100755 index 00000000..9b5496ea --- /dev/null +++ b/tools/ise_wizard/install_ise_wizard.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +mkdir tmp +ecb -config ewf_ise_wizard-safe.ecf -target wizard -finalize -c_compile -project_path tmp +mkdir -p spec/$ISE_PLATFORM +mv tmp/EIFGENs/wizard/F_code/wizard spec/$ISE_PLATFORM/wizard +rm -rf tmp + +WIZ_TARGET=$ISE_EIFFEL/studio/wizards/new_projects/ewf +rm -rf $WIZ_TARGET +mkdir $WIZ_TARGET +cp -r resources $WIZ_TARGET/resources +cp -r spec $WIZ_TARGET/spec +cp ewf.dsc $WIZ_TARGET/../ewf.dsc +rm -rf spec diff --git a/tools/ise_wizard/install_ise_wizard_custom.sh b/tools/ise_wizard/install_ise_wizard_custom.sh new file mode 100755 index 00000000..308e7d84 --- /dev/null +++ b/tools/ise_wizard/install_ise_wizard_custom.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +mkdir tmp +ecb -config ewf_ise_wizard-safe.ecf -target custom_wizard -finalize -c_compile -project_path tmp +mkdir -p custom/spec/$ISE_PLATFORM +mv tmp/EIFGENs/custom_wizard/F_code/wizard custom/spec/$ISE_PLATFORM/wizard +rm -rf tmp + +WIZ_TARGET=$ISE_EIFFEL/studio/wizards/new_projects/ewf_custom +rm -rf $WIZ_TARGET +mkdir $WIZ_TARGET +cp -r resources $WIZ_TARGET/resources +cp -f custom/resources/* $WIZ_TARGET/resources +cp -r custom/spec $WIZ_TARGET/spec +cp custom/ewf.dsc $WIZ_TARGET/../ewf_custom.dsc +rm -rf custom/spec diff --git a/tools/ise_wizard/resources/ewf_application.e b/tools/ise_wizard/resources/ewf_application.e index af64909d..929cd433 100644 --- a/tools/ise_wizard/resources/ewf_application.e +++ b/tools/ise_wizard/resources/ewf_application.e @@ -26,8 +26,6 @@ feature -- Execution -- Default request handler if no other are relevant local mesg: WSF_HTML_PAGE_RESPONSE - s: STRING_8 - l_user_name: READABLE_STRING_32 do create mesg.make mesg.set_title ("Hello World!") @@ -44,9 +42,6 @@ feature {NONE} -- Initialization --| If you don't need any custom options, you are not obliged to redefine `initialize' Precursor - - --| Initialize router - initialize_router end end diff --git a/tools/ise_wizard/src/ewf_wizard.e b/tools/ise_wizard/src/ewf_wizard.e index 9d6f08a6..09bcdd21 100644 --- a/tools/ise_wizard/src/ewf_wizard.e +++ b/tools/ise_wizard/src/ewf_wizard.e @@ -119,15 +119,14 @@ feature -- Form tfn.add_extension ("ecf") copy_resource_template ("template.ecf", tfn.string) + create res.make (tfn.string, d.name) + create tfn.make_from_string (dn.string) tfn.set_file_name ("ewf") tfn.add_extension ("ini") copy_resource_template ("ewf.ini", tfn.string) - - create res.make (tfn.string, d.name) - create dn.make_from_string (pdn) dn.extend (pn) dn.extend ("src")