Class: Dor::Services::Client::Object
- Inherits:
-
VersionedService
- Object
- VersionedService
- Dor::Services::Client::Object
- Extended by:
- Deprecation
- Defined in:
- lib/dor/services/client/object.rb
Overview
API calls that are about a repository object
Instance Attribute Summary collapse
-
#object_identifier ⇒ Object
readonly
Returns the value of attribute object_identifier.
Instance Method Summary collapse
- #close_version(**params) ⇒ Object
- #current_version ⇒ Object
- #files ⇒ Object
-
#initialize(connection:, version:, object_identifier:) ⇒ Object
constructor
A new instance of Object.
- #metadata ⇒ Object
-
#notify_goobi ⇒ boolean
Notify the external Goobi system for a new object that was registered in DOR.
- #open_new_version(**params) ⇒ Object
-
#publish ⇒ boolean
Publish a new object.
-
#refresh_metadata ⇒ boolean
Pull in metadata from Symphony and update descMetadata.
- #release_tags ⇒ Object
- #sdr ⇒ Object
-
#update_marc_record ⇒ boolean
Update the marc record for the give object.
- #version ⇒ Object
- #workflow ⇒ Object
- #workspace ⇒ Object
Constructor Details
#initialize(connection:, version:, object_identifier:) ⇒ Object
Returns a new instance of Object.
15 16 17 18 19 20 |
# File 'lib/dor/services/client/object.rb', line 15 def initialize(connection:, version:, object_identifier:) raise ArgumentError, "The `object_identifier` parameter must be an identifier string: #{object_identifier.inspect}" unless object_identifier.is_a?(String) super(connection: connection, version: version) @object_identifier = object_identifier end |
Instance Attribute Details
#object_identifier ⇒ Object (readonly)
Returns the value of attribute object_identifier.
12 13 14 |
# File 'lib/dor/services/client/object.rb', line 12 def object_identifier @object_identifier end |
Instance Method Details
#close_version(**params) ⇒ Object
112 113 114 |
# File 'lib/dor/services/client/object.rb', line 112 def close_version(**params) version.close(**params) end |
#current_version ⇒ Object
102 103 104 |
# File 'lib/dor/services/client/object.rb', line 102 def current_version version.current end |
#files ⇒ Object
30 31 32 |
# File 'lib/dor/services/client/object.rb', line 30 def files @files ||= Files.new(connection: connection, version: api_version, object_identifier: object_identifier) end |
#metadata ⇒ Object
26 27 28 |
# File 'lib/dor/services/client/object.rb', line 26 def @metadata ||= Metadata.new(connection: connection, version: api_version, object_identifier: object_identifier) end |
#notify_goobi ⇒ boolean
Notify the external Goobi system for a new object that was registered in DOR
93 94 95 96 97 98 99 100 |
# File 'lib/dor/services/client/object.rb', line 93 def notify_goobi resp = connection.post do |req| req.url "#{object_path}/notify_goobi" end return true if resp.success? raise_exception_based_on_response!(resp) end |
#open_new_version(**params) ⇒ Object
107 108 109 |
# File 'lib/dor/services/client/object.rb', line 107 def open_new_version(**params) version.open(**params) end |
#publish ⇒ boolean
Publish a new object
54 55 56 57 58 59 60 61 |
# File 'lib/dor/services/client/object.rb', line 54 def publish resp = connection.post do |req| req.url "#{object_path}/publish" end return true if resp.success? raise_exception_based_on_response!(resp) end |
#refresh_metadata ⇒ boolean
Pull in metadata from Symphony and update descMetadata
80 81 82 83 84 85 86 87 |
# File 'lib/dor/services/client/object.rb', line 80 def resp = connection.post do |req| req.url "#{object_path}/refresh_metadata" end return true if resp.success? raise_exception_based_on_response!(resp) end |
#release_tags ⇒ Object
42 43 44 |
# File 'lib/dor/services/client/object.rb', line 42 def @release_tags ||= ReleaseTags.new(connection: connection, version: api_version, object_identifier: object_identifier) end |
#sdr ⇒ Object
22 23 24 |
# File 'lib/dor/services/client/object.rb', line 22 def sdr @sdr ||= SDR.new(connection: connection, version: api_version, object_identifier: object_identifier) end |
#update_marc_record ⇒ boolean
Update the marc record for the give object
67 68 69 70 71 72 73 74 |
# File 'lib/dor/services/client/object.rb', line 67 def update_marc_record resp = connection.post do |req| req.url "#{object_path}/update_marc_record" end return true if resp.success? raise_exception_based_on_response!(resp) end |
#version ⇒ Object
46 47 48 |
# File 'lib/dor/services/client/object.rb', line 46 def version @version ||= ObjectVersion.new(connection: connection, version: api_version, object_identifier: object_identifier) end |