note description : "OPENID demo application root class" date : "$Date$" revision : "$Revision$" class APPLICATION inherit WSF_ROUTED_SKELETON_SERVICE undefine requires_proxy end WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_SERVICE WSF_SERVICE WSF_NO_PROXY_POLICY SHARED_EXECUTION_ENVIRONMENT export {NONE} all end create make_and_launch feature {NONE} -- Initialization make_and_launch local launcher: WSF_NINO_SERVICE_LAUNCHER opts: WSF_SERVICE_LAUNCHER_OPTIONS do initialize_router create opts.make opts.set_verbose (True) opts.set_option ("port", 0) create launcher.make (Current, opts) launcher.on_launched_actions.extend (agent on_launched) launcher.launch end on_launched (conn: WGI_CONNECTOR) local e: EXECUTION_ENVIRONMENT cmd: STRING_32 do if attached {WGI_NINO_CONNECTOR} conn as nino then e := execution_environment create cmd.make (32) if attached e.item ("COMSPEC") as l_comspec then cmd.append (l_comspec) cmd.append ({STRING_32} " /C start ") end cmd.append ("http://localhost:") cmd.append_integer (nino.port) cmd.append_character ({CHARACTER_32} '/') e.launch (cmd) end end setup_router do map_uri_template_agent ("/", agent handle_root) map_uri_template_agent ("/openid", agent handle_openid) end handle_root (req: WSF_REQUEST; res: WSF_RESPONSE) local m: WSF_HTML_PAGE_RESPONSE s: STRING do create m.make m.set_title ("EWF::OpenID demo") create s.make_empty s.append ("
%N") s.append ("%N") m.set_body (s) res.send (m) end handle_openid (req: WSF_REQUEST; res: WSF_RESPONSE) local m: WSF_HTML_PAGE_RESPONSE redir: WSF_HTML_DELAYED_REDIRECTION_RESPONSE s: STRING o: OPENID_CONSUMER v: OPENID_CONSUMER_VALIDATION do if attached req.string_item ("openid.mode") as l_openid_mode then create m.make m.set_title ("EWF::OpenID demo") create s.make_empty if l_openid_mode.same_string ("id_res") then o := new_openid_consumer (req) create v.make_from_items (o, req.items_as_string_items) v.validate if v.is_valid then s.append ("