aspose_slides_cloud 22.1.0 → 22.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +16 -0
- data/README.md +14 -3
- data/TestData/test.pptx +0 -0
- data/aspose_slides_cloud.gemspec +3 -1
- data/docker-entrypoint.sh +7 -0
- data/lib/aspose_slides_cloud/api/slides_api.rb +946 -654
- data/lib/aspose_slides_cloud/api_client.rb +11 -0
- data/lib/aspose_slides_cloud/models/accent_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/add_layout_slide.rb +4 -0
- data/lib/aspose_slides_cloud/models/add_master_slide.rb +4 -0
- data/lib/aspose_slides_cloud/models/add_shape.rb +4 -0
- data/lib/aspose_slides_cloud/models/add_slide.rb +4 -0
- data/lib/aspose_slides_cloud/models/api_info.rb +4 -0
- data/lib/aspose_slides_cloud/models/arc_to_path_segment.rb +4 -0
- data/lib/aspose_slides_cloud/models/array_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/arrow_head_properties.rb +4 -0
- data/lib/aspose_slides_cloud/models/audio_frame.rb +4 -0
- data/lib/aspose_slides_cloud/models/axes.rb +4 -0
- data/lib/aspose_slides_cloud/models/axis.rb +10 -6
- data/lib/aspose_slides_cloud/models/bar_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/base64_input_file.rb +4 -0
- data/lib/aspose_slides_cloud/models/block_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/blur_effect.rb +4 -0
- data/lib/aspose_slides_cloud/models/border_box_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/box_and_whisker_series.rb +6 -5
- data/lib/aspose_slides_cloud/models/box_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/bubble_chart_data_point.rb +4 -0
- data/lib/aspose_slides_cloud/models/bubble_series.rb +19 -7
- data/lib/aspose_slides_cloud/models/camera.rb +4 -0
- data/lib/aspose_slides_cloud/models/chart.rb +4 -0
- data/lib/aspose_slides_cloud/models/chart_category.rb +4 -0
- data/lib/aspose_slides_cloud/models/chart_title.rb +4 -0
- data/lib/aspose_slides_cloud/models/chart_wall.rb +4 -0
- data/lib/aspose_slides_cloud/models/close_path_segment.rb +4 -0
- data/lib/aspose_slides_cloud/models/color_scheme.rb +4 -0
- data/lib/aspose_slides_cloud/models/common_slide_view_properties.rb +4 -0
- data/lib/aspose_slides_cloud/models/connector.rb +4 -0
- data/lib/aspose_slides_cloud/models/cubic_bezier_to_path_segment.rb +4 -0
- data/lib/aspose_slides_cloud/models/custom_dash_pattern.rb +4 -0
- data/lib/aspose_slides_cloud/models/data_point.rb +4 -0
- data/lib/aspose_slides_cloud/models/delimiter_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/disc_usage.rb +4 -0
- data/lib/aspose_slides_cloud/models/document.rb +4 -0
- data/lib/aspose_slides_cloud/models/document_properties.rb +4 -0
- data/lib/aspose_slides_cloud/models/document_property.rb +4 -0
- data/lib/aspose_slides_cloud/models/document_replace_result.rb +4 -0
- data/lib/aspose_slides_cloud/models/effect.rb +4 -0
- data/lib/aspose_slides_cloud/models/effect_format.rb +4 -0
- data/lib/aspose_slides_cloud/models/entity_exists.rb +4 -0
- data/lib/aspose_slides_cloud/models/error.rb +4 -0
- data/lib/aspose_slides_cloud/models/error_details.rb +4 -0
- data/lib/aspose_slides_cloud/models/export_format.rb +1 -0
- data/lib/aspose_slides_cloud/models/export_options.rb +4 -0
- data/lib/aspose_slides_cloud/models/file_version.rb +4 -0
- data/lib/aspose_slides_cloud/models/file_versions.rb +4 -0
- data/lib/aspose_slides_cloud/models/files_list.rb +4 -0
- data/lib/aspose_slides_cloud/models/files_upload_result.rb +4 -0
- data/lib/aspose_slides_cloud/models/fill_format.rb +4 -0
- data/lib/aspose_slides_cloud/models/fill_overlay_effect.rb +4 -0
- data/lib/aspose_slides_cloud/models/font_scheme.rb +4 -0
- data/lib/aspose_slides_cloud/models/font_set.rb +4 -0
- data/lib/aspose_slides_cloud/models/format_scheme.rb +4 -0
- data/lib/aspose_slides_cloud/models/fraction_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/function_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/geometry_path.rb +4 -0
- data/lib/aspose_slides_cloud/models/geometry_paths.rb +4 -0
- data/lib/aspose_slides_cloud/models/geometry_shape.rb +4 -0
- data/lib/aspose_slides_cloud/models/gif_export_options.rb +4 -0
- data/lib/aspose_slides_cloud/models/glow_effect.rb +4 -0
- data/lib/aspose_slides_cloud/models/gradient_fill.rb +4 -0
- data/lib/aspose_slides_cloud/models/gradient_fill_stop.rb +4 -0
- data/lib/aspose_slides_cloud/models/graphical_object.rb +4 -0
- data/lib/aspose_slides_cloud/models/group_shape.rb +4 -0
- data/lib/aspose_slides_cloud/models/grouping_character_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/header_footer.rb +4 -0
- data/lib/aspose_slides_cloud/models/html5_export_options.rb +4 -0
- data/lib/aspose_slides_cloud/models/html_export_options.rb +4 -0
- data/lib/aspose_slides_cloud/models/hyperlink.rb +4 -0
- data/lib/aspose_slides_cloud/models/i_shape_export_options.rb +4 -0
- data/lib/aspose_slides_cloud/models/image.rb +4 -0
- data/lib/aspose_slides_cloud/models/image_export_options.rb +4 -0
- data/lib/aspose_slides_cloud/models/images.rb +4 -0
- data/lib/aspose_slides_cloud/models/inner_shadow_effect.rb +4 -0
- data/lib/aspose_slides_cloud/models/input.rb +4 -0
- data/lib/aspose_slides_cloud/models/input_file.rb +4 -0
- data/lib/aspose_slides_cloud/models/interactive_sequence.rb +4 -0
- data/lib/aspose_slides_cloud/models/layout_slide.rb +4 -0
- data/lib/aspose_slides_cloud/models/layout_slides.rb +4 -0
- data/lib/aspose_slides_cloud/models/left_sub_superscript_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/legend.rb +4 -0
- data/lib/aspose_slides_cloud/models/light_rig.rb +4 -0
- data/lib/aspose_slides_cloud/models/limit_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/line_format.rb +4 -0
- data/lib/aspose_slides_cloud/models/line_to_path_segment.rb +4 -0
- data/lib/aspose_slides_cloud/models/master_slide.rb +4 -0
- data/lib/aspose_slides_cloud/models/master_slides.rb +4 -0
- data/lib/aspose_slides_cloud/models/math_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/math_paragraph.rb +4 -0
- data/lib/aspose_slides_cloud/models/matrix_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/merge.rb +4 -0
- data/lib/aspose_slides_cloud/models/merging_source.rb +4 -0
- data/lib/aspose_slides_cloud/models/move_to_path_segment.rb +4 -0
- data/lib/aspose_slides_cloud/models/nary_operator_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/no_fill.rb +4 -0
- data/lib/aspose_slides_cloud/models/normal_view_restored_properties.rb +4 -0
- data/lib/aspose_slides_cloud/models/notes_slide.rb +4 -0
- data/lib/aspose_slides_cloud/models/notes_slide_header_footer.rb +4 -0
- data/lib/aspose_slides_cloud/models/object_exist.rb +4 -0
- data/lib/aspose_slides_cloud/models/ole_object_frame.rb +4 -0
- data/lib/aspose_slides_cloud/models/one_value_chart_data_point.rb +4 -0
- data/lib/aspose_slides_cloud/models/one_value_series.rb +16 -6
- data/lib/aspose_slides_cloud/models/ordered_merge_request.rb +4 -0
- data/lib/aspose_slides_cloud/models/outer_shadow_effect.rb +4 -0
- data/lib/aspose_slides_cloud/models/output_file.rb +4 -0
- data/lib/aspose_slides_cloud/models/paragraph.rb +4 -0
- data/lib/aspose_slides_cloud/models/paragraphs.rb +4 -0
- data/lib/aspose_slides_cloud/models/path_input_file.rb +4 -0
- data/lib/aspose_slides_cloud/models/path_output_file.rb +4 -0
- data/lib/aspose_slides_cloud/models/path_segment.rb +4 -0
- data/lib/aspose_slides_cloud/models/pattern_fill.rb +4 -0
- data/lib/aspose_slides_cloud/models/pdf_export_options.rb +4 -0
- data/lib/aspose_slides_cloud/models/picture_fill.rb +4 -0
- data/lib/aspose_slides_cloud/models/picture_frame.rb +4 -0
- data/lib/aspose_slides_cloud/models/pipeline.rb +4 -0
- data/lib/aspose_slides_cloud/models/placeholder.rb +4 -0
- data/lib/aspose_slides_cloud/models/placeholders.rb +4 -0
- data/lib/aspose_slides_cloud/models/plot_area.rb +4 -0
- data/lib/aspose_slides_cloud/models/portion.rb +4 -0
- data/lib/aspose_slides_cloud/models/portions.rb +4 -0
- data/lib/aspose_slides_cloud/models/pptx_export_options.rb +4 -0
- data/lib/aspose_slides_cloud/models/presentation_to_merge.rb +4 -0
- data/lib/aspose_slides_cloud/models/presentations_merge_request.rb +4 -0
- data/lib/aspose_slides_cloud/models/preset_shadow_effect.rb +4 -0
- data/lib/aspose_slides_cloud/models/protection_properties.rb +4 -0
- data/lib/aspose_slides_cloud/models/quadratic_bezier_to_path_segment.rb +4 -0
- data/lib/aspose_slides_cloud/models/radical_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/reflection_effect.rb +4 -0
- data/lib/aspose_slides_cloud/models/remove_shape.rb +4 -0
- data/lib/aspose_slides_cloud/models/remove_slide.rb +4 -0
- data/lib/aspose_slides_cloud/models/reorder_slide.rb +4 -0
- data/lib/aspose_slides_cloud/models/replace_text.rb +4 -0
- data/lib/aspose_slides_cloud/models/request_input_file.rb +4 -0
- data/lib/aspose_slides_cloud/models/reset_slide.rb +4 -0
- data/lib/aspose_slides_cloud/models/resource_base.rb +4 -0
- data/lib/aspose_slides_cloud/models/resource_uri.rb +4 -0
- data/lib/aspose_slides_cloud/models/response_output_file.rb +4 -0
- data/lib/aspose_slides_cloud/models/right_sub_superscript_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/save.rb +6 -2
- data/lib/aspose_slides_cloud/models/save_shape.rb +4 -0
- data/lib/aspose_slides_cloud/models/save_slide.rb +4 -0
- data/lib/aspose_slides_cloud/models/scatter_chart_data_point.rb +4 -0
- data/lib/aspose_slides_cloud/models/scatter_series.rb +8 -6
- data/lib/aspose_slides_cloud/models/section.rb +4 -0
- data/lib/aspose_slides_cloud/models/section_zoom_frame.rb +256 -0
- data/lib/aspose_slides_cloud/models/sections.rb +4 -0
- data/lib/aspose_slides_cloud/models/series.rb +5 -41
- data/lib/aspose_slides_cloud/models/series_marker.rb +4 -0
- data/lib/aspose_slides_cloud/models/shape.rb +16 -2
- data/lib/aspose_slides_cloud/models/shape_base.rb +6 -2
- data/lib/aspose_slides_cloud/models/shape_bevel.rb +4 -0
- data/lib/aspose_slides_cloud/models/shape_image_export_options.rb +4 -0
- data/lib/aspose_slides_cloud/models/shapes.rb +4 -0
- data/lib/aspose_slides_cloud/models/slide.rb +4 -0
- data/lib/aspose_slides_cloud/models/slide_animation.rb +4 -0
- data/lib/aspose_slides_cloud/models/slide_background.rb +4 -0
- data/lib/aspose_slides_cloud/models/slide_comment.rb +4 -0
- data/lib/aspose_slides_cloud/models/slide_comments.rb +4 -0
- data/lib/aspose_slides_cloud/models/slide_properties.rb +4 -0
- data/lib/aspose_slides_cloud/models/slide_replace_result.rb +4 -0
- data/lib/aspose_slides_cloud/models/slides.rb +4 -0
- data/lib/aspose_slides_cloud/models/smart_art.rb +4 -0
- data/lib/aspose_slides_cloud/models/smart_art_node.rb +4 -0
- data/lib/aspose_slides_cloud/models/smart_art_shape.rb +4 -0
- data/lib/aspose_slides_cloud/models/soft_edge_effect.rb +4 -0
- data/lib/aspose_slides_cloud/models/solid_fill.rb +4 -0
- data/lib/aspose_slides_cloud/models/split_document_result.rb +4 -0
- data/lib/aspose_slides_cloud/models/storage_exist.rb +4 -0
- data/lib/aspose_slides_cloud/models/storage_file.rb +4 -0
- data/lib/aspose_slides_cloud/models/subscript_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/summary_zoom_frame.rb +275 -0
- data/lib/aspose_slides_cloud/models/summary_zoom_section.rb +267 -0
- data/lib/aspose_slides_cloud/models/superscript_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/svg_export_options.rb +4 -0
- data/lib/aspose_slides_cloud/models/swf_export_options.rb +4 -0
- data/lib/aspose_slides_cloud/models/table.rb +4 -0
- data/lib/aspose_slides_cloud/models/table_cell.rb +4 -0
- data/lib/aspose_slides_cloud/models/table_column.rb +4 -0
- data/lib/aspose_slides_cloud/models/table_row.rb +4 -0
- data/lib/aspose_slides_cloud/models/task.rb +4 -0
- data/lib/aspose_slides_cloud/models/text_element.rb +4 -0
- data/lib/aspose_slides_cloud/models/text_frame_format.rb +255 -0
- data/lib/aspose_slides_cloud/models/text_item.rb +4 -0
- data/lib/aspose_slides_cloud/models/text_items.rb +4 -0
- data/lib/aspose_slides_cloud/models/theme.rb +4 -0
- data/lib/aspose_slides_cloud/models/three_d_format.rb +4 -0
- data/lib/aspose_slides_cloud/models/tiff_export_options.rb +4 -0
- data/lib/aspose_slides_cloud/models/update_background.rb +4 -0
- data/lib/aspose_slides_cloud/models/update_shape.rb +4 -0
- data/lib/aspose_slides_cloud/models/video_export_options.rb +258 -0
- data/lib/aspose_slides_cloud/models/video_frame.rb +4 -0
- data/lib/aspose_slides_cloud/models/view_properties.rb +4 -0
- data/lib/aspose_slides_cloud/models/waterfall_chart_data_point.rb +4 -0
- data/lib/aspose_slides_cloud/models/waterfall_series.rb +6 -5
- data/lib/aspose_slides_cloud/models/xaml_export_options.rb +4 -0
- data/lib/aspose_slides_cloud/models/xps_export_options.rb +4 -0
- data/lib/aspose_slides_cloud/models/xy_series.rb +255 -0
- data/lib/aspose_slides_cloud/models/zoom_frame.rb +256 -0
- data/lib/aspose_slides_cloud/models/zoom_object.rb +301 -0
- data/lib/aspose_slides_cloud/type_registry.rb +23 -5
- data/lib/aspose_slides_cloud/version.rb +1 -1
- data/lib/aspose_slides_cloud.rb +10 -2
- data/spec/api/slides_api_spec.rb +822 -0
- data/spec/use_cases/abstract_class_spec.rb +38 -0
- data/spec/use_cases/animation_spec.rb +193 -0
- data/spec/use_cases/auth_spec.rb +91 -0
- data/spec/use_cases/chart_spec.rb +291 -0
- data/spec/use_cases/convert_spec.rb +154 -0
- data/spec/use_cases/create_spec.rb +101 -0
- data/spec/use_cases/header_footer_spec.rb +78 -0
- data/spec/use_cases/hyperlink_spec.rb +92 -0
- data/spec/use_cases/image_spec.rb +102 -0
- data/spec/use_cases/layout_slide_spec.rb +190 -0
- data/spec/use_cases/master_slide_spec.rb +190 -0
- data/spec/use_cases/math_spec.rb +163 -0
- data/spec/use_cases/merge_spec.rb +106 -0
- data/spec/use_cases/notes_slide_spec.rb +172 -0
- data/spec/use_cases/nullable_field_spec.rb +86 -0
- data/spec/use_cases/pipeline_spec.rb +61 -0
- data/spec/use_cases/property_spec.rb +177 -0
- data/spec/use_cases/section_spec.rb +104 -0
- data/spec/use_cases/shape_format_spec.rb +126 -0
- data/spec/use_cases/shape_spec.rb +399 -0
- data/spec/use_cases/split_spec.rb +88 -0
- data/spec/use_cases/text_spec.rb +74 -0
- data/spec/use_cases/timeout_spec.rb +44 -0
- data/spec/use_cases/watermark_spec.rb +158 -0
- data/testRules.json +3 -0
- metadata +105 -15
- data/TestData/ChartTest.pptx +0 -0
- data/TestData/Sections.pptx +0 -0
- data/TestData/placeholders.pptx +0 -0
- data/TestData/test-unprotected.ppt +0 -0
- data/TestData/test.ppt +0 -0
- data/spec/extra/extra_spec.rb +0 -203
@@ -0,0 +1,38 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2019 Aspose Pty Ltd
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
12
|
+
copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
SOFTWARE.
|
21
|
+
=end
|
22
|
+
|
23
|
+
require 'spec_helper'
|
24
|
+
|
25
|
+
describe 'UseCases' do
|
26
|
+
describe 'Abstract Classes' do
|
27
|
+
it 'base shape' do
|
28
|
+
AsposeSlidesCloud::SpecUtils.initialize('GetSlideShape', nil, nil)
|
29
|
+
o = AsposeSlidesCloud::SpecUtils.api.get_shape("test.pptx", 1, 1, "password", "TempSlidesSDK")
|
30
|
+
expect(o.text).to eq("1")
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'chart' do
|
34
|
+
chart = AsposeSlidesCloud::Chart.new
|
35
|
+
expect(chart.type).to eq("Chart")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,193 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2019 Aspose Pty Ltd
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
12
|
+
copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
SOFTWARE.
|
21
|
+
=end
|
22
|
+
|
23
|
+
require 'spec_helper'
|
24
|
+
|
25
|
+
describe 'UseCases' do
|
26
|
+
describe 'Animation' do
|
27
|
+
it 'get' do
|
28
|
+
folder_name = "TempSlidesSDK"
|
29
|
+
file_name = "test.pptx"
|
30
|
+
password = "password"
|
31
|
+
slide_index = 1
|
32
|
+
watermark_text = "watermarkText"
|
33
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
34
|
+
|
35
|
+
animation = AsposeSlidesCloud::SpecUtils.api.get_animation(file_name, slide_index, nil, nil, password, folder_name)
|
36
|
+
expect(animation.main_sequence.length).to eq(1)
|
37
|
+
expect(animation.interactive_sequences.length).to eq(1)
|
38
|
+
|
39
|
+
animation = AsposeSlidesCloud::SpecUtils.api.get_animation(file_name, slide_index, 3, nil, password, folder_name)
|
40
|
+
expect(animation.main_sequence.length).to eq(1)
|
41
|
+
expect(animation.interactive_sequences.length).to eq(0)
|
42
|
+
|
43
|
+
animation = AsposeSlidesCloud::SpecUtils.api.get_animation(file_name, slide_index, 3, 1, password, folder_name)
|
44
|
+
expect(animation.main_sequence.length).to eq(0)
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'set' do
|
48
|
+
folder_name = "TempSlidesSDK"
|
49
|
+
file_name = "test.pptx"
|
50
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
51
|
+
|
52
|
+
dto = AsposeSlidesCloud::SlideAnimation.new
|
53
|
+
|
54
|
+
effect1 = AsposeSlidesCloud::Effect.new
|
55
|
+
effect1.type = "Blink"
|
56
|
+
effect1.shape_index = 2
|
57
|
+
effect1.paragraph_index = 1
|
58
|
+
|
59
|
+
effect2 = AsposeSlidesCloud::Effect.new
|
60
|
+
effect2.type = "Box"
|
61
|
+
effect2.subtype = "In"
|
62
|
+
effect2.preset_class_type = "Entrance"
|
63
|
+
effect2.shape_index = 4
|
64
|
+
dto.main_sequence = [ effect1, effect2 ]
|
65
|
+
dto.interactive_sequences = []
|
66
|
+
animation = AsposeSlidesCloud::SpecUtils.api.set_animation(file_name, 1, dto, "password", folder_name)
|
67
|
+
expect(animation.main_sequence.length).to eq(dto.main_sequence.length)
|
68
|
+
expect(animation.interactive_sequences.length).to eq(0)
|
69
|
+
end
|
70
|
+
|
71
|
+
it 'create effect' do
|
72
|
+
folder_name = "TempSlidesSDK"
|
73
|
+
file_name = "test.pptx"
|
74
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
75
|
+
|
76
|
+
dto = AsposeSlidesCloud::Effect.new
|
77
|
+
dto.type = "Blast"
|
78
|
+
dto.shape_index = 3
|
79
|
+
animation = AsposeSlidesCloud::SpecUtils.api.create_animation_effect(file_name, 1, dto, "password", folder_name)
|
80
|
+
expect(animation.main_sequence.length).to eq(2)
|
81
|
+
expect(animation.interactive_sequences.length).to eq(1)
|
82
|
+
end
|
83
|
+
|
84
|
+
it 'create interactive sequence' do
|
85
|
+
folder_name = "TempSlidesSDK"
|
86
|
+
file_name = "test.pptx"
|
87
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
88
|
+
|
89
|
+
dto = AsposeSlidesCloud::InteractiveSequence.new
|
90
|
+
dto.trigger_shape_index = 2
|
91
|
+
effect = AsposeSlidesCloud::Effect.new
|
92
|
+
effect.type = "Blast"
|
93
|
+
effect.shape_index = 3
|
94
|
+
dto.effects = [ effect ]
|
95
|
+
animation = AsposeSlidesCloud::SpecUtils.api.create_animation_interactive_sequence(file_name, 1, dto, "password", folder_name)
|
96
|
+
expect(animation.main_sequence.length).to eq(1)
|
97
|
+
expect(animation.interactive_sequences.length).to eq(2)
|
98
|
+
end
|
99
|
+
|
100
|
+
it 'create interactive sequence effect' do
|
101
|
+
folder_name = "TempSlidesSDK"
|
102
|
+
file_name = "test.pptx"
|
103
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
104
|
+
|
105
|
+
dto = AsposeSlidesCloud::Effect.new
|
106
|
+
dto.type = "Blast"
|
107
|
+
dto.shape_index = 3
|
108
|
+
animation = AsposeSlidesCloud::SpecUtils.api.create_animation_interactive_sequence_effect(file_name, 1, 1, dto, "password", folder_name)
|
109
|
+
expect(animation.main_sequence.length).to eq(1)
|
110
|
+
expect(animation.interactive_sequences.length).to eq(1)
|
111
|
+
end
|
112
|
+
|
113
|
+
it 'update effect' do
|
114
|
+
folder_name = "TempSlidesSDK"
|
115
|
+
file_name = "test.pptx"
|
116
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
117
|
+
|
118
|
+
dto = AsposeSlidesCloud::Effect.new
|
119
|
+
dto.type = "Blast"
|
120
|
+
dto.shape_index = 3
|
121
|
+
animation = AsposeSlidesCloud::SpecUtils.api.update_animation_effect(file_name, 1, 1, dto, "password", folder_name)
|
122
|
+
expect(animation.main_sequence.length).to eq(1)
|
123
|
+
expect(animation.interactive_sequences.length).to eq(1)
|
124
|
+
end
|
125
|
+
|
126
|
+
it 'update interactive sequence effect' do
|
127
|
+
folder_name = "TempSlidesSDK"
|
128
|
+
file_name = "test.pptx"
|
129
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
130
|
+
|
131
|
+
dto = AsposeSlidesCloud::Effect.new
|
132
|
+
dto.type = "Blast"
|
133
|
+
dto.shape_index = 3
|
134
|
+
animation = AsposeSlidesCloud::SpecUtils.api.update_animation_interactive_sequence_effect(file_name, 1, 1, 1, dto, "password", folder_name)
|
135
|
+
expect(animation.main_sequence.length).to eq(1)
|
136
|
+
expect(animation.interactive_sequences.length).to eq(1)
|
137
|
+
end
|
138
|
+
|
139
|
+
it 'delete' do
|
140
|
+
folder_name = "TempSlidesSDK"
|
141
|
+
file_name = "test.pptx"
|
142
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
143
|
+
animation = AsposeSlidesCloud::SpecUtils.api.delete_animation(file_name, 1, "password", folder_name)
|
144
|
+
expect(animation.main_sequence.length).to eq(0)
|
145
|
+
expect(animation.interactive_sequences.length).to eq(0)
|
146
|
+
end
|
147
|
+
|
148
|
+
it 'delete main sequence' do
|
149
|
+
folder_name = "TempSlidesSDK"
|
150
|
+
file_name = "test.pptx"
|
151
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
152
|
+
animation = AsposeSlidesCloud::SpecUtils.api.delete_animation_main_sequence(file_name, 1, "password", folder_name)
|
153
|
+
expect(animation.main_sequence.length).to eq(0)
|
154
|
+
expect(animation.interactive_sequences.length).to eq(1)
|
155
|
+
end
|
156
|
+
|
157
|
+
it 'delete main sequence effect' do
|
158
|
+
folder_name = "TempSlidesSDK"
|
159
|
+
file_name = "test.pptx"
|
160
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
161
|
+
animation = AsposeSlidesCloud::SpecUtils.api.delete_animation_effect(file_name, 1, 1, "password", folder_name)
|
162
|
+
expect(animation.main_sequence.length).to eq(0)
|
163
|
+
expect(animation.interactive_sequences.length).to eq(1)
|
164
|
+
end
|
165
|
+
|
166
|
+
it 'delete interactive sequences' do
|
167
|
+
folder_name = "TempSlidesSDK"
|
168
|
+
file_name = "test.pptx"
|
169
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
170
|
+
animation = AsposeSlidesCloud::SpecUtils.api.delete_animation_interactive_sequences(file_name, 1, "password", folder_name)
|
171
|
+
expect(animation.main_sequence.length).to eq(1)
|
172
|
+
expect(animation.interactive_sequences.length).to eq(0)
|
173
|
+
end
|
174
|
+
|
175
|
+
it 'delete interactive sequence' do
|
176
|
+
folder_name = "TempSlidesSDK"
|
177
|
+
file_name = "test.pptx"
|
178
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
179
|
+
animation = AsposeSlidesCloud::SpecUtils.api.delete_animation_interactive_sequence(file_name, 1, 1, "password", folder_name)
|
180
|
+
expect(animation.main_sequence.length).to eq(1)
|
181
|
+
expect(animation.interactive_sequences.length).to eq(0)
|
182
|
+
end
|
183
|
+
|
184
|
+
it 'delete interactive sequence effect' do
|
185
|
+
folder_name = "TempSlidesSDK"
|
186
|
+
file_name = "test.pptx"
|
187
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
188
|
+
animation = AsposeSlidesCloud::SpecUtils.api.delete_animation_interactive_sequence_effect(file_name, 1, 1, 1, "password", folder_name)
|
189
|
+
expect(animation.main_sequence.length).to eq(1)
|
190
|
+
expect(animation.interactive_sequences.length).to eq(1)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2019 Aspose Pty Ltd
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
12
|
+
copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
SOFTWARE.
|
21
|
+
=end
|
22
|
+
|
23
|
+
require 'spec_helper'
|
24
|
+
|
25
|
+
describe 'UseCases' do
|
26
|
+
describe 'Authentication' do
|
27
|
+
it 'good auth' do
|
28
|
+
config = JSON.parse(File.read('testConfig.json'))
|
29
|
+
configuration = AsposeSlidesCloud::Configuration.new
|
30
|
+
configuration.base_url = config["BaseUrl"]
|
31
|
+
configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
|
32
|
+
configuration.app_sid = config["ClientId"]
|
33
|
+
configuration.app_key = config["ClientSecret"]
|
34
|
+
configuration.debugging = config["Debug"]
|
35
|
+
api = AsposeSlidesCloud::SlidesApi.new(configuration)
|
36
|
+
o, c, _h = api.get_api_info_with_http_info
|
37
|
+
expect(c).to eq(200)
|
38
|
+
expect(o).not_to be(nil)
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'bad auth' do
|
42
|
+
config = JSON.parse(File.read('testConfig.json'))
|
43
|
+
configuration = AsposeSlidesCloud::Configuration.new
|
44
|
+
configuration.base_url = config["BaseUrl"]
|
45
|
+
configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
|
46
|
+
configuration.app_sid = "invalid"
|
47
|
+
configuration.app_key = config["ClientSecret"]
|
48
|
+
configuration.debugging = config["Debug"]
|
49
|
+
api = AsposeSlidesCloud::SlidesApi.new(configuration)
|
50
|
+
begin
|
51
|
+
o, c, _h = api.get_api_info_with_http_info
|
52
|
+
fail "An exception expected"
|
53
|
+
rescue AsposeSlidesCloud::ApiError => e
|
54
|
+
expect(e.code).to eq(401)
|
55
|
+
expect(e.response_body).to include("invalid_client")
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'good token' do
|
60
|
+
config = JSON.parse(File.read('testConfig.json'))
|
61
|
+
configuration = AsposeSlidesCloud::Configuration.new
|
62
|
+
configuration.base_url = config["BaseUrl"]
|
63
|
+
configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
|
64
|
+
configuration.app_sid = config["ClientId"]
|
65
|
+
configuration.app_key = config["ClientSecret"]
|
66
|
+
configuration.debugging = config["Debug"]
|
67
|
+
api = AsposeSlidesCloud::SlidesApi.new(configuration)
|
68
|
+
api.get_api_info_with_http_info
|
69
|
+
configuration.app_sid = "invalid"
|
70
|
+
api = AsposeSlidesCloud::SlidesApi.new(configuration)
|
71
|
+
o, c, _h = api.get_api_info_with_http_info
|
72
|
+
expect(c).to eq(200)
|
73
|
+
expect(o).not_to be(nil)
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'bad token' do
|
77
|
+
config = JSON.parse(File.read('testConfig.json'))
|
78
|
+
configuration = AsposeSlidesCloud::Configuration.new
|
79
|
+
configuration.base_url = config["BaseUrl"]
|
80
|
+
configuration.auth_base_url = config["AuthBaseUrl"] ? config["AuthBaseUrl"] : config["BaseUrl"]
|
81
|
+
configuration.app_sid = config["ClientId"]
|
82
|
+
configuration.app_key = config["ClientSecret"]
|
83
|
+
configuration.access_token = "expired.token"
|
84
|
+
configuration.debugging = config["Debug"]
|
85
|
+
api = AsposeSlidesCloud::SlidesApi.new(configuration)
|
86
|
+
o, c, _h = api.get_api_info_with_http_info
|
87
|
+
expect(c).to eq(200)
|
88
|
+
expect(o).not_to be(nil)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,291 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2019 Aspose Pty Ltd
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
12
|
+
copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
SOFTWARE.
|
21
|
+
=end
|
22
|
+
|
23
|
+
require 'spec_helper'
|
24
|
+
|
25
|
+
describe 'UseCases' do
|
26
|
+
describe 'Chart' do
|
27
|
+
it 'get' do
|
28
|
+
folder_name = "TempSlidesSDK"
|
29
|
+
file_name = "test.pptx"
|
30
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
31
|
+
chart = AsposeSlidesCloud::SpecUtils.api.get_shape(file_name, 3, 1, "password", folder_name)
|
32
|
+
expect(chart.series.length).to eq(3)
|
33
|
+
expect(chart.categories.length).to eq(4)
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'create' do
|
37
|
+
folder_name = "TempSlidesSDK"
|
38
|
+
file_name = "test.pptx"
|
39
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
40
|
+
chart = AsposeSlidesCloud::Chart.new
|
41
|
+
chart.chart_type = 'ClusteredColumn'
|
42
|
+
chart.width = 400
|
43
|
+
chart.height = 300
|
44
|
+
series1 = AsposeSlidesCloud::OneValueSeries.new
|
45
|
+
series1.name = "Series1"
|
46
|
+
point11 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
47
|
+
point11.value = 40
|
48
|
+
point12 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
49
|
+
point12.value = 50
|
50
|
+
point13 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
51
|
+
point13.value = 70
|
52
|
+
series1.data_points = [point11, point12, point13]
|
53
|
+
series2 = AsposeSlidesCloud::OneValueSeries.new
|
54
|
+
series2.name = "Series2"
|
55
|
+
point21 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
56
|
+
point21.value = 55
|
57
|
+
point22 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
58
|
+
point22.value = 35
|
59
|
+
point23 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
60
|
+
point23.value = 90
|
61
|
+
series2.data_points = [point21, point22, point23]
|
62
|
+
chart.series = [ series1, series2 ]
|
63
|
+
category1 = AsposeSlidesCloud::ChartCategory.new
|
64
|
+
category1.value = "Category1"
|
65
|
+
category2 = AsposeSlidesCloud::ChartCategory.new
|
66
|
+
category2.value = "Category2"
|
67
|
+
category3 = AsposeSlidesCloud::ChartCategory.new
|
68
|
+
category3.value = "Category3"
|
69
|
+
chart.categories = [category1, category2, category3]
|
70
|
+
result = AsposeSlidesCloud::SpecUtils.api.create_shape(file_name, 3, chart, nil, nil, "password", folder_name)
|
71
|
+
expect(result.series.length).to eq(2)
|
72
|
+
expect(result.categories.length).to eq(3)
|
73
|
+
end
|
74
|
+
|
75
|
+
it 'update' do
|
76
|
+
folder_name = "TempSlidesSDK"
|
77
|
+
file_name = "test.pptx"
|
78
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
79
|
+
chart = AsposeSlidesCloud::Chart.new
|
80
|
+
chart.chart_type = 'ClusteredColumn'
|
81
|
+
chart.width = 400
|
82
|
+
chart.height = 300
|
83
|
+
series1 = AsposeSlidesCloud::OneValueSeries.new
|
84
|
+
series1.name = "Series1"
|
85
|
+
point11 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
86
|
+
point11.value = 40
|
87
|
+
point12 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
88
|
+
point12.value = 50
|
89
|
+
point13 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
90
|
+
point13.value = 70
|
91
|
+
series1.data_points = [point11, point12, point13]
|
92
|
+
series2 = AsposeSlidesCloud::OneValueSeries.new
|
93
|
+
series2.name = "Series2"
|
94
|
+
point21 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
95
|
+
point21.value = 55
|
96
|
+
point22 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
97
|
+
point22.value = 35
|
98
|
+
point23 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
99
|
+
point23.value = 90
|
100
|
+
series2.data_points = [point21, point22, point23]
|
101
|
+
chart.series = [ series1, series2 ]
|
102
|
+
category1 = AsposeSlidesCloud::ChartCategory.new
|
103
|
+
category1.value = "Category1"
|
104
|
+
category2 = AsposeSlidesCloud::ChartCategory.new
|
105
|
+
category2.value = "Category2"
|
106
|
+
category3 = AsposeSlidesCloud::ChartCategory.new
|
107
|
+
category3.value = "Category3"
|
108
|
+
chart.categories = [category1, category2, category3]
|
109
|
+
result = AsposeSlidesCloud::SpecUtils.api.update_shape(file_name, 3, 1, chart, "password", folder_name)
|
110
|
+
expect(result.series.length).to eq(2)
|
111
|
+
expect(result.categories.length).to eq(3)
|
112
|
+
end
|
113
|
+
|
114
|
+
it 'series create' do
|
115
|
+
folder_name = "TempSlidesSDK"
|
116
|
+
file_name = "test.pptx"
|
117
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
118
|
+
series = AsposeSlidesCloud::OneValueSeries.new
|
119
|
+
series.name = "New Series"
|
120
|
+
point1 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
121
|
+
point1.value = 40
|
122
|
+
point2 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
123
|
+
point2.value = 50
|
124
|
+
point3 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
125
|
+
point3.value = 14
|
126
|
+
point4 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
127
|
+
point4.value = 70
|
128
|
+
series.data_points = [ point1, point2, point3, point4 ]
|
129
|
+
result = AsposeSlidesCloud::SpecUtils.api.create_chart_series(file_name, 3, 1, series, "password", folder_name)
|
130
|
+
expect(result.series.length).to eq(4)
|
131
|
+
expect(result.categories.length).to eq(4)
|
132
|
+
end
|
133
|
+
|
134
|
+
it 'series update' do
|
135
|
+
folder_name = "TempSlidesSDK"
|
136
|
+
file_name = "test.pptx"
|
137
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
138
|
+
series = AsposeSlidesCloud::OneValueSeries.new
|
139
|
+
series.name = "Series3"
|
140
|
+
point1 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
141
|
+
point1.value = 40
|
142
|
+
point2 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
143
|
+
point2.value = 50
|
144
|
+
point3 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
145
|
+
point3.value = 14
|
146
|
+
point4 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
147
|
+
point4.value = 70
|
148
|
+
series.data_points = [ point1, point2, point3, point4 ]
|
149
|
+
result = AsposeSlidesCloud::SpecUtils.api.update_chart_series(file_name, 3, 1, 2, series, "password", folder_name)
|
150
|
+
expect(result.series.length).to eq(3)
|
151
|
+
expect(result.categories.length).to eq(4)
|
152
|
+
end
|
153
|
+
|
154
|
+
it 'series delete' do
|
155
|
+
folder_name = "TempSlidesSDK"
|
156
|
+
file_name = "test.pptx"
|
157
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
158
|
+
result = AsposeSlidesCloud::SpecUtils.api.delete_chart_series(file_name, 3, 1, 2, "password", folder_name)
|
159
|
+
expect(result.series.length).to eq(2)
|
160
|
+
expect(result.categories.length).to eq(4)
|
161
|
+
end
|
162
|
+
|
163
|
+
it 'category create' do
|
164
|
+
folder_name = "TempSlidesSDK"
|
165
|
+
file_name = "test.pptx"
|
166
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
167
|
+
category = AsposeSlidesCloud::ChartCategory.new
|
168
|
+
category.value = "New Category"
|
169
|
+
point1 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
170
|
+
point1.value = 40
|
171
|
+
point2 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
172
|
+
point2.value = 50
|
173
|
+
point3 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
174
|
+
point3.value = 14
|
175
|
+
category.data_points = [ point1, point2, point3 ]
|
176
|
+
result = AsposeSlidesCloud::SpecUtils.api.create_chart_category(file_name, 3, 1, category, "password", folder_name)
|
177
|
+
expect(result.series.length).to eq(3)
|
178
|
+
expect(result.categories.length).to eq(5)
|
179
|
+
expect(result.series[0].data_points.length).to eq(5)
|
180
|
+
expect(result.series[0].data_points[4].value).to eq(category.data_points[0].value)
|
181
|
+
end
|
182
|
+
|
183
|
+
it 'category update' do
|
184
|
+
folder_name = "TempSlidesSDK"
|
185
|
+
file_name = "test.pptx"
|
186
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
187
|
+
category = AsposeSlidesCloud::ChartCategory.new
|
188
|
+
category.value = "New Category"
|
189
|
+
point1 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
190
|
+
point1.value = 40
|
191
|
+
point2 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
192
|
+
point2.value = 50
|
193
|
+
point3 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
194
|
+
point3.value = 14
|
195
|
+
category.data_points = [ point1, point2, point3 ]
|
196
|
+
result = AsposeSlidesCloud::SpecUtils.api.update_chart_category(file_name, 3, 1, 2, category, "password", folder_name)
|
197
|
+
expect(result.series.length).to eq(3)
|
198
|
+
expect(result.categories.length).to eq(4)
|
199
|
+
expect(result.series[0].data_points.length).to eq(4)
|
200
|
+
expect(result.series[0].data_points[1].value).to eq(category.data_points[0].value)
|
201
|
+
end
|
202
|
+
|
203
|
+
it 'category delete' do
|
204
|
+
folder_name = "TempSlidesSDK"
|
205
|
+
file_name = "test.pptx"
|
206
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
207
|
+
result = AsposeSlidesCloud::SpecUtils.api.delete_chart_category(file_name, 3, 1, 2, "password", folder_name)
|
208
|
+
expect(result.series.length).to eq(3)
|
209
|
+
expect(result.categories.length).to eq(3)
|
210
|
+
expect(result.series[0].data_points.length).to eq(3)
|
211
|
+
end
|
212
|
+
|
213
|
+
it 'data point create' do
|
214
|
+
folder_name = "TempSlidesSDK"
|
215
|
+
file_name = "test.pptx"
|
216
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
217
|
+
point = AsposeSlidesCloud::OneValueChartDataPoint.new
|
218
|
+
point.value = 40
|
219
|
+
begin
|
220
|
+
result = AsposeSlidesCloud::SpecUtils.api.create_chart_data_point(file_name, 3, 1, 2, point, "password", folder_name)
|
221
|
+
fail "Must have failed because adding data points only works with Scatter & Bubble charts"
|
222
|
+
rescue AsposeSlidesCloud::ApiError => e
|
223
|
+
expect(e.code).to eq(400)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
it 'data point update' do
|
228
|
+
folder_name = "TempSlidesSDK"
|
229
|
+
file_name = "test.pptx"
|
230
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
231
|
+
point = AsposeSlidesCloud::OneValueChartDataPoint.new
|
232
|
+
point.value = 40
|
233
|
+
result = AsposeSlidesCloud::SpecUtils.api.update_chart_data_point(file_name, 3, 1, 2, 2, point, "password", folder_name)
|
234
|
+
expect(result.series.length).to eq(3)
|
235
|
+
expect(result.categories.length).to eq(4)
|
236
|
+
expect(result.series[1].data_points.length).to eq(4)
|
237
|
+
expect(result.series[1].data_points[1].value).to eq(point.value)
|
238
|
+
end
|
239
|
+
|
240
|
+
it 'data point delete' do
|
241
|
+
folder_name = "TempSlidesSDK"
|
242
|
+
file_name = "test.pptx"
|
243
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
244
|
+
result = AsposeSlidesCloud::SpecUtils.api.delete_chart_data_point(file_name, 3, 1, 2, 2, "password", folder_name)
|
245
|
+
expect(result.series.length).to eq(3)
|
246
|
+
expect(result.categories.length).to eq(4)
|
247
|
+
expect(result.series[1].data_points[1]).not_to be_truthy
|
248
|
+
end
|
249
|
+
|
250
|
+
it 'sunburst' do
|
251
|
+
folder_name = "TempSlidesSDK"
|
252
|
+
file_name = "test.pptx"
|
253
|
+
AsposeSlidesCloud::SpecUtils.api.copy_file("TempTests/" + file_name, folder_name + "/" + file_name)
|
254
|
+
chart = AsposeSlidesCloud::Chart.new
|
255
|
+
chart.chart_type = 'Sunburst'
|
256
|
+
chart.width = 400
|
257
|
+
chart.height = 300
|
258
|
+
series1 = AsposeSlidesCloud::OneValueSeries.new
|
259
|
+
series1.name = "Series1"
|
260
|
+
point1 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
261
|
+
point1.value = 40
|
262
|
+
point2 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
263
|
+
point2.value = 50
|
264
|
+
point3 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
265
|
+
point3.value = 70
|
266
|
+
point4 = AsposeSlidesCloud::OneValueChartDataPoint.new
|
267
|
+
point4.value = 70
|
268
|
+
series1.data_points = [ point1, point2, point3, point4 ]
|
269
|
+
chart.series = [ series1 ]
|
270
|
+
category1 = AsposeSlidesCloud::ChartCategory.new
|
271
|
+
category1.value = "Leaf1"
|
272
|
+
category1.level = 3
|
273
|
+
category1.parent_categories = [ "Branch1", "Stem1" ]
|
274
|
+
category2 = AsposeSlidesCloud::ChartCategory.new
|
275
|
+
category2.value = "Leaf2"
|
276
|
+
category2.level = 3
|
277
|
+
category2.parent_categories = [ "Branch1", "Stem1" ]
|
278
|
+
category3 = AsposeSlidesCloud::ChartCategory.new
|
279
|
+
category3.value = "Branch2"
|
280
|
+
category3.level = 2
|
281
|
+
category3.parent_categories = [ "Stem1" ]
|
282
|
+
category4 = AsposeSlidesCloud::ChartCategory.new
|
283
|
+
category4.value = "Stem2"
|
284
|
+
category4.level = 1
|
285
|
+
chart.categories = [ category1, category2, category3, category4 ]
|
286
|
+
result = AsposeSlidesCloud::SpecUtils.api.create_shape(file_name, 3, chart, nil, nil, "password", folder_name)
|
287
|
+
expect(result.series.length).to eq(1)
|
288
|
+
expect(result.categories.length).to eq(4)
|
289
|
+
end
|
290
|
+
end
|
291
|
+
end
|