Compare commits

..

15 Commits

Author SHA1 Message Date
Jocelyn Fiat
88dec34a1e Made "common" targets as abstract. 2017-05-12 14:39:48 +02:00
Jocelyn Fiat
a928f27b1a Updated or added timestamp to obsolete and fixme messages.
Fixed ecf file exclusion for .svn and .git .
Cosmetic changed.
2017-05-12 14:31:35 +02:00
Jocelyn Fiat
7ba678d726 Added empty .travis.yml for now (see https://travis-ci.com/) 2017-04-14 13:32:37 +02:00
Jocelyn Fiat
2371ad4bd1 Commented unwanted change. 2017-04-14 12:52:08 +02:00
Jocelyn Fiat
146b78e5b0 Updated code regarding to string 32 vs string 8. 2017-04-14 12:49:34 +02:00
Jocelyn Fiat
273a55d93c Merge branch 'pr177' 2017-04-14 11:48:29 +02:00
Jocelyn Fiat
2e920f063a Merge branch 'master' of https://github.com/EiffelWebFramework/EWF 2017-04-14 11:48:14 +02:00
Jocelyn Fiat
3b8261ff08 Updated code regarding to string 32 vs string 8. 2017-04-14 11:45:38 +02:00
Jocelyn Fiat
a530bbebb4 Merge remote-tracking branch 'javier/ewf_get_rid_obsolete_messages' into pr177 2017-04-13 22:58:12 +02:00
Jocelyn Fiat
d41dbb9f47 Syntax in ecf files. 2017-04-13 22:56:40 +02:00
Jocelyn Fiat
a57e041003 Added precondition to WSF_FILTER.set_next (..) to avoid cycle. 2017-04-13 22:55:39 +02:00
jvelilla
5d9752f257 Updated code, get rid of obsolete feature calls in libraries and examples 2017-04-13 16:48:17 -03:00
Jocelyn Fiat
d4d988e532 Update README.md 2017-03-21 15:20:11 +01:00
Jocelyn Fiat
ce11a3c0fc Fixed markdown links related to network libraries. 2017-03-21 15:17:43 +01:00
Jocelyn Fiat
4eb743fa58 Updated CHANGELOG.md
Added full commit log in doc/CommitLog
2017-03-15 18:58:41 +01:00
88 changed files with 6417 additions and 360 deletions

0
.travis.yml Normal file
View File

6073
CHANGELOG.md Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -41,10 +41,10 @@ Tasks and issues are managed with github issue system
* Forum/group post: https://groups.google.com/forum/#!forum/eiffel-web-framework * Forum/group post: https://groups.google.com/forum/#!forum/eiffel-web-framework
## Requirements ## Requirements
* Compiling from EiffelStudio 13.11 to 15.05 and more recent version of the compiler. * Compiling from EiffelStudio 16.05 to 17.05 and more recent version of the compiler.
* Currently being developped using EiffelStudio 15.01 (on Windows, Linux) * Currently being developped using EiffelStudio 17.01 (on Windows, Linux)
* Tested using EiffelStudio 15.01 with "jenkins" CI server (not anymore compatible with 6.8 due to use of `TABLE_ITERABLE') * Tested using EiffelStudio 17.01 with "jenkins" CI server.
* The code have to allow __void-safe__ compilation and non void-safe system (see [more about void-safety](http://docs.eiffel.com/book/method/void-safe-programming-eiffel) ) * The code have to allow __void-safe__ compilation and non void-safe system (see [more about void-safety](https://www.eiffel.org/doc/eiffel/Void-safe%20programming%20in%20Eiffel)
## How to get the source code? ## How to get the source code?
@@ -65,12 +65,12 @@ Using git
* __router__: URL dispatching/routing based on uri, uri_template, or custom [read more](library/server/wsf/router) * __router__: URL dispatching/routing based on uri, uri_template, or custom [read more](library/server/wsf/router)
### protocol ### protocol
* __http__: HTTP related classes, constants for status code, content types, ... [read more](library/protocol/http) * __http__: HTTP related classes, constants for status code, content types, ... [read more](library/network/protocol/http)
* __uri_template__: URI Template library (parsing and expander) [read more](library/protocol/uri_template) * __uri_template__: URI Template library (parsing and expander) [read more](library/network/protocol/uri_template)
* __CONNEG__: Content negotiation library (Content-type Negociation) [read more](library/protocol/content_negotiation) * __CONNEG__: Content negotiation library (Content-type Negociation) [read more](library/network/protocol/content_negotiation)
### client ### client
* __http_client__: simple HTTP client based on cURL [read more](library/client/http_client) * __http_client__: simple HTTP client based on cURL [read more](library/network/http_client)
### text ### text
* __encoder__: Various simpler encoders: base64, url-encoder, xml entities, html entities [read more](library/text/encoder) * __encoder__: Various simpler encoders: base64, url-encoder, xml entities, html entities [read more](library/text/encoder)
@@ -78,10 +78,6 @@ Using git
### Others ### Others
* error: very simple/basic library to handle error * error: very simple/basic library to handle error
## External libraries under 'contrib'
* [Eiffel Web Nino](contrib/library/server/nino)
* ..
## Draft folder = call for contribution ## ## Draft folder = call for contribution ##
## Examples ## Examples
@@ -106,5 +102,4 @@ Keep track of development and community news.
* Have a question that's not a feature request or bug report? [Ask on the mailing list](http://groups.google.com/group/eiffel-web-framework) * Have a question that's not a feature request or bug report? [Ask on the mailing list](http://groups.google.com/group/eiffel-web-framework)
For more information please have a look at the related wiki: For more information please have a look at the related [workbook documentation](docs/workbook)
* https://github.com/EiffelWebFramework/EWF/wiki

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="filter" uuid="52FF4B77-0614-4D8B-9B96-C07EC852793E"> <system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="filter" uuid="52FF4B77-0614-4D8B-9B96-C07EC852793E">
<target name="common"> <target name="common" abstract="true">
<file_rule> <file_rule>
<exclude>/EIFGENs$</exclude> <exclude>/EIFGENs$</exclude>
<exclude>/\.git$</exclude> <exclude>/\.git$</exclude>

View File

@@ -205,7 +205,7 @@ feature {NONE} -- Implementation
loop loop
s.append (" - ") s.append (" - ")
s.append (c.item.url_encoded_name) s.append (c.item.url_encoded_name)
t := c.item.generating_type t := c.item.generating_type.name
if t.same_string ("WSF_STRING") then if t.same_string ("WSF_STRING") then
else else
s.append_character (' ') s.append_character (' ')

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="filter" uuid="52FF4B77-0614-4D8B-9B96-C07EC852793E"> <system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="filter" uuid="52FF4B77-0614-4D8B-9B96-C07EC852793E">
<target name="common"> <target name="common" abstract="true">
<file_rule> <file_rule>
<exclude>/EIFGENs$</exclude> <exclude>/EIFGENs$</exclude>
<exclude>/\.git$</exclude> <exclude>/\.git$</exclude>

View File

@@ -84,7 +84,7 @@ feature {NONE} -- Initialization
create l_methods create l_methods
l_methods.enable_options l_methods.enable_options
l_methods.enable_get l_methods.enable_get
router.handle_with_request_methods ("/user/{userid}", create {WSF_URI_TEMPLATE_AGENT_HANDLER}.make (agent l_options_filter.execute), l_methods) router.handle ("/user/{userid}", create {WSF_URI_TEMPLATE_AGENT_HANDLER}.make (agent l_options_filter.execute), l_methods)
end end
initialize_json initialize_json
@@ -99,7 +99,7 @@ feature {NONE} -- Implementation
-- Port number -- Port number
note note
copyright: "2011-2014, Olivier Ligot, Jocelyn Fiat and others" copyright: "2011-2017, Olivier Ligot, Jocelyn Fiat and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -42,7 +42,7 @@ feature -- Basic operations
id : STRING id : STRING
do do
if attached req.orig_path_info as orig_path then if attached req.orig_path_info as orig_path then
id := get_user_id_from_path (orig_path) id := get_user_id_from_path (orig_path.as_string_32)
if attached retrieve_user (id) as l_user then if attached retrieve_user (id) as l_user then
if l_user ~ req.execution_variable ("user") then if l_user ~ req.execution_variable ("user") then
compute_response_get (req, res, l_user) compute_response_get (req, res, l_user)
@@ -92,6 +92,6 @@ feature {NONE} -- Implementation
end end
note note
copyright: "2011-2013, Olivier Ligot, Jocelyn Fiat and others" copyright: "2011-2017, Olivier Ligot, Jocelyn Fiat and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end end

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="restbucks" uuid="2773FEAA-448F-410E-BEDE-9298C4749066"> <system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="restbucks" uuid="2773FEAA-448F-410E-BEDE-9298C4749066">
<target name="restbucks_common"> <target name="restbucks_common" abstract="true">
<file_rule> <file_rule>
<exclude>/EIFGENs$</exclude> <exclude>/EIFGENs$</exclude>
<exclude>/\.git$</exclude> <exclude>/\.git$</exclude>

View File

@@ -85,7 +85,6 @@ feature {NONE} -- Initialization
create_order (sess: HTTP_CLIENT_SESSION) : HTTP_CLIENT_RESPONSE create_order (sess: HTTP_CLIENT_SESSION) : HTTP_CLIENT_RESPONSE
local local
s: READABLE_STRING_8 s: READABLE_STRING_8
j: JSON_PARSER
context : HTTP_CLIENT_REQUEST_CONTEXT context : HTTP_CLIENT_REQUEST_CONTEXT
do do
s := "[ s := "[

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="restbucks" uuid="2773FEAA-448F-410E-BEDE-9298C4749066"> <system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="restbucks" uuid="2773FEAA-448F-410E-BEDE-9298C4749066">
<target name="restbucks_common"> <target name="restbucks_common" abstract="true">
<file_rule> <file_rule>
<exclude>/EIFGENs$</exclude> <exclude>/EIFGENs$</exclude>
<exclude>/\.git$</exclude> <exclude>/\.git$</exclude>

View File

@@ -87,7 +87,7 @@ feature -- Access: order status
end end
Order_states : ARRAY [STRING] Order_states : ARRAY [STRING]
-- List of valid status states -- List of valid status states.
once once
Result := << Result := <<
status_unset, status_unset,

View File

@@ -27,7 +27,7 @@ feature -- Access
end end
Milk_types: ARRAY [STRING] Milk_types: ARRAY [STRING]
-- List of valid Milk types -- List of valid Milk types.
once once
Result := <<"skim", "semi", "whole">> Result := <<"skim", "semi", "whole">>
end end

View File

@@ -4,7 +4,8 @@ note
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
class ORDER_HANDLER class
ORDER_HANDLER
inherit inherit
@@ -537,7 +538,6 @@ feature {NONE} -- Conversion
order_to_json (obj: ORDER): JSON_OBJECT order_to_json (obj: ORDER): JSON_OBJECT
local local
j_order: JSON_OBJECT
j_item: JSON_OBJECT j_item: JSON_OBJECT
ja: JSON_ARRAY ja: JSON_ARRAY
do do

View File

@@ -334,7 +334,6 @@ feature {NONE} -- Conversion
order_to_json (obj: ORDER): JSON_OBJECT order_to_json (obj: ORDER): JSON_OBJECT
local local
j_order: JSON_OBJECT
j_item: JSON_OBJECT j_item: JSON_OBJECT
ja: JSON_ARRAY ja: JSON_ARRAY
do do

View File

@@ -12,8 +12,6 @@ inherit
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (a_location: PATH) make (a_location: PATH)
local
d: DIRECTORY
do do
location := a_location location := a_location
ensure_directory_exists (a_location) ensure_directory_exists (a_location)
@@ -67,7 +65,6 @@ feature -- Access
save (a_entry_type: TYPE [detachable ANY]; a_entry: detachable ANY; cl_entry_id: CELL [detachable READABLE_STRING_GENERAL]) save (a_entry_type: TYPE [detachable ANY]; a_entry: detachable ANY; cl_entry_id: CELL [detachable READABLE_STRING_GENERAL])
local local
f: RAW_FILE
l_id: detachable READABLE_STRING_GENERAL l_id: detachable READABLE_STRING_GENERAL
p: PATH p: PATH
do do

View File

@@ -19,8 +19,6 @@ create
feature {NONE} -- Initialization feature {NONE} -- Initialization
make make
local
b: SED_MEMORY_READER_WRITER
do do
create collections.make (0) create collections.make (0)
end end
@@ -86,8 +84,6 @@ feature {NONE} -- Implementation
next_identifier (a_entry_type: TYPE [detachable ANY]): STRING_8 next_identifier (a_entry_type: TYPE [detachable ANY]): STRING_8
local local
i: INTEGER i: INTEGER
f: RAW_FILE
s: STRING
tb: detachable STRING_TABLE [detachable ANY] tb: detachable STRING_TABLE [detachable ANY]
do do
tb := collections.item (a_entry_type) tb := collections.item (a_entry_type)

View File

@@ -54,7 +54,7 @@ feature -- Execution
if attached {WSF_STRING} req.item ("user") as u then if attached {WSF_STRING} req.item ("user") as u then
--| If yes, say hello world #name --| If yes, say hello world #name
l_user_name := (create {HTML_ENCODER}).decoded_string (u.value) l_user_name := (create {HTML_ENCODER}).general_decoded_string (u.value)
s := "<p>Hello " + mesg.html_encoded_string (l_user_name) + "!</p>" s := "<p>Hello " + mesg.html_encoded_string (l_user_name) + "!</p>"
s.append ("Display a <a href=%"/users/" + u.url_encoded_value + "/message/%">message</a></p>") s.append ("Display a <a href=%"/users/" + u.url_encoded_value + "/message/%">message</a></p>")

View File

@@ -86,7 +86,7 @@ feature -- Access
html_decoded_string (v: READABLE_STRING_32): READABLE_STRING_32 html_decoded_string (v: READABLE_STRING_32): READABLE_STRING_32
do do
if v.is_valid_as_string_8 then if v.is_valid_as_string_8 then
Result := (create {HTML_ENCODER}).decoded_string (v) Result := (create {HTML_ENCODER}).general_decoded_string (v)
else else
Result := v Result := v
end end

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="upload_image" uuid="F2400BE8-D8EB-48EB-B4E4-5D4377062A7F"> <system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="upload_image" uuid="F2400BE8-D8EB-48EB-B4E4-5D4377062A7F">
<target name="upload_image_common"> <target name="upload_image_common" abstract="true">
<file_rule> <file_rule>
<exclude>/EIFGENs$</exclude> <exclude>/EIFGENs$</exclude>
<exclude>/\.git$</exclude> <exclude>/\.git$</exclude>

View File

@@ -13,7 +13,7 @@ note
Note that any value set in this context class overrides conflicting value eventually Note that any value set in this context class overrides conflicting value eventually
set in associated HTTP_CLIENT_SESSION. set in associated HTTP_CLIENT_SESSION.
Warning: for now [2012-May], you can have only one of the following data Warning: for now [2012-05-31], you can have only one of the following data
- form_parameters - form_parameters
- or upload_data - or upload_data
- or upload_filename - or upload_filename

View File

@@ -9,7 +9,7 @@ class
LIBCURL_UPLOAD_FILE_READ_FUNCTION LIBCURL_UPLOAD_FILE_READ_FUNCTION
obsolete obsolete
"Use LIBCURL_CUSTOM_FUNCTION [2013-apr-04]" "Use LIBCURL_CUSTOM_FUNCTION [2017-05-31]"
inherit inherit
LIBCURL_DEFAULT_FUNCTION LIBCURL_DEFAULT_FUNCTION

View File

@@ -114,14 +114,14 @@ feature -- Obsolete query
include_max_age: BOOLEAN include_max_age: BOOLEAN
obsolete obsolete
"Use `max_age > 0' [April-2016]" "Use `max_age > 0' [2017-05-31]"
do do
Result := max_age > 0 Result := max_age > 0
end end
include_expires: BOOLEAN include_expires: BOOLEAN
obsolete obsolete
"Use `expires /= Void' [April-2016]" "Use `expires /= Void' [2017-05-31]"
do do
Result := expiration /= Void Result := expiration /= Void
end end
@@ -133,7 +133,7 @@ feature -- Obsolete element change
-- Set `expires to void' -- Set `expires to void'
-- Set-Cookie will include only Max-Age attribute and not Expires. -- Set-Cookie will include only Max-Age attribute and not Expires.
obsolete obsolete
"Uset `set_max_age' and `unset_*' features to add or remove the attributes from the response header [April-2016]" "Uset `set_max_age' and `unset_*' features to add or remove the attributes from the response header [2017-05-31]"
do do
max_age := 1 max_age := 1
expiration := Void expiration := Void
@@ -147,7 +147,7 @@ feature -- Obsolete element change
-- Set `expiration to a default date' -- Set `expiration to a default date'
-- Set-Cookie will include only Expires attribute and not Max_Age. -- Set-Cookie will include only Expires attribute and not Max_Age.
obsolete obsolete
"Use `set_expiration' and `unset_*' features to add or remove the attribute from the response header [April-2016]" "Use `set_expiration' and `unset_*' features to add or remove the attribute from the response header [2017-05-31]"
do do
max_age := -1 max_age := -1
set_expiration_date (create {DATE_TIME}.make_now_utc) set_expiration_date (create {DATE_TIME}.make_now_utc)
@@ -343,7 +343,7 @@ feature {NONE} -- Constants
end end
note note
copyright: "2011-2016, Jocelyn Fiat, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -54,7 +54,7 @@ feature {NONE} -- Initialization
create date_time.make_from_epoch (n.as_integer_32) create date_time.make_from_epoch (n.as_integer_32)
end end
make_from_string (s: READABLE_STRING_8) make_from_string (s: READABLE_STRING_GENERAL)
-- Create from string representation `s' -- Create from string representation `s'
-- Supports: RFC 1123 and RFC 850 -- Supports: RFC 1123 and RFC 850
-- Tolerant with: GMT+offset and GMT-offset -- Tolerant with: GMT+offset and GMT-offset
@@ -350,7 +350,7 @@ feature -- Helper routines.
feature {NONE} -- Implementation feature {NONE} -- Implementation
string_to_date_time (s: READABLE_STRING_8): detachable DATE_TIME string_to_date_time (s: READABLE_STRING_GENERAL): detachable DATE_TIME
-- String representation of `dt' using the RFC 1123 -- String representation of `dt' using the RFC 1123
-- HTTP-date = rfc1123-date | rfc850-date | asctime-date -- HTTP-date = rfc1123-date | rfc850-date | asctime-date
-- rfc1123-date = wkday "," SP date1 SP time SP "GMT" -- rfc1123-date = wkday "," SP date1 SP time SP "GMT"
@@ -377,8 +377,8 @@ feature {NONE} -- Implementation
note note
EIS: "name=RFC2616", "protocol=URI", "src=http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html" EIS: "name=RFC2616", "protocol=URI", "src=http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html"
local local
t: STRING_8 t: STRING_32
l_ddd, l_mmm: detachable STRING_8 l_ddd, l_mmm: detachable STRING_32
l_dd, l_yyyy, l_hh, l_mi, l_ss, l_ff2: INTEGER l_dd, l_yyyy, l_hh, l_mi, l_ss, l_ff2: INTEGER
l_mo: INTEGER l_mo: INTEGER
l_gmt_offset: INTEGER -- minutes l_gmt_offset: INTEGER -- minutes
@@ -565,7 +565,7 @@ feature {NONE} -- Implementation
t.extend (s[i].as_upper) t.extend (s[i].as_upper)
i := i + 1 i := i + 1
end end
if if
t.same_string ("GMT") -- for instance: GMT+0002 t.same_string ("GMT") -- for instance: GMT+0002
or t.same_string ("UTC") -- for instance: UTC+0002 or t.same_string ("UTC") -- for instance: UTC+0002
or t.is_empty -- for instance: +0002 or t.is_empty -- for instance: +0002
@@ -622,7 +622,7 @@ feature {NONE} -- Implementation
end end
end end
ansi_c_string_to_date_time (s: READABLE_STRING_8): detachable DATE_TIME ansi_c_string_to_date_time (s: READABLE_STRING_GENERAL): detachable DATE_TIME
-- String representation of `dt' using the RFC 1123 -- String representation of `dt' using the RFC 1123
-- asctime-date = wkday SP date3 SP time SP 4DIGIT -- asctime-date = wkday SP date3 SP time SP 4DIGIT
-- date3 = month SP ( 2DIGIT | ( SP 1DIGIT )) -- date3 = month SP ( 2DIGIT | ( SP 1DIGIT ))
@@ -638,8 +638,8 @@ feature {NONE} -- Implementation
note note
EIS: "name=RFC2616", "protocol=URI", "src=http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html" EIS: "name=RFC2616", "protocol=URI", "src=http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html"
local local
t: STRING_8 t: STRING_32
l_ddd, l_mmm: detachable STRING_8 l_ddd, l_mmm: detachable STRING_32
l_dd, l_yyyy, l_hh, l_mi, l_ss, l_ff2: INTEGER l_dd, l_yyyy, l_hh, l_mi, l_ss, l_ff2: INTEGER
l_mo: INTEGER l_mo: INTEGER
l_gmt_offset: INTEGER -- minutes l_gmt_offset: INTEGER -- minutes
@@ -681,18 +681,18 @@ feature {NONE} -- Implementation
-- Tolerant to full month name .. -- Tolerant to full month name ..
l_mmm.keep_head (3) l_mmm.keep_head (3)
end end
if l_mmm.same_string ("JAN") then l_mo := 01 if l_mmm.same_string_general ("JAN") then l_mo := 01
elseif l_mmm.same_string ("FEB") then l_mo := 02 elseif l_mmm.same_string_general ("FEB") then l_mo := 02
elseif l_mmm.same_string ("MAR") then l_mo := 03 elseif l_mmm.same_string_general ("MAR") then l_mo := 03
elseif l_mmm.same_string ("APR") then l_mo := 04 elseif l_mmm.same_string_general ("APR") then l_mo := 04
elseif l_mmm.same_string ("MAY") then l_mo := 05 elseif l_mmm.same_string_general ("MAY") then l_mo := 05
elseif l_mmm.same_string ("JUN") then l_mo := 06 elseif l_mmm.same_string_general ("JUN") then l_mo := 06
elseif l_mmm.same_string ("JUL") then l_mo := 07 elseif l_mmm.same_string_general ("JUL") then l_mo := 07
elseif l_mmm.same_string ("AUG") then l_mo := 08 elseif l_mmm.same_string_general ("AUG") then l_mo := 08
elseif l_mmm.same_string ("SEP") then l_mo := 09 elseif l_mmm.same_string_general ("SEP") then l_mo := 09
elseif l_mmm.same_string ("OCT") then l_mo := 10 elseif l_mmm.same_string_general ("OCT") then l_mo := 10
elseif l_mmm.same_string ("NOV") then l_mo := 11 elseif l_mmm.same_string_general ("NOV") then l_mo := 11
elseif l_mmm.same_string ("DEC") then l_mo := 12 elseif l_mmm.same_string_general ("DEC") then l_mo := 12
else err := True else err := True
end end
else else
@@ -875,7 +875,7 @@ feature {NONE} -- Implementation
invariant invariant
note note
copyright: "2011-2015, Jocelyn Fiat, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -118,7 +118,7 @@ feature -- Access
header_named_value (a_name: READABLE_STRING_8): like item header_named_value (a_name: READABLE_STRING_8): like item
-- First header item found for `a_name' if any -- First header item found for `a_name' if any
obsolete obsolete
"Use `item' [2014-03]" "Use `item' [2017-05-31]"
do do
Result := item (a_name) Result := item (a_name)
end end

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="ws_client" uuid="AF6EDC56-D7B4-4E1F-A62B-40EBED3D93DF"> <system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="ws_client" uuid="AF6EDC56-D7B4-4E1F-A62B-40EBED3D93DF">
<target name="common"> <target name="common" abstract="true">
<file_rule> <file_rule>
<exclude>/.git$</exclude> <exclude>/.git$</exclude>
<exclude>/.svn$</exclude> <exclude>/.svn$</exclude>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="echo_websocket_server" uuid="C9B3DA5F-DF0D-4C0F-924A-130B5C1E6604"> <system xmlns="http://www.eiffel.com/developers/xml/configuration-1-15-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-15-0 http://www.eiffel.com/developers/xml/configuration-1-15-0.xsd" name="echo_websocket_server" uuid="C9B3DA5F-DF0D-4C0F-924A-130B5C1E6604">
<target name="common"> <target name="common" abstract="true">
<file_rule> <file_rule>
<exclude>/.git$</exclude> <exclude>/.git$</exclude>
<exclude>/.svn$</exclude> <exclude>/.svn$</exclude>

View File

@@ -55,7 +55,7 @@ feature -- Access
body: like content body: like content
obsolete obsolete
"Use `content' [June/2015]" "Use `content'. [2017-05-31]"
do do
Result := body Result := body
end end
@@ -69,6 +69,19 @@ feature -- Status report
across to_addresses as ic all is_valid_address (ic.item) end across to_addresses as ic all is_valid_address (ic.item) end
end end
has_header (a_header_name: READABLE_STRING_8): BOOLEAN
-- Has additional header `a_header_name'?
-- Warning: it checks only `additional_header_lines'!
local
h_colon: STRING
do
if attached additional_header_lines as lst then
create h_colon.make_from_string (a_header_name)
h_colon.append_character (':')
Result := across lst as ic some ic.item.starts_with (h_colon) end
end
end
feature -- Change feature -- Change
set_date (d: like date) set_date (d: like date)
@@ -158,21 +171,6 @@ feature -- Header manipulation
lst.force (a_line) lst.force (a_line)
end end
feature -- Status report
has_header (a_header_name: READABLE_STRING_8): BOOLEAN
-- Has additional header `a_header_name'?
-- Warning: it checks only `additional_header_lines'!
local
h_colon: STRING
do
if attached additional_header_lines as lst then
create h_colon.make_from_string (a_header_name)
h_colon.append_character (':')
Result := across lst as ic some ic.item.starts_with (h_colon) end
end
end
feature -- Reset feature -- Reset
reset reset
@@ -209,8 +207,6 @@ feature -- Conversion
end end
header: STRING_8 header: STRING_8
local
hdate: HTTP_DATE
do do
create Result.make (20) create Result.make (20)
if attached reply_to_address as l_reply_to then if attached reply_to_address as l_reply_to then
@@ -259,8 +255,7 @@ feature -- Conversion
Result.append (subject) Result.append (subject)
Result.append_character ('%N') Result.append_character ('%N')
Result.append ("Date: ") Result.append ("Date: ")
create hdate.make_from_date_time (date) ;(create {HTTP_DATE}.make_from_date_time (date)).append_to_rfc1123_string (Result)
hdate.append_to_rfc1123_string (Result)
Result.append_character ('%N') Result.append_character ('%N')
if attached additional_header_lines as l_lines and then if attached additional_header_lines as l_lines and then
not l_lines.is_empty not l_lines.is_empty
@@ -285,11 +280,8 @@ feature -- Helpers
Result := add.has ('@') Result := add.has ('@')
end end
invariant
-- invariant_clause: True
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -43,11 +43,8 @@ feature {NONE} -- Initialization
feature -- Status feature -- Status
is_available: BOOLEAN is_available: BOOLEAN
local
f: RAW_FILE
do do
create f.make_with_path (executable_path) Result := (create {RAW_FILE}.make_with_path (executable_path)).exists
Result := f.exists
end end
feature -- Change feature -- Change
@@ -108,7 +105,7 @@ feature -- Basic operation
if attached arguments as l_args then if attached arguments as l_args then
args := l_args.twin args := l_args.twin
else else
if attached {RAW_FILE} new_temporary_file (generator) as f then if attached new_temporary_file (generator) as f then
f.create_read_write f.create_read_write
f.put_string (a_email.message) f.put_string (a_email.message)
f.close f.close
@@ -196,10 +193,8 @@ feature {NONE} -- Implementation
result_creatable: Result.is_creatable result_creatable: Result.is_creatable
end end
invariant
note note
copyright: "2011-2016, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -4,9 +4,8 @@ note
Note: it is based on EiffelNet {SMTP_PROTOCOL} implementation, and may not be complete. Note: it is based on EiffelNet {SMTP_PROTOCOL} implementation, and may not be complete.
]" ]"
author: "$Author: jfiat $" date: "$Date$"
date: "$Date: 2015-06-30 11:07:17 +0200 (mar., 30 juin 2015) $" revision: "$Revision$"
revision: "$Revision: 97586 $"
class class
NOTIFICATION_SMTP_MAILER NOTIFICATION_SMTP_MAILER
@@ -57,15 +56,12 @@ feature {NONE} -- Initialization
initialize initialize
-- Initialize service. -- Initialize service.
local
l_address_factory: INET_ADDRESS_FACTORY
do do
if attached username as u then if attached username as u then
create smtp_protocol.make (smtp_host, u) create smtp_protocol.make (smtp_host, u)
else else
-- Get local host name needed in creation of SMTP_PROTOCOL. -- Get local host name needed in creation of SMTP_PROTOCOL.
create l_address_factory create smtp_protocol.make (smtp_host, (create {INET_ADDRESS_FACTORY}).create_localhost.host_name)
create smtp_protocol.make (smtp_host, l_address_factory.create_localhost.host_name)
end end
if smtp_port > 0 then if smtp_port > 0 then
smtp_protocol.set_default_port (smtp_port) smtp_protocol.set_default_port (smtp_port)
@@ -98,9 +94,7 @@ feature -- Basic operation
local local
l_email: EMAIL l_email: EMAIL
h: STRING h: STRING
k,v: STRING
i: INTEGER i: INTEGER
hdate: HTTP_DATE
do do
create l_email.make_with_entry (a_email.from_address, addresses_to_header_line_value (a_email.to_addresses)) create l_email.make_with_entry (a_email.from_address, addresses_to_header_line_value (a_email.to_addresses))
if attached a_email.reply_to_address as l_reply_to then if attached a_email.reply_to_address as l_reply_to then
@@ -117,8 +111,7 @@ feature -- Basic operation
l_email.add_header_entry ({EMAIL_CONSTANTS}.H_subject, a_email.subject) l_email.add_header_entry ({EMAIL_CONSTANTS}.H_subject, a_email.subject)
create h.make_empty create h.make_empty
create hdate.make_from_date_time (a_email.date) ;(create {HTTP_DATE}.make_from_date_time (a_email.date)).append_to_rfc1123_string (h)
hdate.append_to_rfc1123_string (h)
l_email.add_header_entry ("Date", h) l_email.add_header_entry ("Date", h)
if attached a_email.additional_header_lines as lst then if attached a_email.additional_header_lines as lst then
@@ -128,9 +121,7 @@ feature -- Basic operation
h := ic.item h := ic.item
i := h.index_of (':', 1) i := h.index_of (':', 1)
if i > 0 then if i > 0 then
k := h.head (i - 1) l_email.add_header_entry (h.head (i - 1), h.substring (i + 1, h.count))
v := h.substring (i + 1, h.count)
l_email.add_header_entry (k, v)
else else
check is_header_line: False end check is_header_line: False end
end end
@@ -181,7 +172,7 @@ feature {NONE} -- Implementation
end end
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -1,7 +1,7 @@
note note
description: "Store emails in specific folder." description: "Store emails in specific folder."
date: "$Date: 2017-03-08 10:34:57 +0100 (mer., 08 mars 2017) $" date: "$Date$"
revision: "$Revision: 99935 $" revision: "$Revision$"
class class
NOTIFICATION_EMAIL_DIRECTORY_STORAGE NOTIFICATION_EMAIL_DIRECTORY_STORAGE
@@ -41,7 +41,7 @@ feature -- Storage
-- Store `a_email'. -- Store `a_email'.
local local
retried: BOOLEAN retried: BOOLEAN
f,w: RAW_FILE w: RAW_FILE
dt: DATE_TIME dt: DATE_TIME
p: PATH p: PATH
fn: STRING fn: STRING
@@ -72,8 +72,7 @@ feature -- Storage
p := p.extended (fn) p := p.extended (fn)
from from
create f.make_with_path (p) w := new_file_opened_for_writing (create {RAW_FILE}.make_with_path (p))
w := new_file_opened_for_writing (f)
until until
w /= Void or i > 100 w /= Void or i > 100
loop loop
@@ -113,14 +112,15 @@ feature -- Storage
local local
retried: BOOLEAN retried: BOOLEAN
do do
if not retried then if
if not f.exists then not retried and then
f.open_write not f.exists
if f.is_open_write then then
Result := f f.open_write
elseif not f.is_closed then if f.is_open_write then
f.close Result := f
end elseif not f.is_closed then
f.close
end end
end end
ensure ensure

View File

@@ -47,7 +47,7 @@ feature -- Change
across across
ax_to_sreg_map as c ax_to_sreg_map as c
loop loop
ask_info (c.key.to_string_32, is_required) ask_info (c.key, is_required)
end end
end end
@@ -204,18 +204,18 @@ feature {OPENID_CONSUMER_VALIDATION} -- Implementation
l_types as t l_types as t
loop loop
s := xml_content (t.item) s := xml_content (t.item)
if s.same_string ("http://openid.net/sreg/1.0") then if s.same_string_general ("http://openid.net/sreg/1.0") then
r_sreg_supported := True r_sreg_supported := True
elseif s.same_string ("http://openid.net/extensions/sreg/1.1") then elseif s.same_string_general ("http://openid.net/extensions/sreg/1.1") then
r_sreg_supported := True r_sreg_supported := True
elseif s.same_string ("http://openid.net/srv/ax/1.0") then elseif s.same_string_general ("http://openid.net/srv/ax/1.0") then
r_ax_supported := True r_ax_supported := True
elseif s.same_string ("http://specs.openid.net/auth/2.0/signon") then elseif s.same_string_general ("http://specs.openid.net/auth/2.0/signon") then
r_version := 2 r_version := 2
elseif s.same_string ("http://specs.openid.net/auth/2.0/server") then elseif s.same_string_general ("http://specs.openid.net/auth/2.0/server") then
r_version := 2 r_version := 2
r_identifier_select := True r_identifier_select := True
elseif s.same_string ("http://openid.net/signon/1.1") then elseif s.same_string_general ("http://openid.net/signon/1.1") then
r_version := 1 r_version := 1
end end
end end
@@ -494,7 +494,7 @@ feature {NONE} -- Implementation
feature -- Helper feature -- Helper
xml_content (e: XML_ELEMENT): STRING_8 xml_content (e: XML_ELEMENT): STRING_32
do do
create Result.make_empty create Result.make_empty
if attached e.contents as lst then if attached e.contents as lst then

View File

@@ -89,10 +89,10 @@ feature -- Basic operation
create ret.make_from_string (return_url) create ret.make_from_string (return_url)
create tb.make (5) create tb.make (5)
if attached values as q_lst then if attached values as q_lst then
if attached item_by_name ("openid.claimed_id", q_lst) as q_claimed_id then if attached item_by_name ("openid.claimed_id", q_lst) as q_claimed_id and then q_claimed_id.is_valid_as_string_8 then
l_claimed_id := q_claimed_id.as_string_8 l_claimed_id := q_claimed_id.to_string_8
elseif attached item_by_name ("openid.identity", q_lst) as l_id then elseif attached item_by_name ("openid.identity", q_lst) as l_id and then l_id.is_valid_as_string_8 then
l_claimed_id := l_id l_claimed_id := l_id.to_string_8
end end
identity := l_claimed_id identity := l_claimed_id
tb.force (item_by_name ("openid.assoc_handle", q_lst), "openid.assoc_handle") tb.force (item_by_name ("openid.assoc_handle", q_lst), "openid.assoc_handle")
@@ -117,7 +117,7 @@ feature -- Basic operation
if if
attached item_by_name ("openid.return_to", q_lst) as q_return_to and then attached item_by_name ("openid.return_to", q_lst) as q_return_to and then
not return_url.same_string (q_return_to) not return_url.same_string_general (q_return_to)
then then
-- The return_to url must match the url of current request. -- The return_to url must match the url of current request.
-- I'm assuing that noone will set the returnUrl to something that doesn't make sense. -- I'm assuing that noone will set the returnUrl to something that doesn't make sense.
@@ -217,7 +217,7 @@ feature -- Basic operation
if s.same_string ({STRING_32} "ns.ax") and v.same_string ({STRING_32} "http://openid.net/srv/ax/1.0") then if s.same_string ({STRING_32} "ns.ax") and v.same_string ({STRING_32} "http://openid.net/srv/ax/1.0") then
l_alias := "ax." l_alias := "ax."
else else
if v.same_string ("http://openid.net/srv/ax/1.0") then if v.same_string_general ("http://openid.net/srv/ax/1.0") then
l_alias := s.substring (("ns.").count + 1, s.count).to_string_8 + "." l_alias := s.substring (("ns.").count + 1, s.count).to_string_8 + "."
end end
end end
@@ -235,8 +235,8 @@ feature -- Basic operation
loop loop
s := c.item s := c.item
if if
s.starts_with (k_value) s.starts_with_general (k_value)
or s.starts_with (k_type) or s.starts_with_general (k_type)
then then
ax_keys.force ("openid." + s) ax_keys.force ("openid." + s)
end end
@@ -251,17 +251,17 @@ feature -- Basic operation
loop loop
s := c.item s := c.item
if attached item_by_name (s, lst) as v then if attached item_by_name (s, lst) as v then
if s.starts_with (k_value) then if s.starts_with_general (k_value) then
k := s.substring (k_value.count + 1, s.count) k := s.substring (k_value.count + 1, s.count)
i := k.index_of ('.', 1) i := k.index_of ('.', 1)
if i > 1 then if i > 1 then
k.keep_head (i - 1) k.keep_head (i - 1)
end end
if attached item_by_name (k_type + k, lst) as l_type then if attached item_by_name (k_type + k, lst) as l_type then
if l_type.starts_with ("http://axschema.org/") then if l_type.starts_with_general ("http://axschema.org/") then
check ("http://axschema.org/").count = 20 end check ("http://axschema.org/").count = 20 end
attributes.force (v, l_type.substring (21, l_type.count)) attributes.force (v, l_type.substring (21, l_type.count))
elseif l_type.starts_with ("http://schema.openid.net/") then elseif l_type.starts_with_general ("http://schema.openid.net/") then
check ("http://schema.openid.net/").count = 25 end check ("http://schema.openid.net/").count = 25 end
attributes.force (v, l_type.substring (26, l_type.count)) attributes.force (v, l_type.substring (26, l_type.count))
else else

View File

@@ -137,7 +137,7 @@ feature -- Status report
-- String that should be displayed in debugger to represent `Current'. -- String that should be displayed in debugger to represent `Current'.
do do
create Result.make_empty create Result.make_empty
Result.append (type) Result.append_string_general (type)
Result.append (" ") Result.append (" ")
if attached login as l_login then if attached login as l_login then
Result.append ("login=[") Result.append ("login=[")

View File

@@ -2,8 +2,8 @@ note
description: "[ description: "[
Standalone Web Server connector. Standalone Web Server connector.
]" ]"
date: "$Date: 2016-08-06 13:34:52 +0200 (sam., 06 août 2016) $" date: "$Date$"
revision: "$Revision: 99106 $" revision: "$Revision$"
class class
WGI_STANDALONE_CONNECTOR [G -> WGI_EXECUTION create make end] WGI_STANDALONE_CONNECTOR [G -> WGI_EXECUTION create make end]
@@ -110,7 +110,7 @@ feature -- Callbacks
on_launched_actions: ACTION_SEQUENCE [TUPLE [WGI_STANDALONE_CONNECTOR [WGI_EXECUTION]]] on_launched_actions: ACTION_SEQUENCE [TUPLE [WGI_STANDALONE_CONNECTOR [WGI_EXECUTION]]]
-- Actions triggered when launched. -- Actions triggered when launched.
-- WARNING: only supported for now with SCOOP concurrency mode. [2016-oct-07] -- WARNING: only supported for now with SCOOP concurrency mode. [2016-10-07]
feature -- Event feature -- Event
@@ -201,7 +201,7 @@ feature -- Server
-- Shutdown web server listening. -- Shutdown web server listening.
do do
if launched then if launched then
-- FIXME jfiat [2015/03/27] : prevent multiple calls (otherwise it hangs) -- FIXME: prevent multiple calls (otherwise it hangs) [2015-03-27]
separate_shutdown_server_on_controller (controller) separate_shutdown_server_on_controller (controller)
end end
end end
@@ -213,7 +213,7 @@ feature -- Events
require require
obs.started -- SCOOP wait condition. obs.started -- SCOOP wait condition.
do do
-- FIXME: this works only with SCOOP concurrency mode. [2016-oct-07] -- FIXME: this works only with SCOOP concurrency mode. [2016-10-07]
if obs.port > 0 then if obs.port > 0 then
on_launched (obs.port) on_launched (obs.port)
end end
@@ -282,9 +282,8 @@ feature {NONE} -- Implementation: element change
cfg.set_is_secure (b) cfg.set_is_secure (b)
end end
note note
copyright: "2011-2016, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -94,7 +94,7 @@ feature {NONE} -- Implementation
require require
a_value_not_is_empty: a_value /= Void a_value_not_is_empty: a_value /= Void
do do
a_output.append (a_name) a_output.append_string_general (a_name)
a_output.append_character ('=') a_output.append_character ('=')
a_output.append_string_general (a_value) a_output.append_string_general (a_value)
a_output.append_character ('%N') a_output.append_character ('%N')
@@ -103,7 +103,7 @@ feature {NONE} -- Implementation
append_variable_to_debug_output (a_name: READABLE_STRING_8; a_value: detachable READABLE_STRING_GENERAL; a_output: STRING_32) append_variable_to_debug_output (a_name: READABLE_STRING_8; a_value: detachable READABLE_STRING_GENERAL; a_output: STRING_32)
do do
if a_value /= Void then if a_value /= Void then
a_output.append (a_name) a_output.append_string_general (a_name)
a_output.append_character ('=') a_output.append_character ('=')
a_output.append_string_general (a_value) a_output.append_string_general (a_value)
a_output.append_character ('%N') a_output.append_character ('%N')
@@ -354,7 +354,7 @@ invariant
request_method_set: not request_method.is_empty request_method_set: not request_method.is_empty
note note
copyright: "2011-2014, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -54,7 +54,7 @@ feature -- Access
force_single_threaded: BOOLEAN assign set_force_single_threaded force_single_threaded: BOOLEAN assign set_force_single_threaded
obsolete obsolete
"Use directly `max_concurrent_connections = 1` [Feb/2017]" "Use directly `max_concurrent_connections = 1` [2017-05-31]"
do do
Result := max_concurrent_connections <= 1 Result := max_concurrent_connections <= 1
end end
@@ -202,7 +202,7 @@ feature -- Element change
-- Force server to handle incoming request in a single thread. -- Force server to handle incoming request in a single thread.
-- i.e set max_concurrent_connections to 1! -- i.e set max_concurrent_connections to 1!
obsolete obsolete
"Use set_max_concurrent_connections (1) [June/2016]" "Use set_max_concurrent_connections (1) [2017-05-31]"
do do
if v then if v then
set_max_concurrent_connections (1) set_max_concurrent_connections (1)
@@ -210,8 +210,8 @@ feature -- Element change
set_max_concurrent_connections (default_max_concurrent_connections) set_max_concurrent_connections (default_max_concurrent_connections)
end end
ensure ensure
force_single_threaded_set: v implies max_concurrent_connections <= 1 force_single_threaded_set: v implies max_concurrent_connections <= 1
not_single_threaded: not v implies max_concurrent_connections > 1 not_single_threaded: not v implies max_concurrent_connections > 1
end end
set_is_verbose (b: BOOLEAN) set_is_verbose (b: BOOLEAN)
@@ -340,7 +340,7 @@ feature -- SSL Helpers
end end
note note
copyright: "2011-2016, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -60,6 +60,7 @@ feature -- Execution
req: WGI_REQUEST_FROM_TABLE req: WGI_REQUEST_FROM_TABLE
res: detachable WGI_RESPONSE_STREAM res: detachable WGI_RESPONSE_STREAM
rescued: BOOLEAN rescued: BOOLEAN
utf: UTF_CONVERTER
do do
if not rescued then if not rescued then
a_input.reset a_input.reset
@@ -68,14 +69,14 @@ feature -- Execution
service.execute (req, res) service.execute (req, res)
res.push res.push
else else
if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.exception_trace as l_trace then if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.trace as l_trace then
if res /= Void then if res /= Void then
if not res.status_is_set then if not res.status_is_set then
res.set_status_code ({HTTP_STATUS_CODE}.internal_server_error, Void) res.set_status_code ({HTTP_STATUS_CODE}.internal_server_error, Void)
end end
if res.message_writable then if res.message_writable then
res.put_string ("<pre>") res.put_string ("<pre>")
res.put_string (l_trace) res.put_string (utf.string_32_to_utf_8_string_8 (l_trace))
res.put_string ("</pre>") res.put_string ("</pre>")
end end
res.push res.push
@@ -105,7 +106,7 @@ invariant
fcgi_attached: fcgi /= Void fcgi_attached: fcgi /= Void
note note
copyright: "2011-2013, Eiffel Software and others" copyright: "2011-2017, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -122,7 +122,7 @@ feature {NONE} -- Initialization
then then
secure_settings := [l_secure_prot, opts.option_string_32_value ("secure_certificate", Void), opts.option_string_32_value ("secure_certificate_key", Void)] secure_settings := [l_secure_prot, opts.option_string_32_value ("secure_certificate", Void), opts.option_string_32_value ("secure_certificate_key", Void)]
elseif elseif
-- OBSOLETE: backward compatible with old settings name [oct/2016]. -- OBSOLETE: backward compatible with old settings name [2017-05-31].
opts.option_boolean_value ("ssl_enabled", is_secure) and then opts.option_boolean_value ("ssl_enabled", is_secure) and then
attached opts.option_string_32_value ("ssl_protocol", "tls_1_2") as ssl_prot attached opts.option_string_32_value ("ssl_protocol", "tls_1_2") as ssl_prot
then then
@@ -141,7 +141,7 @@ feature {NONE} -- Initialization
force_single_threaded force_single_threaded
-- Set `single_threaded' to True. -- Set `single_threaded' to True.
obsolete obsolete
"Use set_max_concurrent_connections (1) [Feb/2017]" "Use set_max_concurrent_connections (1) [2017-05-31]"
do do
set_max_concurrent_connections (1) set_max_concurrent_connections (1)
ensure ensure
@@ -238,7 +238,7 @@ feature {NONE} -- Implementation
single_threaded: BOOLEAN single_threaded: BOOLEAN
obsolete obsolete
"Use max_concurrent_connections <= 1 [Feb/2017]" "Use max_concurrent_connections <= 1 [2017-05-31]"
do do
Result := max_concurrent_connections <= 1 Result := max_concurrent_connections <= 1
end end
@@ -277,7 +277,7 @@ feature -- Status report
end end
;note ;note
copyright: "2011-2016, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -166,7 +166,8 @@ feature -- Basic Operation
if is_verbose then if is_verbose then
log ("%NReceive <====================", debug_level) log ("%NReceive <====================", debug_level)
if attached req.raw_header_data as rhd then if attached req.raw_header_data as rhd then
log (rhd, debug_level) check raw_header_is_valid_as_string_8: rhd.is_valid_as_string_8 end
log (rhd.to_string_8, debug_level)
end end
end end
if if
@@ -189,7 +190,8 @@ feature -- Basic Operation
end end
-- Sending the server's opening handshake -- Sending the server's opening handshake
create l_sha1.make create l_sha1.make
l_sha1.update_from_string (l_ws_key + magic_guid) check l_ws_key_is_valid_as_string_8: l_ws_key.is_valid_as_string_8 end
l_sha1.update_from_string (l_ws_key.to_string_8 + magic_guid)
l_key := Base64_encoder.encoded_string (digest (l_sha1)) l_key := Base64_encoder.encoded_string (digest (l_sha1))
res.header.add_header_key_value ("Upgrade", "websocket") res.header.add_header_key_value ("Upgrade", "websocket")
res.header.add_header_key_value ("Connection", "Upgrade") res.header.add_header_key_value ("Connection", "Upgrade")
@@ -795,7 +797,7 @@ feature {NONE} -- Debug
note note
copyright: "2011-2016, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -69,7 +69,7 @@ feature -- Basic operations
s.append (c.item.url_encoded_name) s.append (c.item.url_encoded_name)
s.append_character (' ') s.append_character (' ')
s.append_character ('{') s.append_character ('{')
s.append (c.item.generating_type) s.append (c.item.generating_type.name)
s.append_character ('}') s.append_character ('}')
s.append_character ('=') s.append_character ('=')
s.append (c.item.debug_output.as_string_8) s.append (c.item.debug_output.as_string_8)
@@ -80,7 +80,7 @@ feature -- Basic operations
end end
note note
copyright: "2011-2014, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
licensing_options: "http://www.eiffel.com/licensing" licensing_options: "http://www.eiffel.com/licensing"
copying: "[ copying: "[

View File

@@ -245,7 +245,7 @@ feature {NONE} -- Implementation
s.append_character (' ') s.append_character (' ')
if attached c.item as l_item then if attached c.item as l_item then
s.append_character ('{') s.append_character ('{')
s.append (l_item.generating_type) s.append (l_item.generating_type.name)
s.append_character ('}') s.append_character ('}')
s.append_character (' ') s.append_character (' ')
@@ -316,7 +316,7 @@ feature {NONE} -- Implementation
else else
a_output.append (c.item.url_encoded_name) a_output.append (c.item.url_encoded_name)
end end
t := c.item.generating_type t := c.item.generating_type.name
if t.same_string ("WSF_STRING") then if t.same_string ("WSF_STRING") then
else else
a_output.append_character (' ') a_output.append_character (' ')
@@ -420,7 +420,7 @@ feature -- Constants
invariant invariant
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -108,13 +108,11 @@ feature -- Basic operations
handle_precondition_failed (req, res) handle_precondition_failed (req, res)
else else
if attached req.http_if_unmodified_since as l_if_unmodified_since then if attached req.http_if_unmodified_since as l_if_unmodified_since then
if l_if_unmodified_since.is_string_8 then create l_date.make_from_string (l_if_unmodified_since)
create l_date.make_from_string (l_if_unmodified_since.as_string_8) if not l_date.has_error then
if not l_date.has_error then if a_handler.modified_since (req, l_date.date_time) then
if a_handler.modified_since (req, l_date.date_time) then handle_precondition_failed (req, res)
handle_precondition_failed (req, res) l_failed := True
l_failed := True
end
end end
end end
end end
@@ -128,13 +126,11 @@ feature -- Basic operations
handle_if_none_match_failed (req, res, a_handler) handle_if_none_match_failed (req, res, a_handler)
else else
if attached req.http_if_modified_since as l_if_modified_since then if attached req.http_if_modified_since as l_if_modified_since then
if l_if_modified_since.is_string_8 then create l_date.make_from_string (l_if_modified_since)
create l_date.make_from_string (l_if_modified_since.as_string_8) if not l_date.has_error then
if not l_date.has_error then if not a_handler.modified_since (req, l_date.date_time) then
if not a_handler.modified_since (req, l_date.date_time) then handle_not_modified (req, res, a_handler)
handle_not_modified (req, res, a_handler) l_failed := True
l_failed := True
end
end end
end end
end end
@@ -408,7 +404,7 @@ feature -- Error reporting
if req.is_content_type_accepted ({HTTP_MIME_TYPES}.text_html) then if req.is_content_type_accepted ({HTTP_MIME_TYPES}.text_html) then
s := "<html lang=%"en%"><head>" s := "<html lang=%"en%"><head>"
s.append ("<title>") s.append ("<title>")
s.append (html_encoder.encoded_string (req.request_uri)) s.append (html_encoder.general_encoded_string (req.request_uri))
s.append ("Error " + a_status_code.out + " (" + l_msg + ")") s.append ("Error " + a_status_code.out + " (" + l_msg + ")")
s.append ("</title>%N") s.append ("</title>%N")
s.append ("[ s.append ("[
@@ -434,7 +430,7 @@ feature -- Error reporting
s.append ("</div>") s.append ("</div>")
s.append ("The current location for this resource is <a href=%"" + a_locations.first.string + "%">here</a>") s.append ("The current location for this resource is <a href=%"" + a_locations.first.string + "%">here</a>")
s.append ("Error " + a_status_code.out + " (" + l_msg + ")</div>") s.append ("Error " + a_status_code.out + " (" + l_msg + ")</div>")
s.append ("<div id=%"message%">Error " + a_status_code.out + " (" + l_msg + "): <code>" + html_encoder.encoded_string (req.request_uri) + "</code></div>") s.append ("<div id=%"message%">Error " + a_status_code.out + " (" + l_msg + "): <code>" + html_encoder.general_encoded_string (req.request_uri) + "</code></div>")
s.append ("<div id=%"footer%"></div>") s.append ("<div id=%"footer%"></div>")
s.append ("</body>%N") s.append ("</body>%N")
s.append ("</html>%N") s.append ("</html>%N")
@@ -587,7 +583,7 @@ feature -- Error reporting
end end
note note
copyright: "2011-2014, Colin Adams, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" copyright: "2011-2017, Colin Adams, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -158,7 +158,7 @@ feature -- Access
deferred deferred
end end
matching_etag (req: WSF_REQUEST; a_etag: READABLE_STRING_32; a_strong: BOOLEAN): BOOLEAN matching_etag (req: WSF_REQUEST; a_etag: READABLE_STRING_GENERAL; a_strong: BOOLEAN): BOOLEAN
-- Is `a_etag' a match for resource requested in `req'? -- Is `a_etag' a match for resource requested in `req'?
-- If `a_strong' then the strong comparison function must be used. -- If `a_strong' then the strong comparison function must be used.
require require

View File

@@ -147,8 +147,11 @@ feature {WSF_RESPONSE} -- Output
l_description.append ("</ul>") l_description.append ("</ul>")
end end
if doc_url_supported and then attached {WSF_STRING} request.query_parameter ("api") as l_api then if
l_api_resource := l_api.value doc_url_supported and then attached {WSF_STRING} request.query_parameter ("api") as l_api and then
l_api.value.is_valid_as_string_8
then
l_api_resource := l_api.value.to_string_8
if l_api_resource.is_empty then if l_api_resource.is_empty then
l_api_resource := Void l_api_resource := Void
end end
@@ -324,7 +327,7 @@ feature {NONE} -- Implementation
end end
note note
copyright: "2011-2014, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -29,6 +29,8 @@ feature -- Element change
set_next (a_next: like next) set_next (a_next: like next)
-- Set `next' to `a_next' -- Set `next' to `a_next'
require
a_next_is_not_current: a_next /= Current
do do
next := a_next next := a_next
ensure ensure

View File

@@ -20,7 +20,7 @@ feature -- Mapping helper: uri
map_uri_with_request_methods (a_uri: READABLE_STRING_8; h: WSF_URI_HANDLER; rqst_methods: detachable WSF_REQUEST_METHODS) map_uri_with_request_methods (a_uri: READABLE_STRING_8; h: WSF_URI_HANDLER; rqst_methods: detachable WSF_REQUEST_METHODS)
-- Map `h' as handler for `a_uri' for request methods `rqst_methods'. -- Map `h' as handler for `a_uri' for request methods `rqst_methods'.
obsolete obsolete
"Use directly `map_uri' [June/2015]" "Use directly `map_uri' [2017-05-31]"
do do
map_uri (a_uri, h, rqst_methods) map_uri (a_uri, h, rqst_methods)
end end
@@ -44,7 +44,7 @@ feature -- Mapping helper: uri agent
map_uri_agent_with_request_methods (a_uri: READABLE_STRING_8; proc: PROCEDURE [TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS) map_uri_agent_with_request_methods (a_uri: READABLE_STRING_8; proc: PROCEDURE [TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
-- Map `proc' as handler for `a_uri' for request methods `rqst_methods'. -- Map `proc' as handler for `a_uri' for request methods `rqst_methods'.
obsolete obsolete
"Use directly `map_uri_agent' [June/2015]" "Use directly `map_uri_agent' [2017-05-31]"
do do
map_uri_agent (a_uri, proc, rqst_methods) map_uri_agent (a_uri, proc, rqst_methods)
end end
@@ -58,7 +58,7 @@ feature -- Mapping helper: uri agent
end end
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -23,7 +23,7 @@ feature -- Mapping helper: uri template
map_uri_template_with_request_methods (a_tpl: READABLE_STRING_8; h: WSF_URI_TEMPLATE_HANDLER; rqst_methods: detachable WSF_REQUEST_METHODS) map_uri_template_with_request_methods (a_tpl: READABLE_STRING_8; h: WSF_URI_TEMPLATE_HANDLER; rqst_methods: detachable WSF_REQUEST_METHODS)
-- Map `h' as handler for `a_tpl' for request methods `rqst_methods'. -- Map `h' as handler for `a_tpl' for request methods `rqst_methods'.
obsolete obsolete
"Use directly `map_uri_template' [June/2015]" "Use directly `map_uri_template' [2017-05-31]"
require require
a_tpl_attached: a_tpl /= Void a_tpl_attached: a_tpl /= Void
h_attached: h /= Void h_attached: h /= Void
@@ -54,7 +54,7 @@ feature -- Mapping helper: uri template agent
map_uri_template_agent_with_request_methods (a_tpl: READABLE_STRING_8; proc: PROCEDURE [TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS) map_uri_template_agent_with_request_methods (a_tpl: READABLE_STRING_8; proc: PROCEDURE [TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
-- Map `proc' as handler for `a_tpl' for request methods `rqst_methods'. -- Map `proc' as handler for `a_tpl' for request methods `rqst_methods'.
obsolete obsolete
"Use directly `map_uri_template_agent' [June/2015]" "Use directly `map_uri_template_agent' [2017-05-31]"
require require
a_tpl_attached: a_tpl /= Void a_tpl_attached: a_tpl /= Void
proc_attached: proc /= Void proc_attached: proc /= Void
@@ -72,7 +72,7 @@ feature -- Mapping helper: uri template agent
end end
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -187,9 +187,9 @@ feature -- Execution
execute (a_start_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE) execute (a_start_path: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE)
local local
p: STRING_32 p: STRING_8
do do
create p.make_from_string (req.path_info) create p.make_from_string (req.percent_encoded_path_info)
if p.starts_with_general (a_start_path) then if p.starts_with_general (a_start_path) then
p.remove_head (a_start_path.count) p.remove_head (a_start_path.count)
else else
@@ -203,7 +203,7 @@ feature -- Execution
execute (a_start_path, req, res) execute (a_start_path, req, res)
end end
process_uri (uri: READABLE_STRING_32; req: WSF_REQUEST; res: WSF_RESPONSE) process_uri (uri: READABLE_STRING_8; req: WSF_REQUEST; res: WSF_RESPONSE)
local local
f: RAW_FILE f: RAW_FILE
fn: like resource_filename fn: like resource_filename
@@ -497,7 +497,7 @@ feature {NONE} -- Implementation
end end
end end
resource_filename (uri: READABLE_STRING_32): PATH resource_filename (uri: READABLE_STRING_GENERAL): PATH
local local
s: like uri_path_to_filename s: like uri_path_to_filename
do do
@@ -544,7 +544,7 @@ feature {NONE} -- Implementation
end end
end end
uri_path_to_filename (fn: READABLE_STRING_32): STRING_32 uri_path_to_filename (fn: READABLE_STRING_GENERAL): STRING_32
-- Real filename from url-path `fn' -- Real filename from url-path `fn'
--| Find a better design for this piece of code --| Find a better design for this piece of code
--| Eventually in a spec/$ISE_PLATFORM/ specific cluster --| Eventually in a spec/$ISE_PLATFORM/ specific cluster
@@ -552,7 +552,7 @@ feature {NONE} -- Implementation
n: INTEGER n: INTEGER
do do
n := fn.count n := fn.count
create Result.make_from_string (fn) create Result.make_from_string_general (fn)
if n > 0 and then Result.item (Result.count) = {CHARACTER_32} '/' then if n > 0 and then Result.item (Result.count) = {CHARACTER_32} '/' then
Result.remove_tail (1) Result.remove_tail (1)
n := n - 1 n := n - 1
@@ -595,7 +595,7 @@ feature {NONE} -- implementation: date time
Result := timestamp_to_date (f.date) Result := timestamp_to_date (f.date)
end end
http_date_format_to_date (s: READABLE_STRING_8): detachable DATE_TIME http_date_format_to_date (s: READABLE_STRING_GENERAL): detachable DATE_TIME
-- String representation of `dt' using the RFC 1123 -- String representation of `dt' using the RFC 1123
-- HTTP-date = rfc1123-date | rfc850-date | asctime-date -- HTTP-date = rfc1123-date | rfc850-date | asctime-date
-- rfc1123-date = wkday "," SP date1 SP time SP "GMT" -- rfc1123-date = wkday "," SP date1 SP time SP "GMT"

View File

@@ -77,7 +77,7 @@ feature -- Mapping
map_with_request_methods (a_mapping: WSF_ROUTER_MAPPING; rqst_methods: detachable WSF_REQUEST_METHODS) map_with_request_methods (a_mapping: WSF_ROUTER_MAPPING; rqst_methods: detachable WSF_REQUEST_METHODS)
-- Map `a_mapping' for request methods `rqst_methods'. -- Map `a_mapping' for request methods `rqst_methods'.
obsolete obsolete
"Use directly `map' [June/2015]" "Use directly `map' [2017-05-31]"
require require
a_mapping_attached: a_mapping /= Void a_mapping_attached: a_mapping /= Void
do do
@@ -135,7 +135,7 @@ feature -- Mapping handler
-- Map the mapping created by factory `f' for resource `a_resource' -- Map the mapping created by factory `f' for resource `a_resource'
-- and only for request methods `rqst_methods' -- and only for request methods `rqst_methods'
obsolete obsolete
"Use directly `handle' [June/2015]" "Use directly `handle' [2017-05-31]"
require require
a_resource_attached: a_resource /= Void a_resource_attached: a_resource /= Void
f_attached: f /= Void f_attached: f /= Void
@@ -166,7 +166,7 @@ feature -- Basic operations
-- And return the associated handler if mapping found and handler executed. -- And return the associated handler if mapping found and handler executed.
--| Violates CQS --| Violates CQS
obsolete obsolete
"Use `dispatch' [2013-mar-21]" "Use `dispatch' [2017-05-31]"
require require
req_attached: req /= Void req_attached: req /= Void
res_attached: res /= Void res_attached: res /= Void
@@ -601,7 +601,7 @@ invariant
pre_execution_actions_attached: pre_execution_actions /= Void pre_execution_actions_attached: pre_execution_actions /= Void
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -45,7 +45,7 @@ feature -- Status report
across across
mtds as c mtds as c
loop loop
s.append_string (c.item) s.append_string_general (c.item)
s.append_string (" ") s.append_string (" ")
end end
s.append_string ("]") s.append_string ("]")
@@ -65,7 +65,7 @@ invariant
mapping_attached: mapping /= Void mapping_attached: mapping /= Void
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -50,8 +50,14 @@ feature -- Status report
debug_output: READABLE_STRING_GENERAL debug_output: READABLE_STRING_GENERAL
-- String that should be displayed in debugger to represent `Current'. -- String that should be displayed in debugger to represent `Current'.
local
s: STRING_32
do do
Result := description + {STRING_32} " : " + associated_resource.to_string_32 create s.make_empty
s.append (description)
s.append_string_general (" : ")
s.append_string_general (associated_resource)
Result := s
end end
feature -- Status feature -- Status
@@ -78,7 +84,7 @@ feature -- Status
end end
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -24,7 +24,7 @@ feature -- Mapping helper: starts_with
map_starts_with_request_methods (a_uri: READABLE_STRING_8; h: WSF_STARTS_WITH_CONTEXT_HANDLER [C]; rqst_methods: detachable WSF_REQUEST_METHODS) map_starts_with_request_methods (a_uri: READABLE_STRING_8; h: WSF_STARTS_WITH_CONTEXT_HANDLER [C]; rqst_methods: detachable WSF_REQUEST_METHODS)
obsolete obsolete
"Use directly `map_starts_with' [June-2015]" "Use directly `map_starts_with' [2017-05-31]"
require require
a_uri_attached: a_uri /= Void a_uri_attached: a_uri /= Void
h_attached: h /= Void h_attached: h /= Void
@@ -44,7 +44,7 @@ feature -- Mapping helper: starts_with agent
map_starts_with_agent_with_request_methods (a_uri: READABLE_STRING_8; proc: PROCEDURE [TUPLE [start_path: READABLE_STRING_8; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS) map_starts_with_agent_with_request_methods (a_uri: READABLE_STRING_8; proc: PROCEDURE [TUPLE [start_path: READABLE_STRING_8; ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
obsolete obsolete
"Use directly `map_starts_with_agent' [June-2015]" "Use directly `map_starts_with_agent' [2017-05-31]"
require require
a_uri_attached: a_uri /= Void a_uri_attached: a_uri /= Void
proc_attached: proc /= Void proc_attached: proc /= Void
@@ -53,7 +53,7 @@ feature -- Mapping helper: starts_with agent
end end
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -24,7 +24,7 @@ feature -- Mapping helper: uri
map_uri_with_request_methods (a_uri: READABLE_STRING_8; h: WSF_URI_CONTEXT_HANDLER [C]; rqst_methods: detachable WSF_REQUEST_METHODS) map_uri_with_request_methods (a_uri: READABLE_STRING_8; h: WSF_URI_CONTEXT_HANDLER [C]; rqst_methods: detachable WSF_REQUEST_METHODS)
obsolete obsolete
"Use directly `map_uri' [June-2015]" "Use directly `map_uri' [2017-05-31]"
require require
a_uri_attached: a_uri /= Void a_uri_attached: a_uri /= Void
h_attached: h /= Void h_attached: h /= Void
@@ -44,7 +44,7 @@ feature -- Mapping helper: uri agent
map_uri_agent_with_request_methods (a_uri: READABLE_STRING_8; proc: PROCEDURE [TUPLE [ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS) map_uri_agent_with_request_methods (a_uri: READABLE_STRING_8; proc: PROCEDURE [TUPLE [ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
obsolete obsolete
"Use directly `map_uri_agent' [June-2015]" "Use directly `map_uri_agent' [2017-05-31]"
require require
a_uri_attached: a_uri /= Void a_uri_attached: a_uri /= Void
proc_attached: proc /= Void proc_attached: proc /= Void
@@ -53,7 +53,7 @@ feature -- Mapping helper: uri agent
end end
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -24,7 +24,7 @@ feature -- Mapping helper: uri
map_uri_template_with_request_methods (a_tpl: READABLE_STRING_8; h: WSF_URI_TEMPLATE_CONTEXT_HANDLER [C]; rqst_methods: detachable WSF_REQUEST_METHODS) map_uri_template_with_request_methods (a_tpl: READABLE_STRING_8; h: WSF_URI_TEMPLATE_CONTEXT_HANDLER [C]; rqst_methods: detachable WSF_REQUEST_METHODS)
obsolete obsolete
"Use directly `make_uri_template' [June/2015]" "Use directly `make_uri_template' [2017-05-31]"
require require
a_tpl_attached: a_tpl /= Void a_tpl_attached: a_tpl /= Void
h_attached: h /= Void h_attached: h /= Void
@@ -44,7 +44,7 @@ feature -- Mapping helper: uri agent
map_uri_template_agent_with_request_methods (a_tpl: READABLE_STRING_8; proc: PROCEDURE [TUPLE [ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS) map_uri_template_agent_with_request_methods (a_tpl: READABLE_STRING_8; proc: PROCEDURE [TUPLE [ctx: C; req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS)
obsolete obsolete
"Use directly `make_uri_template_agent' [June/2015]" "Use directly `make_uri_template_agent' [2017-05-31]"
require require
a_tpl_attached: a_tpl /= Void a_tpl_attached: a_tpl /= Void
proc_attached: proc /= Void proc_attached: proc /= Void
@@ -53,7 +53,7 @@ feature -- Mapping helper: uri agent
end end
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -32,8 +32,12 @@ feature {NONE} -- Initialization
elseif attached {WSF_STRING} req.query_parameter (cookie_name) as q_uuid then elseif attached {WSF_STRING} req.query_parameter (cookie_name) as q_uuid then
l_uuid := q_uuid.value l_uuid := q_uuid.value
end end
if l_uuid /= Void and then session_exists (l_uuid) then if
uuid := l_uuid l_uuid /= Void and then
l_uuid.is_valid_as_string_8 and then
session_exists (l_uuid)
then
uuid := l_uuid.to_string_8
load load
else else
is_pending := True is_pending := True
@@ -128,7 +132,7 @@ feature {NONE} -- Storage
manager: WSF_SESSION_MANAGER manager: WSF_SESSION_MANAGER
session_exists (a_uuid: like uuid): BOOLEAN session_exists (a_uuid: READABLE_STRING_GENERAL): BOOLEAN
do do
Result := manager.session_exists (a_uuid) Result := manager.session_exists (a_uuid)
end end
@@ -183,7 +187,7 @@ feature {NONE} -- Implementation
end end
note note
copyright: "2011-2014, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -30,7 +30,7 @@ feature {NONE} -- Initialization
feature -- Access feature -- Access
session_exists (a_session_uuid: READABLE_STRING_8): BOOLEAN session_exists (a_session_uuid: READABLE_STRING_GENERAL): BOOLEAN
local local
f: RAW_FILE f: RAW_FILE
do do
@@ -38,7 +38,7 @@ feature -- Access
Result := f.exists and then f.is_readable Result := f.exists and then f.is_readable
end end
session_data (a_session_uuid: READABLE_STRING_8): detachable WSF_SESSION_DATA session_data (a_session_uuid: READABLE_STRING_GENERAL): detachable WSF_SESSION_DATA
local local
f: RAW_FILE f: RAW_FILE
do do
@@ -153,7 +153,7 @@ feature {NONE} -- Implementation
end end
note note
copyright: "2011-2014, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -16,7 +16,7 @@ feature -- Access
uuid: READABLE_STRING_8 uuid: READABLE_STRING_8
obsolete obsolete
"Use `id' which is more general [2014-03]" "Use `id' which is more general [2017-05-31]"
deferred deferred
end end
@@ -116,7 +116,7 @@ feature -- Control
end end
note note
copyright: "2011-2014, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -9,11 +9,11 @@ deferred class
feature -- Access feature -- Access
session_exists (a_uuid: READABLE_STRING_8): BOOLEAN session_exists (a_uuid: READABLE_STRING_GENERAL): BOOLEAN
deferred deferred
end end
session_data (a_uuid: READABLE_STRING_8): detachable WSF_SESSION_DATA session_data (a_uuid: READABLE_STRING_GENERAL): detachable WSF_SESSION_DATA
deferred deferred
end end
@@ -28,7 +28,7 @@ feature -- Persistence
end end
note note
copyright: "2011-2014, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -52,14 +52,14 @@ feature -- Status report
feature -- Query feature -- Query
string_representation: STRING_32 string_representation: READABLE_STRING_32
-- String representation of Current -- String representation of Current
-- if possible -- if possible
do do
if attached value as v then if attached value as v then
Result := v.generating_type Result := generating_type.name_32
else else
Result := "Void" Result := {STRING_32} "Void"
end end
end end
@@ -71,7 +71,7 @@ feature -- Visitor
end end
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -69,7 +69,7 @@ feature -- Access
frozen string_values: like values frozen string_values: like values
obsolete obsolete
"Use `values' [2012-May-31]" "Use `values' [2017-05-31]"
do do
Result := values Result := values
end end
@@ -81,7 +81,7 @@ feature -- Access
frozen first_string_value: WSF_STRING frozen first_string_value: WSF_STRING
obsolete obsolete
"Use `first_value' [2012-May-31]" "Use `first_value' [2017-05-31]"
do do
Result := first_value Result := first_value
end end
@@ -179,7 +179,7 @@ invariant
string_values_not_empty: values.count >= 1 string_values_not_empty: values.count >= 1
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -126,17 +126,10 @@ feature -- Helper
Result := value.same_string_general (a_other) Result := value.same_string_general (a_other)
end end
is_case_insensitive_equal (a_other: READABLE_STRING_8): BOOLEAN is_case_insensitive_equal (a_other: READABLE_STRING_GENERAL): BOOLEAN
-- Does `a_other' represent the same case insensitive string as `Current'? -- Does `a_other' represent the same case insensitive string as `Current'?
local
v: like value
do do
v := value Result := value.is_case_insensitive_equal_general (a_other)
if v = a_other then
Result := True
elseif v.is_valid_as_string_8 then
Result := v.is_case_insensitive_equal (a_other)
end
end end
feature -- Conversion feature -- Conversion
@@ -154,7 +147,7 @@ feature -- Visitor
end end
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -2,8 +2,8 @@ note
description: "[ description: "[
Table which can contain value indexed by a key Table which can contain value indexed by a key
]" ]"
date: "$Date: 2015-11-05 21:52:56 +0100 (jeu., 05 nov. 2015) $" date: "$Date$"
revision: "$Revision: 98081 $" revision: "$Revision$"
class class
WSF_TABLE WSF_TABLE
@@ -86,7 +86,7 @@ feature -- Access
frozen first_key: like first_name frozen first_key: like first_name
obsolete obsolete
"Use first_name [2012-May-31]" "Use first_name [2017-05-31]"
do do
Result := first_name Result := first_name
end end
@@ -130,7 +130,7 @@ feature -- Conversion
end end
as_array_of_string: detachable ARRAY [READABLE_STRING_32] as_array_of_string: detachable ARRAY [READABLE_STRING_32]
-- Return an array of STRING if possible., otherwise Void -- Return an array of STRING if possible, otherwise Void.
local local
i,n: INTEGER i,n: INTEGER
nb: INTEGER nb: INTEGER
@@ -145,6 +145,10 @@ feature -- Conversion
if attached {WSF_STRING} value (i.out) as s then if attached {WSF_STRING} value (i.out) as s then
Result.put (s.value, i) Result.put (s.value, i)
nb := nb + 1 nb := nb + 1
--FIXME elseif attached {WSF_STRING} value (name + "[" + i.out + "]") as s then
--
-- Result.put (s.value, i)
-- nb := nb + 1
else else
Result := Void Result := Void
end end
@@ -232,7 +236,7 @@ feature -- Visitor
end end
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -94,7 +94,7 @@ feature -- Status report
feature -- Conversion feature -- Conversion
string_representation: STRING_32 string_representation: READABLE_STRING_32
do do
Result := filename Result := filename
end end
@@ -250,7 +250,7 @@ feature -- Element change
end end
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -70,7 +70,7 @@ feature -- Query
end end
end end
string_representation: STRING_32 string_representation: READABLE_STRING_32
-- String representation of Current -- String representation of Current
-- if possible -- if possible
-- note: unicode value. -- note: unicode value.
@@ -89,7 +89,7 @@ feature -- Helper
result_true_only_for_string: Result implies is_string result_true_only_for_string: Result implies is_string
end end
is_case_insensitive_equal (a_other: READABLE_STRING_8): BOOLEAN is_case_insensitive_equal (a_other: READABLE_STRING_GENERAL): BOOLEAN
-- Does `a_other' represent the same case insensitive string as `Current'? -- Does `a_other' represent the same case insensitive string as `Current'?
do do
if is_string then if is_string then
@@ -130,7 +130,7 @@ feature -- Visitor
end end
note note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -83,7 +83,7 @@ feature {WSF_RESPONSE} -- Output
else else
--| Other response codes are possible, such as 301 Moved permananently, --| Other response codes are possible, such as 301 Moved permananently,
--| 302 Found and 410 Gone. But these require handlers to implement, --| 302 Found and 410 Gone. But these require handlers to implement,
--| so no other code can be given at this point. --| so no other code can be given at this point.
msg := not_found_message (req) msg := not_found_message (req)
end end
res.send (msg) res.send (msg)
@@ -98,7 +98,7 @@ feature {NONE} -- Implementation
do do
create Result.make (req) create Result.make (req)
end end
method_not_allowed_message (req: WSF_REQUEST): detachable WSF_METHOD_NOT_ALLOWED_RESPONSE method_not_allowed_message (req: WSF_REQUEST): detachable WSF_METHOD_NOT_ALLOWED_RESPONSE
require require
req_attached: req /= Void req_attached: req /= Void
@@ -125,13 +125,13 @@ feature {NONE} -- Implementation
l_is_hidden := l_doc_mapping.documentation (i.request_methods).is_hidden l_is_hidden := l_doc_mapping.documentation (i.request_methods).is_hidden
end end
if not l_is_hidden then if not l_is_hidden then
create s.make_from_string (i.mapping.associated_resource) create s.make_from_string_general (i.mapping.associated_resource)
if attached i.request_methods as mtds then if attached i.request_methods as mtds then
s.append (" [ ") s.append (" [ ")
across across
mtds as mtds_c mtds as mtds_c
loop loop
s.append (mtds_c.item) s.append_string_general (mtds_c.item)
s.append_character (' ') s.append_character (' ')
end end
s.append ("]") s.append ("]")
@@ -169,7 +169,7 @@ feature {NONE} -- Implementation
end end
if not l_is_hidden then if not l_is_hidden then
ok := True ok := True
create s.make_from_string (i.mapping.associated_resource) create s.make_from_string_general (i.mapping.associated_resource)
if attached i.request_methods as mtds then if attached i.request_methods as mtds then
ok := False ok := False
s.append (" [ ") s.append (" [ ")
@@ -179,7 +179,7 @@ feature {NONE} -- Implementation
if m = Void or else m.is_case_insensitive_equal (c.item) then if m = Void or else m.is_case_insensitive_equal (c.item) then
ok := True ok := True
end end
s.append (c.item) s.append_string_general (c.item)
s.append_character (' ') s.append_character (' ')
end end
s.append ("]") s.append ("]")
@@ -196,7 +196,7 @@ feature {NONE} -- Implementation
end end
note note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -94,7 +94,7 @@ feature -- Access
file_name: READABLE_STRING_8 file_name: READABLE_STRING_8
obsolete obsolete
"Use `file_path.name' for unicode support [2013-may]" "Use `file_path.name' for unicode support [2017-05-31]"
do do
Result := file_path.utf_8_name Result := file_path.utf_8_name
end end
@@ -230,7 +230,7 @@ invariant
status_code_set: status_code /= 0 status_code_set: status_code /= 0
note note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -165,7 +165,7 @@ feature -- Access
file_name: READABLE_STRING_8 file_name: READABLE_STRING_8
obsolete obsolete
"Use `file_path.name' for unicode support [2013-may]" "Use `file_path.name' for unicode support [2017-05-31]"
do do
Result := file_path.utf_8_name Result := file_path.utf_8_name
end end
@@ -320,7 +320,7 @@ feature {NONE} -- Implementation: output
end end
note note
copyright: "2011-2016, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -101,9 +101,9 @@ feature {WSF_RESPONSE} -- Output
do do
create l_messages create l_messages
h := header h := header
if if
not attached recognized_methods as l_recognized_methods not attached recognized_methods as l_recognized_methods
or else l_recognized_methods.has (request.request_method.as_upper) or else l_recognized_methods.has (request.request_method.as_upper)
then then
res.set_status_code (l_messages.method_not_allowed) res.set_status_code (l_messages.method_not_allowed)
else else
@@ -130,7 +130,7 @@ feature {WSF_RESPONSE} -- Output
if request.is_content_type_accepted ({HTTP_MIME_TYPES}.text_html) then if request.is_content_type_accepted ({HTTP_MIME_TYPES}.text_html) then
s := "<html lang=%"en%"><head>" s := "<html lang=%"en%"><head>"
s.append ("<title>") s.append ("<title>")
s.append (html_encoder.encoded_string (request.request_uri)) s.append (html_encoder.general_encoded_string (request.request_uri))
s.append (l_html_error_code_text + "!!") s.append (l_html_error_code_text + "!!")
s.append ("</title>%N") s.append ("</title>%N")
s.append ( s.append (
@@ -160,7 +160,7 @@ feature {WSF_RESPONSE} -- Output
s.append (l_html_error_code_text + "</div>") s.append (l_html_error_code_text + "</div>")
s.append ("<div id=%"message%">" + l_html_error_code_text + ": the request method <code>") s.append ("<div id=%"message%">" + l_html_error_code_text + ": the request method <code>")
s.append (request.request_method) s.append (request.request_method)
s.append ("</code> is inappropriate for the URL for <code>" + html_encoder.encoded_string (request.request_uri) + "</code>.</div>") s.append ("</code> is inappropriate for the URL for <code>" + html_encoder.general_encoded_string (request.request_uri) + "</code>.</div>")
if attached suggested_methods as lst and then not lst.is_empty then if attached suggested_methods as lst and then not lst.is_empty then
s.append ("<div id=%"suggestions%"><strong>Allowed methods:</strong>") s.append ("<div id=%"suggestions%"><strong>Allowed methods:</strong>")
across across
@@ -186,17 +186,17 @@ feature {WSF_RESPONSE} -- Output
l_text := l_loc l_text := l_loc
end end
s.append ("<li>") s.append ("<li>")
s.append ("<a href=%"" + l_loc + "%">" + html_encoder.encoded_string (l_text.to_string_32) + "</a>") s.append ("<a href=%"" + l_loc + "%">" + html_encoder.general_encoded_string (l_text) + "</a>")
elseif l_text /= Void then elseif l_text /= Void then
s.append ("<li>") s.append ("<li>")
s.append (html_encoder.encoded_string (l_text.to_string_32)) s.append (html_encoder.general_encoded_string (l_text))
s.append ("</li>%N") s.append ("</li>%N")
end end
if (l_loc /= Void or l_text /= Void) then if (l_loc /= Void or l_text /= Void) then
if attached lst.item.description as l_desc then if attached lst.item.description as l_desc then
s.append ("<br/> - ") s.append ("<br/> - ")
s.append (html_encoder.encoded_string (l_desc.to_string_32)) s.append (html_encoder.general_encoded_string (l_desc))
s.append ("%N") s.append ("%N")
end end
s.append ("</li>%N") s.append ("</li>%N")
@@ -221,7 +221,7 @@ feature {WSF_RESPONSE} -- Output
else else
s := l_html_error_code_text + ": the request method " s := l_html_error_code_text + ": the request method "
s.append (request.request_method) s.append (request.request_method)
s.append (" is inappropriate for the URL for '" + html_encoder.encoded_string (request.request_uri) + "'.%N") s.append (" is inappropriate for the URL for '" + html_encoder.general_encoded_string (request.request_uri) + "'.%N")
if attached suggested_methods as lst and then not lst.is_empty then if attached suggested_methods as lst and then not lst.is_empty then
s.append ("Allowed methods:") s.append ("Allowed methods:")
across across
@@ -327,7 +327,7 @@ feature {NONE} -- Implementation
end end
note note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -76,7 +76,7 @@ feature {WSF_RESPONSE} -- Output
if request.is_content_type_accepted ({HTTP_MIME_TYPES}.text_html) then if request.is_content_type_accepted ({HTTP_MIME_TYPES}.text_html) then
s := "<html lang=%"en%"><head>" s := "<html lang=%"en%"><head>"
s.append ("<title>") s.append ("<title>")
s.append (html_encoder.encoded_string (request.request_uri)) s.append (html_encoder.general_encoded_string (request.request_uri))
s.append ("Error 404 (Not Found)") s.append ("Error 404 (Not Found)")
s.append ("</title>%N") s.append ("</title>%N")
s.append ("[ s.append ("[
@@ -101,7 +101,7 @@ feature {WSF_RESPONSE} -- Output
s.append ("<div class=%"inner2%"></div>") s.append ("<div class=%"inner2%"></div>")
s.append ("</div>") s.append ("</div>")
s.append ("Error 404 (Not Found)</div>") s.append ("Error 404 (Not Found)</div>")
s.append ("<div id=%"message%">Error 404 (Not Found): <code>" + html_encoder.encoded_string (request.request_uri) + "</code></div>") s.append ("<div id=%"message%">Error 404 (Not Found): <code>" + html_encoder.general_encoded_string (request.request_uri) + "</code></div>")
if attached suggested_items as lst and then not lst.is_empty then if attached suggested_items as lst and then not lst.is_empty then
s.append ("<div id=%"suggestions%"><strong>Perhaps you are looking for:</strong><ul>") s.append ("<div id=%"suggestions%"><strong>Perhaps you are looking for:</strong><ul>")
from from
@@ -116,17 +116,17 @@ feature {WSF_RESPONSE} -- Output
l_text := l_loc l_text := l_loc
end end
s.append ("<li>") s.append ("<li>")
s.append ("<a href=%"" + l_loc + "%">" + html_encoder.encoded_string (l_text.to_string_32) + "</a>") s.append ("<a href=%"" + l_loc + "%">" + html_encoder.general_encoded_string (l_text) + "</a>")
elseif l_text /= Void then elseif l_text /= Void then
s.append ("<li>") s.append ("<li>")
s.append (html_encoder.encoded_string (l_text.to_string_32)) s.append (html_encoder.general_encoded_string (l_text))
s.append ("</li>%N") s.append ("</li>%N")
end end
if (l_loc /= Void or l_text /= Void) then if (l_loc /= Void or l_text /= Void) then
if attached lst.item.description as l_desc then if attached lst.item.description as l_desc then
s.append ("<br/> - ") s.append ("<br/> - ")
s.append (html_encoder.encoded_string (l_desc.to_string_32)) s.append (html_encoder.general_encoded_string (l_desc))
s.append ("%N") s.append ("%N")
end end
s.append ("</li>%N") s.append ("</li>%N")
@@ -198,7 +198,7 @@ feature {WSF_RESPONSE} -- Output
end end
note note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -61,7 +61,7 @@ feature {WSF_RESPONSE} -- Output
if request.is_content_type_accepted ({HTTP_MIME_TYPES}.text_html) then if request.is_content_type_accepted ({HTTP_MIME_TYPES}.text_html) then
s := "<html lang=%"en%"><head>" s := "<html lang=%"en%"><head>"
s.append ("<title>") s.append ("<title>")
s.append (html_encoder.encoded_string (request.request_uri)) s.append (html_encoder.general_encoded_string (request.request_uri))
s.append ("Error 412 (Precondition Failed)") s.append ("Error 412 (Precondition Failed)")
s.append ("</title>%N") s.append ("</title>%N")
s.append ("[ s.append ("[
@@ -84,7 +84,7 @@ feature {WSF_RESPONSE} -- Output
s.append ("<div class=%"inner2%"></div>") s.append ("<div class=%"inner2%"></div>")
s.append ("</div>") s.append ("</div>")
s.append ("Error 412 (Precondition Failed)</div>") s.append ("Error 412 (Precondition Failed)</div>")
s.append ("<div id=%"message%">Error 412 (Precondition Failed): <code>" + html_encoder.encoded_string (request.request_uri) + "</code></div>") s.append ("<div id=%"message%">Error 412 (Precondition Failed): <code>" + html_encoder.general_encoded_string (request.request_uri) + "</code></div>")
if attached body as b then if attached body as b then
s.append ("<div>") s.append ("<div>")
s.append (b) s.append (b)
@@ -116,7 +116,7 @@ feature {WSF_RESPONSE} -- Output
note note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -346,7 +346,7 @@ feature -- Helper
is_request_method (m: READABLE_STRING_GENERAL): BOOLEAN is_request_method (m: READABLE_STRING_GENERAL): BOOLEAN
-- Is `m' the Current request_method? -- Is `m' the Current request_method?
do do
Result := request_method.is_case_insensitive_equal (m.as_string_8) Result := m.is_case_insensitive_equal (request_method)
end end
is_put_request_method: BOOLEAN is_put_request_method: BOOLEAN
@@ -691,7 +691,7 @@ feature -- Access: CGI Meta variables
do do
meta_variables_table.force (new_string_value (a_name, a_value), a_name) meta_variables_table.force (new_string_value (a_name, a_value), a_name)
ensure ensure
param_set: attached {WSF_STRING} meta_variable (a_name) as val and then val.url_encoded_value.same_string (a_value) param_set: attached {WSF_STRING} meta_variable (a_name) as val and then a_value.same_string_general (val.url_encoded_value)
end end
unset_meta_variable (a_name: READABLE_STRING_GENERAL) unset_meta_variable (a_name: READABLE_STRING_GENERAL)
@@ -842,7 +842,7 @@ feature -- Access: CGI meta parameters - 1.1
if pi.is_empty then if pi.is_empty then
l_result := "" l_result := ""
elseif pi.count = 1 and then pi[1] = '/' then elseif pi.count = 1 and then pi[1] = '/' then
l_result := "/" l_result := "/"
else else
r := request_uri r := request_uri
i := r.index_of ('?', 1) i := r.index_of ('?', 1)
@@ -2110,7 +2110,7 @@ invariant
wgi_request.content_type /= Void implies content_type /= Void wgi_request.content_type /= Void implies content_type /= Void
note note
copyright: "2011-2016, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others" copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ source: "[
Eiffel Software Eiffel Software

View File

@@ -38,7 +38,7 @@ feature -- Element change
v: READABLE_STRING_8 v: READABLE_STRING_8
do do
if a_text /= Void then if a_text /= Void then
v := html_encoded_string (a_text.to_string_32) v := html_encoded_string (a_text)
across across
options as o options as o
loop loop
@@ -69,7 +69,7 @@ feature -- Element change
v: READABLE_STRING_8 v: READABLE_STRING_8
do do
if a_text /= Void then if a_text /= Void then
v := html_encoded_string (a_text.to_string_32) v := html_encoded_string (a_text)
across across
options as o options as o
loop loop

View File

@@ -10,17 +10,19 @@ class
inherit inherit
WSF_FORM_SELECTABLE_ITEM WSF_FORM_SELECTABLE_ITEM
SHARED_HTML_ENCODER
create create
make make
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (a_value: like value; a_text: detachable like text) make (a_value: READABLE_STRING_GENERAL; a_text: detachable like text)
-- Initialize `Current'. -- Initialize `Current'.
do do
value := a_value value := a_value.as_string_32
if a_text = Void then if a_text = Void then
text := a_value text := html_encoder.general_encoded_string (a_value)
else else
text := a_text text := a_text
end end
@@ -30,9 +32,9 @@ feature -- Status
is_selected: BOOLEAN is_selected: BOOLEAN
is_same_value (v: READABLE_STRING_32): BOOLEAN is_same_value (v: READABLE_STRING_GENERAL): BOOLEAN
do do
Result := value.same_string (v) Result := value.same_string_general (v)
end end
is_same_text (v: like text): BOOLEAN is_same_text (v: like text): BOOLEAN

View File

@@ -12,7 +12,7 @@ feature -- Status report
deferred deferred
end end
is_same_value (v: READABLE_STRING_32): BOOLEAN is_same_value (v: READABLE_STRING_GENERAL): BOOLEAN
deferred deferred
end end

View File

@@ -9,9 +9,9 @@ class
feature -- Converter feature -- Converter
html_encoded_string (s: READABLE_STRING_32): READABLE_STRING_8 html_encoded_string (s: READABLE_STRING_GENERAL): READABLE_STRING_8
do do
Result := html_encoder.encoded_string (s) Result := html_encoder.general_encoded_string (s)
end end
html_encoder: HTML_ENCODER html_encoder: HTML_ENCODER

View File

@@ -16,27 +16,27 @@ feature -- Access
-- indicate that the form shouldnt be validated when submitted. -- indicate that the form shouldnt be validated when submitted.
-- it's only applicable to input type=submit or image. -- it's only applicable to input type=submit or image.
formaction: detachable READABLE_STRING_32 formaction: detachable READABLE_STRING_8
-- formaction specifies the file or application that will submit the form. -- formaction specifies the file or application that will submit the form.
-- It has the same effect as the action attribute on the form element and -- It has the same effect as the action attribute on the form element and
-- can only be used with a submit or image button (type="submit" or type="image"). -- can only be used with a submit or image button (type="submit" or type="image").
-- When the form is submitted, the browser first checks for a formaction attribute; -- When the form is submitted, the browser first checks for a formaction attribute;
-- if that isnt present, it proceeds to look for an action attribute on the form. -- if that isnt present, it proceeds to look for an action attribute on the form.
formenctype: detachable READABLE_STRING_32 formenctype: detachable READABLE_STRING_8
-- formenctype details how the form data is encoded with the POST method type. -- formenctype details how the form data is encoded with the POST method type.
-- It has the same effect as the enctype attribute on the form element and -- It has the same effect as the enctype attribute on the form element and
-- can only be used with a submit or image button (type="submit" or type="image"). -- can only be used with a submit or image button (type="submit" or type="image").
-- The default value if not included is application/x-www-formurlencoded. -- The default value if not included is application/x-www-formurlencoded.
--! At the moment the value is not validated. --! At the moment the value is not validated.
formmethod: detachable READABLE_STRING_32 formmethod: detachable READABLE_STRING_8
-- formmethod specifies which HTTP method (GET, POST, PUT, DELETE) will be used to submit the form data. -- formmethod specifies which HTTP method (GET, POST, PUT, DELETE) will be used to submit the form data.
-- It has the same effect as the method attribute on the form element and can only be used with a -- It has the same effect as the method attribute on the form element and can only be used with a
-- submit or image button (type="submit" or type="image"). -- submit or image button (type="submit" or type="image").
--!At the moment the value is not validated. --!At the moment the value is not validated.
formtarget: detachable READABLE_STRING_32 formtarget: detachable READABLE_STRING_8
-- formtarget specifies the target window for the form results. -- formtarget specifies the target window for the form results.
-- It has the same effect as the target attribute on the form element and can only be used with a submit or image button (type="submit" or type="image"). -- It has the same effect as the target attribute on the form element and can only be used with a submit or image button (type="submit" or type="image").
@@ -60,39 +60,47 @@ feature -- Element Change
formnovalidate_false: not formnovalidate formnovalidate_false: not formnovalidate
end end
set_formaction (a_action: READABLE_STRING_32) set_formaction (a_action: READABLE_STRING_GENERAL)
-- Set `formaction' with `a_action'. -- Set `formaction' with `a_action'.
-- Example:<input type="submit" value="Submit" formaction="/users"> -- Example:<input type="submit" value="Submit" formaction="/users">
require
is_valid_as_string_8: a_action.is_valid_as_string_8
do do
formaction := a_action formaction := a_action.to_string_8
ensure ensure
formaction_set: attached formaction as l_action implies l_action = a_action formaction_set: attached formaction as l_action implies l_action = a_action
end end
set_formenctype (a_enctype: READABLE_STRING_32) set_formenctype (a_enctype: READABLE_STRING_GENERAL)
-- Set `formenctype' with `a_enctype'. -- Set `formenctype' with `a_enctype'.
-- Example: <input type="submit" value="Submit" formenctype="application/x-www-form-urlencoded"> -- Example: <input type="submit" value="Submit" formenctype="application/x-www-form-urlencoded">
require
is_valid_as_string_8: a_enctype.is_valid_as_string_8
do do
formenctype := a_enctype formenctype := a_enctype.to_string_8
ensure ensure
formenctype_set: attached formenctype as l_enctype implies l_enctype = a_enctype formenctype_set: attached formenctype as l_enctype implies l_enctype = a_enctype
end end
set_formmethod (a_method: READABLE_STRING_32) set_formmethod (a_method: READABLE_STRING_GENERAL)
-- Set `formmethod' with `a_method'. -- Set `formmethod' with `a_method'.
-- Example: <input type="submit" value="Submit" formmethod="POST"> -- Example: <input type="submit" value="Submit" formmethod="POST">
--! require is_valid_method: [PUT, POST, DELETE, GET, ...] --! require is_valid_method: [PUT, POST, DELETE, GET, ...]
require
is_valid_as_string_8: a_method.is_valid_as_string_8
do do
formmethod := a_method formmethod := a_method.to_string_8
ensure ensure
formmethod_set: attached formmethod as l_method implies l_method = a_method formmethod_set: attached formmethod as l_method implies l_method = a_method
end end
set_formtarget (a_target: READABLE_STRING_32) set_formtarget (a_target: READABLE_STRING_GENERAL)
-- Set `formtarget' with `a_target'. -- Set `formtarget' with `a_target'.
-- Example: <input type="submit" value="Submit" formtarget="_self"> -- Example: <input type="submit" value="Submit" formtarget="_self">
require
is_valid_as_string_8: a_target.is_valid_as_string_8
do do
formtarget := a_target formtarget := a_target.to_string_8
ensure ensure
formtarget_set: attached formtarget as l_target implies l_target = a_target formtarget_set: attached formtarget as l_target implies l_target = a_target
end end

View File

@@ -184,7 +184,7 @@ feature -- Change
end end
extend_text (t: READABLE_STRING_8) extend_text (t: READABLE_STRING_8)
obsolete "Use extend_html_text (..) 2013-Sept-06" obsolete "Use extend_html_text (..) [2017-05-31]"
do do
extend_html_text (t) extend_html_text (t)
end end

View File

@@ -111,9 +111,9 @@ feature -- Execution
i := l_raw_header.substring_index ("%R%N", 1) i := l_raw_header.substring_index ("%R%N", 1)
if i > 0 then if i > 0 then
-- Skip the first status line. -- Skip the first status line.
create h.make_from_raw_header_data (l_raw_header.substring (i + 2, l_raw_header.count)) create h.make_from_raw_header_data (l_raw_header.substring (i + 2, l_raw_header.count).as_string_8_conversion) -- NOTE: it is string 8 per nature.
else else
create h.make_from_raw_header_data (l_raw_header) create h.make_from_raw_header_data (l_raw_header.as_string_8_conversion)
end end
if attached l_remote_uri.host as l_remote_host then if attached l_remote_uri.host as l_remote_host then
if l_remote_uri.port > 0 then if l_remote_uri.port > 0 then

View File

@@ -50,7 +50,7 @@ feature -- Access
create Result.make (l_title) create Result.make (l_title)
Result.set_description (xml_element_text (x_feed, "subtitle"), "plain") Result.set_description (xml_element_text (x_feed, "subtitle"), "plain")
Result.set_id (xml_element_text (x_feed, "id")) Result.set_id (xml_element_text (x_feed, "id"))
Result.set_updated_date_with_text (xml_element_text (x_feed, "updated")) Result.set_date_with_text (xml_element_text (x_feed, "updated"))
if attached links_from_xml (x_feed, "link") as l_links then if attached links_from_xml (x_feed, "link") as l_links then
across across
l_links as link_ic l_links as link_ic
@@ -68,7 +68,7 @@ feature -- Access
create e.make (e_title) create e.make (e_title)
e.set_description (xml_element_text (x_entry, "summary")) e.set_description (xml_element_text (x_entry, "summary"))
e.set_id (xml_element_text (x_entry, "id")) e.set_id (xml_element_text (x_entry, "id"))
e.set_updated_date_with_text (xml_element_text (x_entry, "updated")) e.set_date_with_text (xml_element_text (x_entry, "updated"))
if attached links_from_xml (x_entry, "link") as l_links then if attached links_from_xml (x_entry, "link") as l_links then
across across

View File

@@ -14,7 +14,7 @@ inherit
create create
make make
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (a_title: READABLE_STRING_GENERAL) make (a_title: READABLE_STRING_GENERAL)
do do
@@ -55,7 +55,7 @@ feature -- Access
Result := items.new_cursor Result := items.new_cursor
end end
feature -- Element change feature -- Element change
set_description (a_description: detachable READABLE_STRING_GENERAL; a_description_content_type: like description_content_type) set_description (a_description: detachable READABLE_STRING_GENERAL; a_description_content_type: like description_content_type)
-- Set `description' with `a_description' and optional content type `text:$a_description_content_type'. -- Set `description' with `a_description' and optional content type `text:$a_description_content_type'.
@@ -80,8 +80,8 @@ feature -- Element change
set_updated_date_with_text (a_date_text: detachable READABLE_STRING_32) set_updated_date_with_text (a_date_text: detachable READABLE_STRING_32)
-- Set `date' from date string representation `a_date_text'. -- Set `date' from date string representation `a_date_text'.
obsolete obsolete
"Use set_date_with_text [oct/2015]" "Use set_date_with_text [2017-05-31]"
do do
set_date_with_text (a_date_text) set_date_with_text (a_date_text)
end end
@@ -112,7 +112,7 @@ feature -- Element change
-- Remove feed item `a_item' from Current list of feed items. -- Remove feed item `a_item' from Current list of feed items.
do do
items.prune (a_item) items.prune (a_item)
end end
extended alias "+" (a_feed: FEED): FEED extended alias "+" (a_feed: FEED): FEED
-- New feed object made from Current merged with a_feed. -- New feed object made from Current merged with a_feed.

View File

@@ -22,7 +22,7 @@ inherit
create create
make make
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (a_title: READABLE_STRING_GENERAL) make (a_title: READABLE_STRING_GENERAL)
do do
@@ -157,8 +157,8 @@ feature -- Element change
set_updated_date_with_text (a_date_text: detachable READABLE_STRING_32) set_updated_date_with_text (a_date_text: detachable READABLE_STRING_32)
-- Set `date' from date string representation `a_date_text'. -- Set `date' from date string representation `a_date_text'.
obsolete obsolete
"Use set_date_with_text [oct/2015]" "Use set_date_with_text [2017-05-31]"
do do
set_date_with_text (a_date_text) set_date_with_text (a_date_text)
end end

View File

@@ -52,7 +52,7 @@ feature -- Access
if attached xml_element_text (x_channel, "title") as x_title then if attached xml_element_text (x_channel, "title") as x_title then
create Result.make (x_title) create Result.make (x_title)
Result.set_description (xml_element_text (x_channel, "description"), "xhtml") Result.set_description (xml_element_text (x_channel, "description"), "xhtml")
Result.set_updated_date_with_text (xml_element_text (x_channel, "lastBuildDate")) Result.set_date_with_text (xml_element_text (x_channel, "lastBuildDate"))
if attached links_from_xml (x_channel, "link") as l_links then if attached links_from_xml (x_channel, "link") as l_links then
across across
l_links as link_ic l_links as link_ic
@@ -69,7 +69,7 @@ feature -- Access
if attached xml_element_text (x_item, "title") as e_title then if attached xml_element_text (x_item, "title") as e_title then
create e.make (e_title) create e.make (e_title)
e.set_description (xml_element_text (x_item, "description")) e.set_description (xml_element_text (x_item, "description"))
e.set_updated_date_with_text (xml_element_text (x_item, "pubDate")) e.set_date_with_text (xml_element_text (x_item, "pubDate"))
e.set_id (xml_element_text (x_item, "guid")) e.set_id (xml_element_text (x_item, "guid"))

View File

@@ -130,7 +130,7 @@ feature -- Visitor
s.append_string_general ("@") s.append_string_general ("@")
s.append_string (a_link.relation) s.append_string (a_link.relation)
s.append_string (" -> ") s.append_string (" -> ")
s.append_string (a_link.href) s.append_string_general (a_link.href)
append_text (s) append_text (s)
end end

View File

@@ -3,11 +3,11 @@
<target name="uri_template"> <target name="uri_template">
<root all_classes="true"/> <root all_classes="true"/>
<file_rule> <file_rule>
<exclude>/.git$</exclude> <exclude>/\.git$</exclude>
<exclude>/.svn$</exclude> <exclude>/\.svn$</exclude>
<exclude>/EIFGENs$</exclude> <exclude>/EIFGENs$</exclude>
</file_rule> </file_rule>
<option warning="true" void_safety="all"> <option warning="true" void_safety="all">
</option> </option>
<setting name="concurrency" value="scoop"/> <setting name="concurrency" value="scoop"/>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/> <library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>

View File

@@ -3,11 +3,11 @@
<target name="uri_template"> <target name="uri_template">
<root all_classes="true"/> <root all_classes="true"/>
<file_rule> <file_rule>
<exclude>/.git$</exclude> <exclude>/\.git$</exclude>
<exclude>/.svn$</exclude> <exclude>/\.svn$</exclude>
<exclude>/EIFGENs$</exclude> <exclude>/EIFGENs$</exclude>
</file_rule> </file_rule>
<option warning="true" void_safety="none"> <option warning="true" void_safety="none">
</option> </option>
<setting name="concurrency" value="scoop"/> <setting name="concurrency" value="scoop"/>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/> <library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>

View File

@@ -34,21 +34,21 @@ def set_last_run_CI_tests_failed(m):
f.close() f.close()
def report_failure(msg, a_code=2): def report_failure(msg, a_code=2):
print msg print (msg)
set_last_run_CI_tests_failed(msg) set_last_run_CI_tests_failed(msg)
sys.exit(a_code) sys.exit(a_code)
# Override system command. # Override system command.
# run command. if not successful, complain and exit with error # run command. if not successful, complain and exit with error
def eval_cmd(cmd): def eval_cmd(cmd):
# print cmd # print (cmd)
res = subprocess.call (cmd, shell=True) res = subprocess.call (cmd, shell=True)
if res != 0: if res != 0:
report_failure ("Failed running: %s (returncode=%s)" % (cmd, res), 2) report_failure ("Failed running: %s (returncode=%s)" % (cmd, res), 2)
return res return res
def eval_cmd_output(cmd, ignore_error=False): def eval_cmd_output(cmd, ignore_error=False):
# print cmd # print (cmd)
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if p: if p:
o = p.communicate()[0] o = p.communicate()[0]
@@ -80,17 +80,17 @@ def runTestForProject(where):
# clobber = (len(sys.argv) >= 2 and sys.argv[1] == "-clobber") or (last_build_had_failure()) # clobber = (len(sys.argv) >= 2 and sys.argv[1] == "-clobber") or (last_build_had_failure())
if clobber: if clobber:
reset_last_run_CI_tests_failed() reset_last_run_CI_tests_failed()
print "## Cleaning previous tests" print ("## Cleaning previous tests")
rm_dir("EIFGENs") rm_dir("EIFGENs")
# compile the restbucks # compile the restbucks
print "# Compiling restbucks example" print ("# Compiling restbucks example")
cmd = "ecb -config %s -target restbucks -batch -c_compile -project_path . " % (os.path.join ("examples", "restbucksCRUD", "restbucks-safe.ecf")) cmd = "ecb -config %s -target restbucks -batch -c_compile -project_path . " % (os.path.join ("examples", "rest", "restbucks_CRUD", "restbucks.ecf"))
res = eval_cmd(cmd) res = eval_cmd(cmd)
sleep(1) sleep(1)
print "# check compile_all tests" print ("# check compile_all tests")
if not os.path.exists(os.path.join ("tests", "temp")): if not os.path.exists(os.path.join ("tests", "temp")):
os.makedirs (os.path.join ("tests", "temp")) os.makedirs (os.path.join ("tests", "temp"))
@@ -102,12 +102,12 @@ def runTestForProject(where):
cmd = "%s -keep passed" % (cmd) # forget about failed one .. we'll try again next time cmd = "%s -keep passed" % (cmd) # forget about failed one .. we'll try again next time
if clobber: if clobber:
cmd = "%s -clean" % (cmd) cmd = "%s -clean" % (cmd)
print "command: %s" % (cmd) print ("command: %s" % (cmd))
(res, res_output) = eval_cmd_output(cmd) (res, res_output) = eval_cmd_output(cmd)
if res != 0: if res != 0:
report_failure("compile_all failed", 2) report_failure("compile_all failed", 2)
print "# Analyze check_compilations results" print ("# Analyze check_compilations results")
lines = re.split ("\n", res_output) lines = re.split ("\n", res_output)
regexp = "^(\S+)\s+(\S+)\s+from\s+(\S+)\s+\(([^\)]+)\)\.\.\.(\S+)$" regexp = "^(\S+)\s+(\S+)\s+from\s+(\S+)\s+\(([^\)]+)\)\.\.\.(\S+)$"
p = re.compile (regexp); p = re.compile (regexp);
@@ -122,14 +122,14 @@ def runTestForProject(where):
else: else:
non_failures.append ({"name": p_res.group(2), "target": p_res.group(3), "ecf": p_res.group(4), "result": p_res.group(5)}) non_failures.append ({"name": p_res.group(2), "target": p_res.group(3), "ecf": p_res.group(4), "result": p_res.group(5)})
for non_fails in non_failures: for non_fails in non_failures:
print "[%s] %s : %s @ %s" % (non_fails["result"], non_fails["name"], non_fails["ecf"], non_fails["target"]) print ("[%s] %s : %s @ %s" % (non_fails["result"], non_fails["name"], non_fails["ecf"], non_fails["target"]))
for fails in failures: for fails in failures:
print "[FAILURE] %s : %s @ %s" % (fails["name"], fails["ecf"], fails["target"]) print ("[FAILURE] %s : %s @ %s" % (fails["name"], fails["ecf"], fails["target"]))
sleep(1) sleep(1)
if len(failures) > 0: if len(failures) > 0:
report_failure ("Failure(s) occurred", 2) report_failure ("Failure(s) occurred", 2)
print "# End..." print ("# End...")
if __name__ == '__main__': if __name__ == '__main__':
runTestForProject(os.path.join (os.getcwd(), '..')) runTestForProject(os.path.join (os.getcwd(), '..'))