Skip to content

Commit 881625a

Browse files
committed
Updated code to remove obsolete call on recent version of json library.
Updated upload_image example to use PATH instead of DIRECTORY_NAME or similar. Removed unused local variables.
1 parent b7a12ed commit 881625a

File tree

25 files changed

+131
-112
lines changed

25 files changed

+131
-112
lines changed

draft/library/server/wsf_js_widget/examples/demo/autocompletion/contact_autocompletion.e

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,27 @@ feature -- Implementation
3030
local
3131
o: JSON_OBJECT
3232
do
33-
create Result.make_array
33+
create Result.make_empty
3434
across
3535
list as c
3636
loop
37-
if attached {STRING} c.item.item (1) as value and attached {STRING} c.item.item (3) as img and attached {STRING} c.item.item (2) as company then
37+
if
38+
attached c.item.value as value and
39+
attached c.item.img as img and
40+
attached c.item.company as company
41+
then
3842
if value.as_lower.has_substring (input.as_lower) then
3943
create o.make
40-
o.put (create {JSON_STRING}.make_json (img), "img")
41-
o.put (create {JSON_STRING}.make_json (value), "value")
42-
o.put (create {JSON_STRING}.make_json (company), "company")
44+
o.put (create {JSON_STRING}.make_from_string (img), "img")
45+
o.put (create {JSON_STRING}.make_from_string (value), "value")
46+
o.put (create {JSON_STRING}.make_from_string (company), "company")
4347
Result.add (o)
4448
end
4549
end
4650
end
4751
end
4852

49-
list: ITERABLE [TUPLE [STRING, STRING]]
53+
list: ITERABLE [TUPLE [value: STRING; company: STRING; img: STRING]]
5054
-- List of contacts
5155

5256
end

