groupdocs 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +41 -0
- data/examples/README.md +2 -3
- data/examples/api-samples/Gemfile +5 -0
- data/examples/api-samples/Gemfile.lock +27 -0
- data/examples/api-samples/README.md +12 -0
- data/examples/api-samples/app.rb +17 -0
- data/examples/api-samples/public/css/style.css +166 -0
- data/examples/api-samples/samples/sample1.rb +17 -0
- data/examples/api-samples/samples/sample10.rb +36 -0
- data/examples/api-samples/samples/sample2.rb +19 -0
- data/examples/api-samples/samples/sample3.rb +23 -0
- data/examples/api-samples/samples/sample4.rb +31 -0
- data/examples/api-samples/samples/sample5.rb +44 -0
- data/examples/api-samples/samples/sample6.rb +3 -0
- data/examples/api-samples/samples/sample7.rb +33 -0
- data/examples/api-samples/samples/sample8.rb +40 -0
- data/examples/api-samples/samples/sample9.rb +22 -0
- data/examples/api-samples/views/index.haml +23 -0
- data/examples/api-samples/views/layout.haml +7 -0
- data/examples/api-samples/views/sample1.haml +71 -0
- data/examples/api-samples/views/sample10.haml +69 -0
- data/examples/api-samples/views/sample2.haml +59 -0
- data/examples/api-samples/views/sample3.haml +62 -0
- data/examples/api-samples/views/sample4.haml +58 -0
- data/examples/api-samples/views/sample5.haml +62 -0
- data/examples/api-samples/views/sample6.haml +145 -0
- data/examples/api-samples/views/sample7.haml +59 -0
- data/examples/api-samples/views/sample8.haml +75 -0
- data/examples/api-samples/views/sample9.haml +61 -0
- data/examples/{annotations → viewer}/Gemfile +0 -0
- data/examples/viewer/app.rb +52 -0
- data/groupdocs.gemspec +5 -4
- data/lib/groupdocs/api.rb +1 -0
- data/lib/groupdocs/api/entity.rb +2 -0
- data/lib/groupdocs/api/helpers.rb +2 -0
- data/lib/groupdocs/api/helpers/accessor_helper.rb +30 -0
- data/lib/groupdocs/api/helpers/mime_helper.rb +21 -0
- data/lib/groupdocs/api/helpers/rest_helper.rb +3 -2
- data/lib/groupdocs/api/request.rb +1 -3
- data/lib/groupdocs/datasource.rb +1 -2
- data/lib/groupdocs/document.rb +133 -3
- data/lib/groupdocs/document/annotation.rb +14 -13
- data/lib/groupdocs/document/annotation/reply.rb +4 -8
- data/lib/groupdocs/document/annotation/reviewer.rb +2 -4
- data/lib/groupdocs/document/field.rb +10 -8
- data/lib/groupdocs/document/rectangle.rb +10 -18
- data/lib/groupdocs/job.rb +1 -1
- data/lib/groupdocs/questionnaire.rb +138 -44
- data/lib/groupdocs/questionnaire/collector.rb +262 -0
- data/lib/groupdocs/questionnaire/execution.rb +93 -10
- data/lib/groupdocs/questionnaire/question.rb +1 -2
- data/lib/groupdocs/signature.rb +16 -24
- data/lib/groupdocs/signature/contact.rb +2 -4
- data/lib/groupdocs/signature/envelope.rb +3 -6
- data/lib/groupdocs/signature/envelope/log.rb +2 -4
- data/lib/groupdocs/signature/field.rb +21 -42
- data/lib/groupdocs/signature/field/location.rb +18 -36
- data/lib/groupdocs/signature/form.rb +9 -18
- data/lib/groupdocs/signature/list.rb +1 -2
- data/lib/groupdocs/signature/recipient.rb +3 -6
- data/lib/groupdocs/signature/role.rb +4 -8
- data/lib/groupdocs/signature/shared/entity_fields.rb +12 -20
- data/lib/groupdocs/signature/template.rb +1 -2
- data/lib/groupdocs/storage/file.rb +3 -1
- data/lib/groupdocs/storage/folder.rb +7 -1
- data/lib/groupdocs/subscription.rb +6 -12
- data/lib/groupdocs/subscription/limit.rb +4 -8
- data/lib/groupdocs/user.rb +3 -6
- data/lib/groupdocs/version.rb +1 -1
- data/spec/groupdocs/api/helpers/accessor_helper_spec.rb +16 -0
- data/spec/groupdocs/api/helpers/mime_helper_spec.rb +16 -0
- data/spec/groupdocs/api/helpers/rest_helper_spec.rb +4 -0
- data/spec/groupdocs/api/request_spec.rb +3 -5
- data/spec/groupdocs/datasource/field_spec.rb +3 -6
- data/spec/groupdocs/datasource_spec.rb +8 -15
- data/spec/groupdocs/document/annotation/reply_spec.rb +13 -24
- data/spec/groupdocs/document/annotation/reviewer_spec.rb +5 -9
- data/spec/groupdocs/document/annotation_spec.rb +35 -40
- data/spec/groupdocs/document/change_spec.rb +6 -11
- data/spec/groupdocs/document/field_spec.rb +13 -13
- data/spec/groupdocs/document/metadata_spec.rb +5 -10
- data/spec/groupdocs/document/rectangle_spec.rb +6 -18
- data/spec/groupdocs/document/view_spec.rb +3 -6
- data/spec/groupdocs/document_spec.rb +123 -10
- data/spec/groupdocs/job_spec.rb +9 -18
- data/spec/groupdocs/questionnaire/collector_spec.rb +201 -0
- data/spec/groupdocs/questionnaire/execution_spec.rb +91 -23
- data/spec/groupdocs/questionnaire/page_spec.rb +3 -6
- data/spec/groupdocs/questionnaire/question/answer_spec.rb +2 -4
- data/spec/groupdocs/questionnaire/question_spec.rb +7 -14
- data/spec/groupdocs/questionnaire_spec.rb +117 -41
- data/spec/groupdocs/signature/contact_spec.rb +9 -17
- data/spec/groupdocs/signature/envelope/log_spec.rb +8 -16
- data/spec/groupdocs/signature/envelope_spec.rb +9 -17
- data/spec/groupdocs/signature/field/location_spec.rb +32 -65
- data/spec/groupdocs/signature/field_spec.rb +48 -95
- data/spec/groupdocs/signature/form_spec.rb +22 -43
- data/spec/groupdocs/signature/list_spec.rb +6 -11
- data/spec/groupdocs/signature/recipient_spec.rb +11 -22
- data/spec/groupdocs/signature/role_spec.rb +11 -21
- data/spec/groupdocs/signature/template_spec.rb +2 -4
- data/spec/groupdocs/signature_spec.rb +28 -54
- data/spec/groupdocs/storage/file_spec.rb +14 -26
- data/spec/groupdocs/storage/folder_spec.rb +16 -22
- data/spec/groupdocs/storage/package_spec.rb +2 -4
- data/spec/groupdocs/subscription/limit_spec.rb +8 -16
- data/spec/groupdocs/subscription_spec.rb +11 -22
- data/spec/groupdocs/user_spec.rb +21 -41
- data/spec/groupdocs_spec.rb +4 -8
- data/spec/spec_helper.rb +12 -0
- data/spec/support/files/signature.png +0 -0
- data/spec/support/json/annotation_list.json +6 -6
- data/spec/support/json/comparison_changes.json +8 -8
- data/spec/support/json/document_fields.json +8 -8
- data/spec/support/json/document_page_images_get.json +20 -0
- data/spec/support/json/questionnaire_collector.json +17 -0
- data/spec/support/json/questionnaire_collectors.json +38 -0
- data/spec/support/json/questionnaire_collectors_add.json +10 -0
- data/spec/support/json/questionnaire_create.json +3 -1
- data/spec/support/json/{questionnaire_execution_create.json → questionnaire_execution_add.json} +1 -1
- data/spec/support/json/questionnaire_get.json +3 -0
- data/spec/support/json/questionnaires_get.json +36 -18
- data/spec/support/json/sign_documents.json +16 -0
- data/spec/support/json/templates_get.json +21 -0
- data/spec/support/shared_examples/api/entity.rb +2 -0
- data/spec/support/shared_examples/api/helpers/access_mode_helper.rb +1 -2
- data/spec/support/shared_examples/api/helpers/status_helper.rb +1 -2
- data/spec/support/shared_examples/signature/shared/entity_fields.rb +22 -43
- metadata +82 -16
- data/examples/annotations/app.rb +0 -67
data/examples/annotations/app.rb
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
require 'sinatra'
|
2
|
-
require 'groupdocs'
|
3
|
-
require 'haml'
|
4
|
-
|
5
|
-
GroupDocs.api_version = '2.0'
|
6
|
-
|
7
|
-
get '/' do
|
8
|
-
haml :upload
|
9
|
-
end
|
10
|
-
|
11
|
-
post '/upload' do
|
12
|
-
set :client_id, params[:client_id]
|
13
|
-
set :private_key, params[:private_key]
|
14
|
-
filepath = "#{Dir.tmpdir}/#{params[:file][:filename]}"
|
15
|
-
File.open(filepath, 'wb') { |f| f.write(params[:file][:tempfile].read) }
|
16
|
-
@@file = GroupDocs::Storage::File.upload!(filepath, '/', client_id: options.client_id, private_key: options.private_key)
|
17
|
-
|
18
|
-
haml :annotations
|
19
|
-
end
|
20
|
-
|
21
|
-
get '/annotations' do
|
22
|
-
annotations = @@file.to_document.annotations!(client_id: options.client_id, private_key: options.private_key)
|
23
|
-
annotations.map { |annotation| "Annotation Type: #{annotation.type} -- Replies: #{annotation.replies.map { |reply| "'#{reply.user_name}':'#{reply.text}'" }}" }.join "<br />"
|
24
|
-
end
|
25
|
-
|
26
|
-
|
27
|
-
__END__
|
28
|
-
|
29
|
-
@@layout
|
30
|
-
%html
|
31
|
-
%head
|
32
|
-
%title GroupDocs Ruby SDK Annotations Sample App
|
33
|
-
%script{ src: "http://rightjs.org/hotlink/right.js" }
|
34
|
-
:javascript
|
35
|
-
"#annotations".onClick(function(event) {
|
36
|
-
event.stop();
|
37
|
-
$('annotations_list').load("/annotations");
|
38
|
-
});
|
39
|
-
%body
|
40
|
-
= yield
|
41
|
-
|
42
|
-
@@upload
|
43
|
-
%h4 Upload file
|
44
|
-
%form{ action: '/upload', method: 'post', enctype: 'multipart/form-data' }
|
45
|
-
%label{ for: 'client_id' } GroupDocs Client ID
|
46
|
-
%br
|
47
|
-
%input{ type: 'text', name: 'client_id' }
|
48
|
-
%br
|
49
|
-
%label{ for: 'private_key' } GroupDocs Private Key
|
50
|
-
%br
|
51
|
-
%input{ type: 'text', name: 'private_key' }
|
52
|
-
%br
|
53
|
-
%label{ for: 'file' } File
|
54
|
-
%br
|
55
|
-
%input{ type: 'file', name: 'file' }
|
56
|
-
%br
|
57
|
-
%br
|
58
|
-
%input{ type: 'submit', value: 'Upload' }
|
59
|
-
|
60
|
-
@@annotations
|
61
|
-
%iframe{ src: "https://apps.groupdocs.com/document-annotation/Embed/#{@@file.guid}", frameborder: 0, width: 720, height: 600 }
|
62
|
-
%br
|
63
|
-
%br
|
64
|
-
%button#annotations Poll annotations
|
65
|
-
%br
|
66
|
-
%br
|
67
|
-
#annotations_list
|