Skip to content

Commit 7ddfaca

Browse files
committed
indev_get_compiling
1 parent b7f307b commit 7ddfaca

File tree

4 files changed

+39
-5
lines changed

4 files changed

+39
-5
lines changed

sheets/esheets.ecf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
2121
<library name="cypress_consumer" location="$ISE_LIBRARY\contrib\library\web\authentication\oauth\cypress\consumer\consumer.ecf" readonly="false"/>
2222
<library name="encoder" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\text\encoder\encoder.ecf"/>
23+
<library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http.ecf"/>
2324
<library name="json" location="$ISE_LIBRARY\contrib\library\text\parser\json\library\json.ecf" readonly="false"/>
2425
<library name="logging" location="$ISE_LIBRARY\library\runtime\logging\logging.ecf"/>
2526
<library name="login_with_google" location="$ISE_LIBRARY\contrib\library\web\authentication\oauth\cypress\login_with\google\login_with_google.ecf" readonly="false"/>

sheets/src/eg_sheets_api.e

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,42 @@ feature -- Spreedsheets Operations
7272
EIS:"name=get.spreedsheets", "src=https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/get", "protocol=uri"
7373
require
7474
not a_spreadsheet_id.is_empty
75+
local
76+
l_param: STRING
77+
l_params: STRING_TABLE [STRING]
78+
l_tuple: like parameters.item
7579
do
76-
api_post_call (sheets_url ("spreadsheets/" + a_spreadsheet_id, Void ), Void, Void)
80+
logger.write_information ("Now getting sheet from id:" + a_spreadsheet_id)
81+
l_param := "includeGridData=true"
82+
l_param.append ("&fields=sheets.properties")
83+
create l_params.make (2)
84+
l_params.extend ("includeGridData", "true")
85+
l_params.extend ("fields", "sheets.properties")
86+
create l_tuple
87+
88+
api_get_call (sheets_url ("spreadsheets/" + a_spreadsheet_id, Void), l_params)
7789
check
7890
attached last_response as l_response and then
7991
attached l_response.body as l_body
8092
then
81-
parse_last_response
82-
Result := l_body
93+
if l_response.status = {HTTP_STATUS_CODE}.ok then
94+
parse_last_response
95+
Result := l_body
96+
elseif l_response.status = {HTTP_STATUS_CODE}.not_found then
97+
logger.write_error ("get_from_id-> Not found:" + l_response.status.out + " %NBody: " + l_body)
98+
else
99+
logger.write_error ("get_from_id-> Status code invalid:" + l_response.status.out + " %NBody: " + l_body)
100+
end
83101
end
84102
end
85103

86104
feature -- Parameters Factory
87105

88106
parameters (a_params: detachable STRING_TABLE [STRING] ): detachable ARRAY [detachable TUPLE [name: STRING; value: STRING]]
107+
-- @JV please add a call example
89108
local
90-
l_result: detachable ARRAY [detachable TUPLE [name: STRING; value: STRING]]
91-
l_tuple : detachable TUPLE [name: STRING; value: STRING]
109+
l_result: like parameters
110+
l_tuple : like parameters.item
92111
i: INTEGER
93112
do
94113
if attached a_params then
@@ -106,6 +125,7 @@ feature -- Parameters Factory
106125
end
107126
end
108127

128+
109129
feature -- Error Report
110130

111131
parse_last_response
@@ -210,6 +230,7 @@ feature {NONE} -- Implementation
210230
api_service: OAUTH_20_SERVICE
211231
config: OAUTH_CONFIG
212232
do
233+
logger.write_debug ("internal_api_call-> a_api_url:" + a_api_url + " method:" + a_method)
213234
-- TODO improve this, so we can check the required scopes before we
214235
-- do an api call.
215236
create config.make_default ("", "")

sheets/src/logger/loggable.e

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,19 @@ feature -- Access
1616
create Result.make
1717
-- Result.set_file_path_sep (l_app_instance_sep.log_file_path_s)
1818
create l_log_writter
19+
l_log_writter.enable_debug_log_level
20+
21+
Result.enable_default_stderr_log
22+
-- Result.default_log_writer_system.enable_debug_log_level
23+
Result.default_log_writer_stderr.enable_debug_log_level
24+
1925
Result.register_log_writer (l_log_writter)
26+
-- Result.enable_default_system_log
27+
28+
-- Result.write_debug ("***************** TEST DEBUG")
29+
-- Result.write_information ("***************** TEST INFO")
30+
-- Result.write_error ("***************** TEST ERROR")
31+
2032
end
2133

2234
end

sheets/test/token.access

-909 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)