diff --git a/src/gewf/gewf-safe.ecf b/src/gewf/gewf-safe.ecf new file mode 100644 index 00000000..cc243148 --- /dev/null +++ b/src/gewf/gewf-safe.ecf @@ -0,0 +1,16 @@ + + + + + + /.git$ + /EIFGENs$ + /.svn$ + + + + + + + diff --git a/src/gewf/gewf.ecf b/src/gewf/gewf.ecf new file mode 100644 index 00000000..3213ca47 --- /dev/null +++ b/src/gewf/gewf.ecf @@ -0,0 +1,16 @@ + + + + + + /.git$ + /EIFGENs$ + /.svn$ + + + + + + + diff --git a/src/gewf/src/gewf.e b/src/gewf/src/gewf.e new file mode 100644 index 00000000..7e805323 --- /dev/null +++ b/src/gewf/src/gewf.e @@ -0,0 +1,32 @@ +note + description : "Objects that ..." + author : "$Author$" + date : "$Date$" + revision : "$Revision$" + +class + GEWF + +create + make + +feature {NONE} -- Initialization + + make + -- Initialize `Current'. + do + + end + +feature -- Status + +feature -- Access + +feature -- Change + +feature {NONE} -- Implementation + +invariant +-- invariant_clause: True + +end diff --git a/src/gewf/template/basic/ecf-target-any_connector.tpl b/src/gewf/template/basic/ecf-target-any_connector.tpl new file mode 100644 index 00000000..eb7f6c90 --- /dev/null +++ b/src/gewf/template/basic/ecf-target-any_connector.tpl @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/gewf/template/basic/ecf-target-connector.tpl b/src/gewf/template/basic/ecf-target-connector.tpl new file mode 100644 index 00000000..d4a6fd75 --- /dev/null +++ b/src/gewf/template/basic/ecf-target-connector.tpl @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/gewf/template/basic/launcher/any/application_launcher.e b/src/gewf/template/basic/launcher/any/application_launcher.e new file mode 100644 index 00000000..7182d350 --- /dev/null +++ b/src/gewf/template/basic/launcher/any/application_launcher.e @@ -0,0 +1,85 @@ +note + description: "Summary description for {APPLICATION_LAUNCHER}." + author: "" + date: "$Date: 2013-06-12 13:55:42 +0200 (mer., 12 juin 2013) $" + revision: "$Revision: 36 $" + +deferred class + APPLICATION_LAUNCHER + +feature {NONE} -- Initialization + + launcher_nature: detachable READABLE_STRING_8 + -- Initialize the launcher nature + -- either cgi, libfcgi, or nino. + --| We could extend with more connector if needed. + --| and we could use WSF_DEFAULT_SERVICE_LAUNCHER to configure this at compilation time. + local + p: PATH + l_entry_name: READABLE_STRING_32 + ext: detachable READABLE_STRING_32 + do + create p.make_from_string (execution_environment.arguments.command_name) + if attached p.entry as l_entry then + ext := l_entry.extension + end + if ext /= Void then + if ext.same_string (nature_nino) then + Result := nature_nino + end + if ext.same_string (nature_cgi) then + Result := nature_cgi + end + if ext.same_string (nature_libfcgi) or else ext.same_string ("fcgi") then + Result := nature_libfcgi + end + end + end + +feature {NONE} -- nino + + nature_nino: STRING = "nino" + + launch_nino (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS) + do + create {WSF_NINO_SERVICE_LAUNCHER} launcher.make_and_launch (a_service, opts) + end + +feature {NONE} -- cgi + + nature_cgi: STRING = "cgi" + + launch_cgi (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS) + do + create {WSF_CGI_SERVICE_LAUNCHER} launcher.make_and_launch (a_service, opts) + end + +feature {NONE} -- libfcgi + + nature_libfcgi: STRING = "libfcgi" + + launch_libfcgi (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS) + do + create {WSF_LIBFCGI_SERVICE_LAUNCHER} launcher.make_and_launch (a_service, opts) + end + +feature {NONE} -- Launcher + + launch (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS) + local + nature: like launcher_nature + do + nature := launcher_nature + if nature = Void or else nature = nature_nino then + launch_nino (a_service, opts) + elseif nature = nature_cgi then + launch_cgi (a_service, opts) + elseif nature = nature_libfcgi then + launch_libfcgi (a_service, opts) + else + -- bye bye + (create {EXCEPTIONS}).die (-1) + end + end + +end diff --git a/src/gewf/template/basic/launcher/default/application_launcher.e b/src/gewf/template/basic/launcher/default/application_launcher.e new file mode 100644 index 00000000..e20b06ac --- /dev/null +++ b/src/gewf/template/basic/launcher/default/application_launcher.e @@ -0,0 +1,19 @@ +note + description: "Summary description for {APPLICATION}." + author: "" + date: "$Date: 2013-06-12 13:55:42 +0200 (mer., 12 juin 2013) $" + revision: "$Revision: 36 $" + +deferred class + APPLICATION_LAUNCHER + +feature {NONE} -- Launcher + + launch (a_service: WSF_SERVICE; opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS) + local + launcher: WSF_SERVICE_LAUNCHER + do + create {WSF_DEFAULT_SERVICE_LAUNCHER} launcher.make_and_launch (a_service, opts) + end + +end diff --git a/src/gewf/template/basic/project.ecf b/src/gewf/template/basic/project.ecf new file mode 100644 index 00000000..ff9b4ab7 --- /dev/null +++ b/src/gewf/template/basic/project.ecf @@ -0,0 +1,44 @@ + + + + + /EIFGENs$ + /CVS$ + /.svn$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/gewf/template/basic/project.ecf.tpl b/src/gewf/template/basic/project.ecf.tpl new file mode 100644 index 00000000..3fe8bac0 --- /dev/null +++ b/src/gewf/template/basic/project.ecf.tpl @@ -0,0 +1,45 @@ + + + + + /EIFGENs$ + /CVS$ + /.svn$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/gewf/template/basic/src/app_service.e b/src/gewf/template/basic/src/app_service.e new file mode 100644 index 00000000..23caa88a --- /dev/null +++ b/src/gewf/template/basic/src/app_service.e @@ -0,0 +1,46 @@ +note + description: "[ + application service + ]" + date: "$Date$" + revision: "$Revision$" + +class + APPLICATION + +inherit + WSF_LAUNCHABLE_SERVICE + redefine + initialize + end + + WSF_ROUTED_SERVICE + + APPLICATION_LAUNCHER + +create + make_and_launch + +feature {NONE} -- Initialization + + initialize + -- Initialize current service. + do + Precursor + set_service_option ("port", 9090) + initialize_router + end + + setup_router + -- Setup `router' + local + doc: WSF_ROUTER_SELF_DOCUMENTATION_HANDLER + fhdl: WSF_FILE_SYSTEM_HANDLER + do + router.handle_with_request_methods ("/doc", create {WSF_ROUTER_SELF_DOCUMENTATION_HANDLER}.make (router), router.methods_GET) + create fhdl.make_hidden (".") + fhdl.set_directory_index (<<"index.html">>) + router.handle_with_request_methods ("", fhdl, router.methods_GET) + end + +end