note description: "Objects that represent the Vision2 application.% %The original version of this class has been generated by EiffelBuild." generator: "EiffelBuild" legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" revision: "$Revision$" class WDOCS_APP inherit EV_APPLICATION SHARED_EXECUTION_ENVIRONMENT undefine default_create, copy end create make_and_launch feature {NONE} -- Initialization make_and_launch -- Create `Current', build and display `main_window', -- then launch the application. local l_win: like main_window l_embeded_services: WDOCS_EMBEDDED_WEB_SERVICE env: APP_CMS_ENVIRONMENT do create l_embeded_services.make default_create create env.make_default create l_win.make (env) --l_embeded_services.environment) main_window := l_win l_win.show l_embeded_services.set_port_number (0) -- Use first available port number l_embeded_services.on_launched_actions.force (agent on_web_service_launched (l_win, l_embeded_services)) -- l_embeded_services.request_exit_operation_actions.force (agent on_quit) l_embeded_services.launch launch end on_quit do if attached main_window as win then win.destroy_and_exit_if_last end end on_web_service_launched (a_win: attached like main_window; s: WDOCS_EMBEDDED_WEB_SERVICE) do add_idle_action_kamikaze (agent wait_for_termination (s, Void)) add_idle_action_kamikaze (agent a_win.on_web_service_ready) end wait_for_termination (s: WDOCS_EMBEDDED_WEB_SERVICE; a_timeout: detachable EV_TIMEOUT) local t: detachable EV_TIMEOUT do t := a_timeout if t /= Void then t.set_interval (0) end if attached s.observer as obs and then observer_has_terminaded (obs) then if t /= Void then t.destroy end on_quit else if t = Void then create t t.actions.extend (agent wait_for_termination (s, t)) else t.set_interval (1_000) end t.set_interval (1_000) end end observer_has_terminaded (obs: separate WGI_STANDALONE_SERVER_OBSERVER): BOOLEAN do Result := obs.terminated end feature {NONE} -- Implementation new_cms_environment: APP_CMS_ENVIRONMENT --| Check coherence with EIFFEL_COMMUNITY_SITE_SERVICE.new_cms_environment. do if attached execution_environment.arguments.separate_character_option_value ('d') as l_dir then create Result.make_with_directory_name (l_dir) else create Result.make_default end end main_window: detachable WDOCS_WINDOW -- Main window of `Current' ;note copyright: "Copyright (c) 1984-2009, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software 356 Storke Road, Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end