groupdocs 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. data/.travis.yml +5 -0
  2. data/Gemfile +3 -0
  3. data/README.md +141 -0
  4. data/Rakefile +9 -0
  5. data/groupdocs.gemspec +28 -0
  6. data/lib/groupdocs.rb +53 -0
  7. data/lib/groupdocs/api.rb +3 -0
  8. data/lib/groupdocs/api/entity.rb +113 -0
  9. data/lib/groupdocs/api/helpers.rb +5 -0
  10. data/lib/groupdocs/api/helpers/access_helper.rb +56 -0
  11. data/lib/groupdocs/api/helpers/actions_helper.rb +48 -0
  12. data/lib/groupdocs/api/helpers/rest_helper.rb +89 -0
  13. data/lib/groupdocs/api/helpers/status_helper.rb +48 -0
  14. data/lib/groupdocs/api/helpers/url_helper.rb +89 -0
  15. data/lib/groupdocs/api/request.rb +73 -0
  16. data/lib/groupdocs/api/sugar/lookup.rb +48 -0
  17. data/lib/groupdocs/datasource.rb +162 -0
  18. data/lib/groupdocs/datasource/field.rb +44 -0
  19. data/lib/groupdocs/document.rb +513 -0
  20. data/lib/groupdocs/document/annotation.rb +215 -0
  21. data/lib/groupdocs/document/annotation/reply.rb +167 -0
  22. data/lib/groupdocs/document/change.rb +35 -0
  23. data/lib/groupdocs/document/field.rb +27 -0
  24. data/lib/groupdocs/document/metadata.rb +26 -0
  25. data/lib/groupdocs/document/rectangle.rb +24 -0
  26. data/lib/groupdocs/document/view.rb +36 -0
  27. data/lib/groupdocs/errors.rb +10 -0
  28. data/lib/groupdocs/job.rb +201 -0
  29. data/lib/groupdocs/questionnaire.rb +221 -0
  30. data/lib/groupdocs/questionnaire/execution.rb +120 -0
  31. data/lib/groupdocs/questionnaire/page.rb +43 -0
  32. data/lib/groupdocs/questionnaire/question.rb +75 -0
  33. data/lib/groupdocs/questionnaire/question/answer.rb +10 -0
  34. data/lib/groupdocs/storage.rb +37 -0
  35. data/lib/groupdocs/storage/file.rb +248 -0
  36. data/lib/groupdocs/storage/folder.rb +314 -0
  37. data/lib/groupdocs/storage/package.rb +42 -0
  38. data/lib/groupdocs/user.rb +50 -0
  39. data/lib/groupdocs/version.rb +3 -0
  40. data/spec/groupdocs/api/entity_spec.rb +54 -0
  41. data/spec/groupdocs/api/helpers/access_helper_spec.rb +89 -0
  42. data/spec/groupdocs/api/helpers/actions_helper_spec.rb +51 -0
  43. data/spec/groupdocs/api/helpers/rest_helper_spec.rb +187 -0
  44. data/spec/groupdocs/api/helpers/status_helper_spec.rb +85 -0
  45. data/spec/groupdocs/api/helpers/url_helper_spec.rb +93 -0
  46. data/spec/groupdocs/api/request_spec.rb +85 -0
  47. data/spec/groupdocs/datasource/field_spec.rb +50 -0
  48. data/spec/groupdocs/datasource_spec.rb +156 -0
  49. data/spec/groupdocs/document/annotation/reply_spec.rb +179 -0
  50. data/spec/groupdocs/document/annotation_spec.rb +226 -0
  51. data/spec/groupdocs/document/change_spec.rb +35 -0
  52. data/spec/groupdocs/document/field_spec.rb +31 -0
  53. data/spec/groupdocs/document/metadata_spec.rb +26 -0
  54. data/spec/groupdocs/document/rectangle_spec.rb +34 -0
  55. data/spec/groupdocs/document/view_spec.rb +36 -0
  56. data/spec/groupdocs/document_spec.rb +509 -0
  57. data/spec/groupdocs/errors_spec.rb +7 -0
  58. data/spec/groupdocs/job_spec.rb +196 -0
  59. data/spec/groupdocs/questionnaire/execution_spec.rb +136 -0
  60. data/spec/groupdocs/questionnaire/page_spec.rb +50 -0
  61. data/spec/groupdocs/questionnaire/question/answer_spec.rb +11 -0
  62. data/spec/groupdocs/questionnaire/question_spec.rb +84 -0
  63. data/spec/groupdocs/questionnaire_spec.rb +217 -0
  64. data/spec/groupdocs/storage/file_spec.rb +242 -0
  65. data/spec/groupdocs/storage/folder_spec.rb +310 -0
  66. data/spec/groupdocs/storage/package_spec.rb +41 -0
  67. data/spec/groupdocs/storage_spec.rb +27 -0
  68. data/spec/groupdocs/user_spec.rb +53 -0
  69. data/spec/groupdocs_spec.rb +56 -0
  70. data/spec/spec_helper.rb +46 -0
  71. data/spec/support/files/resume.pdf +0 -0
  72. data/spec/support/json/annotation_collaborators_set.json +16 -0
  73. data/spec/support/json/annotation_create.json +12 -0
  74. data/spec/support/json/annotation_list.json +32 -0
  75. data/spec/support/json/annotation_remove.json +9 -0
  76. data/spec/support/json/annotation_replies_create.json +9 -0
  77. data/spec/support/json/annotation_replies_get.json +25 -0
  78. data/spec/support/json/comparison_changes.json +46 -0
  79. data/spec/support/json/comparison_compare.json +8 -0
  80. data/spec/support/json/comparison_document.json +10 -0
  81. data/spec/support/json/datasource_add.json +8 -0
  82. data/spec/support/json/datasource_get.json +22 -0
  83. data/spec/support/json/datasource_remove.json +8 -0
  84. data/spec/support/json/datasource_update.json +8 -0
  85. data/spec/support/json/document_access_info_get.json +14 -0
  86. data/spec/support/json/document_convert.json +8 -0
  87. data/spec/support/json/document_datasource.json +10 -0
  88. data/spec/support/json/document_fields.json +34 -0
  89. data/spec/support/json/document_formats.json +8 -0
  90. data/spec/support/json/document_metadata.json +15 -0
  91. data/spec/support/json/document_questionnaire_create.json +9 -0
  92. data/spec/support/json/document_questionnaires.json +23 -0
  93. data/spec/support/json/document_sharers_remove.json +8 -0
  94. data/spec/support/json/document_sharers_set.json +16 -0
  95. data/spec/support/json/document_views.json +32 -0
  96. data/spec/support/json/file_compress.json +8 -0
  97. data/spec/support/json/file_copy.json +14 -0
  98. data/spec/support/json/file_delete.json +5 -0
  99. data/spec/support/json/file_move.json +14 -0
  100. data/spec/support/json/file_upload.json +8 -0
  101. data/spec/support/json/folder_create.json +8 -0
  102. data/spec/support/json/folder_delete.json +5 -0
  103. data/spec/support/json/folder_list.json +21 -0
  104. data/spec/support/json/folder_move.json +8 -0
  105. data/spec/support/json/folder_sharers_get.json +16 -0
  106. data/spec/support/json/folder_sharers_remove.json +8 -0
  107. data/spec/support/json/folder_sharers_set.json +16 -0
  108. data/spec/support/json/job_add_url.json +8 -0
  109. data/spec/support/json/job_create.json +8 -0
  110. data/spec/support/json/job_documents.json +39 -0
  111. data/spec/support/json/job_file_add.json +8 -0
  112. data/spec/support/json/job_update.json +7 -0
  113. data/spec/support/json/jobs_get.json +52 -0
  114. data/spec/support/json/package_create.json +7 -0
  115. data/spec/support/json/questionnaire_create.json +8 -0
  116. data/spec/support/json/questionnaire_datasources.json +26 -0
  117. data/spec/support/json/questionnaire_execution_create.json +9 -0
  118. data/spec/support/json/questionnaire_execution_status_set.json +8 -0
  119. data/spec/support/json/questionnaire_execution_update.json +8 -0
  120. data/spec/support/json/questionnaire_executions.json +24 -0
  121. data/spec/support/json/questionnaire_get.json +14 -0
  122. data/spec/support/json/questionnaire_remove.json +8 -0
  123. data/spec/support/json/questionnaire_update.json +8 -0
  124. data/spec/support/json/questionnaires_get.json +22 -0
  125. data/spec/support/json/storage_info.json +10 -0
  126. data/spec/support/shared_examples/api/entity.rb +37 -0
  127. data/spec/support/shared_examples/api/helpers/status_helper.rb +12 -0
  128. data/spec/support/shared_examples/api/sugar/lookup.rb +57 -0
  129. metadata +356 -0
