Adapt to EWF concurrent version.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
<option warning="true" full_class_checking="false" is_attached_by_default="true" void_safety="transitional" syntax="transitional">
|
||||
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
|
||||
</option>
|
||||
<setting name="console_application" value="true"/>
|
||||
<setting name="concurrency" value="scoop"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="cms" location="..\..\cms-safe.ecf" readonly="false"/>
|
||||
@@ -23,16 +24,16 @@
|
||||
<root class="EWF_ROC_SERVER" feature="make_and_launch"/>
|
||||
<setting name="concurrency" value="scoop"/>
|
||||
<library name="cgi" location="$EWF_LIBRARY\library\server\wsf\connector\cgi-safe.ecf"/>
|
||||
<library name="httpd" location="$EWF_LIBRARY\library\server\wsf\connector\httpd-safe.ecf"/>
|
||||
<library name="libfcgi" location="$EWF_LIBRARY\library\server\wsf\connector\libfcgi-safe.ecf"/>
|
||||
<library name="nino" location="$EWF_LIBRARY\library\server\wsf\connector\nino-safe.ecf"/>
|
||||
<library name="standalone" location="$EWF_LIBRARY\library\server\wsf\connector\standalone-safe.ecf"/>
|
||||
<cluster name="launcher" location=".\launcher\any\" recursive="true"/>
|
||||
<cluster name="src" location=".\src\" recursive="true"/>
|
||||
</target>
|
||||
<target name="demo_httpd" extends="common">
|
||||
<target name="demo_standalone" extends="common">
|
||||
<root class="EWF_ROC_SERVER" feature="make_and_launch"/>
|
||||
<setting name="concurrency" value="scoop"/>
|
||||
<library name="default_httpd" location="$EWF_LIBRARY\library\server\wsf\default\httpd-safe.ecf"/>
|
||||
<library name="default_standalone" location="$EWF_LIBRARY\library\server\wsf\default\standalone-safe.ecf"/>
|
||||
<cluster name="launcher" location=".\launcher\default\" recursive="true"/>
|
||||
<cluster name="src" location=".\src\" recursive="true"/>
|
||||
</target>
|
||||
|
||||
@@ -23,9 +23,9 @@ feature -- Execution
|
||||
do
|
||||
nature := launcher_nature
|
||||
if nature = Void then
|
||||
launch_httpd (opts)
|
||||
elseif nature = nature_httpd then
|
||||
launch_httpd (opts)
|
||||
launch_standalone (opts)
|
||||
elseif nature = nature_standalone then
|
||||
launch_standalone (opts)
|
||||
elseif nature = nature_nino then
|
||||
launch_nino (opts)
|
||||
elseif nature = nature_cgi then
|
||||
@@ -54,8 +54,8 @@ feature {NONE} -- Access
|
||||
ext := l_entry.extension
|
||||
end
|
||||
if ext /= Void then
|
||||
if ext.same_string (nature_httpd) then
|
||||
Result := nature_httpd
|
||||
if ext.same_string (nature_standalone) then
|
||||
Result := nature_standalone
|
||||
end
|
||||
if ext.same_string (nature_nino) then
|
||||
Result := nature_nino
|
||||
@@ -70,13 +70,13 @@ feature {NONE} -- Access
|
||||
Result := default_nature
|
||||
end
|
||||
|
||||
feature {NONE} -- httpd
|
||||
feature {NONE} -- standalone
|
||||
|
||||
nature_httpd: STRING = "httpd"
|
||||
nature_standalone: STRING = "standalone"
|
||||
|
||||
launch_httpd (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
launch_standalone (opts: detachable WSF_SERVICE_LAUNCHER_OPTIONS)
|
||||
local
|
||||
launcher: WSF_HTTPD_SERVICE_LAUNCHER [G]
|
||||
launcher: WSF_STANDALONE_SERVICE_LAUNCHER [G]
|
||||
do
|
||||
create launcher.make_and_launch (opts)
|
||||
end
|
||||
@@ -118,7 +118,7 @@ feature -- Default
|
||||
|
||||
default_nature: STRING
|
||||
do
|
||||
Result := nature_httpd
|
||||
Result := nature_standalone
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ class
|
||||
EWF_ROC_SERVER_EXECUTION
|
||||
|
||||
inherit
|
||||
WSF_EXECUTION
|
||||
CMS_EXECUTION
|
||||
redefine
|
||||
initialize
|
||||
end
|
||||
@@ -25,52 +25,6 @@ feature {NONE} -- Initialization
|
||||
initialize
|
||||
do
|
||||
Precursor
|
||||
initialize_cms (cms_setup)
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
cms_service: CMS_SERVICE
|
||||
-- cms service.
|
||||
|
||||
layout: CMS_LAYOUT
|
||||
-- cms layout.
|
||||
|
||||
feature -- Execution
|
||||
|
||||
execute
|
||||
local
|
||||
do
|
||||
cms_service.execute (request, response)
|
||||
end
|
||||
|
||||
feature -- CMS Initialization
|
||||
|
||||
cms_setup: CMS_DEFAULT_SETUP
|
||||
local
|
||||
utf: UTF_CONVERTER
|
||||
do
|
||||
if attached execution_environment.arguments.separate_character_option_value ('d') as l_dir then
|
||||
create layout.make_with_directory_name (l_dir)
|
||||
else
|
||||
create layout.make_default
|
||||
end
|
||||
initialize_logger (layout)
|
||||
write_debug_log (generator + ".cms_setup based directory %"" + utf.escaped_utf_32_string_to_utf_8_string_8 (layout.path.name) + "%"")
|
||||
create Result.make (layout)
|
||||
setup_storage (Result)
|
||||
end
|
||||
|
||||
initialize_cms (a_setup: CMS_SETUP)
|
||||
local
|
||||
cms: CMS_SERVICE
|
||||
api: CMS_API
|
||||
do
|
||||
write_debug_log (generator + ".initialize_cms")
|
||||
setup_modules (a_setup)
|
||||
create api.make (a_setup)
|
||||
create cms.make (api)
|
||||
cms_service := cms
|
||||
end
|
||||
|
||||
feature -- CMS setup
|
||||
|
||||
@@ -49,7 +49,7 @@ feature -- Access: user
|
||||
|
||||
users: LIST [CMS_USER]
|
||||
do
|
||||
create {ARRAYED_LIST[CMS_USER]} Result.make (0)
|
||||
create {ARRAYED_LIST [CMS_USER]} Result.make (0)
|
||||
end
|
||||
|
||||
user_by_id (a_id: like {CMS_USER}.id): detachable CMS_USER
|
||||
@@ -70,16 +70,16 @@ feature -- Access: user
|
||||
|
||||
feature -- User Nodes
|
||||
|
||||
user_collaborator_nodes (a_id: like {CMS_USER}.id): LIST[CMS_NODE]
|
||||
user_collaborator_nodes (a_id: like {CMS_USER}.id): LIST [CMS_NODE]
|
||||
-- Possible list of nodes where the user identified by `a_id', is a collaborator.
|
||||
do
|
||||
create {ARRAYED_LIST[CMS_NODE]} Result.make (0)
|
||||
create {ARRAYED_LIST [CMS_NODE]} Result.make (0)
|
||||
end
|
||||
|
||||
user_author_nodes (a_id: like {CMS_USER}.id): LIST[CMS_NODE]
|
||||
user_author_nodes (a_id: like {CMS_USER}.id): LIST [CMS_NODE]
|
||||
-- Possible list of nodes where the user identified by `a_id', is the author.
|
||||
do
|
||||
create {ARRAYED_LIST[CMS_NODE]} Result.make (0)
|
||||
create {ARRAYED_LIST [CMS_NODE]} Result.make (0)
|
||||
end
|
||||
|
||||
feature -- Change: user
|
||||
@@ -103,10 +103,9 @@ feature -- Access: roles and permissions
|
||||
|
||||
user_roles: LIST [CMS_USER_ROLE]
|
||||
do
|
||||
create {ARRAYED_LIST[CMS_USER_ROLE]} Result.make (0)
|
||||
create {ARRAYED_LIST [CMS_USER_ROLE]} Result.make (0)
|
||||
end
|
||||
|
||||
|
||||
feature -- Change: roles and permissions
|
||||
|
||||
save_user_role (a_user_role: CMS_USER_ROLE)
|
||||
@@ -123,13 +122,13 @@ feature -- Access: node
|
||||
nodes: LIST[CMS_NODE]
|
||||
-- List of nodes.
|
||||
do
|
||||
create {ARRAYED_LIST[CMS_NODE]} Result.make (0)
|
||||
create {ARRAYED_LIST [CMS_NODE]} Result.make (0)
|
||||
end
|
||||
|
||||
recent_nodes (a_lower: INTEGER; a_count: INTEGER): LIST [CMS_NODE]
|
||||
-- List of the `a_count' most recent nodes, starting from `a_lower'.
|
||||
do
|
||||
create {ARRAYED_LIST[CMS_NODE]} Result.make (0)
|
||||
create {ARRAYED_LIST [CMS_NODE]} Result.make (0)
|
||||
end
|
||||
|
||||
node_by_id (a_id: INTEGER_64): detachable CMS_NODE
|
||||
@@ -145,7 +144,7 @@ feature -- Access: node
|
||||
node_collaborators (a_id: like {CMS_NODE}.id): LIST [CMS_USER]
|
||||
-- Possible list of node's collaborator.
|
||||
do
|
||||
create {ARRAYED_LIST[CMS_USER]} Result.make (0)
|
||||
create {ARRAYED_LIST [CMS_USER]} Result.make (0)
|
||||
end
|
||||
|
||||
feature -- Node
|
||||
|
||||
@@ -6,53 +6,49 @@ note
|
||||
even for a specific handler.
|
||||
]"
|
||||
|
||||
class
|
||||
CMS_SERVICE
|
||||
deferred class
|
||||
CMS_EXECUTION
|
||||
|
||||
inherit
|
||||
WSF_ROUTED_SKELETON_SERVICE
|
||||
rename
|
||||
execute as execute_service
|
||||
WSF_FILTERED_ROUTED_SKELETON_EXECUTION
|
||||
undefine
|
||||
requires_proxy
|
||||
redefine
|
||||
execute_default
|
||||
end
|
||||
|
||||
WSF_FILTERED_SERVICE
|
||||
|
||||
WSF_FILTER
|
||||
rename
|
||||
execute as execute_filter
|
||||
execute_default,
|
||||
filter_execute,
|
||||
initialize
|
||||
end
|
||||
|
||||
WSF_NO_PROXY_POLICY
|
||||
|
||||
WSF_URI_HELPER_FOR_ROUTED_SERVICE
|
||||
WSF_URI_HELPER_FOR_ROUTED_EXECUTION
|
||||
|
||||
WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_SERVICE
|
||||
WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_EXECUTION
|
||||
|
||||
REFACTORING_HELPER
|
||||
|
||||
SHARED_LOGGER
|
||||
|
||||
create
|
||||
make
|
||||
--create
|
||||
-- make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_api: CMS_API)
|
||||
initialize
|
||||
-- Build a CMS service with `a_api'
|
||||
do
|
||||
api := a_api
|
||||
initialize
|
||||
ensure
|
||||
api_set: api = a_api
|
||||
initialize_cms (cms_setup)
|
||||
Precursor
|
||||
end
|
||||
|
||||
initialize
|
||||
-- Initialize various parts of the CMS service.
|
||||
initialize_cms (a_setup: CMS_SETUP)
|
||||
do
|
||||
setup := a_setup
|
||||
write_debug_log (generator + ".initialize_cms")
|
||||
setup_modules (a_setup)
|
||||
create api.make (a_setup)
|
||||
|
||||
-- CMS Initialization
|
||||
initialize_modules
|
||||
initialize_users
|
||||
initialize_auth_engine
|
||||
@@ -88,6 +84,17 @@ feature {NONE} -- Initialization
|
||||
to_implement ("To Implement authentication engine")
|
||||
end
|
||||
|
||||
feature -- CMS setup
|
||||
|
||||
setup_modules (a_setup: CMS_SETUP)
|
||||
-- Setup additional modules.
|
||||
deferred
|
||||
end
|
||||
|
||||
setup_storage (a_setup: CMS_SETUP)
|
||||
deferred
|
||||
end
|
||||
|
||||
feature -- Settings: router
|
||||
|
||||
setup_router
|
||||
@@ -155,12 +162,12 @@ feature -- Settings: router
|
||||
|
||||
feature -- Execute Filter
|
||||
|
||||
execute_filter (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
filter_execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
-- Execute the filter.
|
||||
do
|
||||
res.put_header_line ("Date: " + (create {HTTP_DATE}.make_now_utc).string)
|
||||
res.put_header_line ("X-EWF-Server: CMS_v1.0")
|
||||
execute_service (req, res)
|
||||
Precursor (req, res)
|
||||
end
|
||||
|
||||
feature -- Filters
|
||||
@@ -225,13 +232,27 @@ feature -- Filters
|
||||
|
||||
feature -- Access
|
||||
|
||||
layout: CMS_LAYOUT
|
||||
|
||||
api: CMS_API
|
||||
-- API service.
|
||||
|
||||
setup: CMS_SETUP
|
||||
setup: CMS_SETUP
|
||||
|
||||
cms_setup: CMS_DEFAULT_SETUP
|
||||
-- CMS setup.
|
||||
local
|
||||
utf: UTF_CONVERTER
|
||||
do
|
||||
Result := api.setup
|
||||
if attached execution_environment.arguments.separate_character_option_value ('d') as l_dir then
|
||||
create layout.make_with_directory_name (l_dir)
|
||||
else
|
||||
create layout.make_default
|
||||
end
|
||||
initialize_logger (layout)
|
||||
write_debug_log (generator + ".cms_setup based directory %"" + utf.escaped_utf_32_string_to_utf_8_string_8 (layout.path.name) + "%"")
|
||||
create Result.make (layout)
|
||||
setup_storage (Result)
|
||||
end
|
||||
|
||||
modules: CMS_MODULE_COLLECTION
|
||||
Reference in New Issue
Block a user