yaccl 0.1.5 → 1.0.pre.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/lib/yaccl/children.rb +55 -0
  3. data/lib/yaccl/connection.rb +147 -0
  4. data/lib/yaccl/document.rb +62 -0
  5. data/lib/yaccl/folder.rb +76 -0
  6. data/lib/yaccl/helpers.rb +59 -0
  7. data/lib/yaccl/item.rb +11 -0
  8. data/lib/yaccl/object.rb +122 -0
  9. data/lib/yaccl/object_factory.rb +27 -0
  10. data/lib/yaccl/policy.rb +26 -0
  11. data/lib/yaccl/property_definition.rb +32 -0
  12. data/lib/yaccl/query.rb +53 -0
  13. data/lib/yaccl/query_result.rb +15 -0
  14. data/lib/yaccl/relationship.rb +18 -0
  15. data/lib/yaccl/repository.rb +108 -0
  16. data/lib/yaccl/server.rb +37 -0
  17. data/lib/yaccl/type.rb +106 -0
  18. data/lib/yaccl/version.rb +1 -1
  19. data/lib/yaccl.rb +21 -11
  20. data/readme.md +0 -3
  21. data/spec/{model/document_spec.rb → document_spec.rb} +4 -4
  22. data/spec/{model/folder_spec.rb → folder_spec.rb} +6 -6
  23. data/spec/helper.rb +12 -12
  24. data/spec/{model/object_spec.rb → object_spec.rb} +6 -6
  25. data/spec/relationship_spec.rb +19 -0
  26. data/spec/repository_spec.rb +150 -0
  27. data/spec/server_spec.rb +22 -0
  28. data/spec/{model/type_spec.rb → type_spec.rb} +6 -4
  29. data/yaccl.gemspec +1 -0
  30. metadata +48 -50
  31. data/examples/create_type_manual.rb +0 -40
  32. data/lib/yaccl/model/document.rb +0 -68
  33. data/lib/yaccl/model/folder.rb +0 -74
  34. data/lib/yaccl/model/item.rb +0 -9
  35. data/lib/yaccl/model/object.rb +0 -159
  36. data/lib/yaccl/model/object_factory.rb +0 -24
  37. data/lib/yaccl/model/policy.rb +0 -20
  38. data/lib/yaccl/model/property_definition.rb +0 -66
  39. data/lib/yaccl/model/relationship.rb +0 -22
  40. data/lib/yaccl/model/repository.rb +0 -155
  41. data/lib/yaccl/model/server.rb +0 -13
  42. data/lib/yaccl/model/type.rb +0 -146
  43. data/lib/yaccl/model.rb +0 -11
  44. data/lib/yaccl/services/acl_services.rb +0 -23
  45. data/lib/yaccl/services/discovery_services.rb +0 -29
  46. data/lib/yaccl/services/internal/browser_binding_service.rb +0 -170
  47. data/lib/yaccl/services/internal/simple_cache.rb +0 -103
  48. data/lib/yaccl/services/multi_filing_services.rb +0 -22
  49. data/lib/yaccl/services/navigation_services.rb +0 -84
  50. data/lib/yaccl/services/object_services.rb +0 -211
  51. data/lib/yaccl/services/policy_services.rb +0 -30
  52. data/lib/yaccl/services/relationship_services.rb +0 -18
  53. data/lib/yaccl/services/repository_services.rb +0 -67
  54. data/lib/yaccl/services/versioning_services.rb +0 -69
  55. data/lib/yaccl/services.rb +0 -34
  56. data/spec/model/relationship_spec.rb +0 -15
  57. data/spec/model/repository_spec.rb +0 -138
  58. data/spec/model/server_spec.rb +0 -16
  59. data/spec/services/navigation_services_spec.rb +0 -64
  60. data/spec/services/object_services_spec.rb +0 -44
  61. data/spec/services/repository_services_spec.rb +0 -35