draft/library/server/wsf_js_widget/examples/demo/autocompletion/flag_autocompletion.e

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ feature -- Implementation
3333
list := <<["AF", {STRING_32} "Afghanistan"], ["AX", {STRING_32} "Åland Islands"], ["AL", {STRING_32} "Albania"],
3434
["DZ", {STRING_32} "Algeria"], ["AS", {STRING_32} "American Samoa"],
3535
["AD", {STRING_32} "Andorra"], ["AO", {STRING_32} "Angola"], ["AI", {STRING_32} "Anguilla"],
36-
["AQ", {STRING_32} "Antarctica"], ["AG", {STRING_32} "Antigua and Barbuda"],
36+
["AQ", {STRING_32} "Antarctica"], ["AG", {STRING_32} "Antigua and Barbuda"],
3737
["AR", {STRING_32} "Argentina"], ["AM", {STRING_32} "Armenia"], ["AW", {STRING_32} "Aruba"],
38-
["AU", {STRING_32} "Australia"], ["AT", {STRING_32} "Austria"], ["AZ", {STRING_32} "Azerbaijan"],
38+
["AU", {STRING_32} "Australia"], ["AT", {STRING_32} "Austria"], ["AZ", {STRING_32} "Azerbaijan"],
3939
["BS", {STRING_32} "Bahamas"], ["BH", {STRING_32} "Bahrain"], ["BD", {STRING_32} "Bangladesh"],
4040
["BB", {STRING_32} "Barbados"], ["BY", {STRING_32} "Belarus"], ["BE", {STRING_32} "Belgium"],
4141
["BZ", {STRING_32} "Belize"], ["BJ", {STRING_32} "Benin"], ["BM", {STRING_32} "Bermuda"],
4242
["BT", {STRING_32} "Bhutan"], ["BO", {STRING_32} "Bolivia, Plurinational State of"],
4343
["BQ", {STRING_32} "Bonaire, Sint Eustatius and Saba"], ["BA", {STRING_32} "Bosnia and Herzegovina"],
4444
["BW", {STRING_32} "Botswana"], ["BV", {STRING_32} "Bouvet Island"],
45-
["BR", {STRING_32} "Brazil"], ["IO", {STRING_32} "British Indian Ocean Territory"],
46-
["BN", {STRING_32} "Brunei Darussalam"], ["BG", {STRING_32} "Bulgaria"],
45+
["BR", {STRING_32} "Brazil"], ["IO", {STRING_32} "British Indian Ocean Territory"],
46+
["BN", {STRING_32} "Brunei Darussalam"], ["BG", {STRING_32} "Bulgaria"],
4747
["BF", {STRING_32} "Burkina Faso"], ["BI", {STRING_32} "Burundi"], ["KH", {STRING_32} "Cambodia"],
4848
["CM", {STRING_32} "Cameroon"], ["CA", {STRING_32} "Canada"], ["CV", {STRING_32} "Cape Verde"],
49-
["KY", {STRING_32} "Cayman Islands"], ["CF", {STRING_32} "Central African Republic"],
49+
["KY", {STRING_32} "Cayman Islands"], ["CF", {STRING_32} "Central African Republic"],
5050
["TD", {STRING_32} "Chad"], ["CL", {STRING_32} "Chile"], ["CN", {STRING_32} "China"],
51-
["CX", {STRING_32} "Christmas Island"], ["CC", {STRING_32} "Cocos (Keeling) Islands"],
51+
["CX", {STRING_32} "Christmas Island"], ["CC", {STRING_32} "Cocos (Keeling) Islands"],
5252
["CO", {STRING_32} "Colombia"], ["KM", {STRING_32} "Comoros"], ["CG", {STRING_32} "Congo"],
5353
["CD", {STRING_32} "Congo, the Democratic Republic of the"], ["CK", {STRING_32} "Cook Islands"],
5454
["CR", {STRING_32} "Costa Rica"], ["CI", {STRING_32} "Côte d'Ivoire"],
@@ -61,11 +61,11 @@ feature -- Implementation
6161
["FO", {STRING_32} "Faroe Islands"], ["FJ", {STRING_32} "Fiji"], ["FI", {STRING_32} "Finland"],
6262
["FR", {STRING_32} "France"], ["GF", {STRING_32} "French Guiana"],
6363
["PF", {STRING_32} "French Polynesia"], ["TF", {STRING_32} "French Southern Territories"],
64-
["GA", {STRING_32} "Gabon"], ["GM", {STRING_32} "Gambia"], ["GE", {STRING_32} "Georgia"],
64+
["GA", {STRING_32} "Gabon"], ["GM", {STRING_32} "Gambia"], ["GE", {STRING_32} "Georgia"],
6565
["DE", {STRING_32} "Germany"], ["GH", {STRING_32} "Ghana"], ["GI", {STRING_32} "Gibraltar"],
6666
["GR", {STRING_32} "Greece"], ["GL", {STRING_32} "Greenland"], ["GD", {STRING_32} "Grenada"],
67-
["GP", {STRING_32} "Guadeloupe"], ["GU", {STRING_32} "Guam"], ["GT", {STRING_32} "Guatemala"],
68-
["GG", {STRING_32} "Guernsey"], ["GN", {STRING_32} "Guinea"], ["GW", {STRING_32} "Guinea-Bissau"],
67+
["GP", {STRING_32} "Guadeloupe"], ["GU", {STRING_32} "Guam"], ["GT", {STRING_32} "Guatemala"],
68+
["GG", {STRING_32} "Guernsey"], ["GN", {STRING_32} "Guinea"], ["GW", {STRING_32} "Guinea-Bissau"],
6969
["GY", {STRING_32} "Guyana"], ["HT", {STRING_32} "Haiti"], ["HM", {STRING_32} "Heard Island and McDonald Islands"],
7070
["VA", {STRING_32} "Holy See (Vatican City State)"],
7171
["HN", {STRING_32} "Honduras"], ["HK", {STRING_32} "Hong Kong"], ["HU", {STRING_32} "Hungary"],
@@ -92,48 +92,48 @@ feature -- Implementation
9292
["NA", {STRING_32} "Namibia"], ["NR", {STRING_32} "Nauru"], ["NP", {STRING_32} "Nepal"],
9393
["NL", {STRING_32} "Netherlands"], ["NC", {STRING_32} "New Caledonia"], ["NZ", {STRING_32} "New Zealand"],
9494
["NI", {STRING_32} "Nicaragua"], ["NE", {STRING_32} "Niger"],
95-
["NG", {STRING_32} "Nigeria"], ["NU", {STRING_32} "Niue"], ["NF", {STRING_32} "Norfolk Island"],
95+
["NG", {STRING_32} "Nigeria"], ["NU", {STRING_32} "Niue"], ["NF", {STRING_32} "Norfolk Island"],
9696
["MP", {STRING_32} "Northern Mariana Islands"], ["NO", {STRING_32} "Norway"],
9797
["OM", {STRING_32} "Oman"], ["PK", {STRING_32} "Pakistan"], ["PW", {STRING_32} "Palau"],
9898
["PS", {STRING_32} "Palestinian Territory, Occupied"], ["PA", {STRING_32} "Panama"],
99-
["PG", {STRING_32} "Papua New Guinea"], ["PY", {STRING_32} "Paraguay"], ["PE", {STRING_32} "Peru"],
99+
["PG", {STRING_32} "Papua New Guinea"], ["PY", {STRING_32} "Paraguay"], ["PE", {STRING_32} "Peru"],
100100
["PH", {STRING_32} "Philippines"], ["PN", {STRING_32} "Pitcairn"],
101101
["PL", {STRING_32} "Poland"], ["PT", {STRING_32} "Portugal"], ["PR", {STRING_32} "Puerto Rico"],
102102
["QA", {STRING_32} "Qatar"], ["RE", {STRING_32} "Réunion"], ["RO", {STRING_32} "Romania"],
103103
["RU", {STRING_32} "Russian Federation"], ["RW", {STRING_32} "Rwanda"], ["BL", {STRING_32} "Saint Barthélemy"],
104104
["SH", {STRING_32} "Saint Helena, Ascension and Tristan da Cunha"],
105-
["KN", {STRING_32} "Saint Kitts and Nevis"], ["LC", {STRING_32} "Saint Lucia"], ["MF", {STRING_32} "Saint Martin (French part)"],
105+
["KN", {STRING_32} "Saint Kitts and Nevis"], ["LC", {STRING_32} "Saint Lucia"], ["MF", {STRING_32} "Saint Martin (French part)"],
106106
["PM", {STRING_32} "Saint Pierre and Miquelon"],
107-
["VC", {STRING_32} "Saint Vincent and the Grenadines"], ["WS", {STRING_32} "Samoa"],
107+
["VC", {STRING_32} "Saint Vincent and the Grenadines"], ["WS", {STRING_32} "Samoa"],
108108
["SM", {STRING_32} "San Marino"], ["ST", {STRING_32} "Sao Tome and Principe"],
109109
["SA", {STRING_32} "Saudi Arabia"], ["SN", {STRING_32} "Senegal"], ["RS", {STRING_32} "Serbia"],
110110
["SC", {STRING_32} "Seychelles"], ["SL", {STRING_32} "Sierra Leone"],
111-
["SG", {STRING_32} "Singapore"], ["SX", {STRING_32} "Sint Maarten (Dutch part)"], ["SK", {STRING_32} "Slovakia"],
111+
["SG", {STRING_32} "Singapore"], ["SX", {STRING_32} "Sint Maarten (Dutch part)"], ["SK", {STRING_32} "Slovakia"],
112112
["SI", {STRING_32} "Slovenia"], ["SB", {STRING_32} "Solomon Islands"],
113-
["SO", {STRING_32} "Somalia"], ["ZA", {STRING_32} "South Africa"], ["GS", {STRING_32} "South Georgia and the South Sandwich Islands"],
114-
["SS", {STRING_32} "South Sudan"],
113+
["SO", {STRING_32} "Somalia"], ["ZA", {STRING_32} "South Africa"], ["GS", {STRING_32} "South Georgia and the South Sandwich Islands"],
114+
["SS", {STRING_32} "South Sudan"],
115115
["ES", {STRING_32} "Spain"], ["LK", {STRING_32} "Sri Lanka"], ["SD", {STRING_32} "Sudan"], ["SR", {STRING_32} "Suriname"],
116-
["SJ", {STRING_32} "Svalbard and Jan Mayen"],
116+
["SJ", {STRING_32} "Svalbard and Jan Mayen"],
117117
["SZ", {STRING_32} "Swaziland"], ["SE", {STRING_32} "Sweden"], ["CH", {STRING_32} "Switzerland"],
118-
["SY", {STRING_32} "Syrian Arab Republic"],
118+
["SY", {STRING_32} "Syrian Arab Republic"],
119119
["TW", {STRING_32} "Taiwan, Province of China"], ["TJ", {STRING_32} "Tajikistan"],
120120
["TZ", {STRING_32} "Tanzania, United Republic of"], ["TH", {STRING_32} "Thailand"],
121-
["TL", {STRING_32} "Timor-Leste"], ["TG", {STRING_32} "Togo"], ["TK", {STRING_32} "Tokelau"],
121+
["TL", {STRING_32} "Timor-Leste"], ["TG", {STRING_32} "Togo"], ["TK", {STRING_32} "Tokelau"],
122122
["TO", {STRING_32} "Tonga"], ["TT", {STRING_32} "Trinidad and Tobago"],
123123
["TN", {STRING_32} "Tunisia"], ["TR", {STRING_32} "Turkey"], ["TM", {STRING_32} "Turkmenistan"],
124124
["TC", {STRING_32} "Turks and Caicos Islands"], ["TV", {STRING_32} "Tuvalu"],
125125
["UG", {STRING_32} "Uganda"], ["UA", {STRING_32} "Ukraine"], ["AE", {STRING_32} "United Arab Emirates"],
126-
["GB", {STRING_32} "United Kingdom"], ["US", {STRING_32} "United States"],
126+
["GB", {STRING_32} "United Kingdom"], ["US", {STRING_32} "United States"],
127127
["UM", {STRING_32} "United States Minor Outlying Islands"], ["UY", {STRING_32} "Uruguay"],
128128
["UZ", {STRING_32} "Uzbekistan"], ["VU", {STRING_32} "Vanuatu"],
129-
["VE", {STRING_32} "Venezuela, Bolivarian Republic of"], ["VN", {STRING_32} "Viet Nam"],
129+
["VE", {STRING_32} "Venezuela, Bolivarian Republic of"], ["VN", {STRING_32} "Viet Nam"],
130130
["VG", {STRING_32} "Virgin Islands, British"],
131131
["VI", {STRING_32} "Virgin Islands, U.S."], ["WF", {STRING_32} "Wallis and Futuna"],
132132
["EH", {STRING_32} "Western Sahara"], ["YE", {STRING_32} "Yemen"],
133133
["ZM", {STRING_32} "Zambia"], ["ZW", {STRING_32} "Zimbabwe"]
134134
>>
135135

