merging from upstream - stage 1
This commit is contained in:
@@ -14,7 +14,7 @@ feature {NONE} -- Initialization
|
||||
make (m: like mapping)
|
||||
do
|
||||
mapping := m
|
||||
create {STRING_32} description.make_empty
|
||||
create descriptions.make (0)
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
@@ -27,7 +27,7 @@ feature -- Status report
|
||||
-- Is Current empty?
|
||||
-- i.e: does not carry any information.
|
||||
do
|
||||
Result := description.is_empty
|
||||
Result := descriptions.is_empty
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
@@ -35,7 +35,18 @@ feature -- Access
|
||||
mapping: WSF_ROUTER_MAPPING
|
||||
-- Associated mapping
|
||||
|
||||
descriptions: ARRAYED_LIST [READABLE_STRING_GENERAL]
|
||||
|
||||
description: STRING_32
|
||||
do
|
||||
create Result.make_empty
|
||||
across
|
||||
descriptions as c
|
||||
loop
|
||||
Result.append_string_general (c.item)
|
||||
Result.append ("%N")
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Change
|
||||
|
||||
@@ -46,7 +57,17 @@ feature -- Change
|
||||
|
||||
add_description (d: READABLE_STRING_GENERAL)
|
||||
do
|
||||
description.append_string_general (d)
|
||||
descriptions.force (d)
|
||||
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
|
||||
|
||||
@@ -204,6 +204,7 @@ feature {WSF_RESPONSE} -- Output
|
||||
l_url: detachable STRING_8
|
||||
l_base_url: detachable READABLE_STRING_8
|
||||
l_doc: detachable WSF_ROUTER_MAPPING_DOCUMENTATION
|
||||
l_first: BOOLEAN
|
||||
do
|
||||
if attached {WSF_SELF_DOCUMENTED_ROUTER_MAPPING} m as l_doc_mapping then
|
||||
l_doc := l_doc_mapping.documentation (meths)
|
||||
@@ -256,7 +257,17 @@ feature {WSF_RESPONSE} -- Output
|
||||
|
||||
if l_doc /= Void and then not l_doc.is_empty then
|
||||
s.append ("%N<ul class=%"handlerdoc%">")
|
||||
s.append (html_encoder.encoded_string (l_doc.description))
|
||||
l_first := True
|
||||
across
|
||||
l_doc.descriptions as c
|
||||
loop
|
||||
if not l_first then
|
||||
s.append ("<br/>")
|
||||
else
|
||||
l_first := False
|
||||
end
|
||||
s.append (html_encoder.general_encoded_string (c.item))
|
||||
end
|
||||
s.append ("%N</ul>%N")
|
||||
else
|
||||
debug
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
note
|
||||
description: "Summary description for {WSF_STARTS_WITH_AGENT_HANDLER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_STARTS_WITH_AGENT_HANDLER
|
||||
|
||||
inherit
|
||||
WSF_STARTS_WITH_HANDLER
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_action: like action)
|
||||
do
|
||||
action := a_action
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
action: PROCEDURE [ANY, TUPLE [start_path: READABLE_STRING_8; request: WSF_REQUEST; response: WSF_RESPONSE]]
|
||||
|
||||
feature -- Execution
|
||||
|
||||
execute (a_start_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
do
|
||||
action.call ([a_start_path, req, res])
|
||||
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
|
||||
@@ -13,8 +13,11 @@ inherit
|
||||
execute as execute_starts_with
|
||||
end
|
||||
|
||||
WSF_SELF_DOCUMENTED_HANDLER
|
||||
|
||||
create
|
||||
make
|
||||
make,
|
||||
make_hidden
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
@@ -34,6 +37,29 @@ feature {NONE} -- Initialization
|
||||
not document_root.is_empty and then not document_root.ends_with (operating_environment.directory_separator.out)
|
||||
end
|
||||
|
||||
make_hidden (d: like document_root)
|
||||
require
|
||||
valid_d: (d /= Void and then not d.is_empty) implies not d.ends_with (operating_environment.directory_separator.out)
|
||||
do
|
||||
make (d)
|
||||
is_hidden := True
|
||||
ensure
|
||||
hidden: is_hidden
|
||||
end
|
||||
|
||||
is_hidden: BOOLEAN
|
||||
-- Current mapped handler should be hidden from self documentation
|
||||
|
||||
feature -- Documentation
|
||||
|
||||
mapping_documentation (m: WSF_ROUTER_MAPPING; a_request_methods: detachable WSF_REQUEST_METHODS): WSF_ROUTER_MAPPING_DOCUMENTATION
|
||||
-- <Precursor>
|
||||
do
|
||||
create Result.make (m)
|
||||
Result.set_is_hidden (is_hidden)
|
||||
Result.add_description ("File service")
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
document_root: STRING
|
||||
|
||||
@@ -14,7 +14,8 @@ inherit
|
||||
put_string,
|
||||
put_substring,
|
||||
flush,
|
||||
message_writable
|
||||
message_writable,
|
||||
message_committed
|
||||
end
|
||||
|
||||
WSF_RESPONSE_EXPORTER
|
||||
@@ -36,10 +37,10 @@ feature {NONE} -- Implementation
|
||||
|
||||
commit
|
||||
do
|
||||
Precursor
|
||||
if not header_committed then
|
||||
process_header
|
||||
end
|
||||
Precursor
|
||||
end
|
||||
|
||||
process_header
|
||||
@@ -65,6 +66,12 @@ feature -- Status report
|
||||
message_writable: BOOLEAN = True
|
||||
-- Can message be written?
|
||||
|
||||
message_committed: BOOLEAN
|
||||
-- <Precursor>
|
||||
do
|
||||
Result := header_committed
|
||||
end
|
||||
|
||||
feature -- Output operation
|
||||
|
||||
put_character (c: CHARACTER_8)
|
||||
|
||||
@@ -26,7 +26,7 @@ feature {NONE} -- Initialization
|
||||
url_location := a_url_location
|
||||
delay := a_delay_in_seconds
|
||||
make_html
|
||||
set_status_code ({HTTP_STATUS_CODE}.found)
|
||||
status_code := {HTTP_STATUS_CODE}.found
|
||||
end
|
||||
|
||||
feature -- Header
|
||||
@@ -65,7 +65,7 @@ feature {NONE} -- Output
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||
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
|
||||
|
||||
@@ -197,7 +197,7 @@ feature {NONE} -- HTML Generation
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||
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
|
||||
|
||||
@@ -18,7 +18,7 @@ feature {NONE} -- Initialization
|
||||
|
||||
make (a_url_location: like url_location)
|
||||
do
|
||||
status_code := {HTTP_STATUS_CODE}.ok
|
||||
status_code := {HTTP_STATUS_CODE}.found
|
||||
url_location := a_url_location
|
||||
create header.make
|
||||
end
|
||||
@@ -100,7 +100,7 @@ feature {WSF_RESPONSE} -- Output
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||
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
|
||||
|
||||
@@ -252,23 +252,23 @@ feature -- Header output operation: helpers
|
||||
message_writable: message_writable
|
||||
end
|
||||
|
||||
put_header_lines (a_lines: ITERABLE [TUPLE [name: READABLE_STRING_8; value: READABLE_STRING_8]])
|
||||
put_header_lines (a_lines: ITERABLE [READABLE_STRING_8])
|
||||
-- Put headers from `a_lines'
|
||||
require
|
||||
header_not_committed: not header_committed
|
||||
do
|
||||
across a_lines as c loop
|
||||
put_header_line (c.item.name + ": " + c.item.value)
|
||||
put_header_line (c.item)
|
||||
end
|
||||
end
|
||||
|
||||
add_header_lines (a_lines: ITERABLE [TUPLE [name: READABLE_STRING_8; value: READABLE_STRING_8]])
|
||||
add_header_lines (a_lines: ITERABLE [READABLE_STRING_8])
|
||||
-- Add headers from `a_lines'
|
||||
require
|
||||
header_not_committed: not header_committed
|
||||
do
|
||||
across a_lines as c loop
|
||||
add_header_line (c.item.name + ": " + c.item.value)
|
||||
add_header_line (c.item)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -409,8 +409,7 @@ feature -- Response object
|
||||
do
|
||||
a_message.send_to (Current)
|
||||
ensure
|
||||
status_committed: status_committed
|
||||
header_committed: header_committed
|
||||
status_committed: status_is_set
|
||||
end
|
||||
|
||||
feature -- Redirect
|
||||
|
||||
@@ -26,11 +26,10 @@ feature {WSF_RESPONSE} -- Output
|
||||
deferred
|
||||
ensure
|
||||
res_status_set: res.status_is_set
|
||||
res_header_committed: res.header_committed
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
|
||||
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
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="wsf" uuid="A37CE5AA-4D2A-4441-BC6A-0A1D7EC49647" library_target="wsf">
|
||||
<target name="wsf">
|
||||
<root all_classes="true"/>
|
||||
<file_rule>
|
||||
<exclude>/.git$</exclude>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="provisional">
|
||||
</option>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension-safe.ecf"/>
|
||||
<library name="ewsgi" location="..\ewsgi\ewsgi-safe.ecf"/>
|
||||
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
|
||||
<library name="error" location="../../utility/general/error/error-safe.ecf"/>
|
||||
<library name="http" location="../../network/protocol/http/http-safe.ecf"/>
|
||||
<library name="uri_template" location="../../text/parser/uri_template/uri_template-safe.ecf"/>
|
||||
<library name="encoder"
|
||||
location="..\..\text\encoder\encoder-safe.ecf"/>
|
||||
<library name="uri" location="$ISE_LIBRARY\library\text\uri\uri-safe.ecf" readonly="true"/>
|
||||
<cluster name="src" location=".\src" recursive="true"/>
|
||||
<cluster name="router" location=".\router" recursive="true"/>
|
||||
</target>
|
||||
</system>
|
||||
Reference in New Issue
Block a user