From 0427f7a8d3c81bfbfd8fbb5a6aa41952916441f7 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Mon, 7 Jul 2014 11:14:36 +0200 Subject: [PATCH] Fixed compilation issue related to old usage of modified JSON library. --- .../kernel/input/wsf_file_control.e | 25 +++- .../kernel/input/wsf_file_definition.e | 12 +- .../kernel/webcontrol/wsf_json_object.e | 141 ------------------ tests/all-safe.ecf | 3 +- 4 files changed, 33 insertions(+), 148 deletions(-) diff --git a/draft/library/server/wsf_js_widget/kernel/input/wsf_file_control.e b/draft/library/server/wsf_js_widget/kernel/input/wsf_file_control.e index 95883664..c608de79 100644 --- a/draft/library/server/wsf_js_widget/kernel/input/wsf_file_control.e +++ b/draft/library/server/wsf_js_widget/kernel/input/wsf_file_control.e @@ -69,7 +69,12 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- State management Result.put_string (f.name, "file_name") Result.put_string (f.type, "file_type") Result.put_integer (f.size, "file_size") - Result.put_string (f.id, "file_id") + if attached f.id as fid then + Result.put_string (fid, "file_id") + else + Result.put (Void, "file_id") + end + end Result.put_boolean (disabled, "disabled") Result.put_boolean (image_preview, "image_preview") @@ -98,11 +103,21 @@ feature -- Event handling f_type := f.type f_size := f.size f_id := f.id + + state_changes.replace_with_string (f_name, "file_name") + state_changes.replace_with_string (f_type, "file_type") + state_changes.replace_with_integer (f_size, "file_size") + else + state_changes.replace (Void, "file_name") + state_changes.replace (Void, "file_type") + state_changes.replace (Void, "file_size") end - state_changes.replace_with_string (f_name, "file_name") - state_changes.replace_with_string (f_type, "file_type") - state_changes.replace_with_integer (f_size, "file_size") - state_changes.replace_with_string (f_id, "file_id") + if f_id /= Void then + state_changes.replace_with_string (f_id, "file_id") + else + state_changes.replace (Void, "file_id") + end + end end end diff --git a/draft/library/server/wsf_js_widget/kernel/input/wsf_file_definition.e b/draft/library/server/wsf_js_widget/kernel/input/wsf_file_definition.e index 6166f2b7..d7104935 100644 --- a/draft/library/server/wsf_js_widget/kernel/input/wsf_file_definition.e +++ b/draft/library/server/wsf_js_widget/kernel/input/wsf_file_definition.e @@ -36,7 +36,7 @@ feature --Properties is_uploaded: BOOLEAN -- Whether the file denoted by this abstract file has been uploaded. do - Result := attached id + Result := id /= Void end name: STRING_32 @@ -51,4 +51,14 @@ feature --Properties id: detachable STRING_32 -- Server side file id (e.g. S3 filename) +;note + copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" end diff --git a/draft/library/server/wsf_js_widget/kernel/webcontrol/wsf_json_object.e b/draft/library/server/wsf_js_widget/kernel/webcontrol/wsf_json_object.e index c4b2f212..82a168c1 100644 --- a/draft/library/server/wsf_js_widget/kernel/webcontrol/wsf_json_object.e +++ b/draft/library/server/wsf_js_widget/kernel/webcontrol/wsf_json_object.e @@ -18,147 +18,6 @@ inherit create make -feature -- Change - - put_string (value: detachable READABLE_STRING_GENERAL; key: JSON_STRING) - -- Assuming there is no item of key `key', - -- insert `value' with `key'. - require - key_not_present: not has_key (key) - local - l_value: detachable JSON_STRING - do - if attached value as a_value then - create l_value.make_json_from_string_32 (a_value.as_string_32) - end - put (l_value, key) - ensure - has_key: has_key (key) - end - - put_integer (value: detachable INTEGER_64; key: JSON_STRING) - -- Assuming there is no item of key `key', - -- insert `value' with `key'. - require - key_not_present: not has_key (key) - local - l_value: detachable JSON_NUMBER - do - if attached value as a_value then - create l_value.make_integer (a_value) - end - put (l_value, key) - ensure - has_key: has_key (key) - end - - put_natural (value: detachable NATURAL_64; key: JSON_STRING) - -- Assuming there is no item of key `key', - -- insert `value' with `key'. - require - key_not_present: not has_key (key) - local - l_value: detachable JSON_NUMBER - do - if attached value as a_value then - create l_value.make_natural (a_value) - end - put (l_value, key) - ensure - has_key: has_key (key) - end - - put_real (value: detachable DOUBLE; key: JSON_STRING) - -- Assuming there is no item of key `key', - -- insert `value' with `key'. - require - key_not_present: not has_key (key) - local - l_value: detachable JSON_NUMBER - do - if attached value as a_value then - create l_value.make_real (a_value) - end - put (l_value, key) - ensure - has_key: has_key (key) - end - - put_boolean (value: detachable BOOLEAN; key: JSON_STRING) - -- Assuming there is no item of key `key', - -- insert `value' with `key'. - require - key_not_present: not has_key (key) - local - l_value: detachable JSON_BOOLEAN - do - if attached value as a_value then - create l_value.make_boolean (a_value) - end - put (l_value, key) - ensure - has_key: has_key (key) - end - - replace_with_string (value: detachable READABLE_STRING_GENERAL; key: JSON_STRING) - -- Assuming there is no item of key `key', - -- insert `value' with `key'. - local - l_value: detachable JSON_STRING - do - if attached value as a_value then - create l_value.make_json_from_string_32 (value.as_string_32) - end - replace (l_value, key) - end - - replace_with_integer (value: detachable INTEGER_64; key: JSON_STRING) - -- Assuming there is no item of key `key', - -- insert `value' with `key'. - local - l_value: detachable JSON_NUMBER - do - if attached value as a_value then - create l_value.make_integer (a_value) - end - replace (l_value, key) - end - - replace_with_with_natural (value: detachable NATURAL_64; key: JSON_STRING) - -- Assuming there is no item of key `key', - -- insert `value' with `key'. - local - l_value: detachable JSON_NUMBER - do - if attached value as a_value then - create l_value.make_natural (a_value) - end - replace (l_value, key) - end - - replace_with_real (value: detachable DOUBLE; key: JSON_STRING) - -- Assuming there is no item of key `key', - -- insert `value' with `key' - local - l_value: detachable JSON_NUMBER - do - if attached value as a_value then - create l_value.make_real (a_value) - end - replace (l_value, key) - end - - replace_with_boolean (value: detachable BOOLEAN; key: JSON_STRING) - -- Assuming there is no item of key `key', - -- insert `value' with `key'. - local - l_value: detachable JSON_BOOLEAN - do - if attached value as a_value then - create l_value.make_boolean (a_value) - end - replace (l_value, key) - end note copyright: "2011-2014, Yassin Hassan, Severin Munger, Jocelyn Fiat, Eiffel Software and others" diff --git a/tests/all-safe.ecf b/tests/all-safe.ecf index 3d752c57..a34c3a13 100644 --- a/tests/all-safe.ecf +++ b/tests/all-safe.ecf @@ -57,7 +57,8 @@ - + + Compiling as Windows , on other platforms than Windows