136-
create Result.make_array
136+
create Result.make_empty
137137
across
138138
list as c
139139
loop
@@ -143,8 +143,8 @@ feature -- Implementation
143143
then
144144
if second.as_lower.has_substring (input.as_lower) then
145145
create o.make
146-
o.put (create {JSON_STRING}.make_json (first.as_lower), "flag")
147-
o.put (create {JSON_STRING}.make_json_from_string_32 (second), "value")
146+
o.put (create {JSON_STRING}.make_from_string (first.as_lower), "flag")
147+
o.put (create {JSON_STRING}.make_from_string_32 (second), "value")
148148
Result.add (o)
149149
end
150150
end

draft/library/server/wsf_js_widget/examples/demo/autocompletion/google_autocompletion.e

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ feature -- Implementation
4444
if attached sess.get ("/complete/search?client=chrome", ctx) as resp and then not resp.error_occurred then
4545
l_json := resp.body
4646
end
47-
create Result.make_array
47+
create Result.make_empty
4848
if l_json /= Void and then not l_json.is_empty then
49-
create json_parser.make_parser (l_json)
49+
create json_parser.make_with_string (l_json)
50+
json_parser.parse_content
5051
if
51-
attached {JSON_ARRAY} json_parser.parse_json as data and then
52+
json_parser.is_valid and then
53+
attached {JSON_ARRAY} json_parser.parsed_json_value as data and then
5254
data.valid_index (2) and then
5355
attached {JSON_ARRAY} data.i_th (2) as list
5456
then
@@ -57,7 +59,7 @@ feature -- Implementation
5759
loop
5860
if attached {JSON_STRING} list.i_th (c.item) as row then
5961
create o.make
60-
o.put (create {JSON_STRING}.make_with_escaped_json (row.item), "value")
62+
o.put (create {JSON_STRING}.make_from_escaped_json_string (row.item), "value")
6163
Result.add (o)
6264
end
6365
end