@@ -1,64 +0,0 @@
1
- require_relative '../helper'
2
-
3
- describe YACCL::NavigationServices do
4
-
5
- before :all do
6
- @repo = create_repository('testrepo')
7
- end
8
-
9
- after :all do
10
- delete_repository('testrepo')
11
- end
12
-
13
- it 'get children' do
14
- root = @repo.root
15
- f1 = create_folder(root)
16
-
17
- root_children = YACCL::Services.get_children('testrepo', root.cmis_object_id, nil, nil, nil, nil, nil, nil, nil, nil)
18
- root_children[:objects].length.should be 1
19
- root_children[:objects].first[:object][:succinctProperties][:'cmis:objectId'].should eq f1.cmis_object_id
20
- end
21
-
22
- it 'folder in folder - get parents' do
23
- root = @repo.root
24
-
25
- f1 = create_folder(root)
26
- f1_parents = YACCL::Services.get_object_parents('testrepo', f1.cmis_object_id, nil, nil, nil, nil, nil)
27
- f1_parents.length.should eq 1
28
- f1_parents.first[:object][:succinctProperties][:'cmis:objectId'].should eq root.cmis_object_id
29
-
30
- f2 = create_folder(f1)
31
- f2_parents = YACCL::Services.get_object_parents('testrepo', f2.cmis_object_id, nil, nil, nil, nil, nil)
32
- f2_parents.length.should eq 1
33
- f2_parents.first[:object][:succinctProperties][:'cmis:objectId'].should eq f1.cmis_object_id
34
- end
35
-
36
- it 'document in folder - get parents' do
37
- root = @repo.root
38
-
39
- f1 = create_folder(root)
40
- f1_parents = YACCL::Services.get_object_parents('testrepo', f1.cmis_object_id, nil, nil, nil, nil, nil)
41
- f1_parents.length.should eq 1
42
- f1_parents.first[:object][:succinctProperties][:'cmis:objectId'].should eq root.cmis_object_id
43
-
44
- doc = create_document(f1)
45
- doc_parents = YACCL::Services.get_object_parents('testrepo', doc.cmis_object_id, nil, nil, nil, nil, nil)
46
- doc_parents.length.should eq 1
47
- doc_parents.first[:object][:succinctProperties][:'cmis:objectId'].should eq f1.cmis_object_id
48
- end
49
-
50
- def create_folder(folder)
51
- new_object = @repo.new_folder
52
- new_object.name = 'folder'
53
- new_object.object_type_id = 'cmis:folder'
54
- folder.create(new_object)
55
- end
56
-
57
- def create_document(folder)
58
- new_object = @repo.new_document
59
- new_object.name = 'document'
60
- new_object.object_type_id = 'cmis:document'
61
- folder.create(new_object)
62
- end
63
-
64
- end
@@ -1,44 +0,0 @@
1
- require_relative '../helper'
2
-
3
- describe YACCL::NavigationServices do
4
-
5
- before :all do
6
- @repo = create_repository('testrepo')
7
- end
8
-
9
- after :all do
10
- delete_repository('testrepo')
11
- end
12
-
13
- it 'create_document' do
14
- root = @repo.root
15
-
16
- properties = {'cmis:objectTypeId' => 'cmis:document', 'cmis:name' => 'document'}
17
- YACCL::Services.create_document('testrepo', properties, root.cmis_object_id, nil, nil, nil, nil, nil)
18
-
19
- root_children = YACCL::Services.get_children('testrepo', root.cmis_object_id, nil, nil, nil, nil, nil, nil, nil, nil)
20
- root_children[:objects].length.should be 1
21
- end
22
-
23
- it 'get content stream' do
24
- root = @repo.root
25
-
26
- properties = {'cmis:objectTypeId' => 'cmis:document', 'cmis:name' => 'document'}
27
- content = { stream: StringIO.new('Apples are green.'), mime_type: 'text/plain', filename: 'apples.txt' }
28
- doc = YACCL::Services.create_document('testrepo', properties, root.cmis_object_id, content, nil, nil, nil, nil)
29
- doc_id = doc[:succinctProperties][:'cmis:objectId']
30
-
31
- YACCL::Services.get_content_stream('testrepo', doc_id, nil, nil, nil).should eq 'Apples are green.'
32
- end
33
-
34
- it 'get content stream when not set' do
35
- root = @repo.root
36
-
37
- properties = {'cmis:objectTypeId' => 'cmis:document', 'cmis:name' => 'document'}
38
- doc = YACCL::Services.create_document('testrepo', properties, root.cmis_object_id, nil, nil, nil, nil, nil)
39
- doc_id = doc[:succinctProperties][:'cmis:objectId']
40
-
41
- lambda { YACCL::Services.get_content_stream('testrepo', doc_id, nil, nil, nil) }.should raise_exception
42
- end
43
-
44
- end
@@ -1,35 +0,0 @@
1
- require_relative '../helper'
2
-
3
- describe YACCL::RepositoryServices do
4
-
5
- before :all do
6
- @repo = create_repository('testrepo')
7
- end
8
-
9
- after :all do
10
- delete_repository('testrepo')
11
- end
12
-
13
- it 'get repositories' do
14
- repos = YACCL::Services.get_repositories
15
- repos.keys.should include :testrepo
16
- repo = repos[:testrepo]
17
- repo[:repositoryId].should eq 'testrepo'
18
- end
19
-
20
- it 'get repository info' do
21
- repos = YACCL::Services.get_repository_info('testrepo')
22
- repos.keys.should eq [:testrepo]
23
- repo = repos[:testrepo]
24
- repo[:repositoryId].should eq 'testrepo'
25
- end
26
-
27
- it 'get meta repo type descendants' do
28
- descendants = YACCL::Services.get_type_descendants('meta', nil, nil, nil)
29
- end
30
-
31
- it 'get type descendants' do
32
- descendants = YACCL::Services.get_type_descendants('testrepo', nil, nil, nil)
33
- end
34
-
35
- end