diff --git a/draft/application/cms/cms-safe.ecf b/draft/application/cms/cms-safe.ecf index 28c0c7c0..d225d9dd 100644 --- a/draft/application/cms/cms-safe.ecf +++ b/draft/application/cms/cms-safe.ecf @@ -14,6 +14,7 @@ + diff --git a/draft/application/cms/cms.ecf b/draft/application/cms/cms.ecf index 486313e8..7d3f886d 100644 --- a/draft/application/cms/cms.ecf +++ b/draft/application/cms/cms.ecf @@ -15,6 +15,7 @@ + diff --git a/draft/application/cms/src/kernel/form/with_css_style.e b/draft/application/cms/src/kernel/form/with_css_style.e index da2c9e17..2d066ce0 100644 --- a/draft/application/cms/src/kernel/form/with_css_style.e +++ b/draft/application/cms/src/kernel/form/with_css_style.e @@ -8,7 +8,7 @@ deferred class feature -- Status report - css_style: detachable CMS_CSS_STYLE + css_style: detachable CSS_STYLE feature -- Change diff --git a/draft/library/text/css/css-safe.ecf b/draft/library/text/css/css-safe.ecf new file mode 100644 index 00000000..32f848bf --- /dev/null +++ b/draft/library/text/css/css-safe.ecf @@ -0,0 +1,15 @@ + + + + + + /.git$ + /EIFGENs$ + /.svn$ + + + + + + diff --git a/draft/library/text/css/css.ecf b/draft/library/text/css/css.ecf new file mode 100644 index 00000000..6cfee3fc --- /dev/null +++ b/draft/library/text/css/css.ecf @@ -0,0 +1,15 @@ + + + + + + /.git$ + /EIFGENs$ + /.svn$ + + + + + + diff --git a/draft/application/cms/src/kernel/cms_css_selector.e b/draft/library/text/css/src/css_selector.e similarity index 62% rename from draft/application/cms/src/kernel/cms_css_selector.e rename to draft/library/text/css/src/css_selector.e index 14bc1dcf..cc3f91c3 100644 --- a/draft/application/cms/src/kernel/cms_css_selector.e +++ b/draft/library/text/css/src/css_selector.e @@ -1,15 +1,18 @@ note - description: "Summary description for {CMS_CSS_SELECTOR}." + description: "Summary description for {CSS_SELECTOR}." author: "" date: "$Date$" revision: "$Revision$" class - CMS_CSS_SELECTOR + CSS_SELECTOR create make_from_string +convert + make_from_string ({READABLE_STRING_8, STRING_8, IMMUTABLE_STRING_8}) + feature {NONE} -- Initialization make_from_string (s: READABLE_STRING_8) diff --git a/draft/application/cms/src/kernel/cms_css_style.e b/draft/library/text/css/src/css_style.e similarity index 97% rename from draft/application/cms/src/kernel/cms_css_style.e rename to draft/library/text/css/src/css_style.e index d0bd4c05..d3c4f525 100644 --- a/draft/application/cms/src/kernel/cms_css_style.e +++ b/draft/library/text/css/src/css_style.e @@ -1,11 +1,11 @@ note - description: "Summary description for {CMS_CSS_STYLE}." + description: "Summary description for {CSS_STYLE}." date: "$Date$" revision: "$Revision$" EIS: "name=CSS reference", "protocol=URI", "src=http://www.w3schools.com/cssref/" class - CMS_CSS_STYLE + CSS_STYLE inherit ITERABLE [READABLE_STRING_8] @@ -16,7 +16,7 @@ create make_with_items convert - make_with_string ({READABLE_STRING_8, STRING_8}) + make_with_string ({READABLE_STRING_8, STRING_8, IMMUTABLE_STRING_8}) feature {NONE} -- Initialization @@ -58,7 +58,7 @@ feature -- Access feature -- Element change - plus alias "+" (a_other: CMS_CSS_STYLE): like Current + plus alias "+" (a_other: CSS_STYLE): like Current -- local lst: ARRAYED_LIST [READABLE_STRING_8] @@ -73,7 +73,7 @@ feature -- Element change create Result.make_with_items (lst) end - append (a_other: CMS_CSS_STYLE) + append (a_other: CSS_STYLE) -- Append style from `a_other' into Current do across diff --git a/draft/application/cms/src/kernel/cms_css.e b/draft/library/text/css/src/css_text.e similarity index 69% rename from draft/application/cms/src/kernel/cms_css.e rename to draft/library/text/css/src/css_text.e index d3cc9ff3..08555eb1 100644 --- a/draft/application/cms/src/kernel/cms_css.e +++ b/draft/library/text/css/src/css_text.e @@ -1,11 +1,11 @@ note - description: "Summary description for {CMS_CSS}." + description: "Summary description for {CSS_TEXT}." author: "" date: "$Date$" revision: "$Revision$" class - CMS_CSS + CSS_TEXT create make @@ -19,11 +19,21 @@ feature {NONE} -- Initialization feature -- Access - items: ARRAYED_LIST [TUPLE [selectors: ITERABLE [CMS_CSS_SELECTOR]; style: CMS_CSS_STYLE]] + items: ARRAYED_LIST [TUPLE [selectors: ITERABLE [CSS_SELECTOR]; style: CSS_STYLE]] + + add_selector_style (a_selector: CSS_SELECTOR; a_style: CSS_STYLE) + do + items.force ([<>, a_style]) + end + + add_selectors_style (a_selectors: ITERABLE [CSS_SELECTOR]; a_style: CSS_STYLE) + do + items.force ([a_selectors, a_style]) + end feature -- Conversion - string: READABLE_STRING_8 + string: STRING_8 local s: STRING_8 do 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 1b1bd834..6aea58be 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 @@ -158,10 +158,18 @@ feature {WSF_RESPONSE} -- Output if doc_url_supported then l_description.append ("Index
") end - if attached router.item_associated_with_resource (l_api_resource, Void) as l_api_item then - l_description.append ("

Information related to " + l_api_resource + "

    ") - append_documentation_to (l_description, l_api_item.mapping, l_api_item.request_methods) - l_description.append ("
") + if + attached router.items_associated_with_resource (l_api_resource, Void) as l_api_items and then + not l_api_items.is_empty + then + l_description.append ("

Information related to " + l_api_resource + "

") + across + l_api_items as c + loop + l_description.append ("
    ") + append_documentation_to (l_description, c.item.mapping, c.item.request_methods) + l_description.append ("
") + end end else l_description.append ("

Router

    ") @@ -304,4 +312,14 @@ feature {NONE} -- Implementation create Result end +note + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" end diff --git a/library/server/wsf/router/documentation/wsf_self_documented_handler.e b/library/server/wsf/router/documentation/wsf_self_documented_handler.e index ecc23695..9558a1b2 100644 --- a/library/server/wsf/router/documentation/wsf_self_documented_handler.e +++ b/library/server/wsf/router/documentation/wsf_self_documented_handler.e @@ -14,10 +14,19 @@ feature -- Documentation --| `m' and `a_request_methods' are useful to produce specific documentation when the handler is used for multiple mapping. require m_attached: m /= Void - a_request_methods_attached: a_request_methods /= Void deferred ensure mapping_documentation_attached: Result /= Void end +note + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" end diff --git a/library/server/wsf/router/support/starts_with/wsf_starts_with_mapping_i.e b/library/server/wsf/router/support/starts_with/wsf_starts_with_mapping_i.e index 63774e5f..ac09d22c 100644 --- a/library/server/wsf/router/support/starts_with/wsf_starts_with_mapping_i.e +++ b/library/server/wsf/router/support/starts_with/wsf_starts_with_mapping_i.e @@ -59,7 +59,7 @@ feature -- Status end try (req: WSF_REQUEST; res: WSF_RESPONSE; sess: WSF_ROUTER_SESSION; a_router: WSF_ROUTER) - -- Return the handler if Current matches the request `req'. + -- local p: READABLE_STRING_8 s: like based_uri diff --git a/library/server/wsf/router/support/uri/wsf_uri_mapping_i.e b/library/server/wsf/router/support/uri/wsf_uri_mapping_i.e index aa69a860..7301fb3d 100644 --- a/library/server/wsf/router/support/uri/wsf_uri_mapping_i.e +++ b/library/server/wsf/router/support/uri/wsf_uri_mapping_i.e @@ -73,6 +73,7 @@ feature -- Status end try (req: WSF_REQUEST; res: WSF_RESPONSE; sess: WSF_ROUTER_SESSION; a_router: WSF_ROUTER) + -- do if is_mapping (req, a_router) then sess.set_dispatched_handler (handler) diff --git a/library/server/wsf/router/wsf_router.e b/library/server/wsf/router/wsf_router.e index 786d853a..efd46a6d 100644 --- a/library/server/wsf/router/wsf_router.e +++ b/library/server/wsf/router/wsf_router.e @@ -228,7 +228,7 @@ feature -- Status report end item_associated_with_resource (a_resource: READABLE_STRING_8; rqst_methods: detachable WSF_REQUEST_METHODS): detachable WSF_ROUTER_ITEM - -- Handler and request methods for `a_resource', taking into account `rqst_methods' + -- First handler for `a_resource', taking into account `rqst_methods' require a_resource_attached: a_resource /= Void local @@ -259,6 +259,37 @@ feature -- Status report end end + items_associated_with_resource (a_resource: READABLE_STRING_8; rqst_methods: detachable WSF_REQUEST_METHODS): LIST [WSF_ROUTER_ITEM] + -- All handlers for `a_resource', taking into account `rqst_methods' + require + a_resource_attached: a_resource /= Void + local + m: WSF_ROUTER_MAPPING + ok: BOOLEAN + do + create {ARRAYED_LIST [WSF_ROUTER_ITEM]} Result.make (1) + across + mappings as c + loop + m := c.item.mapping + ok := True + if rqst_methods /= Void then + if attached c.item.request_methods as l_item_rqst_methods then + ok := across rqst_methods as mtd some is_matching_request_methods (mtd.item, l_item_rqst_methods) end + else + ok := True + end + end + if ok then + if attached {WSF_ROUTING_HANDLER} m.handler as l_routing then + Result.append (l_routing.router.items_associated_with_resource (a_resource, rqst_methods)) + elseif m.associated_resource.same_string (a_resource) then + Result.force (c.item) + end + end + end + end + allowed_methods_for_request (req: WSF_REQUEST): WSF_REQUEST_METHODS -- Allowed methods for `req' require diff --git a/library/server/wsf/router/wsf_router_mapping.e b/library/server/wsf/router/wsf_router_mapping.e index 6f7b4605..475818ca 100644 --- a/library/server/wsf/router/wsf_router_mapping.e +++ b/library/server/wsf/router/wsf_router_mapping.e @@ -24,14 +24,14 @@ feature {NONE} -- Initialization feature -- Access associated_resource: READABLE_STRING_8 - -- Name (URI, or URI template or regular expression or ...) of handled resource. + -- Name (URI, or URI template or regular expression or ...) of handled resource deferred ensure assciated_resource_not_void: Result /= Void end handler: WSF_HANDLER - -- Handler associated with `Current' mapping. + -- Handler associated with `Current' mapping deferred ensure handler_attached: Result /= Void @@ -40,7 +40,7 @@ feature -- Access feature -- Documentation description: READABLE_STRING_32 - -- Short description of associated mapping. + -- Short description of associated mapping deferred ensure description_attached: Result /= Void @@ -78,7 +78,7 @@ feature -- Status feature -- Helper path_from_request (req: WSF_REQUEST): READABLE_STRING_32 - -- Path used by `Current' to check that mapping matches request `req'. + -- Path used by `Current' to check that mapping matches request `req' require req_attached: req /= Void do diff --git a/library/server/wsf/src/response/wsf_default_router_response.e b/library/server/wsf/src/response/wsf_default_router_response.e index 7c91fe29..cc933b03 100644 --- a/library/server/wsf/src/response/wsf_default_router_response.e +++ b/library/server/wsf/src/response/wsf_default_router_response.e @@ -120,33 +120,51 @@ feature {NONE} -- Implementation Result := Precursor (req) if documentation_included then create vis - vis.on_item_actions.extend (agent (i: WSF_ROUTER_ITEM; r: WSF_NOT_FOUND_RESPONSE) + vis.on_item_actions.extend (agent (i: WSF_ROUTER_ITEM; r: WSF_NOT_FOUND_RESPONSE; m: detachable READABLE_STRING_8) local l_is_hidden: BOOLEAN s: STRING_32 + ok: BOOLEAN do if attached {WSF_SELF_DOCUMENTED_ROUTER_MAPPING} i.mapping as l_doc_mapping then l_is_hidden := l_doc_mapping.documentation (i.request_methods).is_hidden end if not l_is_hidden then + ok := True create s.make_from_string (i.mapping.associated_resource) if attached i.request_methods as mtds then + ok := False s.append (" [ ") across - mtds as mtds_c + mtds as c loop - s.append (mtds_c.item) + if m = Void or else m.is_case_insensitive_equal (c.item) then + ok := True + end + s.append (c.item) s.append_character (' ') end s.append ("]") else s.append (" [*]") end - r.add_suggested_text (s, Void) + if ok then + r.add_suggested_text (s, Void) + end end - end (?, Result)) + end (?, Result, req.request_method)) vis.process_router (router) end end +note + copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" end diff --git a/tests/all-safe.ecf b/tests/all-safe.ecf index c7d6efe5..736905b6 100644 --- a/tests/all-safe.ecf +++ b/tests/all-safe.ecf @@ -15,6 +15,7 @@ + @@ -35,6 +36,8 @@ + + Compiling as Windows , on other platforms than Windows