note description: "Summary description for {ES_CLOUD_HANDLER}." date: "$Date$" revision: "$Revision$" class ES_CLOUD_HANDLER inherit CMS_HANDLER rename make as make_with_cms_api end WSF_URI_TEMPLATE_HANDLER create make feature {NONE} -- Initialization make (a_mod_api: ES_CLOUD_API) do make_with_cms_api (a_mod_api.cms_api) es_cloud_api := a_mod_api end feature -- API es_cloud_api: ES_CLOUD_API feature -- Execution execute (req: WSF_REQUEST; res: WSF_RESPONSE) -- Execute handler for `req' and respond in `res'. do if req.is_get_request_method then get_cloud (req, res) -- elseif req.is_post_request_method then else send_bad_request (req, res) end end get_cloud (req: WSF_REQUEST; res: WSF_RESPONSE) local l_user: ES_CLOUD_USER r: like new_generic_response s: STRING l_plan: detachable ES_CLOUD_PLAN l_org: detachable ES_CLOUD_ORGANIZATION l_session: detachable ES_CLOUD_SESSION l_sessions: detachable LIST [ES_CLOUD_SESSION] inst: ES_CLOUD_INSTALLATION l_display_all: BOOLEAN k: READABLE_STRING_32 ago: DATE_TIME_AGO_CONVERTER l_can_be_deleted, l_user_has_no_license: BOOLEAN do if attached req.query_parameter ("display") as d and then d.is_case_insensitive_equal ("all") then l_display_all := True end r := new_generic_response (req, res) r.add_javascript_url (r.module_name_resource_url ({ES_CLOUD_MODULE}.name, "/files/js/es_cloud.js", Void)) r.add_style (r.module_name_resource_url ({ES_CLOUD_MODULE}.name, "/files/css/es_cloud.css", Void), Void) r.set_title ("EiffelStudio account") s := "" create ago.make if attached api.user as u then create l_user.make (u) s.append ("
") -- Plan -- Installation ... s.append ("EiffelStudio is installed on " + l_installations.count.out + " devices: ") if l_display_all then s.append ("only active sessions") else s.append ("include ended or expired") end s.append ("
EiffelStudio is not yet installed.
") end s.append ("Manager of organization: ") s.append ("") s.append (html_encoded (l_org.title_or_name)) s.append ("
") else s.append ("Member of organization: ") s.append (html_encoded (l_org.title_or_name)) s.append ("
") end end end s.append ("License "+ html_encoded (lic.key) + " for plan ") s.append (html_encoded (l_plan.title_or_name)) s.append ("") s.append ("
You are subscribed to plan: ") s.append (html_encoded (l_plan.title_or_name)) s.append ("") s.append ("
Please Login or Register...
") end if l_plan = Void then s.append ("