dor-services 6.8.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/config_defaults.yml +0 -27
- data/config/dev_console_env.rb.example +0 -17
- data/lib/dor-services.rb +9 -73
- data/lib/dor/config.rb +1 -30
- data/lib/dor/datastreams/content_metadata_ds.rb +8 -0
- data/lib/dor/datastreams/desc_metadata_ds.rb +19 -0
- data/lib/dor/datastreams/identity_metadata_ds.rb +65 -0
- data/lib/dor/datastreams/rights_metadata_ds.rb +14 -2
- data/lib/dor/datastreams/workflow_definition_ds.rb +1 -1
- data/lib/dor/datastreams/workflow_ds.rb +0 -15
- data/lib/dor/indexers/identifiable_indexer.rb +8 -4
- data/lib/dor/indexers/releasable_indexer.rb +7 -1
- data/lib/dor/models/abstract.rb +143 -8
- data/lib/dor/models/admin_policy_object.rb +0 -3
- data/lib/dor/models/collection.rb +0 -2
- data/lib/dor/models/concerns/embargoable.rb +7 -60
- data/lib/dor/models/etd.rb +100 -0
- data/lib/dor/models/item.rb +12 -28
- data/lib/dor/models/part.rb +18 -0
- data/lib/dor/models/set.rb +0 -2
- data/lib/dor/services/collection_service.rb +36 -0
- data/lib/dor/services/embargo_service.rb +93 -0
- data/lib/dor/services/ontology.rb +0 -18
- data/lib/dor/services/public_desc_metadata_service.rb +7 -11
- data/lib/dor/services/search_service.rb +0 -40
- data/lib/dor/version.rb +1 -1
- data/lib/dor/workflow/document.rb +0 -7
- metadata +15 -78
- data/lib/dor/models/concerns/assembleable.rb +0 -18
- data/lib/dor/models/concerns/contentable.rb +0 -185
- data/lib/dor/models/concerns/describable.rb +0 -82
- data/lib/dor/models/concerns/eventable.rb +0 -18
- data/lib/dor/models/concerns/geoable.rb +0 -14
- data/lib/dor/models/concerns/governable.rb +0 -101
- data/lib/dor/models/concerns/identifiable.rb +0 -172
- data/lib/dor/models/concerns/itemizable.rb +0 -42
- data/lib/dor/models/concerns/preservable.rb +0 -46
- data/lib/dor/models/concerns/processable.rb +0 -86
- data/lib/dor/models/concerns/publishable.rb +0 -76
- data/lib/dor/models/concerns/releaseable.rb +0 -118
- data/lib/dor/models/concerns/rightsable.rb +0 -25
- data/lib/dor/models/concerns/shelvable.rb +0 -15
- data/lib/dor/models/concerns/versionable.rb +0 -72
- data/lib/dor/services/ability.rb +0 -77
- data/lib/dor/services/cleanup_reset_service.rb +0 -103
- data/lib/dor/services/datastream_builder.rb +0 -96
- data/lib/dor/services/decommission_service.rb +0 -31
- data/lib/dor/services/digital_stacks_service.rb +0 -125
- data/lib/dor/services/dublin_core_service.rb +0 -45
- data/lib/dor/services/file_metadata_merge_service.rb +0 -71
- data/lib/dor/services/indexing_service.rb +0 -131
- data/lib/dor/services/merge_service.rb +0 -105
- data/lib/dor/services/public_xml_service.rb +0 -116
- data/lib/dor/services/publish_metadata_service.rb +0 -99
- data/lib/dor/services/reset_workspace_service.rb +0 -27
- data/lib/dor/services/sdr_ingest_service.rb +0 -172
- data/lib/dor/services/secondary_file_name_service.rb +0 -10
- data/lib/dor/services/shelving_service.rb +0 -69
- data/lib/dor/services/technical_metadata_service.rb +0 -232
- data/lib/dor/services/version_service.rb +0 -84
- data/lib/dor/utils/sdr_client.rb +0 -94
@@ -53,7 +53,7 @@ module Dor
|
|
53
53
|
ng_xml.at_xpath('/workflow-def/@repository').to_s
|
54
54
|
end
|
55
55
|
|
56
|
-
# Creates the xml used by Dor::
|
56
|
+
# Creates the xml used by Dor::Workflow::Client#create_workflow
|
57
57
|
# @return [String] An object's initial workflow as defined by the <workflow-def> in content
|
58
58
|
def initial_workflow
|
59
59
|
doc = Nokogiri::XML('<workflow/>')
|
@@ -3,9 +3,6 @@
|
|
3
3
|
module Dor
|
4
4
|
# TODO: class docs
|
5
5
|
class WorkflowDs < ActiveFedora::OmDatastream
|
6
|
-
extend Deprecation
|
7
|
-
self.deprecation_horizon = 'dor-services version 7.0.0'
|
8
|
-
|
9
6
|
before_save :build_location
|
10
7
|
set_terminology do |t|
|
11
8
|
t.root(path: 'workflows')
|
@@ -34,18 +31,6 @@ module Dor
|
|
34
31
|
super.merge(mimeType: 'application/xml')
|
35
32
|
end
|
36
33
|
|
37
|
-
def get_workflow(wf, repo = 'dor')
|
38
|
-
xml = Dor::Config.workflow.client.workflow_xml(repo, pid, wf)
|
39
|
-
xml = Nokogiri::XML(xml)
|
40
|
-
return nil if xml.xpath('workflow').length == 0
|
41
|
-
|
42
|
-
Workflow::Document.new(xml.to_s)
|
43
|
-
end
|
44
|
-
deprecation_deprecate get_workflow: 'This has been moved to Argo and will be discontinued'
|
45
|
-
|
46
|
-
alias [] get_workflow
|
47
|
-
deprecation_deprecate :[] => 'This has been moved to Argo and will be discontinued'
|
48
|
-
|
49
34
|
def ng_xml
|
50
35
|
@ng_xml ||= Nokogiri::XML::Document.parse(content)
|
51
36
|
end
|
@@ -4,6 +4,11 @@ module Dor
|
|
4
4
|
class IdentifiableIndexer
|
5
5
|
include SolrDocHelper
|
6
6
|
|
7
|
+
INDEX_VERSION_FIELD = 'dor_services_version_ssi'
|
8
|
+
NS_HASH = { 'hydra' => 'http://projecthydra.org/ns/relations#',
|
9
|
+
'fedora' => 'info:fedora/fedora-system:def/relations-external#',
|
10
|
+
'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' }.freeze
|
11
|
+
|
7
12
|
attr_reader :resource
|
8
13
|
def initialize(resource:)
|
9
14
|
@resource = resource
|
@@ -17,7 +22,7 @@ module Dor
|
|
17
22
|
# @return [Hash] the partial solr document for identifiable concerns
|
18
23
|
def to_solr
|
19
24
|
solr_doc = {}
|
20
|
-
solr_doc[
|
25
|
+
solr_doc[INDEX_VERSION_FIELD] = Dor::VERSION
|
21
26
|
solr_doc['indexed_at_dtsi'] = Time.now.utc.xmlschema
|
22
27
|
resource.datastreams.values.each do |ds|
|
23
28
|
add_solr_value(solr_doc, 'ds_specs', ds.datastream_spec_string, :string, [:symbol]) unless ds.new?
|
@@ -26,9 +31,8 @@ module Dor
|
|
26
31
|
add_solr_value(solr_doc, 'title_sort', resource.label, :string, [:stored_sortable])
|
27
32
|
|
28
33
|
rels_doc = Nokogiri::XML(resource.datastreams['RELS-EXT'].content)
|
29
|
-
|
30
|
-
|
31
|
-
collections = rels_doc.search('//rdf:RDF/rdf:Description/fedora:isMemberOfCollection', ns_hash)
|
34
|
+
apos = rels_doc.search('//rdf:RDF/rdf:Description/hydra:isGovernedBy', NS_HASH)
|
35
|
+
collections = rels_doc.search('//rdf:RDF/rdf:Description/fedora:isMemberOfCollection', NS_HASH)
|
32
36
|
solrize_related_obj_titles(solr_doc, apos, @@apo_hash, 'apo_title', 'nonhydrus_apo_title', 'hydrus_apo_title')
|
33
37
|
solrize_related_obj_titles(solr_doc, collections, @@collection_hash, 'collection_title', 'nonhydrus_collection_title', 'hydrus_collection_title')
|
34
38
|
solr_doc['public_dc_relation_tesim'] ||= solr_doc['collection_title_tesim'] if solr_doc['collection_title_tesim']
|
@@ -15,7 +15,7 @@ module Dor
|
|
15
15
|
|
16
16
|
# TODO: sort of worried about the performance impact in bulk reindex
|
17
17
|
# situations, since released_for recurses all parent collections. jmartin 2015-07-14
|
18
|
-
|
18
|
+
released_for.each do |release_target, release_info|
|
19
19
|
add_solr_value(solr_doc, 'released_to', release_target, :symbol, []) if release_info['release']
|
20
20
|
end
|
21
21
|
|
@@ -24,5 +24,11 @@ module Dor
|
|
24
24
|
|
25
25
|
solr_doc
|
26
26
|
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def released_for
|
31
|
+
ReleaseTagService.for(resource).released_for(skip_live_purl: true)
|
32
|
+
end
|
27
33
|
end
|
28
34
|
end
|
data/lib/dor/models/abstract.rb
CHANGED
@@ -2,19 +2,154 @@
|
|
2
2
|
|
3
3
|
module Dor
|
4
4
|
class Abstract < ::ActiveFedora::Base
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
extend Deprecation
|
6
|
+
self.deprecation_horizon = '8.0'
|
7
|
+
|
8
|
+
has_metadata name: 'provenanceMetadata',
|
9
|
+
type: ProvenanceMetadataDS,
|
10
|
+
label: 'Provenance Metadata'
|
11
|
+
has_metadata name: 'workflows',
|
12
|
+
type: WorkflowDs,
|
13
|
+
label: 'Workflows',
|
14
|
+
control_group: 'E',
|
15
|
+
autocreate: true
|
16
|
+
has_metadata name: 'rightsMetadata',
|
17
|
+
type: RightsMetadataDS,
|
18
|
+
label: 'Rights metadata'
|
19
|
+
has_metadata name: 'events',
|
20
|
+
type: EventsDS,
|
21
|
+
label: 'Events'
|
22
|
+
has_metadata name: 'versionMetadata',
|
23
|
+
type: VersionMetadataDS,
|
24
|
+
label: 'Version Metadata',
|
25
|
+
autocreate: true
|
26
|
+
has_metadata name: 'DC',
|
27
|
+
type: SimpleDublinCoreDs,
|
28
|
+
label: 'Dublin Core Record for self object'
|
29
|
+
has_metadata name: 'identityMetadata',
|
30
|
+
type: Dor::IdentityMetadataDS,
|
31
|
+
label: 'Identity Metadata'
|
32
|
+
has_metadata name: 'descMetadata',
|
33
|
+
type: Dor::DescMetadataDS,
|
34
|
+
label: 'Descriptive Metadata',
|
35
|
+
control_group: 'M'
|
36
|
+
|
37
|
+
belongs_to :admin_policy_object,
|
38
|
+
property: :is_governed_by,
|
39
|
+
class_name: 'Dor::AdminPolicyObject'
|
40
|
+
has_and_belongs_to_many :collections,
|
41
|
+
property: :is_member_of_collection,
|
42
|
+
class_name: 'Dor::Collection'
|
43
|
+
has_and_belongs_to_many :sets,
|
44
|
+
property: :is_member_of,
|
45
|
+
class_name: 'Dor::Collection'
|
13
46
|
|
14
47
|
class_attribute :resource_indexer
|
48
|
+
class_attribute :object_type
|
49
|
+
|
50
|
+
def self.has_object_type(str)
|
51
|
+
self.object_type = str
|
52
|
+
Dor.registered_classes[str] = self
|
53
|
+
end
|
54
|
+
|
55
|
+
# Overrides the method in ActiveFedora to mint a pid using SURI rather
|
56
|
+
# than the default Fedora sequence
|
57
|
+
def self.assign_pid(_obj)
|
58
|
+
return Dor::SuriService.mint_id if Dor::Config.suri.mint_ids
|
15
59
|
|
60
|
+
super
|
61
|
+
end
|
62
|
+
|
63
|
+
# Overrides the method in ActiveFedora
|
16
64
|
def to_solr
|
17
65
|
resource_indexer.new(resource: self).to_solr
|
18
66
|
end
|
67
|
+
|
68
|
+
# Override ActiveFedora::Core#adapt_to_cmodel (used with associations, among other places) to
|
69
|
+
# preferentially use the objectType asserted in the identityMetadata.
|
70
|
+
def adapt_to_cmodel
|
71
|
+
object_type = identityMetadata.objectType.first
|
72
|
+
object_class = Dor.registered_classes[object_type]
|
73
|
+
|
74
|
+
if object_class
|
75
|
+
instance_of?(object_class) ? self : adapt_to(object_class)
|
76
|
+
else
|
77
|
+
begin
|
78
|
+
super
|
79
|
+
rescue ActiveFedora::ModelNotAsserted
|
80
|
+
adapt_to(Dor::Item)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# a regex that can be used to identify the last part of a druid (e.g. oo000oo0001)
|
86
|
+
# @return [Regex] a regular expression to identify the ID part of the druid
|
87
|
+
def pid_regex
|
88
|
+
/[a-zA-Z]{2}[0-9]{3}[a-zA-Z]{2}[0-9]{4}/
|
89
|
+
end
|
90
|
+
|
91
|
+
# a regex that can be used to identify a full druid with prefix (e.g. druid:oo000oo0001)
|
92
|
+
# @return [Regex] a regular expression to identify a full druid
|
93
|
+
def druid_regex
|
94
|
+
/druid:#{pid_regex}/
|
95
|
+
end
|
96
|
+
|
97
|
+
# Since purl does not use the druid: prefix but much of dor does, use this function to strip the druid: if needed
|
98
|
+
# @return [String] the druid sans the druid: or if there was no druid: prefix, the entire string you passed
|
99
|
+
def remove_druid_prefix(druid = id)
|
100
|
+
result = druid.match(/#{pid_regex}/)
|
101
|
+
result.nil? ? druid : result[0] # if no matches, return the string passed in, otherwise return the match
|
102
|
+
end
|
103
|
+
|
104
|
+
# This is used by Argo and the MergeService
|
105
|
+
# @return [Boolean] true if the object is in a state that allows it to be modified.
|
106
|
+
# States that will allow modification are: has not been submitted for accessioning, has an open version or has sdr-ingest set to hold
|
107
|
+
# @todo this could be a workflow service endpoint
|
108
|
+
def allows_modification?
|
109
|
+
client = Dor::Config.workflow.client
|
110
|
+
!client.lifecycle('dor', pid, 'submitted') ||
|
111
|
+
client.active_lifecycle('dor', pid, 'opened') ||
|
112
|
+
client.workflow_status('dor', pid, 'accessionWF', 'sdr-ingest-transfer') == 'hold'
|
113
|
+
end
|
114
|
+
|
115
|
+
def current_version
|
116
|
+
versionMetadata.current_version_id
|
117
|
+
end
|
118
|
+
|
119
|
+
delegate :full_title, :stanford_mods, to: :descMetadata
|
120
|
+
delegate :rights, to: :rightsMetadata
|
121
|
+
delegate :catkey, :catkey=, :previous_catkeys, :tags, :content_type_tag, :source_id, :source_id=, to: :identityMetadata
|
122
|
+
|
123
|
+
def read_rights=(rights)
|
124
|
+
rightsMetadata.set_read_rights(rights)
|
125
|
+
unshelve_and_unpublish if rights == 'dark'
|
126
|
+
end
|
127
|
+
alias set_read_rights read_rights=
|
128
|
+
deprecation_deprecate set_read_rights: 'Use read_rights= instead'
|
129
|
+
|
130
|
+
def add_collection(collection_or_druid)
|
131
|
+
collection_manager.add(collection_or_druid)
|
132
|
+
end
|
133
|
+
|
134
|
+
def remove_collection(collection_or_druid)
|
135
|
+
collection_manager.remove(collection_or_druid)
|
136
|
+
end
|
137
|
+
|
138
|
+
# set the rights metadata datastream to the content of the APO's default object rights
|
139
|
+
def reapply_admin_policy_object_defaults
|
140
|
+
rightsMetadata.content = admin_policy_object.defaultObjectRights.content
|
141
|
+
end
|
142
|
+
alias reapplyAdminPolicyObjectDefaults reapply_admin_policy_object_defaults
|
143
|
+
deprecation_deprecate reapplyAdminPolicyObjectDefaults: 'Use reapply_admin_policy_object_defaults instead'
|
144
|
+
|
145
|
+
private
|
146
|
+
|
147
|
+
def unshelve_and_unpublish
|
148
|
+
contentMetadata.unshelve_and_unpublish if respond_to? :contentMetadata
|
149
|
+
end
|
150
|
+
|
151
|
+
def collection_manager
|
152
|
+
CollectionService.new(self)
|
153
|
+
end
|
19
154
|
end
|
20
155
|
end
|
@@ -18,9 +18,6 @@ module Dor
|
|
18
18
|
WorkflowsIndexer
|
19
19
|
)
|
20
20
|
|
21
|
-
CREATIVE_COMMONS_USE_LICENSES = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('CREATIVE_COMMONS_USE_LICENSES', 'Dor::CreativeCommonsLicenseService')
|
22
|
-
OPEN_DATA_COMMONS_USE_LICENSES = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('OPEN_DATA_COMMONS_USE_LICENSES', 'Dor::OpenDataLicenseService')
|
23
|
-
|
24
21
|
delegate :add_roleplayer, :purge_roles, :roles, to: :roleMetadata
|
25
22
|
delegate :mods_title, :mods_title=, to: :descMetadata
|
26
23
|
delegate :default_collections, :add_default_collection, :remove_default_collection,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Dor
|
4
|
+
# Time limits and processes for embargoed materials.
|
4
5
|
module Embargoable
|
5
6
|
extend ActiveSupport::Concern
|
6
7
|
|
@@ -8,59 +9,17 @@ module Dor
|
|
8
9
|
has_metadata name: 'embargoMetadata', type: Dor::EmbargoMetadataDS, label: 'Embargo metadata'
|
9
10
|
end
|
10
11
|
|
11
|
-
# These methods manipulate the object for embargo purposes
|
12
|
-
# They assume the object has embargoMetadata, rightsMetadata, and events datastreams
|
13
|
-
|
14
12
|
# Manipulates datastreams in the object when embargo is lifted:
|
15
13
|
# Sets embargo status to released in embargoMetadata
|
16
14
|
# Modifies rightsMetadata to remove embargoReleaseDate and updates/adds access from embargoMetadata/releaseAccess
|
17
15
|
# @param [String] release_agent name of the person, application or thing that released embargo
|
18
16
|
# @note The caller should save the object to fedora to commit the changes
|
19
17
|
def release_embargo(release_agent = 'unknown')
|
20
|
-
|
21
|
-
embargo_md = datastreams['embargoMetadata']
|
22
|
-
embargo_md.status = 'released'
|
23
|
-
|
24
|
-
# Remove all read acces nodes
|
25
|
-
rights_md = datastreams['rightsMetadata']
|
26
|
-
rights_xml = rights_md.ng_xml
|
27
|
-
rights_md.ng_xml_will_change!
|
28
|
-
rights_xml.xpath("//rightsMetadata/access[@type='read']").each(&:remove)
|
29
|
-
|
30
|
-
# Replace rights <access> nodes with those from embargoMetadta
|
31
|
-
release_access = embargo_md.release_access_node
|
32
|
-
release_access.xpath('//releaseAccess/access').each do |new_access|
|
33
|
-
access_sibling = rights_xml.at_xpath('//rightsMetadata/access[last()]')
|
34
|
-
if access_sibling
|
35
|
-
access_sibling.add_next_sibling(new_access.clone)
|
36
|
-
else
|
37
|
-
rights_xml.root.add_child(new_access.clone)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
events.add_event('embargo', release_agent, 'Embargo released')
|
18
|
+
embargo_service.release(release_agent)
|
42
19
|
end
|
43
20
|
|
44
21
|
def release_20_pct_vis_embargo(release_agent = 'unknown')
|
45
|
-
|
46
|
-
embargo_md = datastreams['embargoMetadata']
|
47
|
-
embargo_md.twenty_pct_status = 'released'
|
48
|
-
|
49
|
-
# Remove all read acces nodes
|
50
|
-
rights_md = datastreams['rightsMetadata']
|
51
|
-
rights_xml = rights_md.ng_xml
|
52
|
-
rights_md.ng_xml_will_change!
|
53
|
-
rights_xml.xpath("//rightsMetadata/access[@type='read']").each(&:remove)
|
54
|
-
|
55
|
-
# Replace rights <access> nodes with 1 machine/world node
|
56
|
-
access_sibling = rights_xml.at_xpath('//rightsMetadata/access[last()]')
|
57
|
-
if access_sibling
|
58
|
-
access_sibling.add_next_sibling(world_doc.root.clone)
|
59
|
-
else
|
60
|
-
rights_xml.root.add_child(world_doc.root.clone)
|
61
|
-
end
|
62
|
-
|
63
|
-
events.add_event('embargo', release_agent, '20% Visibility Embargo released')
|
22
|
+
embargo_service.release_20_pct_vis(release_agent)
|
64
23
|
end
|
65
24
|
|
66
25
|
def embargoed?
|
@@ -68,23 +27,11 @@ module Dor
|
|
68
27
|
end
|
69
28
|
|
70
29
|
def update_embargo(new_date)
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
updated = false
|
75
|
-
rightsMetadata.ng_xml.search('//embargoReleaseDate').each do |node|
|
76
|
-
node.content = new_date.beginning_of_day.utc.xmlschema
|
77
|
-
updated = true
|
78
|
-
end
|
79
|
-
rightsMetadata.ng_xml_will_change!
|
80
|
-
rightsMetadata.save
|
81
|
-
raise 'No release date in rights metadata, cannot proceed!' unless updated
|
30
|
+
embargo_service.update(new_date)
|
31
|
+
end
|
82
32
|
|
83
|
-
|
84
|
-
|
85
|
-
end
|
86
|
-
embargoMetadata.ng_xml_will_change!
|
87
|
-
embargoMetadata.save
|
33
|
+
def embargo_service
|
34
|
+
EmbargoService.new(self)
|
88
35
|
end
|
89
36
|
end
|
90
37
|
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dor
|
4
|
+
class Etd < Abstract
|
5
|
+
include Dor::Embargoable
|
6
|
+
|
7
|
+
self.resource_indexer = CompositeIndexer.new(
|
8
|
+
DataIndexer
|
9
|
+
)
|
10
|
+
|
11
|
+
# This relationship was modeled incorrectly when first implemented.
|
12
|
+
# It should have been has_and_belongs_to_many so that the ETD is aware of
|
13
|
+
# its component parts. Presently there is no way to discover which parts
|
14
|
+
# belong to the ETD without doing a Solr query.
|
15
|
+
has_many :parts, property: :is_part_of, class_name: 'Part'
|
16
|
+
has_many :supplemental_files, property: :is_constituent_of, class_name: 'Part'
|
17
|
+
has_many :permission_files, property: :is_dependent_of, class_name: 'Part'
|
18
|
+
|
19
|
+
has_metadata name: 'properties', type: ActiveFedora::SimpleDatastream, versionable: false do |m|
|
20
|
+
m.field 'name', :string # PS:name
|
21
|
+
m.field 'prefix', :string # PS:prefix
|
22
|
+
m.field 'suffix', :string # PS:suffix
|
23
|
+
m.field 'major', :string # PS:plan
|
24
|
+
m.field 'degree', :string # PS:degree
|
25
|
+
m.field 'advisor', :string # one of the readers?
|
26
|
+
m.field 'etd_type', :string # PS:type
|
27
|
+
m.field 'title', :string # PS:title
|
28
|
+
m.field 'abstract', :text
|
29
|
+
m.field 'containscopyright', :string
|
30
|
+
m.field 'copyrightclearance', :string
|
31
|
+
m.field 'sulicense', :string
|
32
|
+
m.field 'cclicense', :string
|
33
|
+
m.field 'cclicensetype', :string
|
34
|
+
m.field 'embargo', :string
|
35
|
+
m.field 'external_visibility', :string
|
36
|
+
|
37
|
+
m.field 'term', :string
|
38
|
+
m.field 'sub', :string
|
39
|
+
|
40
|
+
m.field 'univid', :string # PS:univid
|
41
|
+
m.field 'sunetid', :string # PS:sunetid
|
42
|
+
m.field 'ps_career', :string # PS:career
|
43
|
+
m.field 'ps_program', :string # PS:program
|
44
|
+
m.field 'ps_plan', :string # PS:plan
|
45
|
+
m.field 'ps_subplan', :string # PS:subplan
|
46
|
+
m.field 'dissertation_id', :string # PS:dissertationid
|
47
|
+
m.field 'provost', :string # PS:vpname
|
48
|
+
|
49
|
+
# from latest ps revision
|
50
|
+
m.field 'degreeconfyr', :string
|
51
|
+
m.field 'schoolname', :string # Display value derived from ps_career
|
52
|
+
m.field 'department', :string # Display value derived from ps_program
|
53
|
+
m.field 'readerapproval', :string # Possible Values: Not Submitted, Not Approved, Approved, Rejected, Reject with Modification
|
54
|
+
m.field 'readercomment', :string
|
55
|
+
m.field 'readeractiondttm', :string # date?
|
56
|
+
m.field 'regapproval', :string # Possible Values: Not Submitted, Not Approved, Approved, Rejected, Reject with Modification
|
57
|
+
m.field 'regcomment', :string
|
58
|
+
m.field 'regactiondttm', :string
|
59
|
+
m.field 'documentaccess', :string
|
60
|
+
|
61
|
+
m.field 'submit_date', :string
|
62
|
+
m.field 'symphonyStatus', :string
|
63
|
+
end
|
64
|
+
|
65
|
+
has_metadata name: 'workflow', type: ActiveFedora::SimpleDatastream, versionable: false do |m|
|
66
|
+
m.field 'citation_verified', :string
|
67
|
+
m.field 'abstract_provided', :string
|
68
|
+
m.field 'dissertation_uploaded', :string
|
69
|
+
m.field 'supplemental_files_uploaded', :string
|
70
|
+
m.field 'permissions_provided', :string
|
71
|
+
m.field 'permission_files_uploaded', :string
|
72
|
+
m.field 'rights_selected', :string
|
73
|
+
m.field 'cc_license_selected', :string
|
74
|
+
m.field 'submitted_to_registrar', :string
|
75
|
+
end
|
76
|
+
|
77
|
+
has_metadata name: 'DC', type: Dor::SimpleDublinCoreDs, versionable: false, label: 'DC', control_group: 'X'
|
78
|
+
|
79
|
+
def etd_embargo_date
|
80
|
+
regaction = properties.regactiondttm.first
|
81
|
+
embargo = properties.embargo.first
|
82
|
+
if properties.regapproval.first =~ /^approved$/i &&
|
83
|
+
!embargo.nil? && embargo != '' &&
|
84
|
+
!regaction.nil? && regaction != ''
|
85
|
+
embargo_months = case embargo
|
86
|
+
when /6 months/i
|
87
|
+
6
|
88
|
+
when /1 year/i
|
89
|
+
12
|
90
|
+
when /2 years/i
|
91
|
+
24
|
92
|
+
else
|
93
|
+
0
|
94
|
+
end
|
95
|
+
return Time.strptime(regaction, '%m/%d/%Y %H:%M:%S') + embargo_months.months
|
96
|
+
end
|
97
|
+
nil
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|