From 9fcb897b0b10cde17ebf981874b38a9164930169 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Fri, 23 Nov 2012 14:12:13 +0100 Subject: [PATCH] Allow to use WSF_ROUTER_SELF_DOCUMENTATION_MESSAGE without any WSF_ROUTER_SELF_DOCUMENTATION_HANDLER i.e without any specific URL to this self documentation. Added custom value such as header, footer, style css url ... --- .../wsf_router_self_documentation_message.e | 123 +++++++++++++----- 1 file changed, 90 insertions(+), 33 deletions(-) diff --git a/library/server/wsf/router/documentation/wsf_router_self_documentation_message.e b/library/server/wsf/router/documentation/wsf_router_self_documentation_message.e index d583dd6e..a39b7180 100644 --- a/library/server/wsf/router/documentation/wsf_router_self_documentation_message.e +++ b/library/server/wsf/router/documentation/wsf_router_self_documentation_message.e @@ -18,26 +18,49 @@ create feature {NONE} -- Initialization make (req: WSF_REQUEST; a_router: WSF_ROUTER; a_resource: detachable STRING) - local - do request := req router := a_router - if attached a_router.base_url as l_base_url then - resource := l_base_url.twin - else - create resource.make_empty - end - if a_resource /= Void then - resource.append (a_resource) + if a_resource /= Void and then attached a_router.base_url as l_base_url then + resource := l_base_url + a_resource end end +feature -- Access + request: WSF_REQUEST router: WSF_ROUTER - resource: STRING_8 + resource: detachable STRING_8 + +feature -- Properties + + header: detachable STRING_8 + -- Header's content for the output HTML. + + footer: detachable STRING_8 + -- Footer's content for the output HTML. + + custom_style_url: detachable STRING_8 + -- URL for a custom style css document. + +feature -- Change + + set_header (v: like header) + do + header := v + end + + set_footer (v: like footer) + do + footer := v + end + + set_custom_style_url (v: like custom_style_url) + do + custom_style_url := v + end feature {WSF_RESPONSE} -- Output @@ -58,16 +81,23 @@ feature {WSF_RESPONSE} -- Output l_description.append ("") l_description.append ("") l_description.append ("Documentation") - l_description.append ("[ - - ]") + if attached custom_style_url as l_custom_style_url then + l_description.append ("%N") + else + l_description.append ("[ + + ]") + end l_description.append ("") + if attached header as l_header then + l_description.append (l_header) + end l_description.append ("

Documentation

%N") @@ -78,21 +108,20 @@ feature {WSF_RESPONSE} -- Output end debug - l_description.append ("

Meta