asposecloud 1.0.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +31 -9
- data/Tests/Barcode/builder_tests.rb +95 -0
- data/Tests/Barcode/reader_tests.rb +70 -0
- data/Tests/Cells/charteditor_tests.rb +139 -0
- data/Tests/Cells/converter_tests.rb +83 -0
- data/Tests/Cells/extractor_tests.rb +40 -0
- data/Tests/Cells/texteditor_tests.rb +52 -0
- data/Tests/Cells/workbook_tests.rb +167 -0
- data/Tests/Cells/worksheet_tests.rb +435 -0
- data/Tests/Data/barcodeQR.bmp +0 -0
- data/Tests/Data/barcodeQR.jpg +0 -0
- data/Tests/Data/barcodeQR.tiff +0 -0
- data/Tests/Data/bizcard.psd +0 -0
- data/Tests/Data/macbook.gif +0 -0
- data/Tests/Data/mail_merge_regions.docx +0 -0
- data/Tests/Data/mail_merge_template.docx +0 -0
- data/Tests/Data/test_cells.xlsx +0 -0
- data/Tests/Data/test_multi_pages.docx +0 -0
- data/Tests/Data/test_slides.pptx +0 -0
- data/Tests/Email/converter_tests.rb +30 -0
- data/Tests/Email/document_tests.rb +55 -0
- data/Tests/Imaging/converter_tests.rb +32 -0
- data/Tests/Imaging/document_tests.rb +132 -0
- data/Tests/Imaging/extractor_tests.rb +67 -0
- data/Tests/Imaging/image_tests.rb +55 -0
- data/Tests/Ocr/extractor_tests.rb +34 -0
- data/Tests/Pdf/annotationeditor_tests.rb +128 -0
- data/Tests/Pdf/converter_tests.rb +74 -0
- data/Tests/Pdf/document_tests.rb +285 -0
- data/Tests/Pdf/extractor_tests.rb +37 -0
- data/Tests/Pdf/texteditor_tests.rb +84 -0
- data/Tests/Slides/converter_tests.rb +59 -0
- data/Tests/Slides/document_tests.rb +187 -0
- data/Tests/Slides/extractor_tests.rb +92 -0
- data/Tests/Storage/folder_tests.rb +64 -0
- data/Tests/Tasks/assignments_tests.rb +44 -0
- data/Tests/Tasks/calendar_tests.rb +45 -0
- data/Tests/Tasks/converter_tests.rb +32 -0
- data/Tests/Tasks/document_tests.rb +114 -0
- data/Tests/Tasks/resources_tests.rb +44 -0
- data/Tests/Words/builder_tests.rb +56 -0
- data/Tests/Words/converter_tests.rb +54 -0
- data/Tests/Words/document_tests.rb +208 -0
- data/Tests/Words/extractor_tests.rb +120 -0
- data/Tests/Words/mail_merge_tests.rb +120 -0
- data/Tests/setup.json +6 -0
- data/lib/Barcode/builder.rb +270 -20
- data/lib/Barcode/reader.rb +112 -18
- data/lib/Cells/chart_editor.rb +102 -0
- data/lib/Cells/convertor.rb +22 -2
- data/lib/Cells/text_editor.rb +8 -2
- data/lib/Cells/workbook.rb +63 -3
- data/lib/Cells/worksheet.rb +479 -10
- data/lib/Common/utils.rb +2 -0
- data/lib/Email/converter.rb +2 -18
- data/lib/Email/document.rb +32 -17
- data/lib/Ocr/extractor.rb +26 -20
- data/lib/Pdf/annotation_editor.rb +0 -17
- data/lib/Pdf/converter.rb +25 -17
- data/lib/Pdf/document.rb +167 -23
- data/lib/Pdf/extractor.rb +0 -17
- data/lib/Pdf/text_editor.rb +35 -20
- data/lib/Slides/converter.rb +48 -18
- data/lib/Slides/document.rb +186 -51
- data/lib/Slides/extractor.rb +35 -18
- data/lib/Storage/folder.rb +30 -25
- data/lib/Words/builder.rb +23 -29
- data/lib/Words/converter.rb +30 -17
- data/lib/Words/document.rb +336 -28
- data/lib/Words/extractor.rb +112 -33
- data/lib/Words/mail_merge.rb +2 -20
- data/{Tests/word_tests.rb → lib/aspose_imaging.rb} +5 -17
- data/lib/asposecloud.rb +3 -1
- data/lib/asposecloud/version.rb +1 -1
- data/lib/imaging/converter.rb +55 -0
- data/lib/imaging/document.rb +301 -0
- data/lib/imaging/extractor.rb +165 -0
- data/lib/imaging/image.rb +118 -0
- data/lib/restclient.rb +36 -0
- data/lib/tasks/assignments.rb +19 -19
- data/lib/tasks/calendar.rb +27 -19
- data/lib/tasks/converter.rb +4 -17
- data/lib/tasks/document.rb +79 -22
- data/lib/tasks/resources.rb +18 -18
- metadata +70 -19
- checksums.yaml +0 -7
- data/Tests/barcode_tests.rb +0 -45
- data/Tests/cell_tests.rb +0 -41
- data/Tests/email_tests.rb +0 -43
- data/Tests/pdf_tests.rb +0 -76
- data/Tests/slide_tests.rb +0 -41
- data/Tests/storage_tests.rb +0 -86
- data/Tests/tasks_tests.rb +0 -24
data/lib/Barcode/reader.rb
CHANGED
@@ -1,20 +1,3 @@
|
|
1
|
-
# Copyright (c) Aspose 2002-2014. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# LICENSE: This program is free software; you can redistribute it and/or
|
4
|
-
# modify it under the terms of the GNU General Public License
|
5
|
-
# as published by the Free Software Foundation; either version 3
|
6
|
-
# of the License, or (at your option) any later version.
|
7
|
-
# This program is distributed in the hope that it will be useful,
|
8
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
10
|
-
# GNU General Public License for more details.
|
11
|
-
# You should have received a copy of the GNU General Public License
|
12
|
-
# along with this program. If not, see <http://opensource.org/licenses/gpl-3.0.html>;.
|
13
|
-
#
|
14
|
-
# @package Aspose_Cloud_SDK_For_Ruby
|
15
|
-
# @author Assad Mahmood Qazi <assad.mahmood@aspose.com>
|
16
|
-
# @link https://github.com/asposeforcloud/Aspose_Cloud_SDK_For_Ruby/tree/revamp
|
17
|
-
|
18
1
|
module Aspose
|
19
2
|
module Cloud
|
20
3
|
module Barcode
|
@@ -24,6 +7,10 @@ module Aspose
|
|
24
7
|
raise 'Base file is not specified' if @filename.empty?
|
25
8
|
end
|
26
9
|
|
10
|
+
=begin
|
11
|
+
Read Barcode from Aspose Cloud Storage
|
12
|
+
@param string symbology Type of barcode.
|
13
|
+
=end
|
27
14
|
def read(symbology='', remote_folder='', storage_type='Aspose', storage_name='')
|
28
15
|
|
29
16
|
str_uri = "#{Aspose::Cloud::Common::Product.product_uri}/barcode/#{@filename}/recognize"
|
@@ -36,6 +23,12 @@ module Aspose
|
|
36
23
|
json['Code'] == 200 ? json['Barcodes'] : nil
|
37
24
|
end
|
38
25
|
|
26
|
+
=begin
|
27
|
+
Read Barcode from Local Image
|
28
|
+
@param string local_image Path of the local image.
|
29
|
+
@param string symbology Type of barcode.
|
30
|
+
@param string format Returns an image in specified format.
|
31
|
+
=end
|
39
32
|
def read_from_local_image(local_image, remote_folder='', symbology='', format='', storage_type='Aspose', storage_name='')
|
40
33
|
raise 'local image file not provided.' if local_image.empty?
|
41
34
|
|
@@ -45,6 +38,12 @@ module Aspose
|
|
45
38
|
readr(File.basename(local_image), remote_folder, symbology, format)
|
46
39
|
end
|
47
40
|
|
41
|
+
=begin
|
42
|
+
Read Barcode from Aspose Cloud Storage
|
43
|
+
@param string remote_image_name Name of the image.
|
44
|
+
@param string symbology Type of barcode.
|
45
|
+
@param string format Returns an image in specified format.
|
46
|
+
=end
|
48
47
|
def readr(remote_image_name, remote_folder='', symbology='', format='', storage_type='Aspose', storage_name='')
|
49
48
|
raise 'remote image file not provided.' if remote_image_name.empty?
|
50
49
|
|
@@ -58,8 +57,103 @@ module Aspose
|
|
58
57
|
json = JSON.parse(response)
|
59
58
|
json['Code'] == 200 ? json['Barcodes'] : nil
|
60
59
|
end
|
60
|
+
|
61
|
+
=begin
|
62
|
+
Read Barcode from External Image URL
|
63
|
+
@param string url URL of the image.
|
64
|
+
@param string symbology Type of barcode.
|
65
|
+
=end
|
66
|
+
def read_from_url(url, symbology)
|
67
|
+
raise 'URL not provided.' if url.empty?
|
68
|
+
raise 'Symbology not provided.' if symbology.empty?
|
69
|
+
|
70
|
+
str_uri = "#{Aspose::Cloud::Common::Product.product_uri}/barcode/recognize"
|
71
|
+
str_uri = "#{str_uri}?type=#{symbology}&url=#{url}"
|
72
|
+
|
73
|
+
signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
74
|
+
response = RestClient.post(signed_uri, '', {:accept => 'application/json'})
|
75
|
+
json = JSON.parse(response)
|
76
|
+
json['Code'] == 200 ? json['Barcodes'] : nil
|
77
|
+
end
|
78
|
+
|
79
|
+
=begin
|
80
|
+
Read Barcode from Specific Region of Image
|
81
|
+
@param string symbology Type of barcode.
|
82
|
+
@param number rectX X position of rectangle.
|
83
|
+
@param number rectY Y position of rectangle.
|
84
|
+
@param number rectWidth Width of rectangle.
|
85
|
+
@param number rectX Height of rectangle.
|
86
|
+
=end
|
87
|
+
def read_specific_region(symbology, rectX, rectY, rectWidth, rectHeight)
|
88
|
+
raise 'Symbology not provided.' if symbology.empty?
|
89
|
+
raise 'X position not provided.' if rectX.nil?
|
90
|
+
raise 'Y position not provided.' if rectY.nil?
|
91
|
+
raise 'Width not provided.' if rectWidth.nil?
|
92
|
+
raise 'Height not provided.' if rectHeight.nil?
|
93
|
+
|
94
|
+
str_uri = "#{Aspose::Cloud::Common::Product.product_uri}/barcode/#{@filename}/recognize"
|
95
|
+
str_uri = "#{str_uri}?type=#{symbology}&rectX=#{rectX}&rectY=#{rectY}&rectWidth=#{rectWidth}&rectHeight=#{rectHeight}"
|
96
|
+
|
97
|
+
signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
98
|
+
response = RestClient.get(signed_uri, {:accept => 'application/json'})
|
99
|
+
json = JSON.parse(response)
|
100
|
+
json['Code'] == 200 ? json['Barcodes'] : nil
|
101
|
+
end
|
102
|
+
|
103
|
+
=begin
|
104
|
+
Recognize Barcode with Checksum Option from Storage
|
105
|
+
@param string symbology Type of barcode.
|
106
|
+
@param string checksumValidation Sets checksum validation parameter.
|
107
|
+
=end
|
108
|
+
def read_with_checksum(symbology, checksumValidation)
|
109
|
+
raise 'Symbology not provided.' if symbology.empty?
|
110
|
+
raise 'Checksum not provided.' if checksumValidation.empty?
|
111
|
+
|
112
|
+
str_uri = "#{Aspose::Cloud::Common::Product.product_uri}/barcode/#{@filename}/recognize"
|
113
|
+
str_uri = "#{str_uri}?type=#{symbology}&checksumValidation=#{checksumValidation}"
|
114
|
+
|
115
|
+
signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
116
|
+
response = RestClient.get(signed_uri, {:accept => 'application/json'})
|
117
|
+
json = JSON.parse(response)
|
118
|
+
json['Code'] == 200 ? json['Barcodes'] : nil
|
119
|
+
end
|
120
|
+
|
121
|
+
=begin
|
122
|
+
Recognize Specified count of Barcodes
|
123
|
+
@param string symbology Type of barcode.
|
124
|
+
@param string barcodesCount Recognize specified count of barcodes.
|
125
|
+
=end
|
126
|
+
def read_barcode_count(symbology, barcodesCount)
|
127
|
+
raise 'Symbology not provided.' if symbology.empty?
|
128
|
+
raise 'Barcode count not provided.' if barcodesCount.nil?
|
129
|
+
|
130
|
+
str_uri = "#{Aspose::Cloud::Common::Product.product_uri}/barcode/#{@filename}/recognize"
|
131
|
+
str_uri = "#{str_uri}?type=#{symbology}&barcodesCount=#{barcodesCount}"
|
132
|
+
|
133
|
+
signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
134
|
+
response = RestClient.get(signed_uri, {:accept => 'application/json'})
|
135
|
+
json = JSON.parse(response)
|
136
|
+
json['Code'] == 200 ? json['Barcodes'] : nil
|
137
|
+
end
|
138
|
+
|
139
|
+
=begin
|
140
|
+
Read Barcodes by Applying Image Processing Algorithm
|
141
|
+
@param string symbology Type of barcode.
|
142
|
+
@param string barcodesCount Recognize specified count of barcodes.
|
143
|
+
=end
|
144
|
+
def read_by_algorithm(symbology, algorithm)
|
145
|
+
raise 'Symbology not provided.' if symbology.empty?
|
146
|
+
raise 'algorithm not provided.' if algorithm.empty?
|
147
|
+
|
148
|
+
str_uri = "#{Aspose::Cloud::Common::Product.product_uri}/barcode/#{@filename}/recognize"
|
149
|
+
str_uri = "#{str_uri}?type=#{symbology}&BinarizationHints=#{algorithm}"
|
150
|
+
|
151
|
+
signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
152
|
+
response = RestClient.get(signed_uri, {:accept => 'application/json'})
|
153
|
+
json = JSON.parse(response)
|
154
|
+
json['Code'] == 200 ? json['Barcodes'] : nil
|
155
|
+
end
|
61
156
|
end
|
62
157
|
end
|
63
|
-
|
64
158
|
end
|
65
159
|
end
|
data/lib/Cells/chart_editor.rb
CHANGED
@@ -44,6 +44,17 @@ module Aspose
|
|
44
44
|
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
45
45
|
end
|
46
46
|
|
47
|
+
def delete_charts(worksheet_name, folder_name='', storage_type = 'Aspose', storage_name = '')
|
48
|
+
raise 'worksheet_name not specified.' if worksheet_name.empty?
|
49
|
+
|
50
|
+
str_uri = "#{@base_uri}/worksheets/#{worksheet_name}/charts"
|
51
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
52
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
53
|
+
response_stream = RestClient.delete(signed_str_uri, {:accept=>'application/json'})
|
54
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
55
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
56
|
+
end
|
57
|
+
|
47
58
|
def delete_chart(worksheet_name, chart_index, folder_name='', storage_type = 'Aspose', storage_name = '')
|
48
59
|
raise 'worksheet_name not specified.' if worksheet_name.empty?
|
49
60
|
raise 'chart_index not specified.' if chart_index.nil?
|
@@ -56,6 +67,56 @@ module Aspose
|
|
56
67
|
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
57
68
|
end
|
58
69
|
|
70
|
+
def show_chart_legend(worksheet_name, chart_index, folder_name='', storage_type = 'Aspose', storage_name = '')
|
71
|
+
raise 'worksheet_name not specified.' if worksheet_name.empty?
|
72
|
+
raise 'chart_index not specified.' if chart_index.nil?
|
73
|
+
|
74
|
+
str_uri = "#{@base_uri}/worksheets/#{worksheet_name}/charts/#{chart_index}/legend"
|
75
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
76
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
77
|
+
|
78
|
+
response_stream = RestClient.put(signed_str_uri, '', {:accept=>'application/json'})
|
79
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
80
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
81
|
+
end
|
82
|
+
|
83
|
+
def hide_chart_legend(worksheet_name, chart_index, folder_name='', storage_type = 'Aspose', storage_name = '')
|
84
|
+
raise 'worksheet_name not specified.' if worksheet_name.empty?
|
85
|
+
raise 'chart_index not specified.' if chart_index.nil?
|
86
|
+
|
87
|
+
str_uri = "#{@base_uri}/worksheets/#{worksheet_name}/charts/#{chart_index}/legend"
|
88
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
89
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
90
|
+
|
91
|
+
response_stream = RestClient.delete(signed_str_uri, {:accept=>'application/json', :content_type=>'application/json'})
|
92
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
93
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
94
|
+
end
|
95
|
+
|
96
|
+
def update_chart_legend(worksheet_name, chart_index, str_xml, folder_name='', storage_type = 'Aspose', storage_name = '')
|
97
|
+
raise 'worksheet_name not specified.' if worksheet_name.empty?
|
98
|
+
raise 'chart_index not specified.' if chart_index.nil?
|
99
|
+
raise 'str_xml not specified.' if str_xml.empty?
|
100
|
+
|
101
|
+
str_uri = "#{@base_uri}/worksheets/#{worksheet_name}/charts/#{chart_index}/legend"
|
102
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
103
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
104
|
+
|
105
|
+
response_stream = RestClient.post(signed_str_uri, str_xml, {:accept=>'application/json'})
|
106
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
107
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
108
|
+
end
|
109
|
+
|
110
|
+
def read_chart_legend(worksheet_name, chart_index, folder_name='', storage_type = 'Aspose', storage_name = '')
|
111
|
+
raise 'worksheet_name not specified.' if worksheet_name.empty?
|
112
|
+
raise 'chart_index not specified.' if chart_index.nil?
|
113
|
+
|
114
|
+
str_uri = "#{@base_uri}/worksheets/#{worksheet_name}/charts/#{chart_index}/legend"
|
115
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
116
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
117
|
+
JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Legend']
|
118
|
+
end
|
119
|
+
|
59
120
|
def get_chart_area(worksheet_name, chart_index, folder_name='', storage_type = 'Aspose', storage_name = '')
|
60
121
|
raise 'worksheet_name not specified.' if worksheet_name.empty?
|
61
122
|
raise 'chart_index not specified.' if chart_index.nil?
|
@@ -85,6 +146,47 @@ module Aspose
|
|
85
146
|
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
86
147
|
JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Line']
|
87
148
|
end
|
149
|
+
|
150
|
+
def set_chart_title(worksheet_name, chart_index, str_xml, folder_name='', storage_type = 'Aspose', storage_name = '')
|
151
|
+
raise 'worksheet_name not specified.' if worksheet_name.empty?
|
152
|
+
raise 'chart_index not specified.' if chart_index.nil?
|
153
|
+
raise 'str_xml not specified.' if str_xml.empty?
|
154
|
+
|
155
|
+
str_uri = "#{@base_uri}/worksheets/#{worksheet_name}/charts/#{chart_index}/title"
|
156
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
157
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
158
|
+
|
159
|
+
response_stream = RestClient.put(signed_str_uri, str_xml, {:accept=>'application/json'})
|
160
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
161
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
162
|
+
end
|
163
|
+
|
164
|
+
def update_chart_title(worksheet_name, chart_index, str_xml, folder_name='', storage_type = 'Aspose', storage_name = '')
|
165
|
+
raise 'worksheet_name not specified.' if worksheet_name.empty?
|
166
|
+
raise 'chart_index not specified.' if chart_index.nil?
|
167
|
+
raise 'str_xml not specified.' if str_xml.empty?
|
168
|
+
|
169
|
+
str_uri = "#{@base_uri}/worksheets/#{worksheet_name}/charts/#{chart_index}/title"
|
170
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
171
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
172
|
+
|
173
|
+
response_stream = RestClient.post(signed_str_uri, str_xml, {:accept=>'application/json'})
|
174
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
175
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
176
|
+
end
|
177
|
+
|
178
|
+
def delete_chart_title(worksheet_name, chart_index, folder_name='', storage_type = 'Aspose', storage_name = '')
|
179
|
+
raise 'worksheet_name not specified.' if worksheet_name.empty?
|
180
|
+
raise 'chart_index not specified.' if chart_index.nil?
|
181
|
+
|
182
|
+
str_uri = "#{@base_uri}/worksheets/#{worksheet_name}/charts/#{chart_index}/title"
|
183
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
184
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
185
|
+
|
186
|
+
response_stream = RestClient.delete(signed_str_uri, {:accept=>'application/json'})
|
187
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
188
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
189
|
+
end
|
88
190
|
end
|
89
191
|
end
|
90
192
|
end
|
data/lib/Cells/convertor.rb
CHANGED
@@ -128,15 +128,35 @@ module Aspose
|
|
128
128
|
qry = Hash.new
|
129
129
|
qry[:format] = save_format
|
130
130
|
qry[:password] = password unless password.empty?
|
131
|
-
str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
|
131
|
+
str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
|
132
132
|
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
133
|
-
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
133
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
134
134
|
response_stream = RestClient.get(signed_str_uri, {:accept => 'application/json'})
|
135
135
|
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
136
136
|
|
137
137
|
output_path = "#{Aspose::Cloud::Common::AsposeApp.output_location}#{Aspose::Cloud::Common::Utils.get_filename(@filename)}.#{save_format}"
|
138
138
|
valid_output.empty? ? Aspose::Cloud::Common::Utils.save_file(response_stream,output_path) : valid_output
|
139
139
|
end
|
140
|
+
|
141
|
+
def convert_local_file(input_file, output_filename, save_format, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
142
|
+
raise 'input_file not specified.' if input_file.empty?
|
143
|
+
raise 'output_filename not specified.' if output_filename.empty?
|
144
|
+
raise 'save_format not specified.' if save_format.empty?
|
145
|
+
|
146
|
+
str_uri = "#{Aspose::Cloud::Common::Product.product_uri}/cells/convert?format=#{save_format}"
|
147
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
148
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
149
|
+
response_stream = Aspose::Cloud::Common::Utils.upload_file_binary(input_file, signed_str_uri)
|
150
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
151
|
+
|
152
|
+
save_format = 'zip' if save_format.eql?('html')
|
153
|
+
|
154
|
+
if valid_output.empty?
|
155
|
+
output_path = "#{Aspose::Cloud::Common::AsposeApp.output_location}#{Aspose::Cloud::Common::Utils.get_filename(output_filename)}.#{save_format}"
|
156
|
+
Aspose::Cloud::Common::Utils.save_file(response_stream,output_path)
|
157
|
+
end
|
158
|
+
valid_output
|
159
|
+
end
|
140
160
|
end
|
141
161
|
end
|
142
162
|
|
data/lib/Cells/text_editor.rb
CHANGED
@@ -44,8 +44,14 @@ module Aspose
|
|
44
44
|
JSON.parse(RestClient.post(signed_str_uri, '', {:accept=>'application/json'}))['TextItems']['TextItemList']
|
45
45
|
end
|
46
46
|
|
47
|
-
def get_text_items(
|
48
|
-
|
47
|
+
def get_text_items(folder_name='', storage_type = 'Aspose', storage_name = '')
|
48
|
+
str_uri = "#{@base_uri}/textItems"
|
49
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
50
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
51
|
+
JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['TextItems']['TextItemList']
|
52
|
+
end
|
53
|
+
|
54
|
+
def get_text_items_in_worksheet(worksheet_name, folder_name='', storage_type = 'Aspose', storage_name = '')
|
49
55
|
raise 'worksheet_name not specified.' if worksheet_name.empty?
|
50
56
|
|
51
57
|
str_uri = "#{@base_uri}/worksheets/#{worksheet_name}/textItems"
|
data/lib/Cells/workbook.rb
CHANGED
@@ -29,7 +29,7 @@ module Aspose
|
|
29
29
|
str_uri = "#{@base_uri}/documentProperties"
|
30
30
|
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
31
31
|
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
32
|
-
JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['DocumentProperties']['
|
32
|
+
JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['DocumentProperties']['DocumentPropertyList']
|
33
33
|
end
|
34
34
|
|
35
35
|
def get_property(property_name, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
@@ -141,6 +141,16 @@ module Aspose
|
|
141
141
|
JSON.parse(RestClient.post(signed_str_uri, json_data, {:content_type=>:json, :accept=>'application/json'}))['Code'] == 200 ? true : false
|
142
142
|
end
|
143
143
|
|
144
|
+
def decrypt_workbook(password, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
145
|
+
raise 'password not specified.' if password.empty?
|
146
|
+
|
147
|
+
json_data = { :Password => password }.to_json
|
148
|
+
str_uri = "#{@base_uri}/encryption"
|
149
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
150
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
151
|
+
JSON.parse(Aspose::Cloud::Common::Utils.process_command(signed_str_uri,'DELETE','JSON',json_data))['Code'] == 200 ? true : false
|
152
|
+
end
|
153
|
+
|
144
154
|
def protect_workbook(protection_type, password, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
145
155
|
raise 'protection_type not specified.' if protection_type.empty?
|
146
156
|
raise 'password not specified.' if password.empty?
|
@@ -206,8 +216,8 @@ module Aspose
|
|
206
216
|
|
207
217
|
str_uri = "#{@base_uri}/worksheets/#{worksheet_name}"
|
208
218
|
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
209
|
-
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
210
|
-
JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'}))['Code'] ==
|
219
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
220
|
+
JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'}))['Code'] == 200 ? true : false
|
211
221
|
end
|
212
222
|
|
213
223
|
def merge_workbook(merge_filename, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
@@ -218,6 +228,56 @@ module Aspose
|
|
218
228
|
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
219
229
|
JSON.parse(RestClient.post(signed_str_uri, '', {:accept=>'application/json'}))['Code'] == 200 ? true : false
|
220
230
|
end
|
231
|
+
|
232
|
+
def split_workbook(save_format, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
233
|
+
raise 'save_format not specified.' if save_format.empty?
|
234
|
+
|
235
|
+
str_uri = "#{@base_uri}/split?format=#{save_format}"
|
236
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
237
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
238
|
+
response = RestClient.post(signed_str_uri, '', {:accept=>'application/json'})
|
239
|
+
json = JSON.parse(response)
|
240
|
+
|
241
|
+
i = 1
|
242
|
+
json['Result']['Documents'].each { |split_page|
|
243
|
+
source_filename = Aspose::Cloud::Common::Utils.get_filename(@filename)
|
244
|
+
split_filename = File.basename(split_page['link']['Href'])
|
245
|
+
str_uri = Aspose::Cloud::Common::Product.product_uri + '/storage/file/' + split_filename
|
246
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
247
|
+
response_stream = RestClient.get(signed_str_uri, {:accept=>'application/json'})
|
248
|
+
filename = "#{source_filename}_#{i}.#{save_format}"
|
249
|
+
output_path = "#{Aspose::Cloud::Common::AsposeApp.output_location}#{filename}"
|
250
|
+
Aspose::Cloud::Common::Utils.save_file(response_stream,output_path)
|
251
|
+
i += 1
|
252
|
+
}
|
253
|
+
end
|
254
|
+
|
255
|
+
def save_as(str_xml, output_filename, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
256
|
+
raise 'str_xml not specified.' if str_xml.empty?
|
257
|
+
raise 'output_filename not specified.' if output_filename.empty?
|
258
|
+
|
259
|
+
str_uri = "#{@base_uri}/saveAs?newfilename=#{output_filename}"
|
260
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
261
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
262
|
+
|
263
|
+
response_stream = Aspose::Cloud::Common::Utils.process_command(signed_str_uri,'POST','XML',str_xml)
|
264
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
265
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(output_filename,output_filename,folder_name,storage_name,storage_type) : valid_output
|
266
|
+
end
|
267
|
+
|
268
|
+
def autofit_rows(save_format, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
269
|
+
raise 'save_format not specified.' if save_format.empty?
|
270
|
+
|
271
|
+
str_uri = "#{@base_uri}?format=#{save_format}&isAutoFit=true"
|
272
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
273
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
274
|
+
|
275
|
+
response_stream = RestClient.get(signed_str_uri, {:accept=>'application/json'})
|
276
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
277
|
+
|
278
|
+
output_path = "#{Aspose::Cloud::Common::AsposeApp.output_location}#{Aspose::Cloud::Common::Utils.get_filename(@filename)}.#{save_format}"
|
279
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.save_file(response_stream,output_path) : valid_output
|
280
|
+
end
|
221
281
|
end
|
222
282
|
end
|
223
283
|
end
|
data/lib/Cells/worksheet.rb
CHANGED
@@ -87,6 +87,102 @@ module Aspose
|
|
87
87
|
JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Cells']['MaxRow']
|
88
88
|
end
|
89
89
|
|
90
|
+
def get_first_cell(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
91
|
+
raise 'offset not specified.' if offset.nil?
|
92
|
+
raise 'count not specified.' if count.nil?
|
93
|
+
|
94
|
+
str_uri = "#{@base_uri}/cells/firstcell"
|
95
|
+
qry = { :offset => offset, :count => count}
|
96
|
+
str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
|
97
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
98
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
99
|
+
JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Cell']
|
100
|
+
end
|
101
|
+
|
102
|
+
def get_last_cell(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
103
|
+
raise 'offset not specified.' if offset.nil?
|
104
|
+
raise 'count not specified.' if count.nil?
|
105
|
+
|
106
|
+
str_uri = "#{@base_uri}/cells/endcell"
|
107
|
+
qry = { :offset => offset, :count => count}
|
108
|
+
str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
|
109
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
110
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
111
|
+
JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Cell']
|
112
|
+
end
|
113
|
+
|
114
|
+
def get_max_data_row(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
115
|
+
raise 'offset not specified.' if offset.nil?
|
116
|
+
raise 'count not specified.' if count.nil?
|
117
|
+
|
118
|
+
str_uri = "#{@base_uri}/cells/maxdatarow"
|
119
|
+
qry = { :offset => offset, :count => count}
|
120
|
+
str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
|
121
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
122
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
123
|
+
RestClient.get(signed_str_uri, {:accept=>'application/json'})
|
124
|
+
end
|
125
|
+
|
126
|
+
def get_max_data_column(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
127
|
+
raise 'offset not specified.' if offset.nil?
|
128
|
+
raise 'count not specified.' if count.nil?
|
129
|
+
|
130
|
+
str_uri = "#{@base_uri}/cells/maxdatacolumn"
|
131
|
+
qry = { :offset => offset, :count => count}
|
132
|
+
str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
|
133
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
134
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
135
|
+
RestClient.get(signed_str_uri, {:accept=>'application/json'})
|
136
|
+
end
|
137
|
+
|
138
|
+
def get_min_row(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
139
|
+
raise 'offset not specified.' if offset.nil?
|
140
|
+
raise 'count not specified.' if count.nil?
|
141
|
+
|
142
|
+
str_uri = "#{@base_uri}/cells/minrow"
|
143
|
+
qry = { :offset => offset, :count => count}
|
144
|
+
str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
|
145
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
146
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
147
|
+
RestClient.get(signed_str_uri, {:accept=>'application/json'})
|
148
|
+
end
|
149
|
+
|
150
|
+
def get_min_data_row(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
151
|
+
raise 'offset not specified.' if offset.nil?
|
152
|
+
raise 'count not specified.' if count.nil?
|
153
|
+
|
154
|
+
str_uri = "#{@base_uri}/cells/mindatarow"
|
155
|
+
qry = { :offset => offset, :count => count}
|
156
|
+
str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
|
157
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
158
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
159
|
+
RestClient.get(signed_str_uri, {:accept=>'application/json'})
|
160
|
+
end
|
161
|
+
|
162
|
+
def get_min_column(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
163
|
+
raise 'offset not specified.' if offset.nil?
|
164
|
+
raise 'count not specified.' if count.nil?
|
165
|
+
|
166
|
+
str_uri = "#{@base_uri}/cells/mincolumn"
|
167
|
+
qry = { :offset => offset, :count => count}
|
168
|
+
str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
|
169
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
170
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
171
|
+
RestClient.get(signed_str_uri, {:accept=>'application/json'})
|
172
|
+
end
|
173
|
+
|
174
|
+
def get_min_data_column(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
175
|
+
raise 'offset not specified.' if offset.nil?
|
176
|
+
raise 'count not specified.' if count.nil?
|
177
|
+
|
178
|
+
str_uri = "#{@base_uri}/cells/mindatacolumn"
|
179
|
+
qry = { :offset => offset, :count => count}
|
180
|
+
str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
|
181
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
182
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
183
|
+
RestClient.get(signed_str_uri, {:accept=>'application/json'})
|
184
|
+
end
|
185
|
+
|
90
186
|
def get_cells_count(offset, count, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
91
187
|
raise 'offset not specified.' if offset.nil?
|
92
188
|
raise 'count not specified.' if count.nil?
|
@@ -107,7 +203,7 @@ module Aspose
|
|
107
203
|
end
|
108
204
|
|
109
205
|
def get_auto_shapes_by_index(shape_index, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
110
|
-
raise '
|
206
|
+
raise 'shape_index not specified.' if shape_index.nil?
|
111
207
|
|
112
208
|
str_uri = "#{@base_uri}/autoshapes/#{shape_index}"
|
113
209
|
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
@@ -157,10 +253,54 @@ module Aspose
|
|
157
253
|
|
158
254
|
str_uri = "#{@base_uri}/hyperlinks/#{link_index}"
|
159
255
|
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
160
|
-
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
256
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
161
257
|
JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Hyperlink']
|
162
258
|
end
|
163
259
|
|
260
|
+
def add_hyperlink(first_row, first_column, total_rows, total_colunms, url, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
261
|
+
raise 'first_row not specified.' if first_row.nil?
|
262
|
+
raise 'first_column not specified.' if first_column.nil?
|
263
|
+
raise 'total_rows not specified.' if total_rows.nil?
|
264
|
+
raise 'total_colunms not specified.' if total_colunms.nil?
|
265
|
+
raise 'url not specified.' if url.empty?
|
266
|
+
|
267
|
+
str_uri = "#{@base_uri}/hyperlinks?firstRow=#{first_row}&firstColumn=#{first_column}&totalRows=#{total_rows}&totalColumns=#{total_colunms}&address=#{url}"
|
268
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
269
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
270
|
+
|
271
|
+
response_stream = RestClient.put(signed_str_uri, '', {:accept=>'application/json'})
|
272
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
273
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
274
|
+
end
|
275
|
+
|
276
|
+
def update_hyperlink(hyperlink_index, url, screen_tip, display_text, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
277
|
+
raise 'hyperlink_index not specified.' if hyperlink_index.nil?
|
278
|
+
raise 'url not specified.' if url.empty?
|
279
|
+
raise 'screen_tip not specified.' if screen_tip.empty?
|
280
|
+
raise 'display_text not specified.' if display_text.empty?
|
281
|
+
|
282
|
+
str_uri = "#{@base_uri}/hyperlinks/#{hyperlink_index}"
|
283
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
284
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
285
|
+
|
286
|
+
json_data = JSON.generate('address' => url, 'ScreenTip' => screen_tip, 'TextToDisplay' => display_text)
|
287
|
+
|
288
|
+
response_stream = RestClient.post(signed_str_uri, json_data, {:accept=>'application/json', :content_type=>'application/json'})
|
289
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
290
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
291
|
+
end
|
292
|
+
|
293
|
+
def delete_hyperlink(hyperlink_index, folder_name='', storage_type = 'Aspose', storage_name = '')
|
294
|
+
raise 'hyperlink_index not specified.' if hyperlink_index.nil?
|
295
|
+
|
296
|
+
str_uri = "#{@base_uri}/hyperlinks/#{hyperlink_index}"
|
297
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
298
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
299
|
+
response_stream = RestClient.delete(signed_str_uri, {:accept=>'application/json'})
|
300
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
301
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
302
|
+
end
|
303
|
+
|
164
304
|
def get_comment(cell_name, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
165
305
|
raise 'cell_name not specified.' if cell_name.empty?
|
166
306
|
|
@@ -179,6 +319,54 @@ module Aspose
|
|
179
319
|
JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['OleObject']
|
180
320
|
end
|
181
321
|
|
322
|
+
def add_oleobject(ole_file, image_file, upper_left_row, upper_left_column, height, width, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
323
|
+
raise 'ole_file not specified.' if ole_file.empty?
|
324
|
+
raise 'image_file not specified.' if image_file.empty?
|
325
|
+
raise 'upper_left_row not specified.' if upper_left_row.nil?
|
326
|
+
raise 'upper_left_column not specified.' if upper_left_column.nil?
|
327
|
+
raise 'height not specified.' if height.nil?
|
328
|
+
raise 'width not specified.' if width.nil?
|
329
|
+
|
330
|
+
str_uri = "#{@base_uri}/oleobjects"
|
331
|
+
qry = Hash.new
|
332
|
+
qry[:oleFile] = ole_file
|
333
|
+
qry[:imageFile] = image_file
|
334
|
+
qry[:upperLeftRow] = upper_left_row
|
335
|
+
qry[:upperLeftColumn] = upper_left_column
|
336
|
+
qry[:height] = height
|
337
|
+
qry[:width] = width
|
338
|
+
str_uri = Aspose::Cloud::Common::Utils.build_uri(str_uri,qry)
|
339
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
340
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
341
|
+
JSON.parse(RestClient.put(signed_str_uri, '', {:accept=>'application/json'}))['Code'] == 200 ? true : false
|
342
|
+
end
|
343
|
+
|
344
|
+
def update_oleobject(index, str_xml, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
345
|
+
raise 'index not specified.' if index.nil?
|
346
|
+
raise 'str_xml not specified.' if str_xml.empty?
|
347
|
+
|
348
|
+
str_uri = "#{@base_uri}/oleobjects/#{index}"
|
349
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
350
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
351
|
+
JSON.parse(RestClient.post(signed_str_uri, str_xml, {:accept=>'application/json'}))['Code'] == 200 ? true : false
|
352
|
+
end
|
353
|
+
|
354
|
+
def delete_oleobject(index, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
355
|
+
raise 'index not specified.' if index.nil?
|
356
|
+
|
357
|
+
str_uri = "#{@base_uri}/oleobjects/#{index}"
|
358
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
359
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
360
|
+
JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'}))['Code'] == 200 ? true : false
|
361
|
+
end
|
362
|
+
|
363
|
+
def delete_all_oleobjects(folder_name = '', storage_type = 'Aspose', storage_name = '')
|
364
|
+
str_uri = "#{@base_uri}/oleobjects"
|
365
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
366
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
367
|
+
JSON.parse(RestClient.delete(signed_str_uri, {:accept=>'application/json'}))['Code'] == 200 ? true : false
|
368
|
+
end
|
369
|
+
|
182
370
|
def get_picture_by_index(image_index, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
183
371
|
raise 'image_index not specified.' if image_index.nil?
|
184
372
|
|
@@ -193,7 +381,7 @@ module Aspose
|
|
193
381
|
|
194
382
|
str_uri = "#{@base_uri}/validations/#{index}"
|
195
383
|
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
196
|
-
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
384
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
197
385
|
JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Validation']
|
198
386
|
end
|
199
387
|
|
@@ -210,7 +398,7 @@ module Aspose
|
|
210
398
|
str_uri = "#{@base_uri}/mergedCells"
|
211
399
|
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
212
400
|
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
213
|
-
JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['
|
401
|
+
JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['MergedCells']['Count']
|
214
402
|
end
|
215
403
|
|
216
404
|
def get_validations_count(folder_name = '', storage_type = 'Aspose', storage_name = '')
|
@@ -235,7 +423,7 @@ module Aspose
|
|
235
423
|
end
|
236
424
|
|
237
425
|
def get_charts_count(folder_name = '', storage_type = 'Aspose', storage_name = '')
|
238
|
-
str_uri = "#{@base_uri}/
|
426
|
+
str_uri = "#{@base_uri}/charts"
|
239
427
|
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
240
428
|
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
241
429
|
JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Charts']['ChartList'].length
|
@@ -341,6 +529,16 @@ module Aspose
|
|
341
529
|
JSON.parse(RestClient.get(signed_str_uri, {:accept=>'application/json'}))['Value']
|
342
530
|
end
|
343
531
|
|
532
|
+
def set_formula(cell_name, formula, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
533
|
+
raise 'cell_name not specified.' if cell_name.empty?
|
534
|
+
raise 'formula not specified.' if formula.empty?
|
535
|
+
|
536
|
+
str_uri = "#{@base_uri}/cells/#{cell_name}?formula=#{formula}"
|
537
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
538
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
539
|
+
JSON.parse(RestClient.post(signed_str_uri, '', { :accept=>'application/json'}))['Code'] == 200 ? true : false
|
540
|
+
end
|
541
|
+
|
344
542
|
def set_cell_value(cell_name, value_type, value, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
345
543
|
raise 'cell_name not specified.' if cell_name.empty?
|
346
544
|
raise 'value_type not specified.' if value_type.empty?
|
@@ -355,11 +553,11 @@ module Aspose
|
|
355
553
|
end
|
356
554
|
|
357
555
|
def add_picture(picture_path, upper_left_row, upper_left_column, lower_right_row, lower_right_column, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
358
|
-
raise '
|
359
|
-
raise 'upper_left_row not specified.' if upper_left_row.
|
360
|
-
raise 'upper_left_column not specified.' if upper_left_column.
|
361
|
-
raise 'lower_right_row not specified.' if lower_right_row.
|
362
|
-
raise 'lower_right_column not specified.' if lower_right_column.
|
556
|
+
raise 'picture_path not specified.' if picture_path.empty?
|
557
|
+
raise 'upper_left_row not specified.' if upper_left_row.nil?
|
558
|
+
raise 'upper_left_column not specified.' if upper_left_column.nil?
|
559
|
+
raise 'lower_right_row not specified.' if lower_right_row.nil?
|
560
|
+
raise 'lower_right_column not specified.' if lower_right_column.nil?
|
363
561
|
|
364
562
|
qry = { :upperLeftRow => upper_left_row, :upperLeftColumn => upper_left_column, :lowerRightRow => lower_right_row,
|
365
563
|
:lowerRightColumn => lower_right_column, :picturePath => picture_path}
|
@@ -369,6 +567,277 @@ module Aspose
|
|
369
567
|
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
370
568
|
JSON.parse(RestClient.put(signed_str_uri, '', { :accept=>'application/json'}))['Code'] == 200 ? true : false
|
371
569
|
end
|
570
|
+
|
571
|
+
def update_picture(picture_index, picture_data, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
572
|
+
raise 'picture_index not specified.' if picture_index.nil?
|
573
|
+
raise 'picture_data not specified.' if picture_data.empty?
|
574
|
+
|
575
|
+
str_uri = "#{@base_uri}/pictures/#{picture_index}"
|
576
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
577
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
578
|
+
JSON.parse(RestClient.post(signed_str_uri, picture_data, { :accept=>'application/json'}))['Code'] == 200 ? true : false
|
579
|
+
end
|
580
|
+
|
581
|
+
def delete_pictures(folder_name = '', storage_type = 'Aspose', storage_name = '')
|
582
|
+
str_uri = "#{@base_uri}/pictures"
|
583
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
584
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
585
|
+
|
586
|
+
response_stream = RestClient.delete(signed_str_uri, {:accept=>'application/json'})
|
587
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
588
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
589
|
+
end
|
590
|
+
|
591
|
+
def delete_picture(picture_index, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
592
|
+
raise 'picture_index not specified.' if picture_index.nil?
|
593
|
+
|
594
|
+
str_uri = "#{@base_uri}/pictures/#{picture_index}"
|
595
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
596
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
597
|
+
|
598
|
+
response_stream = RestClient.delete(signed_str_uri, {:accept=>'application/json'})
|
599
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
600
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
601
|
+
end
|
602
|
+
|
603
|
+
def copy_worksheet(new_worksheet_name, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
604
|
+
raise 'new_worksheet_name not specified.' if new_worksheet_name.empty?
|
605
|
+
|
606
|
+
str_uri = "#{Aspose::Cloud::Common::Product.product_uri}/cells/#{@filename}/worksheets/#{new_worksheet_name}/copy?sourcesheet=#{@worksheet_name}"
|
607
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
608
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
609
|
+
|
610
|
+
response_stream = RestClient.post(signed_str_uri, '', {:accept=>'application/json'})
|
611
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
612
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
613
|
+
end
|
614
|
+
|
615
|
+
def rename_worksheet(new_worksheet_name, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
616
|
+
raise 'new_worksheet_name not specified.' if new_worksheet_name.empty?
|
617
|
+
|
618
|
+
str_uri = "#{@base_uri}/Rename?newname=#{new_worksheet_name}"
|
619
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
620
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
621
|
+
|
622
|
+
response_stream = RestClient.post(signed_str_uri, '', {:accept=>'application/json'})
|
623
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
624
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
625
|
+
end
|
626
|
+
|
627
|
+
def set_background(background_image, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
628
|
+
raise 'background_image not specified.' if background_image.empty?
|
629
|
+
|
630
|
+
str_uri = "#{@base_uri}/Background?imageFile=#{background_image}"
|
631
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
632
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
633
|
+
|
634
|
+
response_stream = RestClient.post(signed_str_uri, '', {:accept=>'application/json'})
|
635
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
636
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
637
|
+
end
|
638
|
+
|
639
|
+
def delete_background(folder_name = '', storage_type = 'Aspose', storage_name = '')
|
640
|
+
str_uri = "#{@base_uri}/Background"
|
641
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
642
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
643
|
+
|
644
|
+
response_stream = RestClient.delete(signed_str_uri, {:accept=>'application/json'})
|
645
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
646
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
647
|
+
end
|
648
|
+
|
649
|
+
def freeze_panes(row, column, freezed_rows, freezed_columns, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
650
|
+
raise 'row not specified.' if row.nil?
|
651
|
+
raise 'column not specified.' if column.nil?
|
652
|
+
raise 'freezed_rows not specified.' if freezed_rows.nil?
|
653
|
+
raise 'freezed_columns not specified.' if freezed_columns.nil?
|
654
|
+
|
655
|
+
str_uri = "#{@base_uri}/FreezePanes?row=#{row}&column=#{column}&freezedRows=#{freezed_rows}&freezedColumns=#{freezed_columns}"
|
656
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
657
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
658
|
+
|
659
|
+
response_stream = RestClient.put(signed_str_uri, '', {:accept=>'application/json'})
|
660
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
661
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
662
|
+
end
|
663
|
+
|
664
|
+
def unfreeze_panes(row, column, freezed_rows, freezed_columns, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
665
|
+
raise 'row not specified.' if row.nil?
|
666
|
+
raise 'column not specified.' if column.nil?
|
667
|
+
raise 'freezed_rows not specified.' if freezed_rows.nil?
|
668
|
+
raise 'freezed_columns not specified.' if freezed_columns.nil?
|
669
|
+
|
670
|
+
str_uri = "#{@base_uri}/FreezePanes?row=#{row}&column=#{column}&freezedRows=#{freezed_rows}&freezedColumns=#{freezed_columns}"
|
671
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
672
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
673
|
+
|
674
|
+
response_stream = RestClient.delete(signed_str_uri, {:accept=>'application/json'})
|
675
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
676
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
677
|
+
end
|
678
|
+
|
679
|
+
def add_empty_row(row_id, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
680
|
+
raise 'row_id not specified.' if row_id.nil?
|
681
|
+
|
682
|
+
str_uri = "#{@base_uri}/cells/rows/#{row_id}"
|
683
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
684
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
685
|
+
|
686
|
+
response_stream = RestClient.put(signed_str_uri, '', {:accept=>'application/json'})
|
687
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
688
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
689
|
+
end
|
690
|
+
|
691
|
+
def copy_row(source_row_index, destination_row_index, row_number, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
692
|
+
raise 'source_row_index not specified.' if source_row_index.nil?
|
693
|
+
raise 'destination_row_index not specified.' if destination_row_index.nil?
|
694
|
+
raise 'row_number not specified.' if row_number.nil?
|
695
|
+
|
696
|
+
str_uri = "#{@base_uri}/cells/rows/copy?sourceRowIndex=#{source_row_index}&destinationRowIndex=#{destination_row_index}&rowNumber=#{row_number}"
|
697
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
698
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
699
|
+
|
700
|
+
response_stream = RestClient.post(signed_str_uri, '', {:accept=>'application/json'})
|
701
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
702
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
703
|
+
end
|
704
|
+
|
705
|
+
def hide_rows(start_row, total_rows, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
706
|
+
raise 'start_row not specified.' if start_row.nil?
|
707
|
+
raise 'total_rows not specified.' if total_rows.nil?
|
708
|
+
|
709
|
+
str_uri = "#{@base_uri}/cells/rows/hide?startrow=#{start_row}&totalRows=#{total_rows}"
|
710
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
711
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
712
|
+
|
713
|
+
response_stream = RestClient.post(signed_str_uri, '', {:accept=>'application/json'})
|
714
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
715
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
716
|
+
end
|
717
|
+
|
718
|
+
def unhide_rows(start_row, total_rows, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
719
|
+
raise 'start_row not specified.' if start_row.nil?
|
720
|
+
raise 'total_rows not specified.' if total_rows.nil?
|
721
|
+
|
722
|
+
str_uri = "#{@base_uri}/cells/rows/unhide?startrow=#{start_row}&totalRows=#{total_rows}"
|
723
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
724
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
725
|
+
|
726
|
+
response_stream = RestClient.post(signed_str_uri, '', {:accept=>'application/json'})
|
727
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
728
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
729
|
+
end
|
730
|
+
|
731
|
+
def group_rows(first_index, last_index, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
732
|
+
raise 'first_index not specified.' if first_index.nil?
|
733
|
+
raise 'last_index not specified.' if last_index.nil?
|
734
|
+
|
735
|
+
str_uri = "#{@base_uri}/cells/rows/group?firstIndex=#{first_index}&lastIndex=#{last_index}"
|
736
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
737
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
738
|
+
|
739
|
+
response_stream = RestClient.post(signed_str_uri, '', {:accept=>'application/json'})
|
740
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
741
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
742
|
+
end
|
743
|
+
|
744
|
+
def ungroup_rows(first_index, last_index, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
745
|
+
raise 'first_index not specified.' if first_index.nil?
|
746
|
+
raise 'last_index not specified.' if last_index.nil?
|
747
|
+
|
748
|
+
str_uri = "#{@base_uri}/cells/rows/ungroup?firstIndex=#{first_index}&lastIndex=#{last_index}"
|
749
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
750
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
751
|
+
|
752
|
+
response_stream = RestClient.post(signed_str_uri, '', {:accept=>'application/json'})
|
753
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
754
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
755
|
+
end
|
756
|
+
|
757
|
+
def merge_cells(start_row, start_column, total_rows, total_colunms, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
758
|
+
raise 'start_row not specified.' if start_row.nil?
|
759
|
+
raise 'start_column not specified.' if start_column.nil?
|
760
|
+
raise 'total_rows not specified.' if total_rows.nil?
|
761
|
+
raise 'total_colunms not specified.' if total_colunms.nil?
|
762
|
+
|
763
|
+
str_uri = "#{@base_uri}/cells/merge?startrow=#{start_row}&startcolumn=#{start_column}&totalrows=#{total_rows}&totalcolumns=#{total_colunms}"
|
764
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
765
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
766
|
+
|
767
|
+
response_stream = RestClient.post(signed_str_uri, '', {:accept=>'application/json'})
|
768
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
769
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
770
|
+
end
|
771
|
+
|
772
|
+
def unmerge_cells(start_row, start_column, total_rows, total_colunms, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
773
|
+
raise 'start_row not specified.' if start_row.nil?
|
774
|
+
raise 'start_column not specified.' if start_column.nil?
|
775
|
+
raise 'total_rows not specified.' if total_rows.nil?
|
776
|
+
raise 'total_colunms not specified.' if total_colunms.nil?
|
777
|
+
|
778
|
+
str_uri = "#{@base_uri}/cells/unmerge?startrow=#{start_row}&startcolumn=#{start_column}&totalrows=#{total_rows}&totalcolumns=#{total_colunms}"
|
779
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
780
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
781
|
+
|
782
|
+
response_stream = RestClient.post(signed_str_uri, '', {:accept=>'application/json'})
|
783
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
784
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
785
|
+
end
|
786
|
+
|
787
|
+
def clear_cells_formatting(start_row, start_column, end_row, end_column, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
788
|
+
raise 'start_row not specified.' if start_row.nil?
|
789
|
+
raise 'start_column not specified.' if start_column.nil?
|
790
|
+
raise 'end_row not specified.' if end_row.nil?
|
791
|
+
raise 'end_column not specified.' if end_column.nil?
|
792
|
+
|
793
|
+
str_uri = "#{@base_uri}/cells/ClearFormats?startRow=#{start_row}&startColumn=#{start_column}&endRow=#{end_row}&endColumn=#{end_column}"
|
794
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
795
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
796
|
+
|
797
|
+
response_stream = RestClient.post(signed_str_uri, '', {:accept=>'application/json'})
|
798
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
799
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
800
|
+
end
|
801
|
+
|
802
|
+
def clear_cells_contents(range, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
803
|
+
raise 'range not specified.' if range.empty?
|
804
|
+
|
805
|
+
str_uri = "#{@base_uri}/cells/clearcontents?range=#{range}"
|
806
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
807
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
808
|
+
|
809
|
+
response_stream = RestClient.post(signed_str_uri, '', {:accept=>'application/json'})
|
810
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
811
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
812
|
+
end
|
813
|
+
|
814
|
+
def set_range_value(cellarea, value, type, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
815
|
+
raise 'cellarea not specified.' if cellarea.empty?
|
816
|
+
raise 'value not specified.' if value.empty?
|
817
|
+
raise 'type not specified.' if type.empty?
|
818
|
+
|
819
|
+
str_uri = "#{@base_uri}/cells?cellarea=#{cellarea}&value=#{value}&type=#{type}"
|
820
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
821
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
822
|
+
|
823
|
+
response_stream = RestClient.post(signed_str_uri, '', {:accept=>'application/json'})
|
824
|
+
valid_output = Aspose::Cloud::Common::Utils.validate_output(response_stream)
|
825
|
+
valid_output.empty? ? Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type) : valid_output
|
826
|
+
end
|
827
|
+
|
828
|
+
def update_properties(worksheet_name, gridlines_visible = false, pagebreak_preview = false, ruler_visible = false, folder_name = '', storage_type = 'Aspose', storage_name = '')
|
829
|
+
raise 'worksheet_name not specified.' if worksheet_name.empty?
|
830
|
+
|
831
|
+
json_data = { :Name=>worksheet_name, :IsGridlinesVisible=>gridlines_visible, :IsPageBreakPreview=>pagebreak_preview, :IsRulerVisible=>ruler_visible }.to_json
|
832
|
+
str_uri = "#{@base_uri}"
|
833
|
+
str_uri = Aspose::Cloud::Common::Utils.append_storage(str_uri,folder_name,storage_name,storage_type)
|
834
|
+
signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
|
835
|
+
response = RestClient.post(signed_str_uri, json_data, {:content_type=>:json, :accept=>'application/json'})
|
836
|
+
json = JSON.parse(response)
|
837
|
+
if json['Code'] == 200
|
838
|
+
Aspose::Cloud::Common::Utils.download_file(@filename,@filename,folder_name,storage_name,storage_type)
|
839
|
+
end
|
840
|
+
end
|
372
841
|
end
|
373
842
|
end
|
374
843
|
end
|