puree 1.9.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -12
- data/Gemfile +1 -1
- data/README.md +106 -75
- data/lib/puree/extractor/conference_paper.rb +6 -14
- data/lib/puree/extractor/dataset.rb +5 -41
- data/lib/puree/extractor/doctoral_thesis.rb +5 -6
- data/lib/puree/extractor/event.rb +6 -14
- data/lib/puree/extractor/external_organisation.rb +5 -8
- data/lib/puree/extractor/extractor.rb +19 -0
- data/lib/puree/extractor/journal.rb +5 -9
- data/lib/puree/extractor/journal_article.rb +6 -15
- data/lib/puree/extractor/masters_thesis.rb +5 -6
- data/lib/puree/extractor/organisational_unit.rb +25 -0
- data/lib/puree/extractor/paper.rb +6 -11
- data/lib/puree/extractor/person.rb +4 -53
- data/lib/puree/extractor/project.rb +5 -28
- data/lib/puree/extractor/publisher.rb +5 -12
- data/lib/puree/extractor/research_output.rb +20 -0
- data/lib/puree/extractor/resource.rb +22 -58
- data/lib/puree/extractor/thesis.rb +6 -17
- data/lib/puree/model/conference_paper.rb +1 -1
- data/lib/puree/model/dataset.rb +8 -25
- data/lib/puree/model/event.rb +0 -9
- data/lib/puree/model/external_organisation.rb +1 -1
- data/lib/puree/model/external_organisation_header.rb +2 -19
- data/lib/puree/model/identifier.rb +26 -0
- data/lib/puree/model/journal.rb +1 -1
- data/lib/puree/model/journal_article.rb +1 -4
- data/lib/puree/model/model.rb +43 -0
- data/lib/puree/model/{organisation_header.rb → organisation_header_base.rb} +2 -2
- data/lib/puree/model/{organisation.rb → organisational_unit.rb} +3 -6
- data/lib/puree/model/organisational_unit_header.rb +9 -0
- data/lib/puree/model/paper.rb +10 -1
- data/lib/puree/model/person.rb +3 -9
- data/lib/puree/model/project.rb +7 -14
- data/lib/puree/model/publication_status.rb +1 -1
- data/lib/puree/model/publisher.rb +3 -0
- data/lib/puree/model/publisher_header.rb +9 -0
- data/lib/puree/model/{publication.rb → research_output.rb} +18 -20
- data/lib/puree/model/research_output_scopus_metric.rb +26 -0
- data/lib/puree/model/resource.rb +19 -11
- data/lib/puree/model/thesis.rb +6 -3
- data/lib/puree/rest/activity.rb +24 -0
- data/lib/puree/rest/application.rb +24 -0
- data/lib/puree/rest/base.rb +131 -0
- data/lib/puree/rest/classification_scheme.rb +24 -0
- data/lib/puree/rest/client.rb +105 -0
- data/lib/puree/rest/curricula_vitae.rb +24 -0
- data/lib/puree/rest/dataset.rb +24 -0
- data/lib/puree/rest/equipment.rb +24 -0
- data/lib/puree/rest/event.rb +24 -0
- data/lib/puree/rest/external_organisation.rb +24 -0
- data/lib/puree/rest/external_person.rb +24 -0
- data/lib/puree/rest/impact.rb +24 -0
- data/lib/puree/rest/journal.rb +24 -0
- data/lib/puree/rest/mixins/active_mixin.rb +14 -0
- data/lib/puree/rest/mixins/activity_mixin.rb +14 -0
- data/lib/puree/rest/mixins/application_mixin.rb +15 -0
- data/lib/puree/rest/mixins/award_mixin.rb +15 -0
- data/lib/puree/rest/mixins/dataset_mixin.rb +15 -0
- data/lib/puree/rest/mixins/former_mixin.rb +14 -0
- data/lib/puree/rest/mixins/impact_mixin.rb +15 -0
- data/lib/puree/rest/mixins/person_mixin.rb +15 -0
- data/lib/puree/rest/mixins/press_media_mixin.rb +15 -0
- data/lib/puree/rest/mixins/prize_mixin.rb +15 -0
- data/lib/puree/rest/mixins/project_mixin.rb +15 -0
- data/lib/puree/rest/mixins/research_output_mixin.rb +15 -0
- data/lib/puree/rest/mixins/student_thesis_mixin.rb +15 -0
- data/lib/puree/rest/organisational_unit.rb +51 -0
- data/lib/puree/rest/person.rb +58 -0
- data/lib/puree/rest/press_media.rb +24 -0
- data/lib/puree/rest/prize.rb +24 -0
- data/lib/puree/rest/project.rb +27 -0
- data/lib/puree/rest/publisher.rb +31 -0
- data/lib/puree/rest/research_output.rb +24 -0
- data/lib/puree/rest/rest.rb +30 -0
- data/lib/puree/util/util.rb +3 -0
- data/lib/puree/version.rb +1 -1
- data/lib/puree/xml_extractor/base.rb +6 -6
- data/lib/puree/xml_extractor/collection.rb +112 -19
- data/lib/puree/xml_extractor/conference_paper.rb +9 -2
- data/lib/puree/xml_extractor/dataset.rb +56 -166
- data/lib/puree/xml_extractor/doctoral_thesis.rb +1 -1
- data/lib/puree/xml_extractor/event.rb +16 -19
- data/lib/puree/xml_extractor/external_organisation.rb +14 -5
- data/lib/puree/xml_extractor/journal.rb +18 -8
- data/lib/puree/xml_extractor/journal_article.rb +24 -11
- data/lib/puree/xml_extractor/masters_thesis.rb +1 -1
- data/lib/puree/xml_extractor/mixins/abstract_mixin.rb +17 -0
- data/lib/puree/xml_extractor/mixins/description_mixin.rb +17 -0
- data/lib/puree/xml_extractor/mixins/{external_organisations_mixin.rb → external_organisation_mixin.rb} +2 -2
- data/lib/puree/xml_extractor/mixins/identifier_mixin.rb +25 -0
- data/lib/puree/xml_extractor/mixins/keyword_mixin.rb +21 -0
- data/lib/puree/xml_extractor/mixins/organisational_unit_mixin.rb +18 -0
- data/lib/puree/xml_extractor/mixins/owner_mixin.rb +18 -0
- data/lib/puree/xml_extractor/mixins/peer_reviewed_mixin.rb +1 -1
- data/lib/puree/xml_extractor/mixins/person_mixin.rb +45 -0
- data/lib/puree/xml_extractor/mixins/publisher_mixin.rb +22 -0
- data/lib/puree/xml_extractor/mixins/{associated_mixin.rb → research_output_mixin.rb} +7 -7
- data/lib/puree/xml_extractor/mixins/title_mixin.rb +17 -0
- data/lib/puree/xml_extractor/mixins/type_mixin.rb +17 -0
- data/lib/puree/xml_extractor/mixins/workflow_mixin.rb +17 -0
- data/lib/puree/xml_extractor/organisational_unit.rb +82 -0
- data/lib/puree/xml_extractor/paper.rb +17 -3
- data/lib/puree/xml_extractor/person.rb +30 -35
- data/lib/puree/xml_extractor/project.rb +39 -75
- data/lib/puree/xml_extractor/publisher.rb +15 -6
- data/lib/puree/xml_extractor/research_output.rb +189 -0
- data/lib/puree/xml_extractor/resource.rb +28 -36
- data/lib/puree/xml_extractor/shared.rb +12 -9
- data/lib/puree/xml_extractor/thesis.rb +29 -15
- data/lib/puree/xml_extractor/xml_extractor.rb +43 -0
- data/lib/puree.rb +5 -114
- data/puree.gemspec +1 -1
- data/test/extractor/resource_test.rb +103 -0
- data/test/rest/base_test.rb +45 -0
- data/test/rest/common_test.rb +44 -0
- data/test/test_extractor_helper.rb +1 -0
- data/test/test_helper.rb +17 -0
- data/test/test_rest_helper.rb +82 -0
- data/test/test_xml_extractor_helper.rb +17 -0
- data/test/xml_extractor/xml_extractor_collection_test.rb +120 -0
- data/test/xml_extractor/xml_extractor_conference_paper_test.rb +69 -0
- data/test/xml_extractor/xml_extractor_dataset_test.rb +156 -0
- data/test/xml_extractor/xml_extractor_event_test.rb +58 -0
- data/test/xml_extractor/xml_extractor_external_organisation_test.rb +49 -0
- data/test/xml_extractor/xml_extractor_journal_article_test.rb +66 -0
- data/test/xml_extractor/xml_extractor_journal_test.rb +53 -0
- data/test/xml_extractor/xml_extractor_organisation_test.rb +80 -0
- data/test/xml_extractor/xml_extractor_person_test.rb +88 -0
- data/test/xml_extractor/xml_extractor_project_test.rb +136 -0
- data/test/xml_extractor/xml_extractor_publisher_test.rb +49 -0
- data/test/xml_extractor/xml_extractor_research_output_test.rb +214 -0
- data/test/xml_extractor/xml_extractor_thesis_test.rb +80 -0
- metadata +105 -68
- data/lib/puree/api/api.rb +0 -9
- data/lib/puree/api/authentication.rb +0 -33
- data/lib/puree/api/configuration.rb +0 -43
- data/lib/puree/api/map.rb +0 -80
- data/lib/puree/api/person_request.rb +0 -64
- data/lib/puree/api/request.rb +0 -119
- data/lib/puree/extractor/collection.rb +0 -131
- data/lib/puree/extractor/download.rb +0 -71
- data/lib/puree/extractor/organisation.rb +0 -34
- data/lib/puree/extractor/paper_base.rb +0 -28
- data/lib/puree/extractor/publication.rb +0 -53
- data/lib/puree/extractor/server.rb +0 -56
- data/lib/puree/model/download_header.rb +0 -21
- data/lib/puree/model/paper_base.rb +0 -19
- data/lib/puree/model/server.rb +0 -13
- data/lib/puree/query/funding.rb +0 -54
- data/lib/puree/query/person.rb +0 -121
- data/lib/puree/query/query.rb +0 -6
- data/lib/puree/xml_extractor/download.rb +0 -42
- data/lib/puree/xml_extractor/mixins/workflow_state_mixin.rb +0 -18
- data/lib/puree/xml_extractor/organisation.rb +0 -75
- data/lib/puree/xml_extractor/paper_base.rb +0 -17
- data/lib/puree/xml_extractor/publication.rb +0 -257
- data/lib/puree/xml_extractor/server.rb +0 -32
- data/spec/download_http_spec.rb +0 -31
- data/spec/open_api_dataset_http_spec.rb +0 -15
- data/spec/query/funding_http_spec.rb +0 -29
- data/spec/query/person_http_spec.rb +0 -52
- data/spec/resource/collection_all_http_spec.rb +0 -77
- data/spec/resource/collection_http_spec.rb +0 -65
- data/spec/resource/dataset_http_spec.rb +0 -112
- data/spec/resource/event_http_spec.rb +0 -52
- data/spec/resource/journal_http_spec.rb +0 -36
- data/spec/resource/organisation_http_spec.rb +0 -52
- data/spec/resource/person_http_spec.rb +0 -60
- data/spec/resource/project_http_spec.rb +0 -89
- data/spec/resource/publication_http_spec.rb +0 -126
- data/spec/resource/publisher_http_spec.rb +0 -26
- data/spec/server_http_spec.rb +0 -26
- data/spec/spec_helper.rb +0 -159
@@ -1,12 +1,9 @@
|
|
1
1
|
module Puree
|
2
2
|
module Model
|
3
3
|
|
4
|
-
# A
|
4
|
+
# A Research output.
|
5
5
|
#
|
6
|
-
class
|
7
|
-
|
8
|
-
# @return [Array<Puree::Model::RelatedContentHeader>]
|
9
|
-
attr_accessor :associated
|
6
|
+
class ResearchOutput < Resource
|
10
7
|
|
11
8
|
# @return [String, nil]
|
12
9
|
attr_accessor :bibliographical_note
|
@@ -17,12 +14,9 @@ module Puree
|
|
17
14
|
# @return [String, nil]
|
18
15
|
attr_accessor :description
|
19
16
|
|
20
|
-
# @return [String]
|
17
|
+
# @return [String, nil]
|
21
18
|
attr_accessor :doi
|
22
19
|
|
23
|
-
# @return [Array<String>]
|
24
|
-
attr_accessor :dois
|
25
|
-
|
26
20
|
# @return [Array<Puree::Model::ExternalOrganisationHeader>]
|
27
21
|
attr_accessor :external_organisations
|
28
22
|
|
@@ -38,10 +32,13 @@ module Puree
|
|
38
32
|
# @return [Array<String>]
|
39
33
|
attr_accessor :links
|
40
34
|
|
41
|
-
# @return [
|
35
|
+
# @return [String, nil]
|
36
|
+
attr_accessor :open_access_permission
|
37
|
+
|
38
|
+
# @return [Array<Puree::Model::OrganisationalUnitHeader>]
|
42
39
|
attr_accessor :organisations
|
43
40
|
|
44
|
-
# @return [Puree::Model::
|
41
|
+
# @return [Puree::Model::OrganisationalUnitHeader, nil]
|
45
42
|
attr_accessor :owner
|
46
43
|
|
47
44
|
# @return [Array<Puree::Model::EndeavourPerson>]
|
@@ -53,17 +50,18 @@ module Puree
|
|
53
50
|
# @return [Array<Puree::Model::EndeavourPerson>]
|
54
51
|
attr_accessor :persons_other
|
55
52
|
|
56
|
-
# @return [
|
57
|
-
attr_accessor :
|
53
|
+
# @return [Array<Puree::Model::PublicationStatus>]
|
54
|
+
attr_accessor :publication_statuses
|
58
55
|
|
59
|
-
#
|
60
|
-
|
56
|
+
# Related research outputs.
|
57
|
+
# @return [Array<Puree::Model::RelatedContentHeader>]
|
58
|
+
attr_accessor :research_outputs
|
61
59
|
|
62
|
-
# @return [
|
63
|
-
attr_accessor :
|
60
|
+
# @return [Fixnum, nil]
|
61
|
+
attr_accessor :scopus_citations_count
|
64
62
|
|
65
|
-
# @return [Array<Puree::Model::
|
66
|
-
attr_accessor :
|
63
|
+
# @return [Array<Puree::Model::ResearchOutputScopusMetric>]
|
64
|
+
attr_accessor :scopus_metrics
|
67
65
|
|
68
66
|
# @return [String, nil]
|
69
67
|
attr_accessor :subtitle
|
@@ -81,7 +79,7 @@ module Puree
|
|
81
79
|
attr_accessor :type
|
82
80
|
|
83
81
|
# @return [String, nil]
|
84
|
-
attr_accessor :
|
82
|
+
attr_accessor :workflow
|
85
83
|
|
86
84
|
end
|
87
85
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Puree
|
2
|
+
module Model
|
3
|
+
|
4
|
+
# A Scopus metric.
|
5
|
+
#
|
6
|
+
class ResearchOutputScopusMetric < Puree::Model::Structure
|
7
|
+
|
8
|
+
# @return [Fixnum, nil]
|
9
|
+
attr_reader :value
|
10
|
+
|
11
|
+
# @return [Fixnum, nil]
|
12
|
+
attr_reader :year
|
13
|
+
|
14
|
+
# @param v [Fixnum]
|
15
|
+
def value=(v)
|
16
|
+
@value = v if v && !v.empty?
|
17
|
+
end
|
18
|
+
|
19
|
+
# @param v [Fixnum]
|
20
|
+
def year=(v)
|
21
|
+
@year = v if v && !v.empty?
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/puree/model/resource.rb
CHANGED
@@ -8,33 +8,41 @@ module Puree
|
|
8
8
|
# @return [String, nil]
|
9
9
|
attr_reader :uuid
|
10
10
|
|
11
|
-
# @return [
|
12
|
-
attr_reader :
|
11
|
+
# @return [String, nil]
|
12
|
+
attr_reader :created_by
|
13
13
|
|
14
14
|
# @return [Time, nil]
|
15
|
-
attr_reader :
|
15
|
+
attr_reader :created_at
|
16
16
|
|
17
17
|
# @return [String, nil]
|
18
|
-
attr_reader :
|
18
|
+
attr_reader :modified_by
|
19
|
+
|
20
|
+
# @return [Time, nil]
|
21
|
+
attr_reader :modified_at
|
19
22
|
|
20
23
|
# @param v [String]
|
21
24
|
def uuid=(v)
|
22
25
|
@uuid = v if v && !v.empty?
|
23
26
|
end
|
24
27
|
|
25
|
-
# @param v [
|
26
|
-
def
|
27
|
-
@
|
28
|
+
# @param v [String]
|
29
|
+
def created_by=(v)
|
30
|
+
@created_by = v
|
28
31
|
end
|
29
32
|
|
30
33
|
# @param v [Time]
|
31
|
-
def
|
32
|
-
@
|
34
|
+
def created_at=(v)
|
35
|
+
@created_at = v
|
33
36
|
end
|
34
37
|
|
35
38
|
# @param v [String]
|
36
|
-
def
|
37
|
-
@
|
39
|
+
def modified_by=(v)
|
40
|
+
@modified_by = v
|
41
|
+
end
|
42
|
+
|
43
|
+
# @param v [Time]
|
44
|
+
def modified_at=(v)
|
45
|
+
@modified_at = v
|
38
46
|
end
|
39
47
|
|
40
48
|
end
|
data/lib/puree/model/thesis.rb
CHANGED
@@ -3,12 +3,12 @@ module Puree
|
|
3
3
|
|
4
4
|
# A thesis.
|
5
5
|
#
|
6
|
-
class Thesis < Puree::Model::
|
6
|
+
class Thesis < Puree::Model::ResearchOutput
|
7
7
|
|
8
8
|
# @return [Time, nil]
|
9
9
|
attr_accessor :award_date
|
10
10
|
|
11
|
-
# @return [Puree::Model::
|
11
|
+
# @return [Puree::Model::OrganisationalUnitHeader, nil]
|
12
12
|
attr_accessor :awarding_institution
|
13
13
|
|
14
14
|
# @return [String, nil]
|
@@ -17,10 +17,13 @@ module Puree
|
|
17
17
|
# @return [Fixnum, nil]
|
18
18
|
attr_accessor :pages
|
19
19
|
|
20
|
+
# @return [Puree::Model::PublisherHeader, nil]
|
21
|
+
attr_accessor :publisher
|
22
|
+
|
20
23
|
# @return [String, nil]
|
21
24
|
attr_accessor :qualification
|
22
25
|
|
23
|
-
# @return [Array<
|
26
|
+
# @return [Array<Puree::Model::ExternalOrganisationHeader>]
|
24
27
|
attr_accessor :sponsors
|
25
28
|
|
26
29
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Puree
|
2
|
+
|
3
|
+
module REST
|
4
|
+
|
5
|
+
# Requests for the Activity resource
|
6
|
+
#
|
7
|
+
class Activity < Puree::REST::Base
|
8
|
+
|
9
|
+
# @option (see Puree::REST::Base#initialize)
|
10
|
+
def initialize(config)
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def collection
|
17
|
+
'activities'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Puree
|
2
|
+
|
3
|
+
module REST
|
4
|
+
|
5
|
+
# Requests for the Application resource
|
6
|
+
#
|
7
|
+
class Application < Puree::REST::Base
|
8
|
+
|
9
|
+
# (see Puree::REST::Base#initialize)
|
10
|
+
def initialize(config)
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def collection
|
17
|
+
'applications'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,131 @@
|
|
1
|
+
require 'http'
|
2
|
+
|
3
|
+
module Puree
|
4
|
+
|
5
|
+
module REST
|
6
|
+
|
7
|
+
# Requests for a resource
|
8
|
+
#
|
9
|
+
class Base
|
10
|
+
|
11
|
+
# @param config [Hash]
|
12
|
+
# @option config [String] :url URL of the Pure host
|
13
|
+
# @option config [String] :username Username of the Pure host account
|
14
|
+
# @option config [String] :password Password of the Pure host account
|
15
|
+
# @option config [String] :api_key API key of the Pure host account
|
16
|
+
def initialize(config)
|
17
|
+
@http_client = HTTP::Client.new
|
18
|
+
if config[:username] || config[:password]
|
19
|
+
options = {}
|
20
|
+
options[:user] = config[:username]
|
21
|
+
options[:pass] = config[:password]
|
22
|
+
@http_client = @http_client.basic_auth options
|
23
|
+
end
|
24
|
+
@http_client = @http_client.headers(api_key_header(config[:api_key]))
|
25
|
+
@url = config[:url]
|
26
|
+
end
|
27
|
+
|
28
|
+
# @param params [Hash]
|
29
|
+
# @param accept [Symbol]
|
30
|
+
# @return [HTTP::Response]
|
31
|
+
def all(params: {}, accept: :xml)
|
32
|
+
get_request_collection params: params,
|
33
|
+
accept: accept
|
34
|
+
end
|
35
|
+
|
36
|
+
# @param id [String]
|
37
|
+
# @param params [Hash]
|
38
|
+
# @param accept [Symbol]
|
39
|
+
# @return [HTTP::Response]
|
40
|
+
def find(id:, params: {}, accept: :xml)
|
41
|
+
get_request_singleton id: id,
|
42
|
+
params: params,
|
43
|
+
accept: accept
|
44
|
+
end
|
45
|
+
|
46
|
+
# @param accept [Symbol]
|
47
|
+
# @return (see Puree::REST::Base#all)
|
48
|
+
def orderings(accept: :xml)
|
49
|
+
get_request_meta meta_type: 'orderings',
|
50
|
+
accept: accept
|
51
|
+
end
|
52
|
+
|
53
|
+
# @param accept [Symbol]
|
54
|
+
# @return (see Puree::REST::Base#all)
|
55
|
+
def renderings(accept: :xml)
|
56
|
+
get_request_meta meta_type: 'renderings',
|
57
|
+
accept: accept
|
58
|
+
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
def accept_header(accept)
|
63
|
+
case accept
|
64
|
+
when :json
|
65
|
+
return { 'Accept' => 'application/json' }
|
66
|
+
when :xml
|
67
|
+
return { 'Accept' => 'application/xml' }
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def api_key_header(key)
|
72
|
+
msg = 'API key incomplete in configuration'
|
73
|
+
raise msg if !key
|
74
|
+
{ 'api-key' => key }
|
75
|
+
end
|
76
|
+
|
77
|
+
def url_collection
|
78
|
+
File.join @url, collection
|
79
|
+
end
|
80
|
+
|
81
|
+
def url_collection_subcollection(subcollection)
|
82
|
+
File.join url_collection, subcollection
|
83
|
+
end
|
84
|
+
|
85
|
+
def url_singleton(id)
|
86
|
+
File.join url_collection, id
|
87
|
+
end
|
88
|
+
|
89
|
+
def url_singleton_subcollection(id, subcollection)
|
90
|
+
File.join url_singleton(id), subcollection
|
91
|
+
end
|
92
|
+
|
93
|
+
def meta(type)
|
94
|
+
File.join "#{url_collection}-meta", type
|
95
|
+
end
|
96
|
+
|
97
|
+
# @return (see Puree::REST::Base#all)
|
98
|
+
def get_request_collection(params: {}, accept: :xml)
|
99
|
+
@http_client = @http_client.headers(accept_header(accept))
|
100
|
+
@http_client.get url_collection, params: params
|
101
|
+
end
|
102
|
+
|
103
|
+
# @return (see Puree::REST::Base#all)
|
104
|
+
def get_request_collection_subcollection(subcollection:, params: {}, accept: :xml)
|
105
|
+
@http_client = @http_client.headers(accept_header(accept))
|
106
|
+
@http_client.get meta(url_collection_subcollection(subcollection)), params: params
|
107
|
+
end
|
108
|
+
|
109
|
+
# @return (see Puree::REST::Base#all)
|
110
|
+
def get_request_singleton(id:, params: {}, accept: :xml)
|
111
|
+
@http_client = @http_client.headers(accept_header(accept))
|
112
|
+
@http_client.get url_singleton(id), params: params
|
113
|
+
end
|
114
|
+
|
115
|
+
# @return (see Puree::REST::Base#all)
|
116
|
+
def get_request_singleton_subcollection(id:, subcollection:, params: {}, accept: :xml)
|
117
|
+
@http_client = @http_client.headers(accept_header(accept))
|
118
|
+
@http_client.get url_singleton_subcollection(id, subcollection), params: params
|
119
|
+
end
|
120
|
+
|
121
|
+
# @return (see Puree::REST::Base#all)
|
122
|
+
def get_request_meta(meta_type:, accept: :xml)
|
123
|
+
@http_client = @http_client.headers(accept_header(accept))
|
124
|
+
@http_client.get meta(meta_type)
|
125
|
+
end
|
126
|
+
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
|
131
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Puree
|
2
|
+
|
3
|
+
module REST
|
4
|
+
|
5
|
+
# Requests for the Classification Scheme resource
|
6
|
+
#
|
7
|
+
class ClassificationScheme < Puree::REST::Base
|
8
|
+
|
9
|
+
# (see Puree::REST::Base#initialize)
|
10
|
+
def initialize(config)
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def collection
|
17
|
+
'classification-schemes'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
module Puree
|
2
|
+
|
3
|
+
module REST
|
4
|
+
|
5
|
+
# Requests for all resources
|
6
|
+
#
|
7
|
+
class Client
|
8
|
+
|
9
|
+
# (see Puree::REST::Base#initialize)
|
10
|
+
def initialize(config)
|
11
|
+
@config = config
|
12
|
+
end
|
13
|
+
|
14
|
+
# @return [Puree::REST::Activity]
|
15
|
+
def activities
|
16
|
+
Puree::REST::Activity.new @config
|
17
|
+
end
|
18
|
+
|
19
|
+
# @return [Puree::REST::Application]
|
20
|
+
def applications
|
21
|
+
Puree::REST::Application.new @config
|
22
|
+
end
|
23
|
+
|
24
|
+
# @return [Puree::REST::ClassificationScheme]
|
25
|
+
def classification_schemes
|
26
|
+
Puree::REST::ClassificationScheme.new @config
|
27
|
+
end
|
28
|
+
|
29
|
+
# @return [Puree::REST::CurriculaVitae]
|
30
|
+
def curricula_vitae
|
31
|
+
Puree::REST::CurriculaVitae.new @config
|
32
|
+
end
|
33
|
+
|
34
|
+
# @return [Puree::REST::Dataset]
|
35
|
+
def datasets
|
36
|
+
Puree::REST::Dataset.new @config
|
37
|
+
end
|
38
|
+
|
39
|
+
# @return [Puree::REST::Equipment]
|
40
|
+
def equipments
|
41
|
+
Puree::REST::Equipment.new @config
|
42
|
+
end
|
43
|
+
|
44
|
+
# @return [Puree::REST::Event]
|
45
|
+
def events
|
46
|
+
Puree::REST::Event.new @config
|
47
|
+
end
|
48
|
+
|
49
|
+
# @return [Puree::REST::ExternalOrganisation]
|
50
|
+
def external_organisations
|
51
|
+
Puree::REST::ExternalOrganisation.new @config
|
52
|
+
end
|
53
|
+
|
54
|
+
# @return [Puree::REST::ExternalPerson]
|
55
|
+
def external_persons
|
56
|
+
Puree::REST::ExternalPerson.new @config
|
57
|
+
end
|
58
|
+
|
59
|
+
# @return [Puree::REST::Impact]
|
60
|
+
def impacts
|
61
|
+
Puree::REST::Impact.new @config
|
62
|
+
end
|
63
|
+
|
64
|
+
# @return [Puree::REST::Journal]
|
65
|
+
def journals
|
66
|
+
Puree::REST::Journal.new @config
|
67
|
+
end
|
68
|
+
|
69
|
+
# @return [Puree::REST::OrganisationalUnit]
|
70
|
+
def organisational_units
|
71
|
+
Puree::REST::OrganisationalUnit.new @config
|
72
|
+
end
|
73
|
+
|
74
|
+
# @return [Puree::REST::Person]
|
75
|
+
def persons
|
76
|
+
Puree::REST::Person.new @config
|
77
|
+
end
|
78
|
+
|
79
|
+
# @return [Puree::REST::PressMedia]
|
80
|
+
def press_media
|
81
|
+
Puree::REST::PressMedia.new @config
|
82
|
+
end
|
83
|
+
|
84
|
+
# @return [Puree::REST::Prize]
|
85
|
+
def prizes
|
86
|
+
Puree::REST::Prize.new @config
|
87
|
+
end
|
88
|
+
|
89
|
+
# @return [Puree::REST::Project]
|
90
|
+
def projects
|
91
|
+
Puree::REST::Project.new @config
|
92
|
+
end
|
93
|
+
|
94
|
+
# @return [Puree::REST::Publisher]
|
95
|
+
def publishers
|
96
|
+
Puree::REST::Publisher.new @config
|
97
|
+
end
|
98
|
+
|
99
|
+
# @return [Puree::REST::ResearchOutput]
|
100
|
+
def research_outputs
|
101
|
+
Puree::REST::ResearchOutput.new @config
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Puree
|
2
|
+
|
3
|
+
module REST
|
4
|
+
|
5
|
+
# Requests for the Curricula Vitae resource
|
6
|
+
#
|
7
|
+
class CurriculaVitae < Puree::REST::Base
|
8
|
+
|
9
|
+
# (see Puree::REST::Base#initialize)
|
10
|
+
def initialize(config)
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def collection
|
17
|
+
'curricula-vitae'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Puree
|
2
|
+
|
3
|
+
module REST
|
4
|
+
|
5
|
+
# Requests for the Dataset resource
|
6
|
+
#
|
7
|
+
class Dataset < Puree::REST::Base
|
8
|
+
|
9
|
+
# (see Puree::REST::Base#initialize)
|
10
|
+
def initialize(config)
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def collection
|
17
|
+
'datasets'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Puree
|
2
|
+
|
3
|
+
module REST
|
4
|
+
|
5
|
+
# Requests for the Equipment resource
|
6
|
+
#
|
7
|
+
class Equipment < Puree::REST::Base
|
8
|
+
|
9
|
+
# (see Puree::REST::Base#initialize)
|
10
|
+
def initialize(config)
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def collection
|
17
|
+
'equipments'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Puree
|
2
|
+
|
3
|
+
module REST
|
4
|
+
|
5
|
+
# Requests for the Event resource
|
6
|
+
#
|
7
|
+
class Event < Puree::REST::Base
|
8
|
+
|
9
|
+
# (see Puree::REST::Base#initialize)
|
10
|
+
def initialize(config)
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def collection
|
17
|
+
'events'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Puree
|
2
|
+
|
3
|
+
module REST
|
4
|
+
|
5
|
+
# Requests for the External Organisation resource
|
6
|
+
#
|
7
|
+
class ExternalOrganisation < Puree::REST::Base
|
8
|
+
|
9
|
+
# (see Puree::REST::Base#initialize)
|
10
|
+
def initialize(config)
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def collection
|
17
|
+
'external-organisations'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Puree
|
2
|
+
|
3
|
+
module REST
|
4
|
+
|
5
|
+
# Requests for the External Person resource
|
6
|
+
#
|
7
|
+
class ExternalPerson < Puree::REST::Base
|
8
|
+
|
9
|
+
# (see Puree::REST::Base#initialize)
|
10
|
+
def initialize(config)
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def collection
|
17
|
+
'external-persons'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Puree
|
2
|
+
|
3
|
+
module REST
|
4
|
+
|
5
|
+
# Requests for the Impact resource
|
6
|
+
#
|
7
|
+
class Impact < Puree::REST::Base
|
8
|
+
|
9
|
+
# (see Puree::REST::Base#initialize)
|
10
|
+
def initialize(config)
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def collection
|
17
|
+
'impacts'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Puree
|
2
|
+
|
3
|
+
module REST
|
4
|
+
|
5
|
+
# Requests for the Journal resource
|
6
|
+
#
|
7
|
+
class Journal < Puree::REST::Base
|
8
|
+
|
9
|
+
# (see Puree::REST::Base#initialize)
|
10
|
+
def initialize(config)
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def collection
|
17
|
+
'journals'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|