groupdocs 1.5.3 → 1.5.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +0 -1
- data/README.md +2 -0
- data/examples/api-samples/public/docs/annotation-sample.html +167 -57
- data/examples/api-samples/public/docs/docco.css +459 -151
- data/examples/api-samples/public/docs/envelope-sample.html +373 -131
- data/examples/api-samples/public/docs/sample1.html +126 -26
- data/examples/api-samples/public/docs/sample10.html +213 -50
- data/examples/api-samples/public/docs/sample11.html +319 -87
- data/examples/api-samples/public/docs/sample12.html +165 -40
- data/examples/api-samples/public/docs/sample13.html +166 -41
- data/examples/api-samples/public/docs/sample14.html +142 -30
- data/examples/api-samples/public/docs/sample15.html +127 -27
- data/examples/api-samples/public/docs/sample16.html +125 -25
- data/examples/api-samples/public/docs/sample17.html +188 -37
- data/examples/api-samples/public/docs/sample18.html +614 -157
- data/examples/api-samples/public/docs/sample19.html +221 -59
- data/examples/api-samples/public/docs/sample2.html +142 -30
- data/examples/api-samples/public/docs/sample20.html +176 -51
- data/examples/api-samples/public/docs/sample21.html +287 -66
- data/examples/api-samples/public/docs/sample22.html +224 -53
- data/examples/api-samples/public/docs/sample23.html +256 -0
- data/examples/api-samples/public/docs/sample24.html +143 -0
- data/examples/api-samples/public/docs/sample25.html +429 -0
- data/examples/api-samples/public/docs/sample26.html +113 -0
- data/examples/api-samples/public/docs/sample27.html +433 -0
- data/examples/api-samples/public/docs/sample28.html +185 -0
- data/examples/api-samples/public/docs/sample29.html +175 -0
- data/examples/api-samples/public/docs/sample3.html +172 -34
- data/examples/api-samples/public/docs/sample30.html +144 -0
- data/examples/api-samples/public/docs/sample31.html +734 -0
- data/examples/api-samples/public/docs/sample4.html +204 -52
- data/examples/api-samples/public/docs/sample5.html +241 -63
- data/examples/api-samples/public/docs/sample6.html +209 -48
- data/examples/api-samples/public/docs/sample7.html +155 -43
- data/examples/api-samples/public/docs/sample8.html +235 -62
- data/examples/api-samples/public/docs/sample9.html +200 -49
- data/examples/api-samples/public/templates/merge_field1_doc.docx +0 -0
- data/examples/api-samples/public/templates/merge_field2_doc.docx +0 -0
- data/examples/api-samples/samples/sample23.rb +54 -0
- data/examples/api-samples/samples/sample24.rb +30 -0
- data/examples/api-samples/samples/sample25.rb +4 -4
- data/examples/api-samples/samples/sample26.rb +25 -0
- data/examples/api-samples/samples/sample27.rb +100 -0
- data/examples/api-samples/samples/sample28.rb +47 -0
- data/examples/api-samples/samples/sample29.rb +52 -0
- data/examples/api-samples/samples/sample30.rb +39 -0
- data/examples/api-samples/samples/sample31.rb +204 -0
- data/examples/api-samples/samples/sample5.rb +5 -3
- data/examples/api-samples/samples/sample6.rb +2 -0
- data/examples/api-samples/views/_others_samples.haml +12 -0
- data/examples/api-samples/views/index.haml +12 -0
- data/examples/api-samples/views/layout.haml +1 -0
- data/examples/api-samples/views/sample1.haml +3 -2
- data/examples/api-samples/views/sample10.haml +3 -2
- data/examples/api-samples/views/sample11.haml +4 -0
- data/examples/api-samples/views/sample12.haml +4 -0
- data/examples/api-samples/views/sample13.haml +4 -0
- data/examples/api-samples/views/sample14.haml +4 -0
- data/examples/api-samples/views/sample15.haml +4 -0
- data/examples/api-samples/views/sample16.haml +4 -0
- data/examples/api-samples/views/sample17.haml +4 -0
- data/examples/api-samples/views/sample19.haml +4 -0
- data/examples/api-samples/views/sample2.haml +3 -2
- data/examples/api-samples/views/sample20.haml +4 -0
- data/examples/api-samples/views/sample21.haml +4 -0
- data/examples/api-samples/views/sample22.haml +4 -0
- data/examples/api-samples/views/sample23.haml +87 -0
- data/examples/api-samples/views/sample24.haml +44 -0
- data/examples/api-samples/views/sample26.haml +54 -0
- data/examples/api-samples/views/sample27.haml +122 -0
- data/examples/api-samples/views/sample28.haml +47 -0
- data/examples/api-samples/views/sample29.haml +70 -0
- data/examples/api-samples/views/sample3.haml +3 -2
- data/examples/api-samples/views/sample30.haml +46 -0
- data/examples/api-samples/views/sample31.haml +114 -0
- data/examples/api-samples/views/sample4.haml +3 -2
- data/examples/api-samples/views/sample5.haml +3 -2
- data/examples/api-samples/views/sample6.haml +3 -2
- data/examples/api-samples/views/sample7.haml +3 -2
- data/examples/api-samples/views/sample8.haml +3 -2
- data/examples/api-samples/views/sample9.haml +3 -2
- data/examples/viewer/Gemfile +1 -1
- data/groupdocs.gemspec +3 -3
- data/lib/groupdocs/datasource.rb +22 -0
- data/lib/groupdocs/document.rb +493 -43
- data/lib/groupdocs/document/annotation.rb +73 -0
- data/lib/groupdocs/job.rb +82 -1
- data/lib/groupdocs/post.rb +83 -0
- data/lib/groupdocs/questionnaire.rb +41 -0
- data/lib/groupdocs/signature.rb +342 -0
- data/lib/groupdocs/signature/envelope.rb +56 -0
- data/lib/groupdocs/signature/form.rb +47 -5
- data/lib/groupdocs/signature/shared/field_methods.rb +37 -0
- data/lib/groupdocs/storage/file.rb +83 -0
- data/lib/groupdocs/subscription.rb +218 -0
- data/lib/groupdocs/user.rb +422 -1
- data/lib/groupdocs/version.rb +1 -1
- data/spec/groupdocs/job_spec.rb +4 -5
- data/spec/groupdocs/user_spec.rb +157 -0
- data/spec/support/json/annotation_resize.json +11 -0
- data/spec/support/json/annotation_text_color.json +10 -0
- data/spec/support/json/annotation_text_info.json +11 -0
- data/spec/support/json/document_content_get.json +8 -0
- data/spec/support/json/document_edit_lock_get.json +10 -0
- data/spec/support/json/document_editlock_remove.json +8 -0
- data/spec/support/json/document_page_html_urls_get.json +14 -0
- data/spec/support/json/document_password_set.json +19 -0
- data/spec/support/json/document_representations.json +25 -0
- data/spec/support/json/document_shared_documents_get.json +32 -0
- data/spec/support/json/document_tags_get.json +9 -0
- data/spec/support/json/document_tags_remove.json +8 -0
- data/spec/support/json/document_tags_set.json +8 -0
- data/spec/support/json/document_user_status_set.json +12 -0
- data/spec/support/json/job_documents.json +103 -35
- data/spec/support/json/job_xml_get.json +30 -0
- data/spec/support/json/jobs_documents.json +40 -0
- data/spec/support/json/user_get_profile.json +73 -0
- metadata +49 -177
@@ -8,15 +8,17 @@ post '/sample5' do
|
|
8
8
|
# set variables
|
9
9
|
set :client_id, params[:client_id]
|
10
10
|
set :private_key, params[:private_key]
|
11
|
-
set :file_id, params[:
|
11
|
+
set :file_id, params[:fileId]
|
12
12
|
set :url, params[:url]
|
13
13
|
set :copy, params[:copy]
|
14
14
|
set :move, params[:move]
|
15
15
|
set :dest_path, params[:dest_path]
|
16
|
+
set :source, params[:source]
|
16
17
|
|
17
18
|
begin
|
19
|
+
|
18
20
|
# check required variables
|
19
|
-
raise 'Please enter all required parameters' if settings.client_id.empty? or settings.private_key.empty?
|
21
|
+
raise 'Please enter all required parameters' if settings.client_id.empty? or settings.private_key.empty?
|
20
22
|
|
21
23
|
file = nil
|
22
24
|
# get document by file GUID
|
@@ -35,7 +37,7 @@ post '/sample5' do
|
|
35
37
|
else
|
36
38
|
raise 'Wrong GUID source.'
|
37
39
|
end
|
38
|
-
|
40
|
+
# raise files_list.to_yaml
|
39
41
|
# copy file using request to API
|
40
42
|
unless settings.copy.nil?
|
41
43
|
file = file.copy!(settings.dest_path, {}, {:client_id => settings.client_id, :private_key => settings.private_key})
|
@@ -25,10 +25,12 @@ post '/sample6' do
|
|
25
25
|
signature_one_path = "#{Dir.tmpdir}/#{params[:signature][:filename]}"
|
26
26
|
File.open(signature_one_path, 'wb') { |f| f.write(params[:signature][:tempfile].read) }
|
27
27
|
|
28
|
+
|
28
29
|
# add signature to file using API
|
29
30
|
signature_one = GroupDocs::Signature.new(name: 'Test', image_path: signature_one_path)
|
30
31
|
signature_one.position = {top: 0.1, left: 0.07, width: 50, height: 50}
|
31
32
|
|
33
|
+
#raise signature_one.to_yaml
|
32
34
|
# make a request to API using client_id and private_key
|
33
35
|
signed_documents = GroupDocs::Document.sign_documents!([document_one], [signature_one], {}, {:client_id => settings.client_id, :private_key => settings.private_key})
|
34
36
|
guid = signed_documents.first.file.guid
|
@@ -51,6 +51,18 @@
|
|
51
51
|
%a{:href => '/sample24'} Sample24 - How to use StorageApi to upload file from URL to GroupDocs account using Ruby SDK
|
52
52
|
%li
|
53
53
|
%a{:href => '/sample25'} Sample25 - How merge and convert document using Ruby SDK
|
54
|
+
%li
|
55
|
+
%a{:href => '/sample26'} Sample26 - How to use login method in the API
|
56
|
+
%li
|
57
|
+
%a{:href => '/sample27'} Sample27 - How to create your own questionary using forms and show the result document using Ruby SDK
|
58
|
+
%li
|
59
|
+
%a{:href => '/sample28'} Sample28 - How to delete all annotations from document using Ruby SDK
|
60
|
+
%li
|
61
|
+
%a{:href => '/sample29'} Sample29 - How to use Filepicker.io to upload document and get it's URL
|
62
|
+
%li
|
63
|
+
%a{:href => '/sample30'} Sample30 - How to delete file from GroupDocs Storage
|
64
|
+
%li
|
65
|
+
%a{:href => '/sample31'} Sample31 - How to dynamically create Signature Form using data from HTML form
|
54
66
|
%li
|
55
67
|
%a{:href => '/annotation-sample'} Annotation sample
|
56
68
|
%li
|
@@ -51,6 +51,18 @@
|
|
51
51
|
%a{:href => '/sample24'} Sample24 - How to use StorageApi to upload file from URL to GroupDocs account using Ruby SDK
|
52
52
|
%li
|
53
53
|
%a{:href => '/sample25'} Sample25 - How merge and convert document using Ruby SDK
|
54
|
+
%li
|
55
|
+
%a{:href => '/sample26'} Sample26 - How to use login method in the API
|
56
|
+
%li
|
57
|
+
%a{:href => '/sample27'} Sample27 - How to create your own questionary using forms and show the result document using Ruby SDK
|
58
|
+
%li
|
59
|
+
%a{:href => '/sample28'} Sample28 - How to delete all annotations from document
|
60
|
+
%li
|
61
|
+
%a{:href => '/sample29'} Sample29 - How to use Filepicker.io to upload document and get it's URL
|
62
|
+
%li
|
63
|
+
%a{:href => '/sample30'} Sample30 - How to delete file from GroupDocs Storage
|
64
|
+
%li
|
65
|
+
%a{:href => '/sample31'} Sample31 - How to dinamically create Signature Form using data from HTM form
|
54
66
|
%li
|
55
67
|
%a{:href => '/annotation-sample'} Annotation sample
|
56
68
|
%li
|
@@ -5,8 +5,9 @@
|
|
5
5
|
.samplecontent{:style => 'padding:10px;'}
|
6
6
|
%i This sample will show how to use Signer object to be authorized at GroupDocs and how to get GroupDocs user infromation using Ruby SDK
|
7
7
|
%br/
|
8
|
-
%
|
9
|
-
%
|
8
|
+
%br/
|
9
|
+
%span.documentation
|
10
|
+
%a{:href => '/docs/sample1.html'} Builtin documentation for this sample
|
10
11
|
%br/
|
11
12
|
%br/
|
12
13
|
%p
|
@@ -4,8 +4,9 @@
|
|
4
4
|
.samplecontent{:style => 'padding:10px;'}
|
5
5
|
%i This sample will show how to share particular document from your GroupDocs account to other GroupDocs users using Ruby SDK
|
6
6
|
%br/
|
7
|
-
%
|
8
|
-
%
|
7
|
+
%br/
|
8
|
+
%span.documentation
|
9
|
+
%a{:href => '/docs/sample10.html'} Builtin documentation for this sample
|
9
10
|
%br/
|
10
11
|
%br/
|
11
12
|
%p
|
@@ -6,6 +6,10 @@
|
|
6
6
|
%i This sample will show how programmatically create and post an annotation into document. How to delete the annotation using Ruby SDK
|
7
7
|
%br/
|
8
8
|
%br/
|
9
|
+
%span.documentation
|
10
|
+
%a{:href => '/docs/sample11.html'} Builtin documentation for this sample
|
11
|
+
%br/
|
12
|
+
%br/
|
9
13
|
%p
|
10
14
|
You entered:
|
11
15
|
%p
|
@@ -5,6 +5,10 @@
|
|
5
5
|
%i This sample will show how to upload a file into the storage and compress it into zip archive using Ruby SDK
|
6
6
|
%br/
|
7
7
|
%br/
|
8
|
+
%span.documentation
|
9
|
+
%a{:href => '/docs/sample17.html'} Builtin documentation for this sample
|
10
|
+
%br/
|
11
|
+
%br/
|
8
12
|
%p
|
9
13
|
You entered:
|
10
14
|
%p
|
@@ -4,8 +4,9 @@
|
|
4
4
|
.samplecontent{:style => 'padding:10px;'}
|
5
5
|
%i This sample will show how to use StorageApi to list all user files from GroupDocs account using Ruby SDK
|
6
6
|
%br/
|
7
|
-
%
|
8
|
-
%
|
7
|
+
%br/
|
8
|
+
%span.documentation
|
9
|
+
%a{:href => '/docs/sample2.html'} Builtin documentation for this sample
|
9
10
|
%br/
|
10
11
|
%br/
|
11
12
|
%p
|
@@ -0,0 +1,87 @@
|
|
1
|
+
%h3{:style => 'text-align:center;'}
|
2
|
+
%a{:href => '/'} GroupDocs Ruby SDK Samples
|
3
|
+
\- Sample23
|
4
|
+
.samplecontent{:style => 'padding:10px;'}
|
5
|
+
%span.description
|
6
|
+
%i This sample will show how to View Document pages as images using Ruby SDK
|
7
|
+
%br/
|
8
|
+
%br/
|
9
|
+
|
10
|
+
%span.documentation
|
11
|
+
%a{:href => '/docs/sample23.html'} Builtin documentation for this sample
|
12
|
+
|
13
|
+
%br/
|
14
|
+
%br/
|
15
|
+
%p
|
16
|
+
You entered:
|
17
|
+
%p
|
18
|
+
ClientID = #{(defined? userId) ? userId : ''}
|
19
|
+
%p
|
20
|
+
PrivateKey = #{(defined? privateKey) ? privateKey : ''}
|
21
|
+
%p
|
22
|
+
%font{:color => 'red'} #{(defined? err) ? err : ''}
|
23
|
+
%br/
|
24
|
+
#requestForm{:style => 'padding:20px; border:1px solid black;'}
|
25
|
+
%p Enter data for request and press "Make request" button
|
26
|
+
%form{:action => '/sample23', :enctype => 'multipart/form-data', :method => 'post'}
|
27
|
+
%label{:for => 'client_id'} GroupDocs ClientID
|
28
|
+
%br/
|
29
|
+
%input{:type=>'text', :name=>'client_id'}
|
30
|
+
%br/
|
31
|
+
%label{:for => 'private_key'} GroupDocs PrivateKey
|
32
|
+
%br/
|
33
|
+
%input{:type=>'text', :name=>'private_key'}
|
34
|
+
%br/
|
35
|
+
|
36
|
+
|
37
|
+
%div.guid_radio
|
38
|
+
%input{:type=>'radio', :name=>'source', :value=>'guid', :checked=>'checked'} File ID (GUID)
|
39
|
+
%br/
|
40
|
+
%input{:type=>'radio', :name=>'source', :value=>'local'}Upload local file
|
41
|
+
%br/
|
42
|
+
%input{:type=>'radio', :name=>'source', :value=>'url'} Upload file from URL
|
43
|
+
%br/
|
44
|
+
|
45
|
+
%div.guid_field
|
46
|
+
%label{:for=>'fileId', :id=>'guid'} File ID (GUID)
|
47
|
+
%br/
|
48
|
+
%input{:type=>'text', :name=>'fileId'}
|
49
|
+
|
50
|
+
%div.guid_field{:style=>'display:none;'}
|
51
|
+
%label{:for=>'file'} Upload local file
|
52
|
+
%br/
|
53
|
+
%input{:type=>'file', :name=>'file'}
|
54
|
+
|
55
|
+
%div.guid_field{:style=>'display:none;'}
|
56
|
+
%label{:for=>'url', :id=>'url'} Upload file from URL
|
57
|
+
%br/
|
58
|
+
%input{:type=>'text', :name=>'url'}
|
59
|
+
|
60
|
+
%br/
|
61
|
+
%br/
|
62
|
+
|
63
|
+
%input{:type => 'submit', :value => 'Make request'}
|
64
|
+
|
65
|
+
|
66
|
+
%div{:style => 'padding:20px; border:1px solid black;'}
|
67
|
+
%p Results:
|
68
|
+
#{(defined? file_name) ? "<a href='/downloads/#{file_name}'>Download converted file</a>" : ''}
|
69
|
+
- if (defined? page_image)
|
70
|
+
-if page_image
|
71
|
+
- page_image.each do |img|
|
72
|
+
%p
|
73
|
+
%a{:href => img}Page
|
74
|
+
%img{:src => img}
|
75
|
+
- else
|
76
|
+
%p Enter the correct id document
|
77
|
+
= partial :_others_samples
|
78
|
+
|
79
|
+
:javascript
|
80
|
+
$(function($){
|
81
|
+
|
82
|
+
$('.guid_radio input').change(function(){
|
83
|
+
var elementIndex = $(this).parent().children('input').index($(this));
|
84
|
+
$('.guid_field').hide();
|
85
|
+
$('.guid_field').eq(elementIndex).show();
|
86
|
+
});
|
87
|
+
});
|
@@ -0,0 +1,44 @@
|
|
1
|
+
%h3{:style => 'text-align:center;'}
|
2
|
+
%a{:href => '/'} GroupDocs Ruby SDK Samples
|
3
|
+
\- Sample24
|
4
|
+
.samplecontent{:style => 'padding:10px;'}
|
5
|
+
%i This sample will show how to use StorageApi to upload file from URL to GroupDocs account using Ruby SDK
|
6
|
+
%br/
|
7
|
+
%br/
|
8
|
+
%span.documentation
|
9
|
+
%a{:href => '/docs/sample24.html'} Builtin documentation for this sample
|
10
|
+
%br/
|
11
|
+
%br/
|
12
|
+
%p
|
13
|
+
You entered:
|
14
|
+
%p
|
15
|
+
UserId = #{(defined? userId) ? userId : ''}
|
16
|
+
%p
|
17
|
+
PrivateKey = #{(defined? privateKey) ? privateKey : ''}
|
18
|
+
%p
|
19
|
+
%font{:color => 'red'} #{(defined? err) ? err : ''}
|
20
|
+
%br/
|
21
|
+
#requestForm{:style => 'padding:20px; border:1px solid black;'}
|
22
|
+
%p Enter data for request and press "Upload" button
|
23
|
+
%form{:action => '/sample24', :enctype => 'multipart/form-data', :method => 'post'}
|
24
|
+
%label{:for => 'client_id'} GroupDocs ClientID
|
25
|
+
%br/
|
26
|
+
%input{:type=>'text', :name=>'client_id'}
|
27
|
+
%br/
|
28
|
+
%label{:for => 'private_key'} GroupDocs PrivateKey
|
29
|
+
%br/
|
30
|
+
%input{:type=>'text', :name=>'private_key'}
|
31
|
+
%br/
|
32
|
+
%label{:for => 'url'} File Url
|
33
|
+
%br/
|
34
|
+
%input{:name => 'url', :type => 'text'}/
|
35
|
+
%br/
|
36
|
+
%br/
|
37
|
+
%input{:type => 'submit', :value => 'Upload'}/
|
38
|
+
%div{:style => 'padding:20px; border:1px solid black;'}
|
39
|
+
%p
|
40
|
+
Results:
|
41
|
+
#{(defined? message) ? message : ''}
|
42
|
+
#{(defined? iframe) ? iframe : ''}
|
43
|
+
|
44
|
+
= partial :_others_samples
|
@@ -0,0 +1,54 @@
|
|
1
|
+
%h3{:style => 'text-align:center;'}
|
2
|
+
%a{:href => '/'}GroupDocs Ruby SDK Samples
|
3
|
+
\- Sample26
|
4
|
+
|
5
|
+
.samplecontent{:style => 'padding:10px;'}
|
6
|
+
%span.description
|
7
|
+
%i This sample will show how to use Login object to be authorized at GroupDocs using Ruby SDK
|
8
|
+
%br/
|
9
|
+
%br/
|
10
|
+
%span.documentation
|
11
|
+
%a{:href => '/docs/sample26.html'} Builtin documentation for this sample
|
12
|
+
%br/
|
13
|
+
%br/
|
14
|
+
%p
|
15
|
+
%font{:color => 'red'} #{(defined? err) ? err : ''}
|
16
|
+
%div{:style => 'padding:20px; border:1px solid black;'}
|
17
|
+
%p Results:
|
18
|
+
%table{:style => 'border:1px double black;'}
|
19
|
+
%tr
|
20
|
+
%th Field
|
21
|
+
%th Value
|
22
|
+
%tr
|
23
|
+
%td First Name
|
24
|
+
%td #{(defined? user.first_name) ? user.first_name : ''}
|
25
|
+
%tr
|
26
|
+
%td Last Name
|
27
|
+
%td #{(defined? user.last_name) ? user.last_name : ''}
|
28
|
+
%tr
|
29
|
+
%td Nick Name
|
30
|
+
%td #{(defined? user.nickname) ? user.nickname : ''}
|
31
|
+
%tr
|
32
|
+
%td Primary Email
|
33
|
+
%td #{(defined? user.primary_email) ? user.primary_email : ''}
|
34
|
+
%tr
|
35
|
+
%td GUID
|
36
|
+
%td #{(defined? user.guid) ? user.guid : ''}
|
37
|
+
%tr
|
38
|
+
%td Private key
|
39
|
+
%td #{(defined? user.private_key) ? user.private_key : ''}
|
40
|
+
%br/
|
41
|
+
#requestForm{:style => 'padding:20px; border:1px solid black;'}
|
42
|
+
%p Enter data for request and press "Make request" button
|
43
|
+
%form{:action => '/sample26', :enctype => 'multipart/form-data', :method => 'post'}
|
44
|
+
%label{:for => 'email'} Login
|
45
|
+
%br/
|
46
|
+
%input{:type=>'text', :name=>'email'}
|
47
|
+
%br/
|
48
|
+
%label{:for => 'password'} Password
|
49
|
+
%br/
|
50
|
+
%input{:type=>'text', :name=>'password'}
|
51
|
+
%br/
|
52
|
+
%input{:type => 'submit', :value => 'Make Request'}
|
53
|
+
|
54
|
+
= partial :_others_samples
|