draft/library/server/wsf_js_widget/examples/demo/googlenews/google_news_datasource.e

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ feature -- Access
7373
end
7474
end
7575
if l_json /= Void and then not l_json.is_empty then
76-
create json_parser.make_parser (l_json)
77-
if attached {JSON_OBJECT} json_parser.parse_json as sp then
76+
create json_parser.make_with_string (l_json)
77+
json_parser.parse_content
78+
if
79+
json_parser.is_valid and then
80+
attached {JSON_OBJECT} json_parser.parsed_json_value as sp
81+
then
7882
if
7983
attached {JSON_OBJECT} sp.item ("responseData") as responsedata and then
8084
attached {JSON_ARRAY} responsedata.item ("results") as results

draft/library/server/wsf_js_widget/examples/demo/progress/increasing_progresssource.e

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ feature {NONE} -- Initialization
1818

1919
control: detachable WSF_PROGRESS_CONTROL
2020

21-
make ()
21+
make
2222
do
2323
end
2424

draft/library/server/wsf_js_widget/kernel/autocompletion/wsf_simple_autocompletion.e

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ feature -- Implementation
3535
l_lowered_input: READABLE_STRING_GENERAL
3636
l_lowered_item: READABLE_STRING_GENERAL
3737
do
38-
create Result.make_array
38+
create Result.make_empty
3939
l_lowered_input := a_input.as_lower
4040
across
4141
list as c
@@ -50,7 +50,7 @@ feature -- Implementation
5050
end
5151