@@ -0,0 +1,32 @@
1
+ {
2
+ "result":
3
+ {
4
+ "views":
5
+ [
6
+ {
7
+ "document":
8
+ {
9
+ "url": "http://groupdocs.com",
10
+ "name": "test.pdf",
11
+ "id": 1,
12
+ "guid": null
13
+ },
14
+ "short_url": "http://groupdocs.com",
15
+ "viewed_on": 1330178915757
16
+ },
17
+ {
18
+ "document":
19
+ {
20
+ "url": "http://groupdocs.com",
21
+ "name": "test.doc",
22
+ "id": 2,
23
+ "guid": null
24
+ },
25
+ "short_url": "http://groupdocs.com",
26
+ "viewed_on": 1331022248680
27
+ }
28
+ ]
29
+ },
30
+ "status": "Ok",
31
+ "error_message": null
32
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "id": 123,
6
+ "guid": "817fd4f48113ca2cd5bd099645b7c3f304296e686520522e35e782a68580d116"
7
+ }
8
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "src_file":
6
+ {
7
+ "name": "resume.pdf"
8
+ },
9
+ "dst_file":
10
+ {
11
+ "name": "resume2.pdf"
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "result": {},
3
+ "status": "Ok",
4
+ "error_message": null
5
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "src_file":
6
+ {
7
+ "name": "resume.pdf"
8
+ },
9
+ "dst_file":
10
+ {
11
+ "name": "resume2.pdf"
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "adj_name": "File.pdf",
6
+ "type": 1
7
+ }
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "id": 1,
6
+ "path": "Test"
7
+ }
8
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "result": {},
3
+ "status": "Ok",
4
+ "error_message": null
5
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "entities":
6
+ [
7
+ {
8
+ "id": 1,
9
+ "dir": true,
10
+ "created_on": 1330450135,
11
+ "modified_on": 1330450135
12
+ },
13
+ {
14
+ "id": 2,
15
+ "dir": false,
16
+ "created_on": 1330450135,
17
+ "modified_on": 1330450135
18
+ }
19
+ ]
20
+ }
21
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "from_path": "Test1",
6
+ "to_path": "Test2"
7
+ }
8
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "result":
3
+ {
4
+ "shared_users":
5
+ [
6
+ {
7
+ "primary_email": "test1@email.com"
8
+ },
9
+ {
10
+ "primary_email": "test2@email.com"
11
+ }
12
+ ]
13
+ },
14
+ "status": "Ok",
15
+ "error_message": null
16
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "result":
3
+ {
4
+ "shared_users": null
5
+ },
6
+ "status": "Ok",
7
+ "error_message": null
8
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "result":
3
+ {
4
+ "shared_users":
5
+ [
6
+ {
7
+ "primary_email": "test1@email.com"
8
+ },
9
+ {
10
+ "primary_email": "test2@email.com"
11
+ }
12
+ ]
13
+ },
14
+ "status": "Ok",
15
+ "error_message": null
16
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "result":
3
+ {
4
+ "document_id": 1
5
+ },
6
+ "status": "Ok",
7
+ "error_message": null
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "result":
3
+ {
4
+ "job_id": 1
5
+ },
6
+ "status": "Ok",
7
+ "error_message": null
8
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "result":
3
+ {
4
+ "job_status": 5,
5
+ "documents":
6
+ [
7
+ {
8
+ "status": 2,
9
+ "output_formats": "pdf",
10
+ "outputs":
11
+ [
12
+ {
13
+ "ftype": 19,
14
+ "error": null,
15
+ "url": "http://groupdocs.com",
16
+ "name": "Test.pdf"
17
+ }
18
+ ],
19
+ "id": 123
20
+ },
21
+ {
22
+ "status": 1,
23
+ "output_formats": "tiff",
24
+ "outputs":
25
+ [
26
+ {
27
+ "ftype": 15,
28
+ "error": null,
29
+ "url": "http://groupdocs.com",
30
+ "name": "CV.doc"
31
+ }
32
+ ],
33
+ "id": 345
34
+ }
35
+ ]
36
+ },
37
+ "status": "Ok",
38
+ "error_message": null
39
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "result":
3
+ {
4
+ "document_id": 123
5
+ },
6
+ "status": "Ok",
7
+ "error_message": null
8
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "result":
3
+ {
4
+ },
5
+ "status": "Ok",
6
+ "error_message": null
7
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "result":
3
+ {
4
+ "jobs":
5
+ [
6
+ {
7
+ "id": 1,
8
+ "status": 5,
9
+ "documents":
10
+ [
11
+ {
12
+ "status": 2,
13
+ "output_formats": "pdf",
14
+ "outputs":
15
+ [
16
+ {
17
+ "ftype": 19,
18
+ "error": null,
19
+ "url": "http://groupdocs.com",
20
+ "name": "Test.pdf"
21
+ }
22
+ ],
23
+ "id": 123
24
+ }
25
+ ]
26
+ },
27
+ {
28
+ "id": 2,
29
+ "status": 3,
30
+ "documents":
31
+ [
32
+ {
33
+ "status": 1,
34
+ "output_formats": "tiff",
35
+ "outputs":
36
+ [
37
+ {
38
+ "ftype": 15,
39
+ "error": null,
40
+ "url": "http://groupdocs.com",
41
+ "name": "CV.doc"
42
+ }
43
+ ],
44
+ "id": 345
45
+ }
46
+ ]
47
+ }
48
+ ]
49
+ },
50
+ "status": "Ok",
51
+ "error_message": null
52
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "status": "Ok",
3
+ "result":
4
+ {
5
+ "url": "https://groupdocs.com/shared/packages/45c6703eab31f9eab9aa501d243ab25fcc45572c8cf8588007d799e2681bbe95/package1.zip"
6
+ }
7
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "result":
3
+ {
4
+ "questionnaire_id": 1
5
+ },
6
+ "status": "Ok",
7
+ "error_message": null
8
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "result":
3
+ {
4
+ "datasources":
5
+ [
6
+ {
7
+ "id": 1,
8
+ "questionnaire_id": 1,
9
+ "descr": "Description",
10
+ "fields": null,
11
+ "created_on": 1333599236,
12
+ "modified_on": 1333599236
13
+ },
14
+ {
15
+ "id": 2,
16
+ "questionnaire_id": 1,
17
+ "descr": "Description",
18
+ "fields": null,
19
+ "created_on": 1333599299,
20
+ "modified_on": 1333599299
21
+ }
22
+ ]
23
+ },
24
+ "status": "Ok",
25
+ "error_message": null
26
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "result":
3
+ {
4
+ "questionnaire_id": 1,
5
+ "execution_id": 1
6
+ },
7
+ "status": "Ok",
8
+ "error_message": null
9
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "result":
3
+ {
4
+ "execution_id": 0
5
+ },
6
+ "status": "Ok",
7
+ "error_message": null
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "result":
3
+ {
4
+ "execution_id": 1
5
+ },
6
+ "status": "Ok",
7
+ "error_message": null
8
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "result":
3
+ {
4
+ "executions":
5
+ [
6
+ {
7
+ "questionnaireId": 456,
8
+ "executiveId": 789,
9
+ "approverId": 987,
10
+ "datasourceId": 654,
11
+ "status": 5
12
+ },
13
+ {
14
+ "questionnaireId": 111,
15
+ "executiveId": 222,
16
+ "approverId": null,
17
+ "datasourceId": null,
18
+ "status": 2
19
+ }
20
+ ]
21
+ },
22
+ "status": "Ok",
23
+ "error_message": null
24
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "result":
3
+ {
4
+ "questionnaire":
5
+ {
6
+ "id": 1,
7
+ "name": "Q1",
8
+ "descr": "Description",
9
+ "pages": null
10
+ }
11
+ },
12
+ "status": "Ok",
13
+ "error_message": null
14
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "result":
3
+ {
4
+ "questionnaire_id": null
5
+ },
6
+ "status": "Ok",
7
+ "error_message": null
8
+ }