Fixed the EiffelStudio EiffelWeb wizard.
This commit is contained in:
@@ -15,10 +15,10 @@
|
|||||||
</target>
|
</target>
|
||||||
<target name="{$WIZ.project.name/}_any" extends="common">
|
<target name="{$WIZ.project.name/}_any" extends="common">
|
||||||
<root class="{$APP_ROOT/}" feature="make_and_launch"/>
|
<root class="{$APP_ROOT/}" feature="make_and_launch"/>
|
||||||
|
{if condition="$WIZ.connectors.use_standalone ~ $WIZ_YES"}<library name="standalone" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\standalone-safe.ecf"/>{/if}
|
||||||
{if condition="$WIZ.connectors.use_cgi ~ $WIZ_YES"}<library name="cgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\cgi-safe.ecf"/>{/if}
|
{if condition="$WIZ.connectors.use_cgi ~ $WIZ_YES"}<library name="cgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\cgi-safe.ecf"/>{/if}
|
||||||
{if condition="$WIZ.connectors.use_libfcgi ~ $WIZ_YES"}<library name="libfcgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\libfcgi-safe.ecf"/>{/if}
|
{if condition="$WIZ.connectors.use_libfcgi ~ $WIZ_YES"}<library name="libfcgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\libfcgi-safe.ecf"/>{/if}
|
||||||
{if condition="$WIZ.connectors.use_standalone ~ $WIZ_YES"}<library name="standalone" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\standalone-safe.ecf"/>{/if}
|
<cluster name="launcher" location=".\launcher\">
|
||||||
<cluster name="launcher" location=".\launcher\" recursive="true">
|
|
||||||
<cluster name="any_launcher" location="$|any"/>
|
<cluster name="any_launcher" location="$|any"/>
|
||||||
</cluster>
|
</cluster>
|
||||||
<cluster name="src" location=".\src\" recursive="true"/>
|
<cluster name="src" location=".\src\" recursive="true"/>
|
||||||
|
|||||||
@@ -20,28 +20,27 @@ feature -- Execution
|
|||||||
launch (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
launch (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||||
-- Launch Web Server Application using optionals `opts'.
|
-- Launch Web Server Application using optionals `opts'.
|
||||||
local
|
local
|
||||||
launcher: WSF_SERVICE_LAUNCHER
|
launcher: WSF_SERVICE_LAUNCHER [G]
|
||||||
do
|
do
|
||||||
l_id := launcher_id
|
|
||||||
if not attached launcher_id as l_id then
|
if not attached launcher_id as l_id then
|
||||||
{unless condition="$WIZ.connectors.use_standalone ~ $WIZ_YES"}{literal}
|
{unless condition="$WIZ.connectors.use_standalone ~ $WIZ_YES"}{literal}
|
||||||
io.error.put_string ("Application launcher not found!%N")
|
io.error.put_string ("Application launcher not found!%N")
|
||||||
(create {EXCEPTIONS}).die (-1){/literal}{/unless}
|
(create {EXCEPTIONS}).die (-1){/literal}{/unless}
|
||||||
{if condition="$WIZ.connectors.use_standalone ~ $WIZ_YES"}{literal}
|
{if condition="$WIZ.connectors.use_standalone ~ $WIZ_YES"}{literal}
|
||||||
-- Choose a default -> standalone
|
-- Choose a default -> standalone
|
||||||
create {WSF_STANDALONE_SERVICE_LAUNCHER} launcher.make_and_launch (opts){/literal}{/if}
|
create {WSF_STANDALONE_SERVICE_LAUNCHER [G]} launcher.make_and_launch (opts){/literal}{/if}
|
||||||
{if condition="$WIZ.connectors.use_standalone ~ $WIZ_YES"}{literal}
|
{if condition="$WIZ.connectors.use_standalone ~ $WIZ_YES"}{literal}
|
||||||
elseif is_standalone_launcher_id (l_id) then
|
elseif is_standalone_launcher_id (l_id) then
|
||||||
create {WSF_STANDALONE_SERVICE_LAUNCHER} launcher.make_and_launch (opts){/literal}{/if}
|
create {WSF_STANDALONE_SERVICE_LAUNCHER [G]} launcher.make_and_launch (opts){/literal}{/if}
|
||||||
{if condition="$WIZ.connectors.use_libfcgi ~ $WIZ_YES"}{literal}
|
{if condition="$WIZ.connectors.use_libfcgi ~ $WIZ_YES"}{literal}
|
||||||
elseif is_libfcgi_launcher_id (l_id) then
|
elseif is_libfcgi_launcher_id (l_id) then
|
||||||
create {WSF_LIBFCGI_SERVICE_LAUNCHER} launcher.make_and_launch (opts){/literal}{/if}
|
create {WSF_LIBFCGI_SERVICE_LAUNCHER [G]} launcher.make_and_launch (opts){/literal}{/if}
|
||||||
{if condition="$WIZ.connectors.use_cgi ~ $WIZ_YES"}{literal}
|
{if condition="$WIZ.connectors.use_cgi ~ $WIZ_YES"}{literal}
|
||||||
elseif is_cgi_launcher_id (l_id) then
|
elseif is_cgi_launcher_id (l_id) then
|
||||||
create {WSF_CGI_SERVICE_LAUNCHER} launcher.make_and_launch (opts){/literal}{/if}
|
create {WSF_CGI_SERVICE_LAUNCHER [G]} launcher.make_and_launch (opts){/literal}{/if}
|
||||||
{if condition="$WIZ.connectors.use_standalone ~ $WIZ_YES"}{literal}
|
{if condition="$WIZ.connectors.use_standalone ~ $WIZ_YES"}{literal}
|
||||||
elseif is_standalone_launcher_id (l_id) then
|
elseif is_standalone_launcher_id (l_id) then
|
||||||
create {WSF_STANDALONE_SERVICE_LAUNCHER} launcher.make_and_launch (opts){/literal}{/if}
|
create {WSF_STANDALONE_SERVICE_LAUNCHER [G]} launcher.make_and_launch (opts){/literal}{/if}
|
||||||
{literal}
|
{literal}
|
||||||
else
|
else
|
||||||
io.error.put_string ("Application launcher not found!%N")
|
io.error.put_string ("Application launcher not found!%N")
|
||||||
@@ -53,31 +52,39 @@ feature -- Execution
|
|||||||
-- Launcher id based on the executable extension name if any.
|
-- Launcher id based on the executable extension name if any.
|
||||||
-- This can be redefine to customize for your application.
|
-- This can be redefine to customize for your application.
|
||||||
--| ex: standalone, cgi, libfcgi or Void.
|
--| ex: standalone, cgi, libfcgi or Void.
|
||||||
|
local
|
||||||
|
p: PATH
|
||||||
|
s: READABLE_STRING_32
|
||||||
do
|
do
|
||||||
if attached (create {PATH}.make_from_string (execution_environment.arguments.command_name)).extension as ext then
|
create p.make_from_string (execution_environment.arguments.command_name)
|
||||||
Result := ext
|
if attached p.extension as ext then
|
||||||
|
if ext.is_case_insensitive_equal_general ("exe") then
|
||||||
|
-- Windows
|
||||||
|
s := p.name
|
||||||
|
create p.make_from_string (s.head (s.count - 4))
|
||||||
|
Result := p.extension
|
||||||
|
else
|
||||||
|
Result := ext
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Status report
|
feature -- Status report{/literal}
|
||||||
{/literal}
|
|
||||||
{if condition="$WIZ.connectors.use_standalone ~ $WIZ_YES"}
|
{if condition="$WIZ.connectors.use_standalone ~ $WIZ_YES"}
|
||||||
is_standalone_launcher_id (a_id: READABLE_STRING_GENERAL): BOOLEAN
|
is_standalone_launcher_id (a_id: READABLE_STRING_GENERAL): BOOLEAN
|
||||||
do
|
do
|
||||||
Result := a_id.is_case_insensitive ("standalone")
|
Result := a_id.is_case_insensitive_equal ("standalone")
|
||||||
end{/if}
|
end{/if}
|
||||||
|
|
||||||
{if condition="$WIZ.connectors.use_cgi ~ $WIZ_YES"}
|
{if condition="$WIZ.connectors.use_cgi ~ $WIZ_YES"}
|
||||||
is_cgi_launcher_id (a_id: READABLE_STRING_GENERAL): BOOLEAN
|
is_cgi_launcher_id (a_id: READABLE_STRING_GENERAL): BOOLEAN
|
||||||
do
|
do
|
||||||
Result := a_id.is_case_insensitive ("cgi")
|
Result := a_id.is_case_insensitive_equal ("cgi")
|
||||||
end{/if}
|
end{/if}
|
||||||
|
|
||||||
{if condition="$WIZ.connectors.use_libfcgi ~ $WIZ_YES"}
|
{if condition="$WIZ.connectors.use_libfcgi ~ $WIZ_YES"}
|
||||||
is_libfcgi_launcher_id (a_id: READABLE_STRING_GENERAL): BOOLEAN
|
is_libfcgi_launcher_id (a_id: READABLE_STRING_GENERAL): BOOLEAN
|
||||||
do
|
do
|
||||||
Result := a_id.is_case_insensitive ("libfcgi")
|
Result := a_id.is_case_insensitive_equal ("libfcgi")
|
||||||
or a_id.is_case_insensitive ("fcgi")
|
or a_id.is_case_insensitive_equal ("fcgi")
|
||||||
end{/if}
|
end{/if}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,10 +14,8 @@ inherit
|
|||||||
redefine
|
redefine
|
||||||
initialize
|
initialize
|
||||||
end
|
end
|
||||||
{if condition="$WIZ.routers.use_router ~ $WIZ_YES"}
|
|
||||||
WSF_ROUTED_SERVICE{/if}
|
|
||||||
{if isset="$APP_ROOT"}APPLICATION_LAUNCHER [{$APP_ROOT/}_EXECUTION]{/if}
|
{if isset="$APP_ROOT"}APPLICATION_LAUNCHER [{$APP_ROOT/}_EXECUTION]{/if}
|
||||||
{unless isset="$APP_ROOT"}APPLICATION_LAUNCHER [APPLICATION_EXECUTION]{/if}
|
{unless isset="$APP_ROOT"}APPLICATION_LAUNCHER [APPLICATION_EXECUTION]{/unless}
|
||||||
|
|
||||||
{literal}create
|
{literal}create
|
||||||
make_and_launch
|
make_and_launch
|
||||||
@@ -29,6 +27,7 @@ feature {NONE} -- Initialization
|
|||||||
do
|
do
|
||||||
Precursor
|
Precursor
|
||||||
set_service_option ("port", {$WIZ.standalone_connector.port/})
|
set_service_option ("port", {$WIZ.standalone_connector.port/})
|
||||||
|
set_service_option ("verbose", "{$WIZ.standalone_connector.verbose/}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ class
|
|||||||
|
|
||||||
inherit
|
inherit
|
||||||
{unless condition="$WIZ.routers.use_router ~ $WIZ_YES"}
|
{unless condition="$WIZ.routers.use_router ~ $WIZ_YES"}
|
||||||
{unless condition="$WIZ.routers.use_filter ~ $WIZ_YES"}
|
{unless condition="$WIZ.filters.use_filter ~ $WIZ_YES"}
|
||||||
WSF_EXECUTION{/unless}
|
WSF_EXECUTION{/unless}
|
||||||
{if condition="$WIZ.routers.use_filter ~ $WIZ_YES"}
|
{if condition="$WIZ.filters.use_filter ~ $WIZ_YES"}
|
||||||
WSF_FILTERED_EXECUTION{/if}
|
WSF_FILTERED_EXECUTION{/if}
|
||||||
{/unless}
|
{/unless}
|
||||||
{if condition="$WIZ.routers.use_router ~ $WIZ_YES"}
|
{if condition="$WIZ.routers.use_router ~ $WIZ_YES"}
|
||||||
{unless condition="$WIZ.routers.use_filter ~ $WIZ_YES"}
|
{unless condition="$WIZ.filters.use_filter ~ $WIZ_YES"}
|
||||||
WSF_ROUTED_EXECUTION{/unless}
|
WSF_ROUTED_EXECUTION{/unless}
|
||||||
{if condition="$WIZ.routers.use_filter ~ $WIZ_YES"}
|
{if condition="$WIZ.filters.use_filter ~ $WIZ_YES"}
|
||||||
WSF_FILTERED_ROUTED_EXECUTION{/if}
|
WSF_FILTERED_ROUTED_EXECUTION{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
@@ -28,7 +28,6 @@ inherit
|
|||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
{/literal}
|
{/literal}
|
||||||
|
|
||||||
{unless condition="$WIZ.routers.use_router ~ $WIZ_YES"}{literal}
|
{unless condition="$WIZ.routers.use_router ~ $WIZ_YES"}{literal}
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|
||||||
@@ -42,9 +41,9 @@ feature -- Execution
|
|||||||
--| To send back easily a simple plaintext message.
|
--| To send back easily a simple plaintext message.
|
||||||
create mesg.make_with_body ("Hello Eiffel Web")
|
create mesg.make_with_body ("Hello Eiffel Web")
|
||||||
response.send (mesg)
|
response.send (mesg)
|
||||||
end{/unless}
|
end
|
||||||
|
{/literal}{/unless}
|
||||||
{if condition="$WIZ.routers.use_filter ~ $WIZ_YES"}{literal}
|
{if condition="$WIZ.filters.use_filter ~ $WIZ_YES"}{literal}
|
||||||
feature -- Filter
|
feature -- Filter
|
||||||
|
|
||||||
create_filter
|
create_filter
|
||||||
@@ -56,15 +55,18 @@ feature -- Filter
|
|||||||
|
|
||||||
setup_filter
|
setup_filter
|
||||||
-- Setup `filter'
|
-- Setup `filter'
|
||||||
|
local
|
||||||
|
f: like filter
|
||||||
do
|
do
|
||||||
append_filters (<<
|
create {WSF_CORS_FILTER} f
|
||||||
create {WSF_CORS_FILTER},
|
f.set_next (create {WSF_LOGGING_FILTER})
|
||||||
create {WSF_LOGGING_FILTER}
|
|
||||||
>>)
|
|
||||||
--| Chain more filters like {WSF_CUSTOM_HEADER_FILTER}, ...
|
--| Chain more filters like {WSF_CUSTOM_HEADER_FILTER}, ...
|
||||||
--| and your owns filters.
|
--| and your owns filters.
|
||||||
end{/if}
|
|
||||||
|
|
||||||
|
filter.append (f)
|
||||||
|
end
|
||||||
|
{/literal}{/if}
|
||||||
{if condition="$WIZ.routers.use_router ~ $WIZ_YES"}{literal}
|
{if condition="$WIZ.routers.use_router ~ $WIZ_YES"}{literal}
|
||||||
feature -- Router
|
feature -- Router
|
||||||
|
|
||||||
@@ -78,12 +80,12 @@ feature -- Router
|
|||||||
--| /* are dispatched to serve files/directories contained in "www" directory
|
--| /* are dispatched to serve files/directories contained in "www" directory
|
||||||
|
|
||||||
--| Self documentation
|
--| Self documentation
|
||||||
router.handle_with_request_methods ("/doc", create {WSF_ROUTER_SELF_DOCUMENTATION_HANDLER}.make (router), router.methods_GET)
|
router.handle ("/doc", create {WSF_ROUTER_SELF_DOCUMENTATION_HANDLER}.make (router), router.methods_GET)
|
||||||
|
|
||||||
--| Files publisher
|
--| Files publisher
|
||||||
create fhdl.make_hidden ("www")
|
create fhdl.make_hidden ("www")
|
||||||
fhdl.set_directory_index (<<"index.html">>)
|
fhdl.set_directory_index (<<"index.html">>)
|
||||||
router.handle_with_request_methods ("", fhdl, router.methods_GET)
|
router.handle ("", fhdl, router.methods_GET)
|
||||||
end{/literal}{/if}
|
end{/literal}{/if}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user