5252
;note
53-
copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
53+
copyright: "2011-2015, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
5454
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
5555
source: "[
5656
Eiffel Software

draft/library/server/wsf_js_widget/kernel/grid/wsf_pagination_control.e

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
4343
update
4444
-- Send new renederd control to client on update
4545
do
46-
state_changes.replace (create {JSON_STRING}.make_json_from_string_32 (render), "_html")
46+
state_changes.replace (create {JSON_STRING}.make_from_string_32 (render), "_html")
4747
end
4848

4949
feature --Event handling
@@ -100,7 +100,7 @@ feature -- Properties
100100
datasource: WSF_PAGABLE_DATASOURCE [G]
101101

102102
;note
103-
copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
103+
copyright: "2011-2015, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
104104
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
105105
source: "[
106106
Eiffel Software

draft/library/server/wsf_js_widget/kernel/grid/wsf_repeater_control.e

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management
3939
update
4040
-- Send new rendered control to client on update
4141
do
42-
state_changes.replace (create {JSON_STRING}.make_json_from_string_32 (render_body), "_body")
42+
state_changes.replace (create {JSON_STRING}.make_from_string_32 (render_body), "_body")
4343
state_changes.replace (datasource.state, "datasource")
4444
end
4545

@@ -100,7 +100,7 @@ feature -- Access
100100
pagination_control: detachable WSF_PAGINATION_CONTROL [G]
101101

102102
;note
103-
copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
103+
copyright: "2011-2015, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
104104
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
105105
source: "[
106106
Eiffel Software

draft/library/server/wsf_js_widget/kernel/input/wsf_input_control.e

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ feature -- Change
100100
do
101101
if not t.same_string (text) then
102102
text := t
103-
state_changes.replace (create {JSON_STRING}.make_json_from_string_32 (t), "text")
103+
state_changes.replace (create {JSON_STRING}.make_from_string_32 (t), "text")
104104
end
105105
ensure
106106
text_same_string_as_t: text.same_string (t)
@@ -160,7 +160,7 @@ feature -- Properties
160160
-- Procedure to be execued on change
161161

162162
;note
163-
copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
163+
copyright: "2011-2015, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
164164
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
165165
source: "[
166166
Eiffel Software

draft/library/server/wsf_js_widget/kernel/navlist/wsf_navlist_item_control.e

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ feature -- Change
6565
else
6666
remove_class ("active")
6767
end
68-
state_changes.replace (create {JSON_BOOLEAN}.make_boolean (a), "active")
68+
state_changes.replace (create {JSON_BOOLEAN}.make (a), "active")
6969
end
7070
ensure
7171
active_set: active = a
@@ -77,4 +77,14 @@ feature -- Properties
7777
active: BOOLEAN
7878
-- The active state of this item
7979

80+
;note
81+
copyright: "2011-2015, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others"
82+
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
83+
source: "[
84+
Eiffel Software
85+
5949 Hollister Ave., Goleta, CA 93117 USA
86+
Telephone 805-685-1006, Fax 805-685-6869
87+
Website http://www.eiffel.com
88+
Customer support http://support.eiffel.com
89+
]"
8090
end

0 commit comments

Comments
 (0)