diff --git a/calexium_lib/web/CXM_dojo.anubis b/calexium_lib/web/CXM_dojo.anubis index a683a3c..cf588a3 100644 --- a/calexium_lib/web/CXM_dojo.anubis +++ b/calexium_lib/web/CXM_dojo.anubis @@ -20,6 +20,10 @@ read common/language_management.anubis read tools/mf_loggers.anubis read calexium_lib/net_services_protocols/logger_service.anubis read system/logger.anubis + +public type Dojo_Grid_Data : + grid_data(String). + public define HTML_Off_Form dojo_dialog ( @@ -48,7 +52,28 @@ public define HTML_Off_Form . - +public define HTML_Off_Form + dojo_grid + ( + String id, + String colum1, + String colum2, + String colum3, + String colum4, + ) + = + literal(" +
") +. public define HTML_Off_Form diff --git a/calexium_lib/web/CXM_making_a_web_site.anubis b/calexium_lib/web/CXM_making_a_web_site.anubis index 8ff95ca..a78edee 100644 --- a/calexium_lib/web/CXM_making_a_web_site.anubis +++ b/calexium_lib/web/CXM_making_a_web_site.anubis @@ -45,6 +45,7 @@ read tools/basis.anubis +read system/string.anubis read system/logger.anubis read CXM_common.anubis read CXM_multihost_http_server.anubis @@ -330,12 +331,12 @@ public type Web_Action($SessionTicket, $State): must be sent to the client. To that end, you must provide a function (named below 'compute_page') of type: - $State -> HTML_Page + $State -> HTTP_Answer - where the type 'HTML_Page' (defined below in this file) abstractly represents HTML + where the type 'HTTP_Answer' (defined below in this file) abstractly represents HTML pages. -public type HTML_Page:... +public type HTTP_Answer:... It should be clear that states and pages are deeply linked together. Indeed, we really understand the page shown to the client as a representation of the current state of the @@ -438,7 +439,7 @@ public define Web_Site List(Web_arg), Bool is_https) -> (Maybe($SessionTicket), Maybe($State), List(HTTP_header)) ticket_lost_state, List(Web_Action($SessionTicket, $State)) actions, - (Maybe($SessionTicket), Maybe($State), List(Web_arg) lwa) -> HTML_Page compute_page, + (Maybe($SessionTicket), Maybe($State), List(Web_arg) lwa) -> HTTP_Answer compute_page, Int timeout, // seconds (todo: minutes) List(Redirection) redirections, String charset, @@ -1460,15 +1461,21 @@ public type HTML_Body: body(List(Body_Option) options, HTML_Off_Form content). -public type HTML_Page: +public type HTTP_Answer: html_page(String title, List(HTML_Meta) meta_tags, List(CSS_Style) styles, List(CSS_File) css_files, List(JS_File) js_files, - HTML_Body body). - -public define HTML_Page + HTML_Body body), + plain_text (String text), + custom_text(String mime_type, + String content), + custom_binary(String mime_type, + ByteArray content), + http_raw(Printable_tree). + +public define HTTP_Answer html_page ( String title, @@ -1477,7 +1484,7 @@ public define HTML_Page ) = html_page(title,metas,[],[],[],body). -public define HTML_Page +public define HTTP_Answer html_page ( String title, @@ -1487,7 +1494,7 @@ public define HTML_Page ) = html_page(title, metas, styles, [], [], body). - 'HTML_Page' represents the final product of the construction of a web page. + 'HTTP_Answer' represents the final product of the construction of a web page. @@ -2176,11 +2183,12 @@ type CommonInfo: public define Printable_tree format ( - CommonInfo cinfo, - String state_name, - HTML_Page page, - Bool is_https, - String charset + CommonInfo cinfo, + String state_name, + List(HTTP_header) headers, + HTTP_Answer page, + Bool is_https, + String charset ). @@ -2215,7 +2223,7 @@ public define Web_Site List(Web_arg), Bool is_https) -> (Maybe($SessionTicket), Maybe($State), List(HTTP_header)) ticket_lost_state, List(Web_Action($SessionTicket, $State)) actions, - (Maybe($SessionTicket), Maybe($State), List(Web_arg) lwa) -> HTML_Page compute_page, + (Maybe($SessionTicket), Maybe($State), List(Web_arg) lwa) -> HTTP_Answer compute_page, Int timeout, Redirections redirections, String charset, @@ -2251,7 +2259,7 @@ public define Web_Site HTTP_Info http_info, List(Web_arg) lwa, Bool is_https) |-> - ((List(HTTP_header),Printable_tree)) + (Printable_tree) if separate_web_args(lwa) is { swa(mb_previous_state,mb_action_name,operands) then @@ -2288,12 +2296,12 @@ public define Web_Site }, if state_and_headers is (session_ticket, mb_new_state, headers) then with state_name = save_state(mb_new_state), - (headers, - format(info(host_name, http_port, https_port, site_directory, secret), - state_name, - compute_page(session_ticket, mb_new_state, operands), - is_https, - charset)) + format(info(host_name, http_port, https_port, site_directory, secret), + state_name, + headers, + compute_page(session_ticket, mb_new_state, operands), + is_https, + charset) }), // // make the delete_out_of_date function @@ -4229,7 +4237,8 @@ define Printable_tree ( CommonInfo cinfo, String state_name, - HTML_Page page, + List(HTTP_header) additional_headers, + HTTP_Answer page, Bool is_https, String charset ) = @@ -4239,38 +4248,69 @@ define Printable_tree { html_page(title,metas,css_styles, css_files, js_files, body) then if body is body(options,element) then - [ doctype_w3c_header, - "\n", - "\n", - add_css_styles(css_styles), - add_css_files(css_files), - add_js_files(js_files), - "\n", - "\n", - "